mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-15 07:26:51 +00:00
try to fix chinsese char error in infoq search
This commit is contained in:
@@ -23,10 +23,10 @@ def ctx(category='', type=''):
|
|||||||
referer = f'{domain}/search/c=0/k={category1}/t={type}'
|
referer = f'{domain}/search/c=0/k={category1}/t={type}'
|
||||||
DEFAULT_HEADERS.update({'Referer': referer})
|
DEFAULT_HEADERS.update({'Referer': referer})
|
||||||
url = f'{domain}/api/gksearch/search'
|
url = f'{domain}/api/gksearch/search'
|
||||||
|
category = unquote(category, 'utf-8')
|
||||||
payload = {"q":category,"t": type,"s":20,"p":1}
|
payload = {"q":category,"t": type,"s":20,"p":1}
|
||||||
posts = requests.post(url, json=payload, headers=DEFAULT_HEADERS)
|
posts = requests.post(url, json=payload, headers=DEFAULT_HEADERS)
|
||||||
posts = json.loads(posts.text)['data']['list']
|
posts = json.loads(posts.text)['data']['list']
|
||||||
category = unquote(category, 'utf-8')
|
|
||||||
return {
|
return {
|
||||||
'title': f'{category} - 搜索 - InfoQ',
|
'title': f'{category} - 搜索 - InfoQ',
|
||||||
'link': f'{domain}/search/c=0/k={category}/t=0',
|
'link': f'{domain}/search/c=0/k={category}/t=0',
|
||||||
|
|||||||
Reference in New Issue
Block a user