X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=Robots%2Fbkmk_rsimple.py;h=7a21c4fd1a1e72faf1397df7a853194dab30f696;hb=bbcb4777fc62ff721ff60ebc1697ac61acbf0617;hp=0d6c04409756be02fa161257b71729b68c2bd740;hpb=391f68ebaffbf017768a2ca64b4a2aded8a94e41;p=bookmarks_db.git diff --git a/Robots/bkmk_rsimple.py b/Robots/bkmk_rsimple.py index 0d6c044..7a21c4f 100644 --- a/Robots/bkmk_rsimple.py +++ b/Robots/bkmk_rsimple.py @@ -1,7 +1,7 @@ """ Simple, strightforward robot; guaranteed to has problems with timeouts :) - Written by BroytMann, Mar 2000 - Aug 2002. Copyright (C) 2000-2002 PhiloSoft Design + Written by BroytMann, Mar 2000 - Mar 2004. Copyright (C) 2000-2004 PhiloSoft Design """ @@ -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