From d5df4a218d4c963c288c993fad5babeda57ad9c2 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Sat, 3 Dec 2022 12:01:38 +0800 Subject: [PATCH] Fix 404 image cause bot dead --- rssbot.py | 2 ++ textc.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/rssbot.py b/rssbot.py index f2418dc..bfe2ea7 100644 --- a/rssbot.py +++ b/rssbot.py @@ -291,6 +291,8 @@ class main: if fileEntry.connect_error: continue else: + f = False + text.addtotext2(di['caption']) break should_use_file = False if not config.send_img_as_file else True is_supported_photo = None diff --git a/textc.py b/textc.py index 47c7422..befe48c 100644 --- a/textc.py +++ b/textc.py @@ -230,6 +230,12 @@ class textc: else: self.__str = f'{self.__str}\n{s}' + def addtotext2(self, s: str): + if self.__str == '': + self.__str = s + else: + self.__str = f'{s}\n{self.__str}' + def timeToStr(t: int) -> str: te = strftime('%Y-%m-%dT%H:%M:%S', localtime(t))