Merge pull request #574 from mac12m99/master

some improvements in core and an option to enable autoplay in any supported channel
This commit is contained in:
Alfa
2019-03-15 10:01:52 -05:00
committed by GitHub
8 changed files with 68 additions and 25 deletions
+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