Add Zooqle icon.

Change get url to also handle absolute redirects.
This commit is contained in:
JackDandy 2016-06-14 00:10:43 +01:00
parent 013c79d16a
commit cb25fc2e03
2 changed files with 4 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

View file

@ -1174,8 +1174,10 @@ def getURL(url, post_data=None, params=None, headers=None, timeout=30, session=N
else:
resp = session.get(url, timeout=timeout, **kwargs)
if resp.ok and not resp.content and 'url=' in resp.headers.get('Refresh', '').lower():
parsed[2] = '/%s' % resp.headers.get('Refresh').lower().split('url=')[1].strip('/')
url = urlparse.urlunparse(parsed)
url = resp.headers.get('Refresh').lower().split('url=')[1].strip('/')
if not url.startswith('http'):
parsed[2] = '/%s' % url
url = urlparse.urlunparse(parsed)
resp = session.get(url, timeout=timeout, **kwargs)
if not resp.ok: