diff --git a/src/module/network/request_contents.py b/src/module/network/request_contents.py index 684325a6..08d6a41a 100644 --- a/src/module/network/request_contents.py +++ b/src/module/network/request_contents.py @@ -34,7 +34,6 @@ class TorrentInfo: self.__fetch_mikan_info() return self._official_title - class RequestContent(RequestURL): # Mikanani RSS def get_torrents( diff --git a/src/module/searcher/searcher.py b/src/module/searcher/searcher.py index afd2134c..621022eb 100644 --- a/src/module/searcher/searcher.py +++ b/src/module/searcher/searcher.py @@ -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)]