mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 20:53:13 -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):
|
def unshorten(self, url):
|
||||||
try:
|
try:
|
||||||
r=requests.head(url, allow_redirects=True)
|
r=requests.head(url)
|
||||||
return r.url
|
return r.headers['location']
|
||||||
except:
|
except:
|
||||||
return url #we cannot expand
|
return url #we cannot expand
|
||||||
|
Loading…
Reference in New Issue
Block a user