mirror of
https://github.com/d0zingcat/RSSHub-python.git
synced 2026-05-18 07:26:48 +00:00
try to fix aisixiang encoding bug in vercel.app
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import urllib.parse
|
from urllib.parse import quote, unquote
|
||||||
from rsshub.utils import fetch, DEFAULT_HEADERS
|
from rsshub.utils import fetch, DEFAULT_HEADERS
|
||||||
|
|
||||||
|
|
||||||
@@ -14,8 +14,9 @@ def parse(post):
|
|||||||
|
|
||||||
|
|
||||||
def ctx(category='', keywords=''):
|
def ctx(category='', keywords=''):
|
||||||
keywords_encode = urllib.parse.quote(keywords, encoding='gbk')
|
keywords = unquote(keywords,encoding='utf-8')
|
||||||
url = f"{domain}/data/search.php?keyWords={keywords_encode}&searchfield={category}"
|
keywords_gbk = quote(keywords, encoding='gbk')
|
||||||
|
url = f"{domain}/data/search.php?keyWords={keywords_gbk}&searchfield={category}"
|
||||||
tree = fetch(url, headers=DEFAULT_HEADERS)
|
tree = fetch(url, headers=DEFAULT_HEADERS)
|
||||||
posts = tree.css('.search_list').css('li')
|
posts = tree.css('.search_list').css('li')
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user