mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2025-07-18 06:06:06 -04:00
Use head instead of get for URL expansion
This commit is contained in:
@@ -20,4 +20,8 @@ class URLShortener (object):
|
||||
raise NotImplementedError
|
||||
|
||||
def unshorten(self, url):
|
||||
return url
|
||||
try:
|
||||
r=requests.head(url, allow_redirects=True)
|
||||
return r.url
|
||||
except:
|
||||
return url #we cannot expand
|
||||
|
Reference in New Issue
Block a user