Files
Auto_Bangumi/backend/src/module/rss/searcher.py

15 lines
465 B
Python

from module.conf import settings
from module.network import RequestContent
class RSSSearcher(RequestContent):
def __search_url(self, keywords: str) -> str:
keywords.replace(" ", "+")
url = f"{settings.rss_parser.custom_url}/RSS/Search?keyword={keywords}"
return url
def search_keywords(self, keywords: str) -> list[dict]:
url = self.__search_url(keywords)
torrents = self.get_torrents(url)
return torrents