fix ilgenio, link sotto vcrypt&company
This commit is contained in:
@@ -173,6 +173,7 @@ def newest(categoria):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
from lib import unshortenit
|
||||
log()
|
||||
matches = support.match(item, patron=[r'class="metaframe rptss" src="([^"]+)"',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
||||
itemlist = []
|
||||
@@ -188,13 +189,23 @@ def findvideos(item):
|
||||
match = support.httptools.downloadpage(match, follow_redirect=True).url
|
||||
list_url.append(match)
|
||||
|
||||
for i, url in enumerate(list_url):
|
||||
itemlist.append(support.Item(
|
||||
def unshorten(i, url):
|
||||
url = unshortenit.unshorten(url)[0]
|
||||
return support.Item(
|
||||
channel=item.channel,
|
||||
title=list_servers[i],
|
||||
url=url,
|
||||
action='play',
|
||||
quality=list_quality[i],
|
||||
infoLabels = item.infoLabels))
|
||||
infoLabels=item.infoLabels)
|
||||
import sys
|
||||
if sys.version_info[0] >= 3:
|
||||
from concurrent import futures
|
||||
else:
|
||||
from concurrent_py2 import futures
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
unshList = [executor.submit(unshorten, i, url) for i, url in enumerate(list_url)]
|
||||
for it in futures.as_completed(unshList):
|
||||
itemlist.append(it.result())
|
||||
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
Reference in New Issue
Block a user