- 修复 API 中订阅或者添加合集失败的情况。
This commit is contained in:
EstrellaXD
2022-08-06 18:48:59 +08:00
parent ecf4ad3f83
commit 7a8a78f63a
3 changed files with 11 additions and 19 deletions

View File

@@ -17,7 +17,8 @@ ADD ./src /src
RUN apk add curl
RUN mkdir "/config" && \
chmod a+x run.sh
chmod a+x run.sh &&\
chmod a+x getWebUI.sh &&\
ENV TZ=Asia/Shanghai

View File

@@ -14,8 +14,7 @@ class APIProcess:
self._full_season_get = FullSeasonGet()
def link_process(self, link):
data = self._rss_analyser.rss_to_data(link)
return data
return self._rss_analyser.rss_to_data(link)
@api_failed
def download_collection(self, link):
@@ -68,5 +67,6 @@ class APIProcess:
if __name__ == '__main__':
from conf.const_dev import DEV_SETTINGS
settings.init(DEV_SETTINGS)
url = "https://mikanani.me/RSS/Bangumi?bangumiId=2621&subgroupid=382"
API = APIProcess()
API.add_subscribe("http://dmhy.org/topics/rss/rss.xml?keyword=彻夜之歌+星空+简")
API.download_collection(url)

View File

@@ -37,8 +37,12 @@ class RSSAnalyser:
def rss_to_data(self, url) -> dict:
rss_torrents = self._request.get_torrents(url)
self._request.close_session()
data = self._title_analyser.return_dict(rss_torrents[0].name)
return data
for torrent in rss_torrents:
try:
data = self._title_analyser.return_dict(torrent.name)
return data
except Exception as e:
logger.debug(e)
def run(self, bangumi_info: list, download_client: DownloadClient):
logger.info("Start collecting RSS info.")
@@ -48,16 +52,3 @@ class RSSAnalyser:
except Exception as e:
logger.debug(e)
logger.info("Finished")
if __name__ == "__main__":
from conf.const_dev import DEV_SETTINGS
settings.init(DEV_SETTINGS)
print(settings.host_ip)
client = DownloadClient()
ra = RSSAnalyser()
data = []
ra.run(data, client)
for d in data:
print(d.get("official_title"))
print(d.get("season"))