mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-15 15:09:25 +00:00
add headers to mp gh request
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from rsshub.utils import fetch
|
from rsshub.utils import fetch
|
||||||
|
from rsshub.utils import DEFAULT_HEADERS
|
||||||
|
|
||||||
domain = 'https://weixin.sogou.com'
|
domain = 'https://weixin.sogou.com'
|
||||||
|
|
||||||
@@ -16,8 +17,8 @@ def parse(post):
|
|||||||
|
|
||||||
def ctx(gh=''):
|
def ctx(gh=''):
|
||||||
global url
|
global url
|
||||||
url = f"{domain}/weixin?query={gh}"
|
url = f"{domain}/weixin?type=1&s_from=input&query={gh}&ie=utf8&_sug_=n&_sug_type_=&w=01019900&sut=1554&sst0=1628603087755&lkt=0%2C0%2C0"
|
||||||
tree = fetch(url)
|
tree = fetch(url=url, headers=DEFAULT_HEADERS)
|
||||||
global dd_num
|
global dd_num
|
||||||
dd_num = len( tree.css('dd') )
|
dd_num = len( tree.css('dd') )
|
||||||
posts = [ tree.css('dd')[-1] ]
|
posts = [ tree.css('dd')[-1] ]
|
||||||
|
|||||||
Reference in New Issue
Block a user