decode param with non ascii characters

This commit is contained in:
hillerliao
2022-05-15 00:11:03 +08:00
parent 64142cec85
commit ce31f2af8f

View File

@@ -18,6 +18,8 @@ def parse(post):
def ctx(category=''):
DEFAULT_HEADERS.update({'Referer': domain})
from urllib.parse import unquote
category = unquote(category, 'utf-8')
r_url = f'{domain}/search/show'
post_data = {'words':category,'searchType':'2','linkType':'ALL', 'subjectId':'-1'}
posts = requests.post(r_url, data=post_data, headers=DEFAULT_HEADERS).json()['data']['linksList']