From 6cc58314a856b1cbcd05096a02839e52a1d8427c Mon Sep 17 00:00:00 2001 From: marco Date: Fri, 17 Apr 2020 18:42:59 +0200 Subject: [PATCH] fix ilgenio, link sotto vcrypt&company --- channels/ilgeniodellostreaming.py | 17 ++++++++++++++--- servers/wstream.json | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index 8ffa3a60..d6de9d05 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -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) diff --git a/servers/wstream.json b/servers/wstream.json index da667068..665e0029 100644 --- a/servers/wstream.json +++ b/servers/wstream.json @@ -11,7 +11,7 @@ "url": "http://wstream.video/video.php?file_code=\\1" }, { - "pattern": "wstream\\.video/(api/vcmod/fastredirect/streaming\\.php\\?id=[$0-9]+)", + "pattern": "wstream\\.video/(api/vcmod/fastredirect/streaming\\.php\\?id=[$0-9]+|swembedid/[0-9]+\\.html)", "url": "http://wstream.video/\\1" } ],