mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 06:06:06 -04: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:
@@ -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
|
||||
|
Reference in New Issue
Block a user