mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-26 12:53:12 -06:00
acortame.py: if we try to expand an URL not shortened by the service, use generic URL unshortener in the base class
This commit is contained in:
parent
24756e73d3
commit
f18a03d4a1
@ -18,7 +18,9 @@ class AcortameShortener (URLShortener):
|
|||||||
return 'acorta.me' in url
|
return 'acorta.me' in url
|
||||||
|
|
||||||
def unshorten (self, url):
|
def unshorten (self, url):
|
||||||
|
if not 'acorta.me' in url:
|
||||||
|
#use generic expand method
|
||||||
|
return super(AcortameShortener, self).unshorten(url)
|
||||||
answer = url
|
answer = url
|
||||||
api = requests.get ("https://acorta.me/api.php?action=expand&format=simple&shorturl=" + urllib.quote(url))
|
api = requests.get ("https://acorta.me/api.php?action=expand&format=simple&shorturl=" + urllib.quote(url))
|
||||||
if api.status_code == 200:
|
if api.status_code == 200:
|
||||||
|
Loading…
Reference in New Issue
Block a user