add referer to chaindd request

This commit is contained in:
hillerliao
2020-04-29 06:57:43 +08:00
parent 7ebde9b02b
commit 4f3e438f03

View File

@@ -1,4 +1,5 @@
from rsshub.utils import fetch
from rsshub.utils import DEFAULT_HEADERS
domain = 'https://www.chaindd.com'
@@ -13,6 +14,7 @@ def parse(post):
def ctx(category=''):
DEFAULT_HEADERS.update({'Referer': f'https://www.chaindd.com/column/{category}'})
tree = fetch(f"{domain}/column/{category}")
posts = tree.css('li .cont')
return {