X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_rsimple.py;h=2a18beb72edad934fa1120c1f9e9fb3035130c75;hb=199a8ce519d73ee4e7629657b2119b3213efb3e9;hp=e2f4dadc1358ecee16a37be3709ca007d75d4a1f;hpb=387f77d110986aa12967c9cd788ab0e4f41f2be2;p=bookmarks_db.git diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index e2f4dad..2a18beb 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -143,15 +143,18 @@ class robot_simple(Robot): if self.log: self.log(" final title : %s" % bookmark.real_title) if parser.refresh: refresh = parser.refresh - try: - timeout = int(refresh.split(';')[0]) - except (IndexError, ValueError): - timeout = "ERROR" try: url = refresh.split('=', 1)[1] except IndexError: url = "self" - raise RedirectException("html", "%s (%d sec)" % (url, timeout)) + try: + timeout = int(refresh.split(';')[0]) + except (IndexError, ValueError): + timeout = None + if timeout is None: + raise RedirectException("html", "Bad redirect to %s (%s)" % (url, refresh)) + else: + raise RedirectException("html", "%s (%d sec)" % (url, timeout)) except KeyError: pass @@ -180,7 +183,7 @@ class robot_simple(Robot): def finish_check_url(self, bookmark): # Calculate these attributes even in case of an error if os.path.exists(self.tempfname): - size = str(os.stat(self.tempfname).st_size) + size = str(os.path.getsize(self.tempfname)) if size[-1] == 'L': size = size[:-1] bookmark.size = size