From de63a5b0b5918041f5fb066ade04a45b456dda38 Mon Sep 17 00:00:00 2001 From: EstrellaXD Date: Wed, 11 Oct 2023 13:09:17 +0800 Subject: [PATCH] fix: analyser log error. --- backend/src/module/rss/analyser.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/backend/src/module/rss/analyser.py b/backend/src/module/rss/analyser.py index dc141f33..af1bc79a 100644 --- a/backend/src/module/rss/analyser.py +++ b/backend/src/module/rss/analyser.py @@ -82,16 +82,14 @@ class RSSAnalyser(TitleParser): def link_to_data(self, rss: RSSItem) -> Bangumi | ResponseModel: torrents = self.get_rss_torrents(rss.url, False) - try: - for torrent in torrents: - data = self.torrent_to_data(torrent, rss) - if data: - return data - except Exception as e: - logger.debug(e) - return ResponseModel( - status=False, - status_code=406, - msg_en="No new title has been found.", - msg_zh="没有找到新的番剧。", - ) + for torrent in torrents: + data = self.torrent_to_data(torrent, rss) + if data: + return data + else: + return ResponseModel( + status=False, + status_code=406, + msg_en="Cannot parse this link.", + msg_zh="无法解析此链接。", + )