更新 __init__.py
This commit is contained in:
parent
e1122af97c
commit
ea399daef9
@ -472,7 +472,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
else:
|
else:
|
||||||
infos = self.doubanapi.tv_recommend(start=(page - 1) * count, count=count,
|
infos = self.doubanapi.tv_recommend(start=(page - 1) * count, count=count,
|
||||||
sort=sort, tags=tags)
|
sort=sort, tags=tags)
|
||||||
if infos:
|
if infos and infos.get("items"):
|
||||||
medias = [MediaInfo(douban_info=info) for info in infos.get("items")]
|
medias = [MediaInfo(douban_info=info) for info in infos.get("items")]
|
||||||
return [media for media in medias if media.poster_path
|
return [media for media in medias if media.poster_path
|
||||||
and "movie_large.jpg" not in media.poster_path
|
and "movie_large.jpg" not in media.poster_path
|
||||||
@ -488,7 +488,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
infos = self.doubanapi.movie_showing(start=(page - 1) * count,
|
infos = self.doubanapi.movie_showing(start=(page - 1) * count,
|
||||||
count=count)
|
count=count)
|
||||||
if infos:
|
if infos and infos.get("subject_collection_items"):
|
||||||
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -508,7 +508,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
infos = self.doubanapi.tv_global_best_weekly(start=(page - 1) * count,
|
infos = self.doubanapi.tv_global_best_weekly(start=(page - 1) * count,
|
||||||
count=count)
|
count=count)
|
||||||
if infos:
|
if infos and infos.get("subject_collection_items"):
|
||||||
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
infos = self.doubanapi.tv_animation(start=(page - 1) * count,
|
infos = self.doubanapi.tv_animation(start=(page - 1) * count,
|
||||||
count=count)
|
count=count)
|
||||||
if infos:
|
if infos and infos.get("subject_collection_items"):
|
||||||
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
infos = self.doubanapi.movie_hot_gaia(start=(page - 1) * count,
|
infos = self.doubanapi.movie_hot_gaia(start=(page - 1) * count,
|
||||||
count=count)
|
count=count)
|
||||||
if infos:
|
if infos and infos.get("subject_collection_items"):
|
||||||
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -538,7 +538,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
infos = self.doubanapi.tv_hot(start=(page - 1) * count,
|
infos = self.doubanapi.tv_hot(start=(page - 1) * count,
|
||||||
count=count)
|
count=count)
|
||||||
if infos:
|
if infos and infos.get("subject_collection_items"):
|
||||||
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@ -553,7 +553,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
if not meta.name:
|
if not meta.name:
|
||||||
return []
|
return []
|
||||||
result = self.doubanapi.search(meta.name)
|
result = self.doubanapi.search(meta.name)
|
||||||
if not result:
|
if not result or not result.get("items"):
|
||||||
return []
|
return []
|
||||||
# 返回数据
|
# 返回数据
|
||||||
ret_medias = []
|
ret_medias = []
|
||||||
@ -618,7 +618,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
# 搜索
|
# 搜索
|
||||||
logger.info(f"开始使用名称 {name} 匹配豆瓣信息 ...")
|
logger.info(f"开始使用名称 {name} 匹配豆瓣信息 ...")
|
||||||
result = self.doubanapi.search(f"{name} {year or ''}".strip())
|
result = self.doubanapi.search(f"{name} {year or ''}".strip())
|
||||||
if not result:
|
if not result or not result.get("items"):
|
||||||
logger.warn(f"未找到 {name} 的豆瓣信息")
|
logger.warn(f"未找到 {name} 的豆瓣信息")
|
||||||
return {}
|
return {}
|
||||||
# 触发rate limit
|
# 触发rate limit
|
||||||
@ -654,7 +654,7 @@ class DoubanModule(_ModuleBase):
|
|||||||
"""
|
"""
|
||||||
infos = self.doubanapi.movie_top250(start=(page - 1) * count,
|
infos = self.doubanapi.movie_top250(start=(page - 1) * count,
|
||||||
count=count)
|
count=count)
|
||||||
if infos:
|
if infos and infos.get("subject_collection_items"):
|
||||||
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
return [MediaInfo(douban_info=info) for info in infos.get("subject_collection_items")]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user