fix bug
This commit is contained in:
parent
e3526d817e
commit
365c610a75
@ -1,6 +1,7 @@
|
|||||||
import traceback
|
import traceback
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from typing import Optional, List
|
from typing import Optional, List
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
import zhconv
|
import zhconv
|
||||||
from lxml import etree
|
from lxml import etree
|
||||||
@ -461,8 +462,8 @@ class TmdbHelper:
|
|||||||
if StringUtils.is_chinese(name):
|
if StringUtils.is_chinese(name):
|
||||||
return {}
|
return {}
|
||||||
logger.info("正在从TheDbMovie网站查询:%s ..." % name)
|
logger.info("正在从TheDbMovie网站查询:%s ..." % name)
|
||||||
tmdb_url = "https://www.themoviedb.org/search?query=%s" % name
|
tmdb_url = "https://www.themoviedb.org/search?query=%s" % quote(name)
|
||||||
res = RequestUtils(timeout=5).get_res(url=tmdb_url)
|
res = RequestUtils(timeout=5, ua=settings.USER_AGENT).get_res(url=tmdb_url)
|
||||||
if res and res.status_code == 200:
|
if res and res.status_code == 200:
|
||||||
html_text = res.text
|
html_text = res.text
|
||||||
if not html_text:
|
if not html_text:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user