From 8ce9812dfd950a5ba85946dd7ca66aa69655144e Mon Sep 17 00:00:00 2001 From: pictuga Date: Fri, 19 Apr 2013 11:43:47 +0200 Subject: [PATCH] Meta redirects are now supported. --- morss.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/morss.py b/morss.py index 17e6207..4c4d386 100644 --- a/morss.py +++ b/morss.py @@ -231,6 +231,14 @@ def EncDownload(url): log('http error') return False + # meta-redirect + match = re.search(r'(?i)]*?url=(http.*?)["\']', data) + if match: + new_url = match.groups()[0] + log('redirect: %s' % new_url) + return EncDownload(new_url) + + # encoding if con.headers.getparam('charset'): log('header') enc = con.headers.getparam('charset')