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