mirror of
https://github.com/EstrellaXD/Auto_Bangumi.git
synced 2026-12-01 08:46:31 +08:00
2.5.24
- 修复 API 中订阅或者添加合集失败的情况。
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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)
|
||||
@@ -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"))
|
||||
Reference in New Issue
Block a user