diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 270dbab5..573e5987 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -138,5 +138,5 @@ def findvideos(item): support.log('findvideos', item) return support.hdpass_get_servers(item) -def play(item): - return support.hdpass_get_url(item) \ No newline at end of file +# def play(item): +# return support.hdpass_get_url(item) \ No newline at end of file diff --git a/core/support.py b/core/support.py index 5e9f89f7..098975fa 100755 --- a/core/support.py +++ b/core/support.py @@ -34,30 +34,35 @@ from specials import autoplay def hdpass_get_servers(item): def get_hosts(url, quality): ret = [] - page = httptools.downloadpage(url).data - + page = httptools.downloadpage(url, CF=False).data mir = scrapertools.find_single_match(page, patron_mir) - for mir_url, srv in scrapertools.find_multiple_matches(mir, patron_option): - mir_url = scrapertools.decodeHtmlentities(mir_url) - log(mir_url) - ret.append(Item(channel=item.channel, - action="play", - fulltitle=item.fulltitle, - quality=quality, - show=item.show, - thumbnail=item.thumbnail, - contentType=item.contentType, - title=srv, - server=srv, - url= mir_url)) + with futures.ThreadPoolExecutor() as executor: + thL = [] + for mir_url, srv in scrapertools.find_multiple_matches(mir, patron_option): + mir_url = scrapertools.decodeHtmlentities(mir_url) + log(mir_url) + it = Item(channel=item.channel, + action="play", + fulltitle=item.fulltitle, + quality=quality, + show=item.show, + thumbnail=item.thumbnail, + contentType=item.contentType, + title=srv, + # server=srv, + url= mir_url) + thL.append(executor.submit(hdpass_get_url, it)) + for res in futures.as_completed(thL): + if res.result(): + ret.append(res.result()[0]) return ret # Carica la pagina itemlist = [] if 'hdpass' in item.url or 'hdplayer' in item.url: url = item.url else: - data = httptools.downloadpage(item.url).data.replace('\n', '') + data = httptools.downloadpage(item.url, CF=False).data.replace('\n', '') patron = r']+><\/iframe>' url = scrapertools.find_single_match(data, patron) url = url.replace("&download=1", "") @@ -66,7 +71,7 @@ def hdpass_get_servers(item): if not url.startswith('http'): url = 'https:' + url - data = httptools.downloadpage(url).data + data = httptools.downloadpage(url, CF=False).data patron_res = '
(.*?)
(.*?)
([^<]+?)' @@ -85,7 +90,7 @@ def hdpass_get_servers(item): def hdpass_get_url(item): patron_media = r'