mirror of
https://github.com/jxxghp/MoviePilot-Plugins.git
synced 2026-03-27 10:05:57 +00:00
fix(ImdbSource): API 查询错误重试
This commit is contained in:
@@ -453,11 +453,12 @@
|
||||
"name": "IMDb源",
|
||||
"description": "让探索,推荐和媒体识别支持IMDb数据源。",
|
||||
"labels": "探索",
|
||||
"version": "1.6.1",
|
||||
"version": "1.6.2",
|
||||
"icon": "IMDb_IOS-OSX_App.png",
|
||||
"author": "wumode",
|
||||
"level": 1,
|
||||
"history": {
|
||||
"v1.6.2": "修复 API 查询错误重试问题",
|
||||
"v1.6.1": "添加中文主屏幕组件; 修复 bug",
|
||||
"v1.5.8": "修改UA",
|
||||
"v1.5.7": "改进异常处理",
|
||||
|
||||
@@ -30,7 +30,7 @@ class ImdbSource(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "IMDb_IOS-OSX_App.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.6.1"
|
||||
plugin_version = "1.6.2"
|
||||
# 插件作者
|
||||
plugin_author = "wumode"
|
||||
# 作者主页
|
||||
|
||||
@@ -332,7 +332,7 @@ class OfficialApiClient:
|
||||
self._req = RequestUtils(accept_type="application/json",
|
||||
content_type="application/json",
|
||||
timeout=10,
|
||||
ua=None,
|
||||
ua=ua,
|
||||
proxies=proxies,
|
||||
session=requests.Session())
|
||||
if proxies:
|
||||
@@ -457,7 +457,7 @@ class OfficialApiClient:
|
||||
if title_type in ImdbType._value2member_map_:
|
||||
title_type_ids.append(title_type)
|
||||
if len(title_type_ids):
|
||||
variables["titleTypeConstraint"] = {"anyTitleTypeIds": params.title_types}
|
||||
variables["titleTypeConstraint"] = {"anyTitleTypeIds": title_type_ids}
|
||||
if params.genres:
|
||||
variables["genreConstraint"] = {"allGenreIds": params.genres, "excludeGenreIds": []}
|
||||
if params.countries:
|
||||
@@ -504,11 +504,7 @@ class OfficialApiClient:
|
||||
|
||||
params = {"operationName": operation_name,
|
||||
"variables": variables}
|
||||
try:
|
||||
data = await self._async_request(params, sha256)
|
||||
except Exception as e:
|
||||
logger.debug(f"An error occurred while querying {operation_name}: {e}")
|
||||
return None
|
||||
data = await self._async_request(params, sha256)
|
||||
if not data:
|
||||
return None
|
||||
if 'error' in data:
|
||||
|
||||
Reference in New Issue
Block a user