diff --git a/channels.json b/channels.json index fd24875f..1fec6e20 100644 --- a/channels.json +++ b/channels.json @@ -42,7 +42,7 @@ "hd4me": "https://hd4me.net", "ilgeniodellostreaming": "https://ilgeniodellostreaming.pet", "ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.gold", - "italiaserie": "https://italiaserie.eu", + "italiaserie": "https://italiaserie.run", "mondoserietv": "https://mondoserietv.fun", "piratestreaming": "https://www.piratestreaming.deals", "polpotv": "https://polpotv.life", diff --git a/channels/dsda.py b/channels/dsda.py index 476e3143..71fe4ea5 100644 --- a/channels/dsda.py +++ b/channels/dsda.py @@ -75,7 +75,7 @@ def peliculas(item): else: patron = r'
\s*]+>\s*]+>)?.*?\s*(?P[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<p>(?P<plot>[^<]+)<' + patron = r'<article[^>]+>[^>]+>[^>]+>(?:<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>)?.*?<a href="(?P<url>[^"]+)"[^>]*>\s*(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<p>(?P<plot>[^<]+)<' patronNext = r'<a class="page-numbers next" href="([^"]+)">' # select category @@ -121,14 +121,14 @@ def episodios(item): else: patron = r'class="title-episodio">(?P<title>[^<]+)<(?P<url>.*?)<p' - def itemlistHook(itemlist): - counter = 0 - for item in itemlist: - episode = support.match(item.title, patron=r'\d+').match - if episode == '1': - counter += 1 - item.title = support.typo(str(counter) + 'x' + episode.zfill(2) + support.re.sub(r'\[[^\]]+\](?:\d+)?','',item.title),'bold') - return itemlist + # def itemlistHook(itemlist): + # counter = 0 + # for item in itemlist: + # episode = support.match(item.title, patron=r'\d+').match + # if episode == '1': + # counter += 1 + # item.title = support.typo(str(counter) + 'x' + episode.zfill(2) + support.re.sub(r'\[[^\]]+\](?:\d+)?','',item.title),'bold') + # return itemlist return locals() diff --git a/channels/film4k.json b/channels/film4k.json index fc92ab9d..2875fcfa 100644 --- a/channels/film4k.json +++ b/channels/film4k.json @@ -2,7 +2,7 @@ "id": "film4k", "name": "Film4k", "language": ["ita"], - "active": true, + "active": false, "thumbnail": "film4k.png", "banner": "film4k.png", "categories": ["tvshow", "movie", "anime"], diff --git a/channels/guardaserieicu.py b/channels/guardaserieicu.py index c92a0a42..4d60f951 100644 --- a/channels/guardaserieicu.py +++ b/channels/guardaserieicu.py @@ -28,7 +28,7 @@ def mainlist(item): @support.scrape def peliculas(item): patronBlock = r'movies-list movies-list-full(?P<block>.*?)footer>' - patron = r'<div data-movie-id[^>]+> <a href="(?P<url>[^"]+).*?<img data-original="(?P<thumbnail>[^"]+)[^>]+>[^>]+>[^>]+>(?P<title>[^<]+).*?jt-info[^>]+>[^:]+:\s*(?P<rating>[^<]+).*?rel="tag">(?P<year>\d+).*?jt-info">(?P<duration>\d+)' + patron = r'<div data-movie-id[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>[^>]+><img src="(?P<thumbnail>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+).*?jt-info[^>]+>[^:]+:\s*(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d*)[^>]+>[^>]+>[^>]+>(?P<duration>\d*)' patronNext = '<li class=.active.>.*?href=.(.*?).>' action = 'episodios' return locals() diff --git a/channels/italiaserie.py b/channels/italiaserie.py index b56d643b..e7a75716 100644 --- a/channels/italiaserie.py +++ b/channels/italiaserie.py @@ -2,22 +2,11 @@ # ------------------------------------------------------------ # Canale per italiaserie # ------------------------------------------------------------ -""" - - Problemi noti che non superano il test del canale: - Avvisi: - - - Ulteriori info: - -""" - -import re from core import support, httptools, scrapertools from core.item import Item -from platformcode import config +from platformcode import config, logger host = config.get_channel_url() headers = [['Referer', host]] @@ -25,11 +14,11 @@ headers = [['Referer', host]] @support.menu def mainlist(item): - support.info() - - tvshow = ['/category/serie-tv/', - ('Aggiornamenti', ['/ultimi-episodi/', 'peliculas', 'update']), - ('Generi', ['', 'category', 'Serie-Tv per Genere']) + tvshow = ['', + ('Aggiornamenti', ['/aggiornamento-episodi/', 'peliculas', 'update']), + ('Top 10', ['/top-10', 'peliculas', 'top']), + ('Netflix {tv submenu}', ['/genere/netflix', 'peliculas']), + ('A-Z', ['/lista-completa', 'peliculas', 'a-z']) ] return locals() @@ -37,44 +26,46 @@ def mainlist(item): @support.scrape def peliculas(item): - support.info() - action = 'episodios' - patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" '\ - 'title="(?P<title>[^"]+)">\s*<img src="(?P<thumb>[^"]+)"[^>]+>' + patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"\[]+)[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>' if item.args == 'update': - patron += r'.*?aj-eps">(?P<episode>.+?)[ ]?(?P<lang>Sub-Ita|Ita)</span>' + pagination = '' + patron = r'br />(?P<title>[^–]+)[^<]+<a href="(?P<url>[^"]+)">(?P<episode>[^ ]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))??' action = 'findvideos' + if item.args == 'top': + patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>[^>]+>[^>]+>[^>]+><img.*?src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>:\s*(?P<rating>[^/]+)' + if item.args =='a-z': + pagination = '' + patron = r'<li ><a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"' patronNext = r'<a class="next page-numbers" href="(.*?)">' -## debug = True + def itemHook(item): + item.title = support.re.sub(r'<[^>]+>','', item.title) + return item + return locals() @support.scrape def episodios(item): - support.info() + res = support.match(item, patron=r'<a href="([^"]+)">>') + if res.match: data = support.match(res.match).data + else: data = res.data - patronBlock = r'</i> Stagione (?P<block>(?P<season>\d+)</div> '\ - '<div class="su-spoiler-content".*?)<div class="clearfix">' - patron = r'(?:(?P<season>\d+)?</div> <div class="su-spoiler-content"(:?.+?)?> )?'\ - '<div class="su-link-ep">\s+<a.*?href="(?P<url>[^"]+)".*?strong>[ ]'\ - '(?P<title>.+?)[ ](?P<episode>\d+-\d+|\d+)[ ](?:-\s+(?P<title2>.+?))?'\ - '[ ]?(?:(?P<lang>Sub-ITA))?[ ]?</strong>' + patronBlock = r'(?:Stagione|STAGIONE)\s*(?P<lang>[^<]+)?(?:</p>)?(?P<block>.*?)</p>' + patron = r'(?:p>|/>)(?P<title>[^–]+)–(?P<data>.*?)(?:<br|$)' - - #debug = True + def itemHook(item): + item.title = support.re.sub('<[^>]+>','', item.title) + return item return locals() @support.scrape def category(item): - support.info() - action = 'peliculas' patron = r'<li class="cat-item.*?href="(?P<url>[^"]+)".*?>(?P<title>.*?)</a>' - return locals() @@ -111,41 +102,28 @@ def newest(categoria): except: import sys for line in sys.exc_info(): - support.info("{0}".format(line)) + logger.error("{0}".format(line)) return [] return itemlist def findvideos(item): - support.info() + logger.debug() if item.args == 'update': itemlist = [] item.infoLabels['mediatype'] = 'episode' - data = httptools.downloadpage(item.url, headers=headers).data - data = re.sub('\n|\t', ' ', data) - data = re.sub(r'>\s+<', '> <', data) - url_video = scrapertools.find_single_match(data, r'<a rel="[^"]+" target="[^"]+" act="[^"]+"\s+href="([^"]+)" class="[^"]+-link".+?\d+.+?</strong> </a>', -1) - url_serie = scrapertools.find_single_match(data, r'<link rel="canonical" href="([^"]+)" />') + data = support.match(item.url, headers=headers).data + url_video = support.match(data, patron=r'<a rel="[^"]+" target="[^"]+" act="[^"]+"\s+href="([^"]+)" class="[^"]+-link".+?\d+.+?</strong> </a>').matches + url_serie = support.match(data, patron=r'<link rel="canonical" href="([^"]+)" />').matches goseries = support.typo("Vai alla Serie:", ' bold') series = support.typo(item.contentSerieName, ' bold color kod') itemlist = support.server(item, data=url_video) - itemlist.append( - Item(channel=item.channel, - title=goseries + series, - fulltitle=item.fulltitle, - show=item.show, - contentType='tvshow', - contentSerieName=item.contentSerieName, - url=url_serie, - action='episodios', - contentTitle=item.contentSerieName, - plot = goseries + series + "con tutte le puntate", - )) + itemlist.append(item.clone(title=goseries + series, contentType='tvshow', url=url_serie, action='episodios', plot = goseries + series + "con tutte le puntate")) return itemlist else: - return support.server(item, data=item.url) + return support.server(item, data=item.data) diff --git a/channels/metalvideo.py b/channels/metalvideo.py index 7db2eb3a..441b4922 100644 --- a/channels/metalvideo.py +++ b/channels/metalvideo.py @@ -13,7 +13,7 @@ headers = {'X-Requested-With': 'XMLHttpRequest'} def mainlist(item): item.url = host action = 'peliculas' - patronBlock = r'<ul class="dropdown-menu(?P<block>.*?)</ul> </div' + patronBlock = r'<ul class="dropdown-menu(?P<block>.*?)</ul>\s*</div' patron = r'<a href="(?P<url>[^"]+)"(?: class="")?>(?P<title>[^<]+)<' def itemHook(item): item.thumbnail = support.thumb('music') @@ -24,7 +24,7 @@ def mainlist(item): itemlist.append( support.Item( channel=item.channel, - title=support.typo('Cerca...', 'bold color kod'), + title=support.typo('Cerca...', 'bold'), contentType='music', url=item.url, action='search', diff --git a/core/support.py b/core/support.py index 84360377..c8422456 100755 --- a/core/support.py +++ b/core/support.py @@ -1392,7 +1392,7 @@ def thumb(item_itemlist_string=None, genre=False, live=False): '_tvshow':['serie','tv', 'fiction']} def autoselect_thumb(item, genre): - logger.debug('SPLIT',re.split(r'\.|\{|\}|\[|\]|\(|\)|/| ',item.title.lower())) + # logger.debug('SPLIT',re.split(r'\.|\{|\}|\[|\]|\(|\)|/| ',item.title.lower())) if genre == False: for thumb, titles in icon_dict.items(): if any(word in re.split(r'\.|\{|\}|\[|\]|\(|\)|/| ',item.title.lower()) for word in search): diff --git a/servers/doodstream.py b/servers/doodstream.py index 519b38ba..42f2cc01 100644 --- a/servers/doodstream.py +++ b/servers/doodstream.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -import re, time +import re, time from lib import js2py from core import httptools, scrapertools from platformcode import logger, config @@ -21,28 +21,17 @@ def get_video_url(page_url, premium=False, user="", password="", video_password= # from core.support import dbg;dbg() global data logger.debug("URL", page_url) - - video_urls = list() - host = "https://dood.to" + # from core.support import dbg;dbg() + video_urls = [] + host = scrapertools.find_single_match(page_url, r'http[s]?://[^/]+') new_url = scrapertools.find_single_match(data, r'<iframe src="([^"]+)"') - if new_url: - data = httptools.downloadpage(host + new_url).data - logger.debug('DATA', data) + if new_url: data = httptools.downloadpage(host + new_url).data label = scrapertools.find_single_match(data, r'type:\s*"video/([^"]+)"') - # js_code = scrapertools.find_single_match(data, ('(function makePlay.*?;})')) - # js_code = re.sub(r"\+Date.now\(\)", '', js_code) - # js = js2py.eval_js(js_code) - # makeplay = js() + str(int(time.time()*1000)) - - # base_url = scrapertools.find_single_match(data, r"\$.get\('([^']+)'") - # data = httptools.downloadpage("%s%s" % (host, base_url), headers={"referer": page_url}).data - # data = re.sub(r'\s+', '', data) base_url, token = scrapertools.find_single_match(data, r'''dsplayer\.hotkeys[^']+'([^']+).+?function\s*makePlay.+?return[^?]+([^"]+)''') - url = httptools.downloadpage(host + base_url, headers={"referer": page_url}).data - url += token + "|Referer=%s" % page_url + url = '{}{}{}|Referer={}'.format(httptools.downloadpage(host + base_url, headers={"Referer": page_url}).data, token, str(int(time.time() * 1000)), page_url) video_urls.append([ label + ' [DooD Stream]', url]) return video_urls \ No newline at end of file diff --git a/specials/community.py b/specials/community.py index b7fa69c7..1dca0fb1 100644 --- a/specials/community.py +++ b/specials/community.py @@ -6,7 +6,7 @@ import re, inspect, xbmcgui from core import httptools, jsontools, tmdb, support, filetools from core.item import Item -from platformcode import config, platformtools +from platformcode import config, platformtools, logger from channelselector import get_thumb from collections import OrderedDict @@ -25,7 +25,7 @@ list_quality = ['SD', '720', '1080', '4k'] tmdb_api = 'a1ab8b8669da03637a4b98fa39c39228' def mainlist(item): - support.info() + logger.debug() path = filetools.join(config.get_data_path(), 'community_channels.json') if not filetools.exists(path): @@ -37,7 +37,7 @@ def mainlist(item): def show_channels(item): - support.info() + logger.debug() itemlist = [] # add context menu @@ -77,7 +77,7 @@ def show_channels(item): def show_menu(item): - support.info() + logger.debug() itemlist = [] @@ -116,12 +116,12 @@ def show_menu(item): if 'channel_name' in json and not 'disable_search' in json and 'search' not in json: itemlist += get_search_menu(item, json, channel_name=json['channel_name']) - support.info('PAGINATION:', disable_pagination) + logger.debug('PAGINATION:', disable_pagination) return itemlist def search(item, text): - support.info(text) + logger.info('search',text) itemlist = [] if item.custom_search: @@ -170,7 +170,7 @@ def global_search(item, text): def peliculas(item, json='', key='', itemlist=[]): item.plot = item.thumb = item.fanart ='' - support.info('PAGINATION:', item.disable_pagination) + logger.debug('PAGINATION:', item.disable_pagination) if not json: key = item.key json = load_json(item)[key] @@ -241,7 +241,7 @@ def peliculas(item, json='', key='', itemlist=[]): def get_seasons(item): - support.info() + logger.debug() itemlist = [] infoLabels = item.infoLabels json = item.url if type(item.url) == dict else item.url @@ -281,7 +281,7 @@ def get_seasons(item): def episodios(item, json ='', key='', itemlist =[]): - support.info() + logger.debug() infoLabels = item.infoLabels itm=item @@ -394,7 +394,7 @@ def episodios(item, json ='', key='', itemlist =[]): # Find Servers def findvideos(item): - support.info() + logger.debug() itemlist = [] if 'links' in item.url: json = item.url['links'] @@ -414,7 +414,7 @@ def findvideos(item): ################################ Menu ################################ def get_menu(item, json, key, itemlist=[]): - support.info() + logger.debug() json = json[key] for option in json: title = option['title'] if 'title' in option else json[option] if 'search' not in option else '' @@ -449,7 +449,7 @@ def get_menu(item, json, key, itemlist=[]): def get_sub_menu(item, json, key, itemlist=[]): - support.info() + logger.debug() json = json[key] search = False if item.menu: @@ -488,7 +488,7 @@ def get_sub_menu(item, json, key, itemlist=[]): def get_search_menu(item, json='', itemlist=[], channel_name=''): - support.info() + logger.debug() if 'title' in json: title = json['title'] elif channel_name: @@ -514,7 +514,7 @@ def get_search_menu(item, json='', itemlist=[], channel_name=''): def submenu(item, json, key, itemlist = [], filter_list = []): - support.info(item) + logger.debug(item) import sys if sys.version_info[0] >= 3: from concurrent import futures @@ -585,7 +585,6 @@ def filter_thread(filter, key, item, description): if id: thumbnail = 'https://image.tmdb.org/t/p/original' + results['profile_path'] if results['profile_path'] else item.thumbnail json_file = httptools.downloadpage('http://api.themoviedb.org/3/person/'+ str(id) + '?api_key=' + tmdb_api + '&language=en', use_requests=True).data - support.info(json_file) plot += jsontools.load(json_file)['biography'] if description: @@ -620,7 +619,7 @@ def filter_thread(filter, key, item, description): # for load json from item or url def load_json(item, no_order=False): - support.info() + logger.debug() if type(item) == Item: url = item.url filterkey = item.filterkey @@ -645,7 +644,7 @@ def load_json(item, no_order=False): # Load Channels json and check that the paths and channel titles are correct def load_and_check(item): - support.info() + logger.debug() path = filetools.join(config.get_data_path(), 'community_channels.json') file = open(path, "r") json = jsontools.load(file.read()) @@ -667,7 +666,7 @@ def load_and_check(item): # set extra values def set_extra_values(item, json, path): - support.info() + logger.debug() ret = Item() for key in json: if key == 'quality': @@ -713,7 +712,7 @@ def set_extra_values(item, json, path): # format titles def set_title(title, language='', quality=''): - support.info() + logger.debug() t = support.match(title, patron=r'\{([^\}]+)\}').match if 'bold' not in t: t += ' bold' @@ -734,7 +733,7 @@ def set_title(title, language='', quality=''): # for relative path def relative(key, json, path): - support.info() + logger.debug() ret = '' if key in json: if key in ['thumbnail', 'poster']: @@ -746,7 +745,7 @@ def relative(key, json, path): def pagination(item, itemlist = []): - support.info() + logger.debug() itlist = [] if not itemlist: @@ -786,7 +785,7 @@ def pagination(item, itemlist = []): return itlist def add_channel(item): - support.info() + logger.debug() channel_to_add = {} json_file = '' result = platformtools.dialog_select(config.get_localized_string(70676), [config.get_localized_string(70678), config.get_localized_string(70679)]) @@ -840,7 +839,7 @@ def add_channel(item): return def remove_channel(item): - support.info() + logger.debug() path = filetools.join(config.get_data_path(), 'community_channels.json')