diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 8c6ca2d9..998e69bc 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -130,6 +130,7 @@ def newest(categoria): except: import sys for line in sys.exc_info(): + from platformcode import logger logger.error("{0}".format(line)) return [] @@ -138,3 +139,6 @@ def newest(categoria): 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 diff --git a/channels/casacinemaInfo.py b/channels/casacinemaInfo.py index d3d656f5..e2d9d4c9 100644 --- a/channels/casacinemaInfo.py +++ b/channels/casacinemaInfo.py @@ -126,3 +126,6 @@ def newest(categoria): 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 diff --git a/channels/seriehd.py b/channels/seriehd.py index 04e58ed7..aeeac9e1 100644 --- a/channels/seriehd.py +++ b/channels/seriehd.py @@ -142,3 +142,6 @@ def findvideos(item): matches = support.match(url,patron=r'(\d+)<', patronBlock=r'

EPISODIO

').matches if matches: item.url = support.urlparse.urljoin(url, matches[-1][0]) return support.hdpass_get_servers(item) + +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 1b022cbf..d9f425f3 100755 --- a/core/support.py +++ b/core/support.py @@ -21,19 +21,25 @@ from platformcode import logger, config from specials import autoplay def hdpass_get_servers(item): - def get_url(mir_url, srv): - data = httptools.downloadpage(urlparse.urljoin(url, mir_url)).data # .replace('\n', '') - for media_url in scrapertools.find_multiple_matches(data, patron_media): - log("video -> ", res_video) - return Item(channel=item.channel, - action="play", - fulltitle=item.fulltitle, - quality=res_video, - show=item.show, - thumbnail=item.thumbnail, - contentType=item.contentType, - url=base64.b64decode(media_url)) + def get_hosts(url, quality): + ret = [] + page = httptools.downloadpage(url).data + log(page) + mir = scrapertools.find_single_match(page, patron_mir) + + for mir_url, srv in scrapertools.find_multiple_matches(mir, patron_option): + 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)) + return ret # Carica la pagina itemlist = [] if 'hdpass' in item.url or 'hdplayer' in item.url: @@ -51,30 +57,25 @@ def hdpass_get_servers(item): data = httptools.downloadpage(url).data patron_res = '
(.*?)
(.*?)
([^<]+?)' res = scrapertools.find_single_match(data, patron_res) - itemlist = [] - with futures.ThreadPoolExecutor() as executor: thL = [] for res_url, res_video in scrapertools.find_multiple_matches(res, patron_option): - if data: # per non riscaricare - page = data - data = '' - else: - page = httptools.downloadpage(urlparse.urljoin(url, res_url)).data - mir = scrapertools.find_single_match(page, patron_mir) - - for mir_url, srv in scrapertools.find_multiple_matches(mir, patron_option): - thL.append(executor.submit(get_url, mir_url, srv)) + thL.append(executor.submit(get_hosts, res_url, res_video)) for res in futures.as_completed(thL): if res.result(): - itemlist.append(res.result()) + itemlist.extend(res.result()) return server(item, itemlist=itemlist) +def hdpass_get_url(item): + patron_media = r'