mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-03-20 03:57:30 +08:00
fix TMDB因连接失败产生的NoneType错误
glitchtip#11
This commit is contained in:
@@ -747,6 +747,9 @@ class TmdbApi:
|
||||
logger.info("正在从TheDbMovie网站查询:%s ..." % name)
|
||||
tmdb_url = self._build_tmdb_search_url(name)
|
||||
res = RequestUtils(timeout=5, ua=settings.NORMAL_USER_AGENT, proxies=settings.PROXY).get_res(url=tmdb_url)
|
||||
if res is None:
|
||||
logger.error("无法连接TheDbMovie")
|
||||
return None
|
||||
|
||||
# 响应验证
|
||||
response_result = self._validate_response(res)
|
||||
@@ -1857,6 +1860,9 @@ class TmdbApi:
|
||||
tmdb_url = self._build_tmdb_search_url(name)
|
||||
res = await AsyncRequestUtils(timeout=5, ua=settings.NORMAL_USER_AGENT, proxies=settings.PROXY).get_res(
|
||||
url=tmdb_url)
|
||||
if res is None:
|
||||
logger.error("无法连接TheDbMovie")
|
||||
return None
|
||||
|
||||
# 响应验证
|
||||
response_result = self._validate_response(res)
|
||||
|
||||
Reference in New Issue
Block a user