Meta redirects are now supported.

master
pictuga 2013-04-19 11:43:47 +02:00
parent 80ba60d295
commit 8ce9812dfd
1 changed files with 8 additions and 0 deletions

View File

@ -231,6 +231,14 @@ def EncDownload(url):
log('http error') log('http error')
return False return False
# meta-redirect
match = re.search(r'(?i)<meta http-equiv=.refresh[^>]*?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'): if con.headers.getparam('charset'):
log('header') log('header')
enc = con.headers.getparam('charset') enc = con.headers.getparam('charset')