Fix: eps collect bug

This commit is contained in:
EstrellaXD
2023-05-24 21:14:39 +08:00
parent 5d231b88b7
commit 409cc595c6
2 changed files with 9 additions and 2 deletions

View File

@@ -34,7 +34,6 @@ class TorrentInfo:
self.__fetch_mikan_info()
return self._official_title
class RequestContent(RequestURL):
# Mikanani RSS
def get_torrents(

View File

@@ -17,7 +17,15 @@ class SearchTorrent(RequestContent):
url = search_url(site, keywords)
# TorrentInfo to TorrentBase
torrents = self.get_torrents(url)
return [TorrentBase(**torrent.dict()) for torrent in torrents]
def to_dict():
for torrent in torrents:
yield {
"name": torrent.name,
"torrent_link": torrent.torrent_link,
"homepage": torrent.homepage,
}
return [TorrentBase(**d) for d in to_dict()]
def search_season(self, data: BangumiData):
keywords = [getattr(data, key) for key in SEARCH_KEY if getattr(data, key)]