fix apis
This commit is contained in:
@ -74,6 +74,36 @@ class DoubanModule(_ModuleBase):
|
||||
return []
|
||||
return infos.get("items") or []
|
||||
|
||||
def movie_showing(self, page: int = 1, count: int = 30) -> List[dict]:
|
||||
"""
|
||||
获取正在上映的电影
|
||||
"""
|
||||
infos = self.doubanapi.movie_showing(start=(page - 1) * count,
|
||||
count=count)
|
||||
if not infos:
|
||||
return []
|
||||
return infos.get("subject_collection_items")
|
||||
|
||||
def tv_weekly_chinese(self, page: int = 1, count: int = 30) -> List[dict]:
|
||||
"""
|
||||
获取豆瓣本周口碑国产剧
|
||||
"""
|
||||
infos = self.doubanapi.tv_chinese_best_weekly(start=(page - 1) * count,
|
||||
count=count)
|
||||
if not infos:
|
||||
return []
|
||||
return infos.get("subject_collection_items")
|
||||
|
||||
def tv_weekly_global(self, page: int = 1, count: int = 30) -> List[dict]:
|
||||
"""
|
||||
获取豆瓣本周口碑外国剧
|
||||
"""
|
||||
infos = self.doubanapi.tv_global_best_weekly(start=(page - 1) * count,
|
||||
count=count)
|
||||
if not infos:
|
||||
return []
|
||||
return infos.get("subject_collection_items")
|
||||
|
||||
def search_medias(self, meta: MetaBase) -> Optional[List[MediaInfo]]:
|
||||
"""
|
||||
搜索媒体信息
|
||||
|
@ -221,6 +221,14 @@ class TheMovieDbModule(_ModuleBase):
|
||||
else:
|
||||
return None
|
||||
|
||||
def tmdb_trending(self, page: int = 1) -> List[dict]:
|
||||
"""
|
||||
TMDB流行趋势
|
||||
:param page: 第几页
|
||||
:return: TMDB信息列表
|
||||
"""
|
||||
return self.tmdb.trending.all_week(page=page)
|
||||
|
||||
def gen_scraper_files(self, mediainfo: MediaInfo, file_path: Path):
|
||||
"""
|
||||
生成刮削文件
|
||||
|
@ -5,7 +5,7 @@ from urllib.parse import quote
|
||||
|
||||
import zhconv
|
||||
from lxml import etree
|
||||
from tmdbv3api import TMDb, Search, Movie, TV, Season, Episode, Discover
|
||||
from tmdbv3api import TMDb, Search, Movie, TV, Season, Episode, Discover, Trending
|
||||
from tmdbv3api.exceptions import TMDbException
|
||||
|
||||
from app.core.config import settings
|
||||
@ -42,13 +42,14 @@ class TmdbHelper:
|
||||
self.tmdb.proxies = settings.PROXY
|
||||
# 调试模式
|
||||
self.tmdb.debug = False
|
||||
# 查询对象
|
||||
# TMDB查询对象
|
||||
self.search = Search()
|
||||
self.movie = Movie()
|
||||
self.tv = TV()
|
||||
self.season = Season()
|
||||
self.episode = Episode()
|
||||
self.discover = Discover()
|
||||
self.trending = Trending()
|
||||
|
||||
def search_multiis(self, title: str) -> List[dict]:
|
||||
"""
|
||||
|
Reference in New Issue
Block a user