do not limit expurl on some services

This commit is contained in:
mac12m99
2019-03-08 23:49:25 +01:00
parent 7884d63384
commit c78988bfad
+2 -11
View File
@@ -1,23 +1,14 @@
# -*- coding: utf-8 -*-
import urlparse
from lib import unshortenit
SERVICES_SHORT = ["adf.ly", "sh.st", "bit.ly", "ul.to"]
def expand_url(url):
e = unshortenit.UnshortenIt()
estado = 200
while Es_Corto(url):
while estado != 0:
long_url, estado = e.unshorten(url)
url = long_url
return long_url
def Es_Corto(url):
server = urlparse.urlsplit(url).netloc
Corto = (server in SERVICES_SHORT)
return Corto