mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
URL shortener now performs step by step expansion, so you possibly will have to expand an URL multiple times to reach the final destination
This commit is contained in:
parent
a1381008d7
commit
11ca3a2190
@ -21,7 +21,7 @@ class URLShortener (object):
|
||||
|
||||
def unshorten(self, url):
|
||||
try:
|
||||
r=requests.head(url, allow_redirects=True)
|
||||
return r.url
|
||||
r=requests.head(url)
|
||||
return r.headers['location']
|
||||
except:
|
||||
return url #we cannot expand
|
||||
|
Loading…
Reference in New Issue
Block a user