Skip to content

Commit

Permalink
Merge pull request #2432 from InfinityPacer/main
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp authored Jun 26, 2024
2 parents db7b2cd + 940cc56 commit 2944c34
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/modules/douban/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,13 +624,16 @@ def match_doubaninfo(self, name: str, imdbid: str = None,
# 搜索
logger.info(f"开始使用名称 {name} 匹配豆瓣信息 ...")
result = self.doubanapi.search(f"{name} {year or ''}".strip())
if not result or not result.get("items"):
if not result:
logger.warn(f"未找到 {name} 的豆瓣信息")
return {}
# 触发rate limit
if "search_access_rate_limit" in result.values():
logger.warn(f"触发豆瓣API速率限制 错误信息 {result} ...")
raise Exception("触发豆瓣API速率限制")
logger.warn(f"触发豆瓣API速率限制,错误信息:{result} ...")
return {}
if not result.get("items"):
logger.warn(f"未找到 {name} 的豆瓣信息")
return {}
for item_obj in result.get("items"):
type_name = item_obj.get("type_name")
if type_name not in [MediaType.TV.value, MediaType.MOVIE.value]:
Expand Down

0 comments on commit 2944c34

Please sign in to comment.