From 23e9ac387533df1e33457e36d60838a317730804 Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 4 Feb 2020 18:24:33 +0100 Subject: [PATCH] KoD 0.7.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - - aggiunto raiplay - agigunto d.s.d.a (ex documentaristreamingda) - svariati fix ai canali (eurostreaming, streamtime, piratestreaming, altadefinizioneclick) - la videoteca ora può essere messa nelle unità di rete - aggiunto server upstream - altri piccoli fix vari --- addon.xml | 12 +- channels.json | 6 +- channels/altadefinizioneclick.py | 10 +- channels/cineblog01.py | 22 +- channels/documentaristreamingda.json | 36 --- channels/documentaristreamingda.py | 264 --------------- channels/dsda.json | 11 + channels/dsda.py | 126 ++++++++ channels/eurostreaming.py | 2 +- channels/fastsubita.py | 2 +- channels/ilgeniodellostreaming.py | 79 +---- channels/raiplay.json | 13 + channels/raiplay.py | 301 ++++++++++++++++++ channelselector.py | 13 +- core/httptools.py | 3 +- core/servertools.py | 5 +- core/support.py | 16 +- core/tmdb.py | 6 +- core/videolibrarytools.py | 6 +- lib/unshortenit.py | 64 +++- resources/settings.xml | 8 +- resources/skins/Default/720p/NextDialog.xml | 2 +- .../skins/Default/720p/NextDialogCompact.xml | 4 +- .../Default/media/NextDialog/play-fo.png | Bin 1823 -> 2012 bytes .../Default/media/NextDialog/play-nf.png | Bin 1814 -> 2007 bytes servers/decrypters/zcrypt.py | 113 ------- servers/mixdrop.json | 2 +- servers/upstream.json | 42 +++ servers/upstream.py | 26 ++ servers/wstream.py | 13 +- specials/downloads.py | 6 +- specials/nextep.py | 2 +- specials/resolverdns.py | 18 +- 33 files changed, 681 insertions(+), 552 deletions(-) delete mode 100644 channels/documentaristreamingda.json delete mode 100644 channels/documentaristreamingda.py create mode 100644 channels/dsda.json create mode 100644 channels/dsda.py create mode 100644 channels/raiplay.json create mode 100644 channels/raiplay.py delete mode 100644 servers/decrypters/zcrypt.py create mode 100644 servers/upstream.json create mode 100644 servers/upstream.py diff --git a/addon.xml b/addon.xml index 4550f759..bd9dec94 100644 --- a/addon.xml +++ b/addon.xml @@ -1,4 +1,4 @@ - + @@ -19,10 +19,12 @@ resources/media/themes/ss/2.png resources/media/themes/ss/3.png - - A grande richiesta, è ora possibile riprodurre in automatico l'episodio successivo di una serie in libreria -- aggiunta la possibilità di nascondere la lista dei server, quando si usa l'autoplay -- aggiunto canale pufimovies.com -- fix vari + - - aggiunto raiplay +- agigunto d.s.d.a (ex documentaristreamingda) +- svariati fix ai canali (eurostreaming, streamtime, piratestreaming, altadefinizioneclick) +- la videoteca ora può essere messa nelle unità di rete +- aggiunto server upstream +- altri piccoli fix vari Naviga velocemente sul web e guarda i contenuti presenti [COLOR red]The owners and submitters to this addon do not host or distribute any of the content displayed by these addons nor do they have any affiliation with the content providers.[/COLOR] [COLOR yellow]Kodi © is a registered trademark of the XBMC Foundation. We are not connected to or in any other way affiliated with Kodi, Team Kodi, or the XBMC Foundation. Furthermore, any software, addons, or products offered by us will receive no support in official Kodi channels, including the Kodi forums and various social networks.[/COLOR] diff --git a/channels.json b/channels.json index 88a7e56b..983d9865 100644 --- a/channels.json +++ b/channels.json @@ -1,6 +1,7 @@ { "altadefinizione01": "https://www.altadefinizione01.tel", "altadefinizione01_link": "https://altadefinizione01.cam", + "altadefinizioneclick": "https://altadefinizione.style", "animeforce": "https://ww1.animeforce.org", "animeleggendari": "https://animepertutti.com", "animesaturn": "https://animesaturn.com", @@ -13,8 +14,8 @@ "casacinemaInfo": "https://casacinema.kim", "cb01anime": "https://www.cineblog01.ink", "cinetecadibologna": "http://cinestore.cinetecadibologna.it", - "documentaristreamingda": "https://documentari-streaming-da.com", "dreamsub": "https://dreamsub.stream", + "dsda": "https://www.dsda.press/", "fastsubita": "https://fastsubita.com", "filmgratis": "https://www.filmaltadefinizione.org", "filmigratis": "https://filmigratis.org", @@ -24,13 +25,14 @@ "guardarefilm": "https://www.guardarefilm.red", "guardaserie_stream": "https://guardaserie.store", "guardaserieclick": "https://www.guardaserie.media", - "ilgeniodellostreaming": "https://igds.se", + "ilgeniodellostreaming": "https://ilgeniodellostreaming.si", "italiaserie": "https://italiaserie.org", "mondoserietv": "https://mondoserietv.com", "netfreex": "https://www.netfreex.pro", "piratestreaming": "https://www.piratestreaming.gratis", "polpotv": "https://polpo.tv", "pufimovies": "https://pufimovies.com", + "raiplay": "https://www.raiplay.it", "seriehd": "https://www.seriehd.watch", "serietvonline": "https://serietvonline.icu", "serietvsubita": "http://serietvsubita.xyz", diff --git a/channels/altadefinizioneclick.py b/channels/altadefinizioneclick.py index 48631174..8c6ca2d9 100644 --- a/channels/altadefinizioneclick.py +++ b/channels/altadefinizioneclick.py @@ -21,12 +21,12 @@ from core import support from core.item import Item from platformcode import config -def findhost(): - data = support.httptools.downloadpage('https://altadefinizione-nuovo.link/').data - host = support.scrapertools.find_single_match(data, '
[^"]+)" alt="(?P.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+><a href="(?P<url>[^"]+)".*?<div class="rpwe-summary">.*?\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<' action = 'episodios' elif '/serietv/' not in item.url: - patron = r'<div class="?card-image"?>.*?<img src="?(?P<thumb>[^" ]+)"? alt.*?<a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[A-Za-z0-9/-]+)])? (?:\((?P<year>[0-9]{4})\))?.*?<strong>(?P<genre>[^<>&–]+).*?DURATA (?P<duration>[0-9]+).*?<br(?: /)?>(?P<plot>[^<>]+)' + patron = r'<div class="?card-image"?>.*?<img src="?(?P<thumb>[^" ]+)"? alt[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[A-Za-z0-9/-]+)])? (?:\((?P<year>[0-9]{4})\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<genre>[^<>&–]+)(?:[^ ]+\s*DURATA\s*(?P<duration>[0-9]+)[^>]+>[^>]+>[^>]+>(?P<plot>[^<>]+))?' + # patron = r'<div class="?card-image"?>.*?<img src="?(?P<thumb>[^" ]+)"? alt.*?<a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[A-Za-z0-9/-]+)])? (?:\((?P<year>[0-9]{4})\))?.*?<strong>(?P<genre>[^<>&–]+).*?DURATA (?P<duration>[0-9]+).*?<br(?: /)?>(?P<plot>[^<>]+)' action = 'findvideos' else: # debug = True @@ -161,8 +163,8 @@ def peliculas(item): @support.scrape def episodios(item): - patronBlock = r'(?P<block><div class="sp-head[a-z ]*?" title="Espandi">\s*(?:STAGIONE [0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?[^<>]*?</div>.*?)<div class="spdiv">\[riduci\]</div>' - patron = '(?:<p>|<strong>)(?P<episode>[0-9]+(?:×|×)[0-9]+)(?P<url>.*?)(?:</p>|<br)' + patronBlock = r'(?P<block><div class="sp-head[a-z ]*?" title="Espandi">\s*(?:STAGION[EI]\s*(?:DA\s*[0-9]+\s*A)?\s*[0-9]+|MINISERIE) - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?[^<>]*?<\/div>.*?)<div class="spdiv">\[riduci\]<\/div>' + patron = '(?:<p>|<strong>)(?P<episode>[0-9]+(?:×|×)[0-9]+)\s*(?P<title2>[^&<]*)?(?:–|-)?\s*(?P<url>.*?)(?:<\/p>|<br)' return locals() @@ -208,7 +210,7 @@ def findvideos(item): matches = re.compile(patronvideos, re.DOTALL).finditer(data) QualityStr = "" for match in matches: - QualityStr = scrapertools.decodeHtmlentities(match.group(1))[6:] + QualityStr = scrapertools.decodeHtmlentities(match.group(1)) # Estrae i contenuti - Streaming load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "orange", "Streaming", "SD") @@ -218,8 +220,16 @@ def findvideos(item): # Estrae i contenuti - Streaming 3D load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "pink", "Streaming 3D") - - return support.server(item, itemlist=itemlist) + + itemlist=support.server(item, itemlist=itemlist) + if itemlist and QualityStr: + itemlist.insert(0, + Item(channel=item.channel, + action="", + title="[COLOR orange]%s[/COLOR]" % QualityStr, + folder=False)) + + return itemlist # Estrae i contenuti - Download # load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download") diff --git a/channels/documentaristreamingda.json b/channels/documentaristreamingda.json deleted file mode 100644 index ad800ddf..00000000 --- a/channels/documentaristreamingda.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "id": "documentaristreamingda", - "name": "DocumentariStreamingDa", - "language": ["ita"], - "active": true, - "adult": false, - "thumbnail": "documentaristreamingda.png", - "banner": "documentaristreamingda.png", - "categories": ["documentary"], - "settings": [ - { - "id": "include_in_global_search", - "type": "bool", - "label": "Includi ricerca globale", - "default": false, - "enabled": false, - "visible": false - }, - { - "id": "include_in_newest_documentales", - "type": "bool", - "label": "Includi in Novità - Documentari", - "default": true, - "enabled": true, - "visible": true - }, - { - "id": "include_in_newest_italiano", - "type": "bool", - "label": "Includi in Novità - Italiano", - "default": true, - "enabled": true, - "visible": true - } - ] -} diff --git a/channels/documentaristreamingda.py b/channels/documentaristreamingda.py deleted file mode 100644 index 80b2bb76..00000000 --- a/channels/documentaristreamingda.py +++ /dev/null @@ -1,264 +0,0 @@ -# -*- coding: utf-8 -*- -# ------------------------------------------------------------ -# Ringraziamo Icarus crew -# Canale per documentaristreamingda -# ------------------------------------------------------------ -import re -import urlparse - -from core import httptools, scrapertools, servertools, support -from core.item import Item -from platformcode import logger, config - -host = config.get_channel_url() - -list_servers = [''] -list_quality = [''] - -def mainlist(item): - logger.info("kod.documentaristreamingda mainlist") - itemlist = [Item(channel=item.channel, - title="[COLOR azure]Aggiornamenti[/COLOR]", - action="peliculas", - url=host + "/?searchtype=movie&post_type=movie&sl=lasts&s=", - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), - Item(channel=item.channel, - title="[COLOR azure]Categorie[/COLOR]", - action="categorias", - url=host + "/documentari-streaming-dataarchive/", - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"), - Item(channel=item.channel, - title="[COLOR yellow]Cerca...[/COLOR]", - action="search", - thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search")] - - return itemlist - - -def newest(categoria): - logger.info("kod.documentaristreamingda newest" + categoria) - itemlist = [] - item = Item() - try: - if categoria == "documentales": - item.url = host + "/?searchtype=movie&post_type=movie&sl=lasts&s=" - item.action = "peliculas" - 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(): - logger.error("{0}".format(line)) - return [] - - return itemlist - - -def categorias(item): - itemlist = [] - - # Carica la pagina - data = httptools.downloadpage(item.url).data - bloque = scrapertools.find_single_match(data, 'Categorie</a></li>(.*?)</ul>') - - # Estrae i contenuti - patron = '<a href="([^"]+)">([^<]+)</a></li>' - matches = re.compile(patron, re.DOTALL).findall(bloque) - - for scrapedurl, scrapedtitle in matches: - - scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.replace("Documentari ", "")) - - html = httptools.downloadpage(scrapedurl).data - - patron = '>Ultime uscite[^<]+<\/h3><a href="([^"]+)"' - matches = re.compile(patron, re.DOTALL).findall(html) - for url in matches: - url = url.replace("&", "&") - itemlist.append( - Item(channel=item.channel, - action="peliculas", - title="[COLOR azure]" + scrapedtitle + "[/COLOR]", - url=url, - thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png", - folder=True)) - - return itemlist - - -def search(item, texto): - logger.info("kod.documentaristreamingda " + item.url + " search " + texto) - item.url = host + "/?searchtype=movie&post_type=movie&s=" + texto - try: - return peliculas(item) - # Continua la ricerca in caso di errore - except: - import sys - for line in sys.exc_info(): - logger.error("%s" % line) - return [] - - -def peliculas(item): - logger.info("kod.documentaristreamingda peliculas") - itemlist = [] - - # Carica la pagina - data = httptools.downloadpage(item.url).data - - # Estrae i contenuti - patron = '<div class="movie-poster">\s*<img[^s]+src="([^"]+)"[^=]+=[^=]+="([^"]+)"[^>]+>[^<]+<a[^h]+href="([^"]+)"' - matches = re.compile(patron, re.DOTALL).findall(data) - - for scrapedthumbnail, scrapedtitle, scrapedurl in matches: - # html = httptools.downloadpage(scrapedurl) - # start = html.find("</div><h2>") - # end = html.find("<p><strong>", start) - # scrapedplot = html[start:end] - # scrapedplot = re.sub(r'<[^>]*>', '', scrapedplot) - # scrapedplot = scrapertools.decodeHtmlentities(scrapedplot) - scrapedplot = "" - scrapedtitle = scrapedtitle.replace("streaming", "") - scrapedtitle = scrapedtitle.replace("_", " ") - scrapedtitle = scrapedtitle.replace("-", " ") - scrapedtitle = scrapedtitle.title() - itemlist.append( - Item(channel=item.channel, - action="findvideos", - fulltitle=scrapedtitle, - show=scrapedtitle, - title="[COLOR azure]" + scrapedtitle + "[/COLOR]", - url=scrapedurl, - viewmode="movie_with_plot", - thumbnail=scrapedthumbnail, - plot=scrapedplot, - folder=True)) - - # Paginazione - patronvideos = '<a class="next page-numbers" href="(.*?)">' - matches = re.compile(patronvideos, re.DOTALL).findall(data) - - if len(matches) > 0: - scrapedurl = urlparse.urljoin(item.url, matches[0]) - scrapedurl = scrapedurl.replace("&", "&") - itemlist.append( - Item(channel=item.channel, - action="peliculas", - title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]", - url=scrapedurl, - thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png", - folder=True)) - - return itemlist - - -def findvideos(item): - logger.info("kod.documentaristreamingda findvideos") - return support.server(item)#, data= item.url) - -## -## data = httptools.downloadpage(item.url).data -## -## links = [] -## begin = data.find('<div class="moview-details-text">') -## if begin != -1: -## end = data.find('<!-- //movie-details -->', begin) -## mdiv = data[begin:end] -## -## items = [[m.end(), m.group(1)] for m in re.finditer('<b style="color:#333333;">(.*?)<\/b>', mdiv)] -## if items: -## for idx, val in enumerate(items): -## if idx == len(items) - 1: -## _data = mdiv[val[0]:-1] -## else: -## _data = mdiv[val[0]:items[idx + 1][0]] -## -## for link in re.findall('<a.*?href="([^"]+)"[^>]+>.*?<b>(.*?)<\/b><\/a>+', _data): -## if not link[0].strip() in [l[1] for l in links]: links.append( -## [val[1], link[0].strip(), link[1].strip()]) -## -## items = [[m.end(), m.group(1)] for m in re.finditer('<p><strong>(.*?)<\/strong><\/p>', mdiv)] -## if items: -## _title = '' -## for idx, val in enumerate(items): -## if idx == len(items) - 1: -## _data = mdiv[val[0]:-1] -## else: -## _data = mdiv[val[0]:items[idx + 1][0]] -## -## for link in re.findall('<a\s.*?href="([^"]+)".*?>(?:<span[^>]+>)*(?:<strong>)*([^<]+)', _data): -## if not link[0].strip() in [l[1] for l in links]: -## if not link[1].strip() in link[0]: _title = link[1].strip() -## links.append([_title, link[0].strip(), 'unknown']) -## -## items = [[m.start(), m.group(1)] for m in re.finditer('<li><strong>([^<]+)<', mdiv)] -## if items: -## for idx, val in enumerate(items): -## if idx == len(items) - 1: -## _data = mdiv[val[0]:-1] -## else: -## _data = mdiv[val[0]:items[idx + 1][0]] -## -## for link in re.findall('<a\s.*?href="([^"]+)".*?>(?:<span[^>]+>)*(?:<strong>)*([^<]+)', _data): -## if not link[0].strip() in [l[1] for l in links]: links.append( -## [val[1], link[0].strip(), link[1].strip()]) -## -## itemlist = [] -## if links: -## for l in links: -## title = unicode(l[0], 'utf8', 'ignore') -## title = title.replace(u'\xa0', ' ').replace('Documentario ', '').replace(' doc ', ' ').replace(' streaming', -## '').replace( -## ' Streaming', '') -## url = l[1] -## action = "play" -## server = "unknown" -## folder = False -## -## if url == '#' or not title: continue -## -## logger.info('server: %s' % l[2]) -## if l[2] != 'unknown': -## server = unicode(l[2], 'utf8', 'ignore') -## else: -## logger.info(url) -## match = re.search('https?:\/\/(?:www\.)*([^\.]+)\.', url) -## if match: -## server = match.group(1) -## -## if server == "documentari-streaming-db": -## action = "findvideos" -## folder = True -## logger.info('server: %s, action: %s' % (server, action)) -## -## logger.info(title + ' - [COLOR blue]' + server + '[/COLOR]') -## -## itemlist.append(Item( -## channel=item.channel, -## title=title + ' - [COLOR blue]' + server + '[/COLOR]', -## action=action, -## server=server, # servertools.get_server_from_url(url), -## url=url, -## thumbnail=item.thumbnail, -## fulltitle=title, -## show=item.show, -## plot=item.plot, -## parentContent=item, -## folder=folder) -## ) -## else: -## itemlist = servertools.find_video_items(data=data) -## -## for videoitem in itemlist: -## videoitem.title = "".join([item.title, '[COLOR green][B]' + videoitem.title + '[/B][/COLOR]']) -## videoitem.fulltitle = item.fulltitle -## videoitem.show = item.show -## videoitem.thumbnail = item.thumbnail -## videoitem.channel = item.channel -## -## return itemlist - diff --git a/channels/dsda.json b/channels/dsda.json new file mode 100644 index 00000000..f6d4adf6 --- /dev/null +++ b/channels/dsda.json @@ -0,0 +1,11 @@ +{ + "id": "dsda", + "name": "D.S.D.A", + "language": ["ita"], + "active": true, + "adult": false, + "thumbnail": "dsda.png", + "banner": "dsda.png", + "categories": ["documentary"], + "settings": [] +} diff --git a/channels/dsda.py b/channels/dsda.py new file mode 100644 index 00000000..d1a2a4f3 --- /dev/null +++ b/channels/dsda.py @@ -0,0 +1,126 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Ringraziamo Icarus crew +# Canale per documentaristreamingda +# ------------------------------------------------------------ +import re +import urlparse + +from core import httptools, scrapertools, servertools, support +from core.item import Item +from platformcode import logger, config + +host = config.get_channel_url() + +@support.menu +def mainlist(item): + docu = [('Documentari {bullet bold}',('/elenco-documentari','peliculas')), + ('Categorie {submenu}',('','menu')), + ('Cerca... {bullet bold}',('','search')),] + return locals() + + +@support.scrape +def menu(item): + action = 'peliculas' + patronMenu = r'<li class="menu-item menu-item-type-taxonomy[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<' + def fullItemlistHook(itemlist): + item_list = [] + title_list = [] + for item in itemlist: + if item.title not in title_list: + item_list.append(item) + title_list.append(item.title) + itemlist = item_list + return itemlist + return locals() + +def newest(categoria): + support.log() + item = Item() + try: + if categoria == "documentales": + item.url = host + "/elenco-documentari" + item.action = "peliculas" + return peliculas(item) + + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + support.logger.error("{0}".format(line)) + return [] + + +def search(item, texto): + support.log(texto) + item.url = host + "/?s=" + texto + try: + return peliculas(item) + # Continua la ricerca in caso di errore + except: + import sys + for line in sys.exc_info(): + logger.error("%s" % line) + return [] + + +@support.scrape +def peliculas(item): + if item.args == 'collection': + patron = r'<div class="cover-racolta">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>(?P<title>[^<]+)<' + elif item.args == 'raccolta': + patron = r'<a (?:style="[^"]+" )?href="(?P<url>[^"]+)"[^>]+>(?:[^>]+><strong>)?(?P<title>[^<]+)(?:</a>)?</strong' + else: + 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 + def itemHook(item): + title = support.re.sub(r'(?:[Ss]erie\s*|[Ss]treaming(?:\s*[Dd][Aa])?\s*|[Cc]ollezione\s*|[Rr]accolta\s*|[Dd]ocumentari(?:o)?\s*)?','',item.fulltitle).strip() + if 'serie' in item.fulltitle.lower(): + item.contentType = 'tvshow' + item.action = 'episodios' + item.contentSerieName = title + item.contentTitle = '' + elif 'collezione' in item.fulltitle.lower(): + item.args = 'collection' + item.action = 'peliculas' + item.contentTitle = title + item.contentSerieName = '' + elif 'raccolta' in item.fulltitle.lower(): + item.args = 'raccolta' + item.action = 'peliculas' + item.contentTitle = title + item.contentSerieName = '' + else: + item.contentTitle = title + item.contentSerieName = '' + + item.title = support.typo(title,'bold') + item.fulltitle = item.show = title + return item + # remove duplicates + def fullItemlistHook(itemlist): + item_list = [] + title_list = [] + for item in itemlist: + if item.title not in title_list: + item_list.append(item) + title_list.append(item.title) + itemlist = item_list + return itemlist + return locals() + +@support.scrape +def episodios(item): + patron = r'class="title-episodio">(?P<episode>[^<]+)<(?P<url>.*?)<p' + return locals() + + +def findvideos(item): + support.log() + if item.args == 'raccolta' or item.contentType == 'episode': + return support.server(item, item.url) + else: + return support.server(item) \ No newline at end of file diff --git a/channels/eurostreaming.py b/channels/eurostreaming.py index 2101e2d4..ae2da54b 100644 --- a/channels/eurostreaming.py +++ b/channels/eurostreaming.py @@ -25,7 +25,7 @@ headers = [['Referer', host]] -list_servers = ['verystream', 'wstream', 'speedvideo', 'flashx', 'nowvideo', 'streamango', 'deltabit', 'openload'] +list_servers = ['akstream', 'wstream', 'mixdrop', 'vidtome', 'turbovid', 'speedvideo', 'flashx', 'nowvideo', 'deltabit'] list_quality = ['default'] @support.menu diff --git a/channels/fastsubita.py b/channels/fastsubita.py index b96af5e8..a20d354c 100644 --- a/channels/fastsubita.py +++ b/channels/fastsubita.py @@ -23,7 +23,7 @@ from platformcode import config host = config.get_channel_url() headers = [['Referer', host]] -list_servers = ['verystream', 'openload', 'speedvideo', 'wstream', 'flashx', 'vidoza', 'vidtome'] +list_servers = ['wstream', 'upstream', 'flashx', 'vidoza', 'vidtome'] list_quality = ['default'] diff --git a/channels/ilgeniodellostreaming.py b/channels/ilgeniodellostreaming.py index 2c7fb457..bb347e0e 100644 --- a/channels/ilgeniodellostreaming.py +++ b/channels/ilgeniodellostreaming.py @@ -4,32 +4,6 @@ # Canale per ilgeniodellostreaming # ------------------------------------------------------------ -""" - - Alcuni video non si aprono sul sito... - - Avvisi per il test: - i link per le categorie non sono TUTTI visibili nella pagina del sito: - vanno costruiti con i nomi dei generi che vedete nel CANALE. - Es: - https://ilgeniodellostreaming.se/genere/+ genere nel canale - genere-> kids - https://ilgeniodellostreaming.se/genere/kids - genere-> avventura - https://ilgeniodellostreaming.se/genere/avventura - Se il genere è formato da 2 parola lo spazio si trasforma in - - genere-> televisione film - https://ilgeniodellostreaming.se/genere/televisione-film - - Novità -> Serietv e Aggiornamenti nel canale: - - le pagine sono di 25 titoli - - - ##### note per i dev ######### - - La pagina "Aggiornamenti Anime" del sito è vuota (update 13-9-2019) - - in url: film o serietv - -""" import re @@ -68,7 +42,7 @@ def mainlist(item): ] Tvshow = [ - ('Show TV', ['/tv-show/', 'peliculas', '', 'tvshow']) + ('Show TV bullet bold', ['/tv-show/', 'peliculas', '', 'tvshow']) ] search = '' @@ -81,21 +55,11 @@ def peliculas(item): log() if item.args == 'search': - patronBlock = r'<div class="search-page">(?P<block>.*?)<footer class="main">' - patron = r'<div class="thumbnail animation-2"><a href="(?P<url>[^"]+)">'\ - '<img src="(?P<thumb>[^"]+)" alt="[^"]+" \/>[^>]+>(?P<type>[^<]+)'\ - '<\/span>.*?<a href.*?>(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?'\ - '<\/a>[^>]+>(?:<span class="rating">IMDb\s*(?P<rating>[0-9.]+)<\/span>)?'\ - '.+?(?:<span class="year">(?P<year>[0-9]+)<\/span>)?[^>]+>[^>]+><p>(?P<plot>.*?)<\/p>' + patron = r'<img src="(?P<thumb>[^"]+)" alt="[^"]+" />[^>]+>(?P<type>[^<]+)</span>.*?<a href="(?P<url>[^"]+)">(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?</a>[^>]+>[^>]+>(?:<span class="rating">IMDb\s*(?P<rating>[^>]+)</span>)?.?(?:<span class="year">(?P<year>[0-9]+)</span>)?[^>]+>[^>]+><p>(?P<plot>.*?)</p>' -## type_content_dict={'movie': ['film'], 'tvshow': ['tv']} -## type_action_dict={'findvideos': ['film'], 'episodios': ['tv']} - def itemHook(item): - if 'film' not in item.url: - item.contentType = 'tvshow' - item.action = 'episodios' - return item + typeContentDict={'movie': ['film'], 'tvshow': ['tv']} + typeActionDict={'findvideos': ['film'], 'episodios': ['tv']} else: if item.contentType == 'movie': @@ -161,9 +125,8 @@ def genres(item): elif item.args == 'letter': patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">' - patron = r'<a(?:.+?)?href="(?P<url>.*?)"[ ]?>(?P<title>.*?)<\/a>' + patronMenu = r'<a(?:.+?)?href="(?P<url>.*?)"[ ]?>(?P<title>.*?)<\/a>' -## debug = True return locals() def search(item, text): @@ -211,34 +174,4 @@ def newest(categoria): def findvideos(item): log() - itemlist =[] - - html = support.match(item, patron='<iframe class="metaframe rptss" src="([^"]+)"[^>]+>',headers=headers) - matches = html.matches - data = html.data - for url in matches: - html = httptools.downloadpage(url, headers=headers).data - data += str(scrapertools.find_multiple_matches(html, '<meta name="og:url" content="([^"]+)">')) - - itemlist = support.server(item, data) - - if item.args == 'update': - - data = httptools.downloadpage(item.url).data - patron = r'<div class="item"><a href="'+host+'/serietv/([^"\/]+)\/"><i class="icon-bars">' - series = support.match(data, patron=patron).matches - titles = support.typo(series.upper().replace('-', ' '), 'bold color kod') - goseries = support.typo("Vai alla Serie:", ' bold') - itemlist.append( - Item(channel=item.channel, - title=goseries + titles, - fulltitle=titles, - show=series, - contentType='tvshow', - contentSerieName=series, - url=host+"/serietv/"+series, - action='episodios', - contentTitle=titles, - plot = "Vai alla Serie :" + titles + " con tutte le puntate", - )) - return itemlist + return support.server(item) diff --git a/channels/raiplay.json b/channels/raiplay.json new file mode 100644 index 00000000..cf69a5b1 --- /dev/null +++ b/channels/raiplay.json @@ -0,0 +1,13 @@ +{ + "id": "raiplay", + "name": "Rai Play", + "active": true, + "adult": false, + "language": ["ita"], + "thumbnail": "raiplay.png", + "banner": "raiplay.png", + "categories": ["movie", "tvshow", "documentary", "live"], + "not_active": ["include_in_newest"], + "settings": [], + "cloudflare": true +} diff --git a/channels/raiplay.py b/channels/raiplay.py new file mode 100644 index 00000000..9850096d --- /dev/null +++ b/channels/raiplay.py @@ -0,0 +1,301 @@ +# -*- coding: utf-8 -*- +# ------------------------------------------------------------ +# Canale per SerieHD +# ------------------------------------------------------------ + +import requests +from core import support +from lib.concurrent import futures +current_session = requests.Session() +host = support.config.get_channel_url() +onair = host + '/palinsesto/onAir.json' + + +@support.menu +def mainlist(item): + top = [('Dirette {bold}', ['/dl/RaiPlay/2016/PublishingBlock-9a2ff311-fcf0-4539-8f8f-c4fee2a71d58.html?json', 'dirette']), + ('Replay {bold}', ['/dl/RaiPlay/2016/PublishingBlock-9a2ff311-fcf0-4539-8f8f-c4fee2a71d58.html?json', 'replay_menu'])] + + menu = [('Film {bullet bold}', ['/film/index.json', 'menu']), + ('Serie TV {bullet bold}', ['/serietv/index.json', 'menu']), + ('Fiction {bullet bold}', ['/fiction/index.json', 'menu']), + ('Documentari {bullet bold}', ['/documentari/index.json', 'menu']), + ('Programmi TV{bullet bold}', ['/programmi/index.json', 'menu']), + ('Programmi per Bambini {bullet bold}', ['/bambini/index.json', 'menu']), + ('Teche Rai {bullet bold storia}', ['/techerai/index.json', 'menu']), + ('Musica e Teatro {bullet bold}', ['/performing-arts/index.json', 'menu']) + ] + + search = '' + + return locals() + + +def menu(item): + support.log() + itemlist = [support.Item(channel= item.channel, title = support.typo('Tutti','bullet bold'), + url = item.url, action = 'peliculas'), + + support.Item(channel= item.channel, title = support.typo('Generi','submenu'), + url = item.url, args = 'genre', action = 'submenu'), + + support.Item(channel= item.channel, title = support.typo('A-Z','submenu'), + url = item.url, args = 'az', action = 'submenu')] + + return support.thumb(itemlist) + + +def submenu(item): + support.log() + itemlist = [] + json = current_session.get(item.url).json()['contents'][-1]['contents'] + if item.args == 'az': + json_url = getUrl(json[-1]['path_id']) + json = current_session.get(json_url).json()['contents'] + for key in json: + itemlist.append(support.Item(channel = item.channel, title = support.typo(key,'bold'), fulltitle = key, show = key, + url = json[key], thumbnail = item.thumbnail, action = 'peliculas', args = item.args)) + else: + for key in json: + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], + thumbnail = getUrl(key['image']), url = getUrl(key['path_id']), action = 'peliculas', args = item.args)) + itemlist.pop(-1) + return support.thumb(itemlist) + + +def replay_menu(item): + support.log() + import datetime, xbmc + + # create day and month list + days = [] + months = [] + days.append(xbmc.getLocalizedString(17)) + for day in range(11, 17): days.append(xbmc.getLocalizedString(day)) + for month in range(21, 33): months.append(xbmc.getLocalizedString(month)) + + # make menu + itemlist = [] + today = datetime.date.today() + for d in range(7): + day = today - datetime.timedelta(days=d) + itemlist.append(support.Item(channel = item.channel, thumbnail = item.thumbnail, action = 'replay_channels', url = item.url, date = day.strftime("%d-%m-%Y"), + title = support.typo(days[int(day.strftime("%w"))] + " " + day.strftime("%d") + " " + months[int(day.strftime("%m"))-1], 'bold'))) + return itemlist + + +def replay_channels(item): + support.log() + itemlist = [] + json = current_session.get(item.url).json()['dirette'] + for key in json: + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['channel'], 'bold'), fulltitle = key['channel'], show = key['channel'],plot = item.title, action = 'replay', + thumbnail = key['transparent-icon'].replace("[RESOLUTION]", "256x-"), url = '%s/palinsesto/app/old/%s/%s.json' % (host, key['channel'].lower().replace(' ','-'), item.date))) + return itemlist + + +def replay(item): + support.log() + itemlist = [] + json = current_session.get(item.url).json()[item.fulltitle][0]['palinsesto'][0]['programmi'] + # support.log(json) + for key in json: + support.log('KEY=',key) + if key and key['pathID']: itemlist.append(support.Item(channel = item.channel, thumbnail = getUrl(key['images']['landscape']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['pathID']), + title = support.typo(key['timePublished'], 'color kod bold') + support.typo(' | ' + key['name'], ' bold'), fulltitle = key['name'], show = key['name'], plot = key['testoBreve'], action = 'findvideos')) + return itemlist + +def search(item, text): + support.log() + itemlist =[] + try: + json = current_session.get(host + '/dl/RaiTV/RaiPlayMobile/Prod/Config/programmiAZ-elenco.json').json() + for key in json: + for key in json[key]: + if key.has_key('PathID') and (text.lower() in key['name'].lower()): + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], url = key['PathID'].replace('/?json', '.json'), action = 'Type', + thumbnail = getUrl(key['images']['portrait'] if key['images'].has_key('portrait') else key['images']['portrait43'] if key['images'].has_key('portrait43') else key['images']['landscape']), + fanart = getUrl(key['images']['landscape'] if key['images'].has_key('landscape') else key['images']['landscape43']))) + except: + import sys + for line in sys.exc_info(): + support.logger.error("%s" % line) + return [] + return itemlist + + +def Type(item): + json = current_session.get(item.url).json() + if json['program_info']['layout'] == 'single': + item.contentTitle = item.fulltitle + item.contentType = 'movie' + return findvideos(item) + else: + item.contentType = 'tvshow' + return select(item) + + +def dirette(item): + support.log() + itemlist =[] + json = current_session.get(item.url).json()['dirette'] + onAir = current_session.get(onair).json()['on_air'] + for i, key in enumerate(json): + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['channel'], 'bold'), fulltitle = key['channel'], show = key['channel'], + thumbnail = key['transparent-icon'].replace("[RESOLUTION]", "256x-"), fanart = getUrl(onAir[i]['currentItem']['image']), url = key['video']['contentUrl'], + plot = support.typo(onAir[i]['currentItem']['name'],'bold')+ '\n\n' + onAir[i]['currentItem']['description'], action = 'play')) + return itemlist + + +def peliculas(item): + support.log() + itemlist = [] + keys = [] + key_list = [] + + # pagination options + pag = item.page if item.page else 1 + pagination = 40 + + # load json + if item.args == 'az': + json = item.url + for key in json: + if item.search.lower() in key['name'].lower(): + keys.append(key) + else: + json = current_session.get(item.url).json() + + # load json for main menu item + if not item.args: + json_url = getUrl(json['contents'][-1]['contents'][-1]['path_id']) + json = current_session.get(json_url).json()['contents'] + else: + json = json['contents'] + for key in json: + if len(json[key]) > 0: + for key in json[key]: + keys.append(key) + + # load titles + for i, key in enumerate(keys): + if pagination and (pag - 1) * pagination > i: continue # pagination + if pagination and i >= pag * pagination: break + key_list.append(key) + + with futures.ThreadPoolExecutor() as executor: + itlist = [executor.submit(addinfo, key, item) for key in key_list] + for res in futures.as_completed(itlist): + if res.result(): + itemlist.append(res.result()) + itemlist = sorted(itemlist, key=lambda it: it.title) + + if len(keys) > pag * pagination and not item.search: + itemlist.append(support.Item(channel=item.channel, action = item.action, contentType=item.contentType, + title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), + fulltitle= item.fulltitle, show= item.show, url=item.url, args=item.args, page=pag + 1, + thumbnail=support.thumb())) + return itemlist + + +def select(item): + support.log() + itemlist = [] + json = current_session.get(item.url).json()['blocks'] + for key in json: + itemlist.append(support.Item(channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = item.fulltitle, + show = item.show, thumbnail = item.thumbnail, url = key['sets'], action = 'episodios', args = item.args)) + if len(itemlist) == 1: + return episodios(itemlist[0]) + else: + return itemlist + + +def episodios(item): + support.log() + itemlist = [] + with futures.ThreadPoolExecutor() as executor: + itlist = [executor.submit(load_episodes, key, item) for key in item.url] + for res in futures.as_completed(itlist): + if res.result(): + itemlist += res.result() + if itemlist[0].VL: + itemlist.reverse() + else: + itemlist = sorted(itemlist, key=lambda it: it.title) + if itemlist[0].VL: support.videolibrary(itemlist, item) + return itemlist + + +def findvideos(item): + support.log() + itemlist = [] + if item.url.endswith('json'): + json = current_session.get(item.url).json() + + if json.has_key('first_item_path'): + url = current_session.get(getUrl(json['first_item_path'])).json()['video']['content_url'] + else: + url = json['video']['content_url'] + else: + url = item.url + + itemlist.append(support.Item(channel = item.channel, server = 'directo', title = 'Diretto', fulltitle = item.fulltitle, + show = item.show, thumbnail = item.thumbnail, fanart = item.json, url = getUrl(url), action = 'play' )) + return support.server(item, itemlist=itemlist, down_load=False) + + +def getUrl(pathId): + support.log() + url = pathId.replace(" ", "%20") + if url.startswith("/raiplay/"): + url = url.replace("/raiplay/",host +'/') + + if url.startswith("//"): + url = "https:" + url + elif url.startswith("/"): + url = host + url + + # fix format of url for json + if url.endswith(".html?json"): + url = url.replace(".html?json", ".json") + elif url.endswith("/?json"): + url = url.replace("/?json","/index.json") + elif url.endswith("?json"): + url = url.replace("?json",".json") + + return url + + +def addinfo(key, item): + support.log() + info = current_session.get(getUrl(key['info_url'])).json() + it = support.Item( channel = item.channel, title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'], + thumbnail = getUrl(key['images']['portrait_logo']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['path_id']), plot = info['description']) + if key['layout'] == 'single': + it.action = 'findvideos' + it.contentType = 'movie' + it.contentTitle = it.fulltitle + else: + it.action = 'select' + it.contentType = 'tvshow' + it.contentSerieName = it.fulltitle + return it + + +def load_episodes(key, item): + support.log() + itemlist=[] + json = current_session.get(getUrl(key['path_id'])).json()['items'] + for key in json: + ep = support.match(key['subtitle'].encode('utf8'), patron=r'St\s*(\d+)\s*Ep\s*(\d+)').match + if ep: + title = ep[0] + 'x' + ep[1].zfill(2) + support.re.sub(r'St\s*\d+\s*Ep\s*\d+','',key['subtitle'].encode('utf8')) + else: + title = key['subtitle'] + itemlist.append(support.Item(channel = item.channel, title = support.typo(title, 'bold'), fulltitle = item.fulltitle, show = item.show, thumbnail = item.thumbnail, + fanart = getUrl(key['images']['landscape']), url = key['video_url'], plot = key['description'], contentType = 'episode', + action = 'findvideos', VL=True if ep else False)) + return itemlist + + diff --git a/channelselector.py b/channelselector.py index a0804291..ebafe694 100644 --- a/channelselector.py +++ b/channelselector.py @@ -80,7 +80,7 @@ def getchanneltypes(view="thumb_"): logger.info() # Lista de categorias - channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "direct"] # , "torrent" + channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "direct", "live"] # , "torrent" if config.get_setting("adult_mode") != 0: channel_types.append("adult") @@ -357,7 +357,7 @@ def thumb(itemlist=[], genre=False, thumb=''): import re icon_dict = {'channels_movie':['film'], - 'channels_tvshow':['serie','tv','episodi','episodio'], + 'channels_tvshow':['serie','tv','episodi','episodio','fiction'], 'channels_documentary':['documentari','documentario', 'documentary'], 'channels_all':['tutti'], 'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'], @@ -385,12 +385,15 @@ def thumb(itemlist=[], genre=False, thumb=''): 'popular' : ['popolari','popolare', 'più visti'], 'thriller':['thriller'], 'top_rated' : ['fortunato', 'votati'], - 'on_the_air' : ['corso', 'onda'], + 'on_the_air' : ['corso', 'onda', 'diretta', 'dirette'], 'channels_western':['western'], 'channels_vos':['sub','sub-ita'], 'channels_romance':['romantico','sentimentale', 'romance'], 'channels_family':['famiglia','famiglie', 'family'], - 'channels_historical':['storico', 'history'], + 'channels_historical':['storico', 'history', 'storia'], + 'channels_az':['lettera','lista','alfabetico','a-z'], + 'channels_year':['anno', 'anni'], + 'update':['replay', 'update'], 'autoplay':[config.get_localized_string(60071)] } @@ -403,7 +406,7 @@ def thumb(itemlist=[], genre=False, thumb=''): search = ['cerca'] search_suffix ={'_movie':['film'], - '_tvshow':['serie','tv']} + '_tvshow':['serie','tv', 'fiction']} for item in itemlist: diff --git a/core/httptools.py b/core/httptools.py index 5e858835..538cf988 100755 --- a/core/httptools.py +++ b/core/httptools.py @@ -253,7 +253,8 @@ def downloadpage(url, **opt): load_cookies() domain = urlparse.urlparse(url).netloc CF = False - if domain in ['www.guardaserie.media', 'casacinema.space', 'wstream.video', 'akvideo.stream', 'backin.net', 'dreamsub.stream', 'altadefinizione-nuovo.link']: + if domain in ['www.guardaserie.media', 'casacinema.space', 'wstream.video', 'akvideo.stream', 'backin.net', + 'dreamsub.stream', 'altadefinizione-nuovo.link', 'ilgeniodellostreaming.si', 'www.piratestreaming.gratis']: from lib import cloudscraper session = cloudscraper.create_scraper() CF = True diff --git a/core/servertools.py b/core/servertools.py index 9a1ea592..c5aa9c66 100644 --- a/core/servertools.py +++ b/core/servertools.py @@ -14,7 +14,8 @@ from core import jsontools from core.item import Item from platformcode import config, logger from platformcode import platformtools -from servers.decrypters import zcrypt +# from servers.decrypters import zcrypt +from lib import unshortenit dict_servers_parameters = {} @@ -40,7 +41,7 @@ def find_video_items(item=None, data=None): if data is None: data = httptools.downloadpage(item.url).data - data = zcrypt.get_video_url(data) + data = unshortenit.findlinks(data) # Crea un item si no hay item if item is None: diff --git a/core/support.py b/core/support.py index 82b8fc95..bd7f6802 100755 --- a/core/support.py +++ b/core/support.py @@ -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' and not scraped["thumb"] else scraped["thumb"] , + thumbnail=item.thumbnail if function == 'episodios' and not scraped["thumb"] else scraped["thumb"] if scraped["thumb"] else '', 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 '', @@ -420,9 +420,6 @@ def scrape(func): if 'itemlistHook' in args: itemlist = args['itemlistHook'](itemlist) - if 'fullItemlistHook' in args: - itemlist = args['fullItemlistHook'](itemlist) - if (pagination and len(matches) <= pag * pagination) or not pagination: # next page with pagination if patronNext and inspect.stack()[1][3] != 'newest': nextPage(itemlist, item, data, patronNext, function) @@ -461,7 +458,8 @@ def scrape(func): if 'patronMenu' in args and itemlist: itemlist = thumb(itemlist, genre=True) - + if 'fullItemlistHook' in args: + itemlist = args['fullItemlistHook'](itemlist) # itemlist = filterLang(item, itemlist) # causa problemi a newest @@ -1017,9 +1015,11 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru videoitem.server = findS[2] videoitem.title = findS[0] videoitem.url = findS[1] - item.title = item.contentTitle.strip() if item.contentType == 'movie' or ( - config.get_localized_string(30161) in item.title) else item.title - videoitem.title = item.title + (typo(videoitem.title, '_ color kod []') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "") + + item.title = typo(item.contentTitle.strip(),'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title + + videoitem.plot= typo(videoitem.title, 'bold') + videoitem.title = item.title + (typo(videoitem.title, '_ color kod [] bold') if videoitem.title else "") + (typo(videoitem.quality, '_ color kod []') if videoitem.quality else "") videoitem.fulltitle = item.fulltitle videoitem.show = item.show videoitem.thumbnail = item.thumbnail diff --git a/core/tmdb.py b/core/tmdb.py index a369f6d0..06c919ed 100644 --- a/core/tmdb.py +++ b/core/tmdb.py @@ -183,7 +183,7 @@ def cache_response(fn): # logger.debug("TARDADO %s" % elapsed_time) # error al obtener los datos - except Exception, ex: + except Exception as ex: message = "An exception of type %s occured. Arguments:\n%s" % (type(ex).__name__, repr(ex.args)) logger.error("error in: %s" % message) @@ -217,7 +217,7 @@ def set_infoLabels(source, seekTmdb=True, idioma_busqueda=def_lang, forced=False logger.debug("The data of %i links were obtained in %f seconds" % (len(source), time.time() - start_time)) else: ret = set_infoLabels_item(source, seekTmdb, idioma_busqueda) - logger.debug("The data of %i links were obtained in %f seconds" % (time.time() - start_time)) + logger.debug("The data were obtained in %f seconds" % (time.time() - start_time)) return ret @@ -878,7 +878,7 @@ class Tmdb(object): # logger.debug("result_data es %s" % dict_data) # error al obtener los datos - except Exception, ex: + except Exception as ex: message = "An exception of type %s occured. Arguments:\n%s" % (type(ex).__name__, repr(ex.args)) logger.error("error in: %s" % message) dict_data = {} diff --git a/core/videolibrarytools.py b/core/videolibrarytools.py index da695886..5357bd28 100644 --- a/core/videolibrarytools.py +++ b/core/videolibrarytools.py @@ -225,6 +225,8 @@ def save_movie(item): def filter_list(episodelist, action=None, path=None): if path: path = path.decode('utf8') + # import xbmc + # if xbmc.getCondVisibility('system.platform.windows') > 0: path = path.replace('smb:','').replace('/','\\') channel_prefs = {} lang_sel = quality_sel = show_title = channel ='' if action: @@ -234,10 +236,10 @@ def filter_list(episodelist, action=None, path=None): show_title = tvshow_item.infoLabels['tvshowtitle'] if not tvshow_item.channel_prefs: tvshow_item.channel_prefs={channel:{}} - list_item = os.listdir(path) + list_item = filetools.listdir(path) for File in list_item: if (File.endswith('.strm') or File.endswith('.json') or File.endswith('.nfo')): - os.remove(os.path.join(path, File)) + filetools.remove(filetools.join(path, File)) if channel not in tvshow_item.channel_prefs: tvshow_item.channel_prefs[channel] = {} channel_prefs = tvshow_item.channel_prefs[channel] diff --git a/lib/unshortenit.py b/lib/unshortenit.py index f6509c2b..ebacd3a4 100644 --- a/lib/unshortenit.py +++ b/lib/unshortenit.py @@ -26,7 +26,7 @@ def find_in_text(regex, text, flags=re.IGNORECASE | re.DOTALL): class UnshortenIt(object): - _adfly_regex = r'adf\.ly|j\.gs|q\.gs|u\.bb|ay\.gy|atominik\.com|tinyium\.com|microify\.com|threadsphere\.bid|clearload\.bid|activetect\.net|swiftviz\.net|briskgram\.net|activetect\.net|baymaleti\.net|thouth\.net|uclaut\.net|gloyah\.net|larati\.net' + _adfly_regex = r'adf\.ly|j\.gs|q\.gs|u\.bb|ay\.gy|atominik\.com|tinyium\.com|microify\.com|threadsphere\.bid|clearload\.bid|activetect\.net|swiftviz\.net|briskgram\.net|activetect\.net|baymaleti\.net|thouth\.net|uclaut\.net|gloyah\.net|larati\.net|scuseami\.net' _linkbucks_regex = r'linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co' _adfocus_regex = r'adfoc\.us' _lnxlu_regex = r'lnx\.lu' @@ -36,9 +36,12 @@ class UnshortenIt(object): _shrink_service_regex = r'shrink-service\.it' _rapidcrypt_regex = r'rapidcrypt\.net' _cryptmango_regex = r'cryptmango|xshield\.net' - _vcrypt_regex = r'vcrypt\.net' + _vcrypt_regex = r'vcrypt\.net|vcrypt\.pw' _linkup_regex = r'linkup\.pro|buckler.link' + listRegex = [_adfly_regex, _linkbucks_regex, _adfocus_regex, _lnxlu_regex, _shst_regex, _hrefli_regex, _anonymz_regex, + _shrink_service_regex, _rapidcrypt_regex, _cryptmango_regex, _vcrypt_regex, _linkup_regex] + _maxretries = 5 _this_dir, _this_filename = os.path.split(__file__) @@ -473,14 +476,16 @@ class UnshortenIt(object): def _unshorten_vcrypt(self, uri): try: + if 'myfoldersakstream.php' in uri or '/verys/' in uri: + return uri, 0 r = None - import base64, pyaes + import pyaes def decrypt(str): str = str.replace("_ppl_", "+").replace("_eqq_", "=").replace("_sll_", "/") iv = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0" key = "naphajU2usWUswec" - decoded = base64.b64decode(str) + decoded = b64decode(str) decoded = decoded + '\0' * (len(decoded) % 16) crypt_object = pyaes.AESModeOfOperationCBC(key, iv) decrypted = '' @@ -521,8 +526,31 @@ class UnshortenIt(object): def _unshorten_linkup(self, uri): try: - r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False) - return r.url, r.code + r = None + if '/tv/' in uri: + uri = uri.replace('/tv/', '/tva/') + elif 'delta' in uri: + uri = uri.replace('/delta/', '/adelta/') + elif '/ga/' in uri: + uri = b64decode(uri.split('/')[-1]).strip() + elif '/speedx/' in uri: + uri = uri.replace('http://linkup.pro/speedx', 'http://speedvideo.net') + else: + r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False) + uri = r.url + link = re.findall("<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>", r.data) + # fix by greko inizio + if not link: + link = re.findall('action="(?:[^/]+.*?/[^/]+/([a-zA-Z0-9_]+))">', r.data) + if link: + uri = link + short = re.findall('^https?://.*?(https?://.*)', uri) + if short: + uri = short[0] + if not r: + r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False) + uri = r.url + return uri, r.code except Exception as e: return uri, str(e) @@ -546,3 +574,27 @@ def unshorten(uri, type=None, timeout=10): if status == 200: uri, status = unshortener.unwrap_30x(uri, timeout=timeout) return uri, status + + +def findlinks(text): + unshortener = UnshortenIt() + matches = [] + + for regex in unshortener.listRegex: + regex = '(?:https?://(?:[\w\d]+\.)?)?(?:' + regex + ')/[a-zA-Z0-9_=/]+' + for match in re.findall(regex, text): + matches.append(match) + if len(matches) == 1: + text += '\n' + unshorten(matches[0])[0] + elif matches: + # non threaded for webpdb + # for match in matches: + # sh = unshorten(match)[0] + # text += '\n' + sh + from concurrent import futures + with futures.ThreadPoolExecutor() as executor: + unshList = [executor.submit(unshorten, match) for match in matches] + for link in futures.as_completed(unshList): + if link.result()[0] not in matches: + text += '\n' + link.result()[0] + return text \ No newline at end of file diff --git a/resources/settings.xml b/resources/settings.xml index a683d76d..19711b58 100644 --- a/resources/settings.xml +++ b/resources/settings.xml @@ -50,7 +50,7 @@ <!-- <setting id="downloadpath" type="folder" label="30017" default=""/> <setting id="downloadlistpath" type="folder" label="30018" default=""/> --> <setting label="30501" type="lsep"/> - <setting id="videolibrarypath" type="folder" label="30067" default=""/> + <setting id="videolibrarypath" type="folder" label="30067" default="special://profile/addon_data/plugin.video.kod/videolibrary"/> <setting id="folder_tvshows" type="text" label="70118" default="SERIES"/> <setting id="folder_movies" type="text" label="70119" default="CINE"/> <setting label="59997" type="lsep"/> @@ -60,15 +60,15 @@ <setting id="videolibrary_max_quality" type="bool" label="70729" default="false" visible="true"/> <setting id="next_ep" type="enum" label="70746" lvalues="70752|70747|70748" default="0"/> <setting id="next_ep_type" type="bool" label="70754" default="false" visible="eq(-1,2)"/> - <setting id="next_ep_seconds" type="enum" values="20|30|40|50|60" label="70749" default="2" visible="!eq(-2,0)"/> + <setting id="next_ep_seconds" type="enum" values="20|30|40|50|60|70|80|90|100|110|120" label="70749" default="2" visible="!eq(-2,0)"/> </category> <!-- Downloads --> <category label="30153"> <setting id="downloadenabled" type="bool" label="70689" default="false"/> - <setting id="downloadpath" type="folder" label="30017" visible="eq(-1,true)" default=""/> - <setting id="downloadlistpath" type="folder" label="30018" visible="eq(-2,true)" default=""/> + <setting id="downloadpath" type="folder" label="30017" visible="eq(-1,true)" default="special://profile/addon_data/plugin.video.kod/downloads"/> + <setting id="downloadlistpath" type="folder" label="30018" visible="eq(-2,true)" default="special://profile/addon_data/plugin.video.kod/downloads/list"/> </category> <!-- Visual --> diff --git a/resources/skins/Default/720p/NextDialog.xml b/resources/skins/Default/720p/NextDialog.xml index 2455d71d..5de2f868 100644 --- a/resources/skins/Default/720p/NextDialog.xml +++ b/resources/skins/Default/720p/NextDialog.xml @@ -42,7 +42,7 @@ <itemgap>0</itemgap> <align>right</align> <control type="button" id="11"> - <label>$ADDON[plugin.video.kod 70750] $INFO[Player.TimeRemaining(ss),,] $ADDON[plugin.video.kod 70751]</label> + <label>$ADDON[plugin.video.kod 70750] $INFO[Player.TimeRemaining(mm:ss)]</label> <onclick>SendClick(3012)</onclick> <height>40</height> <width min="50">auto</width> diff --git a/resources/skins/Default/720p/NextDialogCompact.xml b/resources/skins/Default/720p/NextDialogCompact.xml index 2164ace3..bad59a9f 100644 --- a/resources/skins/Default/720p/NextDialogCompact.xml +++ b/resources/skins/Default/720p/NextDialogCompact.xml @@ -42,11 +42,11 @@ <itemgap>0</itemgap> <align>right</align> <control type="button" id="11"> - <label>[B]$INFO[Player.TimeRemaining(ss),,][/B]</label> + <label>[B]$INFO[Player.TimeRemaining(mm:ss)][/B]</label> <onclick>SendClick(3012)</onclick> <!-- <visible>!Integer.IsGreater(Player.TimeRemaining,59)</visible> --> <height>40</height> - <width>65</width> + <width>100</width> <font>font30_title</font> <textoffsetx>12</textoffsetx> <textcolor>80FFFFFF</textcolor> diff --git a/resources/skins/Default/media/NextDialog/play-fo.png b/resources/skins/Default/media/NextDialog/play-fo.png index 969dfd90063d5d81e92ccc9e118449eb0636d576..1f82754c78558a4bd1fbd5ab06356ad990f68ea2 100644 GIT binary patch delta 849 zcmbQwcZXlKGr-TCmrII^fq{Y7)59eQNT&d?1_uj}TvRyy1Oo%B%|zATll>VpCMz)N zPu|Wrdomxh^yDi{V$6mH29w_~DNWX7cAgx>qy^^JF@*(J<Q7=@rj{h8B$gz)B$lMw zDj69V8R!}q=^7Y^7+PAH7+M)wY8x0@85k&WDJUp_)#s;Vrd8rpJ$XN~Eh|u+ukU0= z7D*^eo<#@B3SiNg{Fb?Z7sZCjSuA-Rp$80tfnK>g`2mY)eQAI{H)Ej8oYd1t9g8MC zVGf9v-r4nrwcRyxXU_Rwlka}5+CAz0)7cvH4_v%?)8?e(pR9X6>+he*mP^oa5>#Er z>QcB$X8Yr_dn$Fyo!KHq0$uNkcgpnr7XCB$xM<rmZ|C&C_kUYHGxA{h>9eIJMDwQ~ zPv6QVX1A^^y?f+s5dVsL?!XFx{PlIF@<%Qk?(_+H;GlSblar;U<%;Q-3oY-y-%j6K zqx@#4W`)--(QOgQ%_61u<Yp`@4qN}GVWs+C_xpF3uK(k|x+mA3vE{f?SJsBJXMjHA zEbxddW?<kJ24O~qS#u;97#L$cT^vIqT9dDMBuj`jWG;|(&^359vHl>No2}7}11sFw zq$R#`)HVpLmJu)1V&Cb$#3DR=mxsXOq6yV4jg9_mwj25PZ`kGdUXYE=tnbX4mGgXh zeuVNe_8S0!6>E-%VCwPZDH#<&wT@R)YFF+w$or}I7^pb$rer8*){d0+3GNaS78PFH z*0LL(Pg8sflu}dMUw=aMqK!^O%8U0BUXAPCK2y@QE4irn0w~G(^k}H!rxi)gmy~&c z;Qxgm5ka>fu<O4|JHO)_XJ`&b)ss&Tmx#vyThPsC*#GDE_Da{Q3+w+IrnXISudA79 zko++BO_B2n<$QT@fBT<e)89<^c;c<`$?mxSM|AB?Y(CY$Kek8qMqCja6AxqmpI?UQ z=boHy3E{2kuc?Z(%{|Y3=#>Qf_l!LP+WfB<=O0-i^ThDeyYIX2A6Y50DOa}y7<9-X dXC}wUu*%WRaHpc2GB5%dJYD@<);T3K0RUkSP`m&D delta 750 zcmcb^Kc7#vGr-TCmrII^fq{Y7)59eQNIL?t1_uj}<YtYJVPIfcKT-Af<PJvt$qI}a zleaU@p8T3gi^<G%vIKLOL~2E5npHq%MQTojOJ;6rUU6oAo~;s4vW-b;auAdB<P}WL zljkvu2^s1dnuQozSQ#2y8JKDt7+M)j&R~|~MG>BSklA)}Crjewcoyl&tgH$3Pdz@d z0o`#g)7d$|y(qP^I5{yVRl&v7fPq0`YH~tC&q>d7x@m?92`A2KYZmbr_4IV~1SQlT zI&ebaz=4AYPAg2C5fk%3`i<D32H~3BY$3cX(@P!G9)`7xZdkHJOr80qu0zhWn1B$b zCHEON`d4}~PB@#vn9`ln&SJ@Y)6SuOn?s&orcsFgiLiNB_FPC%&}BVh#Pg2Fm1iZ- zRGy<eCwV$~EFHEnHFGy>GM}iw@l~?n>rcZc%%N(`Cz%$!Q)=^RD{13t6JnEHkfC|O zWP)X8!sg({WnoQ+IPSh@?R4!dh&Pm!W@e~cX4EQi`O7(=S2+tjB8!0`FAT!<j105p zNH8!k>Ug?1hD5X`U-3wmNH}0}fls3J&<bI<xdugZ6pm;eH$C7t;ZaQNOC`evehCQ= zgkP^cb6Gk--N0Z&VM?0s*OVj~2O!75z=}1;Loij|1H@S|YmL6CxEx3o$LVt`yaK=) z3O-B`E3-=Q7cJ4AHDgBoAEj`Y&l`9a2ulD#Nv^qg=11NYK#s~3@$l9Y{2-=;#J`0f zHy+{DJ=nebrt!L3DF^i!yE$7Pot7^N+-3Rj{{FMttN8x@?$>lySO4?FDDl{#+c%!R zc+|4JzkB)onr`oDe11D>)haK(p1<R1=G&J4)#lIM9+<}T;z>)qz4x;-Gizo}(2}xx zc=`0J%<4FSu;U)9=WP|x=6}67|Hz6Zks5n`|9xj(sMTI<pLB(Dv7baKQzZk#-V1Jq U0-T%n0mGBQ)78&qol`;+0B`0T>;M1& diff --git a/resources/skins/Default/media/NextDialog/play-nf.png b/resources/skins/Default/media/NextDialog/play-nf.png index 1c12b92ea86df8f48b164abbbe3b20b0d834a3de..64531f6bac97f3e2d970b02dd554242db7864fc8 100644 GIT binary patch delta 844 zcmbQncb#9gGr-TCmrII^fq{Y7)59eQNT&d?1_uj}TvRyy1Oo%B%|zATll>VpCMz)N zPu|Wrdomxh^yDi{V$6mH29w_~DNWX7cAgx>qy^^JF@*(J<Q7=@rj{h8B$gz)B$lMw zDj69V8R!}q=^7Y^7+PAH7+M*dXd4(>85k&WDJUp_)#s;Vrd8rpJ$XN~Eh|u+ukU0= z7D*^eo<#@B3SiNg{Fb?Z7sZCjSuA-RwHwS11HE#0@&gvp`qBV@ZpJ{FIjN_QIu=cO z!W<ASy|e2LYrAXY&YbhVCg1&9wR_V0r?WNYAGmn)rp-ymKUw#D*55yqEtjC<B&fQK z)unKi%=X7;_f+bZJF`WK1iIc6@098LE&ONhanZJC-p=WN@Bg-ZX5_*0(`QRdh~`f} zp1ze!%x+y-diTiNApRBg+<_GW`RnUU<&Ru8-02hYz(Mf<Cnrly%N5fv7h2wZzn#9f zM)}Q7%?htwqT3>pn?*|R$<0_+9Jc;V!%FqP?)UF5UH`{_bx*E6W6N=)uB;7b&j5YK zS>O>_%)r1c48n{Iv*t)JFfc}Vx;TbJv?gEiNR|+5$Xp=nplk4IV*NojH(R3{2UfVV zNlSd?sAXWE%%EMU#lF-1M`U(RNM%Q$<q6wE2M(N`oBvqDFXHZk?;Om`+TJahbF>sg zoewDU0Kv6asctc6euVG{_8S;zcwdb=UG!+0ypddDg1{r~t)}9~RIOWVfM%SVmLRyQ zAvVvWvZb-H^P;PId_Qk}_v-c;?h-(-<w=%~>&=U<?F)e1BdprFUs(f=wk-k6{rl_w zbTdznu?DmLeSf>pztmUV5cqOptNZ2ke}1*=Ssk(Y^#1=n?QFTE$&x{GKYwPwyg504 z<7r;S{yo1<-hO%fen(1skNZ2j*+n03$KUznd_>tjPiJ3q{851qktg2UXP=X;aP_#l z;QNW?>o@z||K}7T`}l!e@AHI53I9IKmYCXX<5u_QcVpn!M0V$GYg_q{0_;Qr^WkI4 Z40HV)5+6A^!~nyd!PC{xWt~$(69DSNS33Xz delta 741 zcmcc4KaEedGr-TCmrII^fq{Y7)59eQNIL?t1_uj}<YtYJVPIfcKT-Af<PJvt$qI}a zleaU@p8T3gi^<G%vIKLOL~2E5npHq%MQTojOJ;6rUU6oAo~;s4vW-b;auAdB<P}WL zljkvu2^s1dnuQozSQ#2y85wFD7+M)j&R~|~MG>BSklA)}Crjewcoyl&tgH$3pXYRK z1G?j0rn7T^dr@j-adKi#s)CED0Rw}?)Z~POo|B&EbkhtI5>A}e)-2*L>gnm|2}-Cx zbl`--fddB*oK~1NBPQm7^c%554Z=0M*+O_(rk6UVJq&9X-LPbdm^$-IU5A`$F##b= zOYSpl^sn?}oNzXSF{L}DoyC&*rkz9mHitaFOrsF}6JhhN?75Jjpv!v1i02)TE6+-v zsXRw{PV#i}SUPNDYUXa%WIj=U<Ev!D*Pn(@m_yZ=Pckidr_|=tR?^1PCd4MYAVc$l z$pp*Hgw4T?%fgxtaol~++UeR^5N{|c&CF1@%&1l3@|SZ!uW}Z6L>2=>UKoVy85w5H zkzin8RQ7an42ft>zT%NAk#NA|0-r?bp%ubza}A2-95|?Q!0LeCgY>l<1D{F;s2do3 zD0+U|qKkipu!KZJq>|6$5cVsaJV0>mRjOOe8Rl0kY;373qp~B<F_tnhHw(nCT)Xo_ zgH>Z=<6PZ?N+F33a}OLiaOB0J$?K2Tw;i?HHLWkI$aLDGH(-s02fd<e8$lYGnGf&( zzoJI$SJeMcf1enyujgAJyv}x3-P7y#C4svvAKw4JH~gB-5jAIZ^*?{MetC0p`;DhB z9<`LuUpBYykL+|E**OK@Z%*mH|L@VX<vWG@?nKnE@8_Cj_3-<A)8~A9l$Lb0`TcPE zQhM#>?RbvW$xA}d&uZ>${&_e*DddulNZp^`je#7A?1y*C8@_4@RPV8Bv;iiQr4ES> Tffw%pgOS10)z4*}Q$iB}M3W}E diff --git a/servers/decrypters/zcrypt.py b/servers/decrypters/zcrypt.py deleted file mode 100644 index d5181352..00000000 --- a/servers/decrypters/zcrypt.py +++ /dev/null @@ -1,113 +0,0 @@ -# -*- coding: utf-8 -*- -# Ringraziamo errmax e dr-z3r0 -import re - -from core import httptools, scrapertools -from platformcode import logger -from servers.decrypters import expurl - - -def get_video_url(page_url, premium=False, user="", password="", video_password=""): - - encontrados = { - 'https://vcrypt.net/images/logo', 'https://vcrypt.net/css/out', - 'https://vcrypt.net/images/favicon', 'https://vcrypt.net/css/open', - 'http://linkup.pro/js/jquery', 'https://linkup.pro/js/jquery'#, - #'http://www.rapidcrypt.net/open' - } - devuelve = [] - - patronvideos = [ - r'(https?://(gestyy|rapidteria|sprysphere)\.com/[a-zA-Z0-9]+)', - r'(https?://(?:www\.)?(vcrypt|linkup)\.[^/]+/[^/]+/[a-zA-Z0-9_]+)', - r'(https?://(?:www\.)?(bit|buckler)\.[^/]+/[a-zA-Z0-9]+)', - r'(https?://(?:www\.)?(xshield)\.[^/]+/[^/]+/[^/]+/[a-zA-Z0-9_\.]+)' - ] - - for patron in patronvideos: - # from core.support import dbg; dbg() - logger.info(" find_videos #" + patron + "#") - matches = re.compile(patron).findall(page_url) - - for url, host in matches: - if url not in encontrados: - logger.info(" url=" + url) - encontrados.add(url) - - if host == 'gestyy': - resp = httptools.downloadpage( - url, - follow_redirects=False, - cookies=False, - only_headers=True, - replace_headers=True, - headers={'User-Agent': 'curl/7.59.0'}) - data = resp.headers.get("location", "") - elif 'xshield' in url: - from lib import unshortenit - data, status = unshortenit.unshorten(url) - logger.info("Data - Status zcrypt xshield.net: [%s] [%s] " %(data, status)) - elif 'vcrypt.net' in url: - if 'myfoldersakstream.php' in url or '/verys/' in url: - continue - else: - from lib import unshortenit - sh = unshortenit.UnshortenIt() - data, status = sh.unshorten(url) - logger.info("Data - Status zcrypt vcrypt.net: [%s] [%s] " %(data, status)) - elif 'linkup' in url or 'bit.ly' in url or 'buckler' in url: - logger.info("DATA LINK {}".format(url)) - if '/tv/' in url: - url = url.replace('/tv/','/tva/') - elif 'delta' in url: - url = url.replace('/delta/','/adelta/') - if '/olink/' in url: continue - else: - idata = httptools.downloadpage(url).data - data = scrapertools.find_single_match(idata, "<iframe[^<>]*src=\\'([^'>]*)\\'[^<>]*>") - #fix by greko inizio - if not data: - data = scrapertools.find_single_match(idata, 'action="(?:[^/]+.*?/[^/]+/([a-zA-Z0-9_]+))">') - from lib import unshortenit - data, status = unshortenit.unshorten(url) - # logger.info("Data - Status zcrypt linkup : [%s] [%s] " %(data, status)) - data = httptools.downloadpage(data, follow_redirect=True).url - if '/speedx/' in data: # aggiunto per server speedvideo - data = data.replace('http://linkup.pro/speedx', 'http://speedvideo.net') - # fix by greko fine - else: - data = "" - while host in url: - resp = httptools.downloadpage( - url, follow_redirects=False) - url = resp.headers.get("location", "") - if not url: - data = resp.data - elif host not in url: - data = url - if data: - devuelve.append(data) - else: - logger.info(" url duplicada=" + url) - - patron = r"""(https?://(?:www\.)?(?:threadsphere\.bid|adf\.ly|q\.gs|j\.gs|u\.bb|ay\.gy|linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co|adfoc\.us|lnx\.lu|sh\.st|href\.li|anonymz\.com|shrink-service\.it|rapidcrypt\.net|ecleneue\.com)/[^"']+)""" - - logger.info(" find_videos #" + patron + "#") - matches = re.compile(patron).findall(page_url) - - for url in matches: - if url not in encontrados: - if 'https://rapidcrypt.net/open/' in url or 'https://rapidcrypt.net/verys/' in url: - continue - logger.info(" url=" + url) - encontrados.add(url) - - long_url = expurl.expand_url(url) - if long_url: - devuelve.append(long_url) - else: - logger.info(" url duplicada=" + url) - - ret = page_url+" "+str(devuelve) if devuelve else page_url - logger.info(" RET=" + str(ret)) - return ret diff --git a/servers/mixdrop.json b/servers/mixdrop.json index 6977131e..7ddb6d83 100644 --- a/servers/mixdrop.json +++ b/servers/mixdrop.json @@ -38,5 +38,5 @@ "visible": false } ], - "thumbnail": "https://mixdrop.co/imgs/mixdrop-logo2.png" + "thumbnail": "mixdrop.png" } diff --git a/servers/upstream.json b/servers/upstream.json new file mode 100644 index 00000000..d77be9eb --- /dev/null +++ b/servers/upstream.json @@ -0,0 +1,42 @@ +{ + "active": true, + "find_videos": { + "ignore_urls": [], + "patterns": [ + { + "pattern": "upstream.to/([a-z0-9]+)", + "url": "https://upstream.to/\\1" + } + ] + }, + "free": true, + "id": "upstream", + "name": "UP Stream", + "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": "upstream.png" +} diff --git a/servers/upstream.py b/servers/upstream.py new file mode 100644 index 00000000..fb6a63a6 --- /dev/null +++ b/servers/upstream.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# -------------------------------------------------------- +# Conector UP Stream By Alfa development Group +# -------------------------------------------------------- + +from core import httptools +from core import scrapertools +from lib import jsunpack +from platformcode import logger, config + + +def test_video_exists(page_url): + logger.info("(page_url='%s')" % page_url) + global data + data = httptools.downloadpage(page_url).data + if "<h2>WE ARE SORRY</h2>" in data or '<title>404 Not Found' in data: + return False, config.get_localized_string(70449) % "UP Stream" + return True, "" + + +def get_video_url(page_url, premium=False, user="", password="", video_password=""): + video_urls = [] + media_url = scrapertools.find_single_match(data, r'file:"([^"]+)"') + video_urls.append(["%s [UP Stream]" % media_url.split('.'[-1]), media_url]) + + return video_urls diff --git a/servers/wstream.py b/servers/wstream.py index f903e8b7..53bbaba1 100644 --- a/servers/wstream.py +++ b/servers/wstream.py @@ -21,10 +21,15 @@ def test_video_exists(page_url): page_url = 'https://wstream.video/video.php?file_code=' + code data = httptools.downloadpage(page_url, headers=headers, follow_redirects=True).data - ID, code = scrapertools.find_single_match(data, r"""input\D*id=(?:'|")([^'"]+)(?:'|").*?value='([a-z0-9]+)""") - post = urllib.urlencode({ID: code}) - - data = httptools.downloadpage(page_url, headers=headers, post=post, follow_redirects=True).data + a = scrapertools.find_single_match(data, r"""input\D*id=(?:'|")([^'"]+)(?:'|").*?value='([a-z0-9]+)""") + if a: + ID, code = a + post = urllib.urlencode({ID: code}) + data = httptools.downloadpage(page_url, headers=headers, post=post, follow_redirects=True).data + else: + page_url = scrapertools.find_single_match(data, r"""