From 1c3896c991cd9f26f18dc3af4e4e14e635464cd5 Mon Sep 17 00:00:00 2001 From: Alhaziel Date: Fri, 17 Jan 2020 16:27:13 +0100 Subject: [PATCH 1/5] Aggiunto PufiMovies --- channels.json | 1 + channels/pufimovies.json | 11 ++++ channels/pufimovies.py | 124 +++++++++++++++++++++++++++++++++++++++ core/support.py | 4 +- 4 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 channels/pufimovies.json create mode 100644 channels/pufimovies.py diff --git a/channels.json b/channels.json index 5a36c337..5df090bb 100644 --- a/channels.json +++ b/channels.json @@ -30,6 +30,7 @@ "netfreex": "https://www.netfreex.online", "piratestreaming": "https://www.piratestreaming.gratis", "polpotv": "https://polpo.tv", + "pufimovies": "https://pufimovies.com", "seriehd": "https://www.seriehd.watch", "serietvonline": "https://serietvonline.monster", "serietvsubita": "http://serietvsubita.xyz", diff --git a/channels/pufimovies.json b/channels/pufimovies.json new file mode 100644 index 00000000..5ded05f3 --- /dev/null +++ b/channels/pufimovies.json @@ -0,0 +1,11 @@ +{ + "id": "pufimovies", + "name": "PufiMovies", + "active": true, + "adult": false, + "language": ["ita", "sub-ita"], + "thumbnail": "pufimovies.png", + "banner": "pufimovies.png", + "categories": ["movie","tvshow"], + "settings": [] +} diff --git a/channels/pufimovies.py b/channels/pufimovies.py new file mode 100644 index 00000000..7cabbe4a --- /dev/null +++ b/channels/pufimovies.py @@ -0,0 +1,124 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per Filmi Gratis +# ------------------------------------------------------------ +""" + La voce "Al cinema" si riferisce ai titoli che scorrono nella home page + + Problemi: + - Nessuno noto + + Novità, il canale, è presente in: + - FILM +""" +import re + +from core import servertools, httptools, support +from core.item import Item +from platformcode import config + +host = config.get_channel_url() + +list_servers = ['verystream', 'openload', 'streamango', 'vidoza', 'okru'] +list_quality = ['1080p', '720p', '480p', '360'] + +headers = [['Referer', host]] + + +@support.menu +def mainlist(item): + film = [ + ('Generi', ['', 'menu', 'Film']), + ('Più Visti', ['','peliculas', 'most']) + ] + + tvshow = ['', + ('Generi', ['', 'menu', 'Serie Tv']), + ('Ultimi Episodi', ['','peliculas', 'last']) + ] + + search = '' + return locals() + + +@support.scrape +def menu(item): + action = 'peliculas' + patronBlock = item.args + r' Categorie\s*.*?)' + patronMenu = r']+>(?P[^>]+)<' + return locals() + + +def search(item, text): + support.log('search', item) + + text = text.replace(' ', '+') + item.url = host + '/search/keyword/' + text + try: + item.args = 'search' + return peliculas(item) + # Se captura la excepcion, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + support.log('search log:', line) + return [] + + +def newest(categoria): + support.log(categoria) + itemlist = [] + item = support.Item() + item.url = host + item.action = 'peliculas' + try: + if categoria == 'peliculas': + item.contentType = 'movie' + itemlist = peliculas(item) + else: + item.args = 'last' + item.contentType = 'tvshow' + itemlist = peliculas(item) + + if itemlist[-1].action == 'peliculas': + itemlist.pop() + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.log({0}.format(line)) + return [] + + return itemlist + + +@support.scrape +def peliculas(item): + # debug = True + if item.contentType == 'tvshow' and not item.args: + action = 'episodios' + patron = r'<div class="movie-box">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)[^>]+>[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?P<year>\d+)' + elif item.contentType == 'movie' and not item.args: + patron = r'<div class="existing_item col-6 col-lg-3 col-sm-4 col-xl-4">\s*<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<' + elif item.args == 'last': + patron = r'<div class="episode-box">[^>]+>[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>[^^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>\D*(?P<season>\d+)[^>]+>\D*(?P<episode>\d+)' + elif item.args == 'most': + patron =r'div class="sm-113 item">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<title>[^<]+)' + else: + patron = r'<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<' + typeActionDict = {'findvideos':['movie'], 'episodios':['tvshow']} + typeContentDict = {'movie':['movie'], 'tvshow':['tvshow']} + patronNext = r'<a href="([^"]+)"[^>]+>»' + return locals() + + +@support.scrape +def episodios(item): + patron = r'<div class="episode-box">[^>]+>[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>\D*(?P<season>\d+)[^>]+>\D*(?P<episode>\d+)' + return locals() + + +def findvideos(item): + support.log() + # match = support.match(item, patron) + return support.server(item) diff --git a/core/support.py b/core/support.py index 6e683675..02e5b886 100755 --- a/core/support.py +++ b/core/support.py @@ -219,7 +219,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t if scraped['season']: stagione = scraped['season'] - episode = scraped['season'] +'x'+ scraped['episode'] + episode = scraped['season'] +'x'+ scraped['episode'].zfill(2) elif item.season: episode = item.season +'x'+ scraped['episode'] elif item.contentType == 'tvshow' and (scraped['episode'] == '' and scraped['season'] == '' and stagione == ''): @@ -295,7 +295,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t quality=quality, url=scraped["url"], infoLabels=infolabels, - thumbnail=item.thumbnail if function == 'episodios' else scraped["thumb"] , + thumbnail=item.thumbnail if function == 'episodios' and not scraped["thumb"] else scraped["thumb"] , args=item.args, contentSerieName= scraped['title'] if item.contentType or CT != 'movie' and function != 'episodios' else item.fulltitle if function == 'episodios' else '', contentTitle= scraped['title'] if item.contentType or CT == 'movie' else '', From d6c94f493f5052420d04159a8631d888423456af Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Fri, 17 Jan 2020 16:27:47 +0100 Subject: [PATCH 2/5] Fix e Migliorie a Cloudvideo, Supervideo e vidoza --- servers/cloudvideo.py | 9 ++++++--- servers/supervideo.py | 28 ++++++++++++++++++---------- servers/vidoza.py | 7 ++++--- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/servers/cloudvideo.py b/servers/cloudvideo.py index ef66b57f..d664b88b 100644 --- a/servers/cloudvideo.py +++ b/servers/cloudvideo.py @@ -9,8 +9,10 @@ from platformcode import logger def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url) - if data.code == 404: + html = httptools.downloadpage(page_url) + global data + data = html.data + if html.code == 404: return False, config.get_localized_string(70292) % "CloudVideo" return True, "" @@ -18,7 +20,8 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) video_urls = [] - data = httptools.downloadpage(page_url).data + global data + # data = httptools.downloadpage(page_url).data # enc_data = scrapertools.find_single_match(data, "text/javascript">(.+?)</script>") # dec_data = jsunpack.unpack(enc_data) sources = scrapertools.find_single_match(data, "<source(.*?)</source") diff --git a/servers/supervideo.py b/servers/supervideo.py index 4ef07daa..20410941 100644 --- a/servers/supervideo.py +++ b/servers/supervideo.py @@ -9,7 +9,7 @@ import ast def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) - + global data data = httptools.downloadpage(page_url, cookies=False).data if 'File Not Found' in data: return False, config.get_localized_string(70449) % "SuperVideo" @@ -20,27 +20,35 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) video_urls = [] - data = httptools.downloadpage(page_url).data - logger.info('SUPER DATA= '+data) + # data = httptools.downloadpage(page_url).data + global data + code_data = scrapertools.find_single_match(data, "<script type='text/javascript'>(eval.*)") if code_data: code = jsunpack.unpack(code_data) + + # corrections + if 'file' in code and not '"file"'in code: code = code.replace('file','"file"') + if 'label' in code and not '"label"'in code: code = code.replace('label','"label"') + match = scrapertools.find_single_match(code, r'sources:(\[[^]]+\])') lSrc = ast.literal_eval(match) - lQuality = ['360p', '720p', '1080p', '4k'][:len(lSrc)-1] - lQuality.reverse() + # lQuality = ['360p', '720p', '1080p', '4k'][:len(lSrc)-1] + # lQuality.reverse() + + for source in lSrc: + quality = source['label'] if source.has_key('label') else 'auto' + video_urls.append(['.' + source['file'].split('.')[-1] + ' [' + quality + '] [SuperVideo]', source['file']]) - for n, source in enumerate(lSrc): - quality = 'auto' if n==0 else lQuality[n-1] - video_urls.append(['.' + source.split('.')[-1] + '(' + quality + ') [SuperVideo]', source]) else: logger.info('ELSE!') matches = scrapertools.find_multiple_matches(data, r'src:\s*"([^"]+)",\s*type:\s*"[^"]+"(?:\s*, res:\s(\d+))?') for url, quality in matches: if url.split('.')[-1] != 'm3u8': - video_urls.append([url.split('.')[-1] + ' [' + quality + ']', url]) + video_urls.append([url.split('.')[-1] + ' [' + quality + '] [SuperVideo]', url]) else: video_urls.append([url.split('.')[-1], url]) - video_urls.sort(key=lambda x: x[0].split()[-1]) + + video_urls.sort(key=lambda x: x[0].split()[-2]) return video_urls diff --git a/servers/vidoza.py b/servers/vidoza.py index 9ec0ccad..f9806ec5 100644 --- a/servers/vidoza.py +++ b/servers/vidoza.py @@ -8,6 +8,7 @@ from platformcode import logger def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) + global data data = httptools.downloadpage(page_url).data if "Page not found" in data or "File was deleted" in data: return False, "[vidoza] El archivo no existe o ha sido borrado" @@ -19,7 +20,7 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data + global data video_urls = [] s = scrapertools.find_single_match(data, r'sourcesCode\s*:\s*(\[\{.*?\}\])') @@ -30,8 +31,8 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= if 'src' in enlace or 'file' in enlace: url = enlace['src'] if 'src' in enlace else enlace['file'] tit = '' - if 'label' in enlace: tit += '[%s]' % enlace['label'] - if 'res' in enlace: tit += '[%s]' % enlace['res'] + if 'label' in enlace: tit += ' [%s]' % enlace['label'] + if 'res' in enlace: tit += ' [%s]' % enlace['res'] if tit == '' and 'type' in enlace: tit = enlace['type'] if tit == '': tit = '.mp4' From c3580f3874a26b4a6b9ffd908201c9b1e9c9445b Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Fri, 17 Jan 2020 17:41:11 +0100 Subject: [PATCH 3/5] rimossa forzatura http --- platformcode/platformtools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platformcode/platformtools.py b/platformcode/platformtools.py index d1636478..937573f0 100644 --- a/platformcode/platformtools.py +++ b/platformcode/platformtools.py @@ -726,8 +726,8 @@ def play_video(item, strm=False, force_direct=False, autoplay=False): mediaurl, view, mpd = get_video_seleccionado(item, seleccion, video_urls) if mediaurl == "": return - # no certificate verification - mediaurl = mediaurl.replace('https://', 'http://') + # # no certificate verification + # mediaurl = mediaurl.replace('https://', 'http://') # se obtiene la información del video. if not item.contentThumbnail: From f38e8cad58c03cf0432dbb2c36c40913d7332c3e Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Fri, 17 Jan 2020 17:41:47 +0100 Subject: [PATCH 4/5] migliorie Vup Player --- servers/vup.json | 42 ------------------------------------------ servers/vup.py | 28 ---------------------------- servers/vupplayer.py | 5 +++-- servers/wstream.json | 2 +- 4 files changed, 4 insertions(+), 73 deletions(-) delete mode 100644 servers/vup.json delete mode 100644 servers/vup.py diff --git a/servers/vup.json b/servers/vup.json deleted file mode 100644 index 4c468694..00000000 --- a/servers/vup.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "active": true, - "find_videos": { - "ignore_urls": [], - "patterns": [ - { - "pattern": "(https://vup.to/embed-[A-z0-9]+.html)", - "url": "\\1" - } - ] - }, - "free": true, - "id": "vup", - "name": "VUP", - "settings": [ - { - "default": false, - "enabled": true, - "id": "black_list", - "label": "@60654", - "type": "bool", - "visible": true - }, - { - "default": 0, - "enabled": true, - "id": "favorites_servers_list", - "label": "@60655", - "lvalues": [ - "No", - "1", - "2", - "3", - "4", - "5" - ], - "type": "list", - "visible": false - } - ], - "thumbnail": "server_vupplayer.png" -} diff --git a/servers/vup.py b/servers/vup.py deleted file mode 100644 index 9eba027d..00000000 --- a/servers/vup.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# -------------------------------------------------------- -# Conector vup By Alfa development Group -# -------------------------------------------------------- - -from core import httptools -from core import scrapertools -from platformcode import logger - - -def test_video_exists(page_url): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - if "no longer exists" in data or "to copyright issues" in data: - return False, "[vup] El video ha sido borrado" - return True, "" - - -def get_video_url(page_url, user="", password="", video_password=""): - logger.info("(page_url='%s')" % page_url) - data = httptools.downloadpage(page_url).data - bloque = scrapertools.find_single_match(data, 'sources:.*?\]') - video_urls = [] - videourl = scrapertools.find_multiple_matches(bloque, '"(http[^"]+)') - for video in videourl: - video_urls.append([".MP4 [vup]", video]) - video_urls = video_urls[::-1] - return video_urls diff --git a/servers/vupplayer.py b/servers/vupplayer.py index 113a30e9..e348a184 100644 --- a/servers/vupplayer.py +++ b/servers/vupplayer.py @@ -7,6 +7,8 @@ from platformcode import logger, config def test_video_exists(page_url): logger.info("(page_url='%s')" % page_url) data = httptools.downloadpage(page_url) + global data + data = data.data if data.code == 404: return False, config.get_localized_string(70449) return True, "" @@ -15,8 +17,7 @@ def test_video_exists(page_url): def get_video_url(page_url, premium=False, user="", password="", video_password=""): logger.info("url=" + page_url) video_urls = [] - data = httptools.downloadpage(page_url).data - logger.info('VUP DATA= '+ data) + global data patron = r'sources:\s*\[\{src:\s*"([^"]+)"' matches = scrapertools.find_multiple_matches(data, patron) for url in matches: diff --git a/servers/wstream.json b/servers/wstream.json index 99428674..72b1acbb 100644 --- a/servers/wstream.json +++ b/servers/wstream.json @@ -7,7 +7,7 @@ "find_videos": { "patterns": [ { - "pattern": "wstream\\.video.*?(?<!api)(?:=|/)(?:embed-)?(?<!streaming\\.php\\?id=)([a-z0-9A-Z]+)(?:[^/_.a-z0-9A-Z]|$)", + "pattern": "wstream\\.video(?!<).*?(?<!api)(?:=|/)(?:embed-)?(?<!streaming\\.php\\?id=)([a-z0-9A-Z]+)(?:[^/_.a-z0-9A-Z]|$)", "url": "https://wstream.video/video.php?file_code=\\1" }, { From 4c88543f3042f8d7e2d240a441028aebcd11533f Mon Sep 17 00:00:00 2001 From: Alhaziel <alhaziel01@gmail.com> Date: Fri, 17 Jan 2020 17:42:12 +0100 Subject: [PATCH 5/5] Pulizia PufiMovies --- channels/pufimovies.py | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/channels/pufimovies.py b/channels/pufimovies.py index 7cabbe4a..9600c9fe 100644 --- a/channels/pufimovies.py +++ b/channels/pufimovies.py @@ -1,26 +1,14 @@ # -*- coding: utf-8 -*- # ------------------------------------------------------------ -# Canale per Filmi Gratis +# Canale per PufiMovies # ------------------------------------------------------------ -""" - La voce "Al cinema" si riferisce ai titoli che scorrono nella home page - Problemi: - - Nessuno noto +from core import support - Novità, il canale, è presente in: - - FILM -""" -import re +host = support.config.get_channel_url() -from core import servertools, httptools, support -from core.item import Item -from platformcode import config - -host = config.get_channel_url() - -list_servers = ['verystream', 'openload', 'streamango', 'vidoza', 'okru'] -list_quality = ['1080p', '720p', '480p', '360'] +list_servers = ['mixdrop', 'wstream', 'vupplayer', 'supervideo', 'cloudvideo', 'gounlimited'] +list_quality = ['default','1080p', '720p', '480p', '360p'] headers = [['Referer', host]] @@ -57,7 +45,7 @@ def search(item, text): try: item.args = 'search' return peliculas(item) - # Se captura la excepcion, para no interrumpir al buscador global si un canal falla + # Continua la ricerca in caso di errore except: import sys for line in sys.exc_info(): @@ -94,7 +82,6 @@ def newest(categoria): @support.scrape def peliculas(item): - # debug = True if item.contentType == 'tvshow' and not item.args: action = 'episodios' patron = r'<div class="movie-box">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)[^>]+>[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?P<year>\d+)' @@ -120,5 +107,5 @@ def episodios(item): def findvideos(item): support.log() - # match = support.match(item, patron) + # match = support.match(item, patron='wstream', debug=True) return support.server(item)