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