Scrape come Classe

This commit is contained in:
Alhaziel01
2021-09-08 18:57:42 +02:00
parent 2a5a83c767
commit b84f682461
62 changed files with 1503 additions and 1397 deletions
+7 -11
View File
@@ -75,7 +75,6 @@ headers = [['Referer', host]]
@support.menu @support.menu
def mainlist(item): def mainlist(item):
support.info(item)
# Ordine delle voci # Ordine delle voci
# Voce FILM, puoi solo impostare l'url # Voce FILM, puoi solo impostare l'url
@@ -146,7 +145,6 @@ def mainlist(item):
# AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!! # AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!!
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
support.info(item)
#support.dbg() # decommentare per attivare web_pdb #support.dbg() # decommentare per attivare web_pdb
action = '' action = ''
@@ -161,7 +159,6 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
support.info(item)
#support.dbg() #support.dbg()
action = '' action = ''
@@ -178,7 +175,6 @@ def episodios(item):
# per genere, per anno, per lettera, per qualità ecc ecc # per genere, per anno, per lettera, per qualità ecc ecc
@support.scrape @support.scrape
def genres(item): def genres(item):
support.info(item)
#support.dbg() #support.dbg()
action = '' action = ''
@@ -198,7 +194,7 @@ def genres(item):
# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro # e la ricerca porta i titoli mischiati senza poterli distinguere tra loro
# andranno modificate anche le def peliculas e episodios ove occorre # andranno modificate anche le def peliculas e episodios ove occorre
def select(item): def select(item):
support.info('select --->', item) logger.debug()
#support.dbg() #support.dbg()
data = httptools.downloadpage(item.url, headers=headers).data data = httptools.downloadpage(item.url, headers=headers).data
# pulizia di data, in caso commentare le prossime 2 righe # pulizia di data, in caso commentare le prossime 2 righe
@@ -206,7 +202,7 @@ def select(item):
data = re.sub(r'>\s+<', '> <', data) data = re.sub(r'>\s+<', '> <', data)
block = scrapertools.find_single_match(data, r'') block = scrapertools.find_single_match(data, r'')
if re.findall('', data, re.IGNORECASE): if re.findall('', data, re.IGNORECASE):
support.info('select = ### è una serie ###') logger.debug('select = ### è una serie ###')
return episodios(Item(channel=item.channel, return episodios(Item(channel=item.channel,
title=item.title, title=item.title,
fulltitle=item.fulltitle, fulltitle=item.fulltitle,
@@ -219,7 +215,7 @@ def select(item):
############## Fondo Pagina ############## Fondo Pagina
# da adattare al canale # da adattare al canale
def search(item, text): def search(item, text):
support.info('search', item) logger.debug(text)
itemlist = [] itemlist = []
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text) item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
@@ -232,7 +228,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info('search log:', line) logger.error('search log:', line)
return [] return []
@@ -240,7 +236,7 @@ def search(item, text):
# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte # inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte
# altrimenti NON inserirlo # altrimenti NON inserirlo
def newest(categoria): def newest(categoria):
support.info('newest ->', categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
try: try:
@@ -255,7 +251,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('newest log: ', {0}.format(line)) logger.debug('newest log: ', {0}.format(line))
return [] return []
return itemlist return itemlist
@@ -265,5 +261,5 @@ def newest(categoria):
# sia per i siti con hdpass # sia per i siti con hdpass
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True) #support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
def findvideos(item): def findvideos(item):
support.info('findvideos ->', item) logger.debug()
return support.server(item, headers=headers) return support.server(item, headers=headers)
+2 -2
View File
@@ -32,7 +32,7 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
disabletmdb = True tmdbEnabled = False
action = 'playradio' action = 'playradio'
patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)' patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)'
return locals() return locals()
@@ -66,7 +66,7 @@ def playradio(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
item.url = host + '/search/' + text item.url = host + '/search/' + text
itemlist = [] itemlist = []
try: try:
+10 -26
View File
@@ -2,22 +2,11 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
# Canale per altadefinizione01 # Canale per altadefinizione01
# ------------------------------------------------------------ # ------------------------------------------------------------
"""
Eccezioni note che non superano il test del canale:
Avvisi:
- L'url si prende da questo file.
- è presente nelle novità-> Film.
Ulteriori info:
"""
from core import scrapertools, httptools, support from core import scrapertools, httptools, support
from core.item import Item from core.item import Item
from platformcode import config, logger from platformcode import config, logger
# def findhost(url): # def findhost(url):
# data = httptools.downloadpage(url).data # data = httptools.downloadpage(url).data
# host = scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"') # host = scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
@@ -35,7 +24,7 @@ def mainlist(item):
('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']), ('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']),
('Ultimi Aggiornati-Aggiunti', ['','peliculas', 'update']), ('Ultimi Aggiornati-Aggiunti', ['','peliculas', 'update']),
('Generi', ['', 'genres', 'genres']), ('Generi', ['', 'genres', 'genres']),
('Lettera', ['/catalog/a/', 'genres', 'orderalf']), ('Lettera', ['/catalog/a/', 'genres', 'az']),
('Anni', ['', 'genres', 'years']), ('Anni', ['', 'genres', 'years']),
('Sub-ITA', ['/sub-ita/', 'peliculas', 'pellicola']) ('Sub-ITA', ['/sub-ita/', 'peliculas', 'pellicola'])
] ]
@@ -45,35 +34,32 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
support.info('peliculas', item)
## deflang = 'ITA'
action="findvideos" action="findvideos"
patron = r'<div class="cover boxcaption"> +<h2>\s*<a href="(?P<url>[^"]+)">(?P<title>[^<]+).*?src="(?P<thumb>[^"]+).*?<div class="trdublaj">(?P<quality>[^<]+).*?<span class="ml-label">(?P<year>[0-9]+).*?<span class="ml-label">(?P<duration>[^<]+).*?<p>(?P<plot>[^<]+)' patron = r'<div class="cover boxcaption"> +<h2>\s*<a href="(?P<url>[^"]+)">(?P<title>[^<]+).*?src="(?P<thumb>[^"]+).*?<div class="trdublaj">(?P<quality>[^<]+).*?<span class="ml-label">(?P<year>[0-9]+).*?<span class="ml-label">(?P<duration>[^<]+).*?<p>(?P<plot>[^<]+)'
if item.args == "search": if item.args == "search":
patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">' patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">'
elif item.args == 'update': elif item.args == 'update':
patronBlock = r'<div class="widget-title">Ultimi Film Aggiunti/Aggiornati</div>(?P<block>.*?)<div id="alt_menu">' patronBlock = r'<div class="widget-title">Ultimi Film Aggiunti/Aggiornati</div>(?P<block>.*?)<div id="alt_menu">'
patron = r'style="background-image:url\((?P<thumb>[^\)]+).+?<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> [^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+|N/A).+?>.*?(?:>Film (?P<lang>Sub ITA)</a></p> )?<p>(?P<plot>[^<]+)<.*?href="(?P<url>[^"]+)' patron = r'style="background-image:url\((?P<thumb>[^\)]+).+?<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> [^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+|N/A).+?>.*?(?:>Film (?P<lang>Sub ITA)</a></p> )?<p>(?P<plot>[^<]+)<.*?href="(?P<url>[^"]+)'
elif item.args == 'orderalf': elif item.args == 'az':
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"' \ patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"' \
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<' \ '.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<' \
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>' '[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
else: else:
patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">' patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">'
patronNext = '<a href="([^"]+)">&raquo;' patronNext = r'<a href="([^"]+)">&raquo;'
patronTotalPages = r'>(\d+)(?:[^>]+>){3}&raquo;' patronTotalPages = r'>(\d+)(?:[^>]+>){3}&raquo;'
# debugBlock = True
return locals() return locals()
@support.scrape @support.scrape
def genres(item): def genres(item):
support.info('genres',item)
action = "peliculas" action = "peliculas"
blacklist = ['Altadefinizione01'] blacklist = ['Altadefinizione01']
@@ -83,16 +69,14 @@ def genres(item):
elif item.args == 'years': elif item.args == 'years':
patronBlock = r'<ul class="anno_list">(?P<block>.*?)</li> </ul> </div>' patronBlock = r'<ul class="anno_list">(?P<block>.*?)</li> </ul> </div>'
patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>' patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
elif item.args == 'orderalf': elif item.args == 'az':
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">' patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
patronMenu = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>' patronMenu = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
#debug = True
return locals() return locals()
@support.scrape @support.scrape
def orderalf(item): def az(item):
support.info('orderalf',item)
action = 'findvideos' action = 'findvideos'
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\ patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
@@ -103,7 +87,7 @@ def orderalf(item):
def search(item, text): def search(item, text):
support.info(item, text) logger.debug(text)
itemlist = [] itemlist = []
@@ -120,7 +104,7 @@ def search(item, text):
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
@@ -142,7 +126,7 @@ def newest(categoria):
return itemlist return itemlist
def findvideos(item): def findvideos(item):
support.info('findvideos', item) logger.debug()
data = httptools.downloadpage(item.url).data data = httptools.downloadpage(item.url).data
iframe = support.match(data, patron='player-container[^>]+>\s*<iframe[^>]+src="([^"]+)').match iframe = support.match(data, patron='player-container[^>]+>\s*<iframe[^>]+src="([^"]+)').match
if iframe: if iframe:
+3 -6
View File
@@ -15,8 +15,6 @@ headers = [['Referer', host]]
# =========== home menu =================== # =========== home menu ===================
@support.menu @support.menu
def mainlist(item): def mainlist(item):
support.info('mainlist',item)
film = [ film = [
('Al Cinema', ['/film-del-cinema', 'peliculas', '']), ('Al Cinema', ['/film-del-cinema', 'peliculas', '']),
('Generi', ['', 'genres', 'genres']), ('Generi', ['', 'genres', 'genres']),
@@ -39,7 +37,6 @@ def peliculas(item):
# =========== def pagina categorie ====================================== # =========== def pagina categorie ======================================
@support.scrape @support.scrape
def genres(item): def genres(item):
support.info('genres',item)
action = 'peliculas' action = 'peliculas'
if item.args == 'genres': if item.args == 'genres':
@@ -57,7 +54,7 @@ def genres(item):
# =========== def per cercare film/serietv ============= # =========== def per cercare film/serietv =============
#host+/index.php?do=search&story=avatar&subaction=search #host+/index.php?do=search&story=avatar&subaction=search
def search(item, text): def search(item, text):
support.info('search', item) logger.debug(text)
itemlist = [] itemlist = []
text = text.replace(" ", "+") text = text.replace(" ", "+")
item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text) item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text)
@@ -73,7 +70,7 @@ def search(item, text):
# =========== def per le novità nel menu principale ============= # =========== def per le novità nel menu principale =============
def newest(categoria): def newest(categoria):
support.info('newest', categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
try: try:
@@ -95,5 +92,5 @@ def newest(categoria):
return itemlist return itemlist
def findvideos(item): def findvideos(item):
support.info('findvideos', item) logger.debug('findvideos', item)
return support.server(item, support.match(item, patron='<ul class="playernav">.*?</ul>', headers=headers).match) return support.server(item, support.match(item, patron='<ul class="playernav">.*?</ul>', headers=headers).match)
+5 -5
View File
@@ -82,22 +82,22 @@ def genres(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info("search ", texto) logger.debug(text)
item.args = 'search' item.args = 'search'
item.url = host + "?s=" + texto item.url = host + "?s=" + text
try: try:
return peliculas(item) return peliculas(item)
# Continua la ricerca in caso di errore # Continua la ricerca in caso di errore
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
try: try:
+3 -3
View File
@@ -132,7 +132,7 @@ def peliculas(item):
json = {} json = {}
if item.contentType == 'undefined': if item.contentType == 'undefined':
# disabletmdb = True # tmdbEnabled = False
action = 'check' action = 'check'
elif item.contentType == 'movie': elif item.contentType == 'movie':
action = 'findvideos' action = 'findvideos'
@@ -159,7 +159,7 @@ def peliculas(item):
url = '='.join(spl[:-1]) url = '='.join(spl[:-1])
page = str(int(spl[-1])+1) page = str(int(spl[-1])+1)
total_pages = json.get('lastPage', 0) total_pages = json.get('lastPage', 0)
support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas', total_pages=total_pages) support.nextPage(itemlist, item, 'peliculas', next_page='='.join((url, page)), total_pages=total_pages)
return itemlist return itemlist
return locals() return locals()
@@ -176,7 +176,7 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
+19 -13
View File
@@ -3,7 +3,9 @@
# Canale per animealtadefinizione # Canale per animealtadefinizione
# ---------------------------------------------------------- # ----------------------------------------------------------
from platformcode import platformtools
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -33,21 +35,21 @@ def menu(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info(texto) logger.debug(text)
item.search = texto item.search = text
try: try:
return peliculas(item) return peliculas(item)
# Continua la ricerca in caso di errore # Continua la ricerca in caso di errore
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
if categoria == "anime": if categoria == "anime":
@@ -58,7 +60,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
@@ -79,10 +81,15 @@ def peliculas(item):
else: else:
query='category_name' query='category_name'
searchtext = item.url.split('/')[-2] searchtext = item.url.split('/')[-2]
if not item.pag: item.pag = 1
# debug = True page = 1 if not item.page else item.page
anime = True
data = support.match(host + '/wp-admin/admin-ajax.php', post='action=itajax-sort&loop=main+loop&location=&thumbnail=1&rating=1sorter=recent&columns=4&numarticles='+perpage+'&paginated='+str(item.pag)+'&currentquery%5B'+query+'%5D='+searchtext).data.replace('\\','') numerationEnabled = True
post = 'action=itajax-sort&loop=main+loop&location=&thumbnail=1&rating=1sorter=recent&columns=4&numarticles={}&paginated={}&currentquery%5B{}%5D={}'.format(perpage, page, query, searchtext)
res = support.match(host + '/wp-admin/admin-ajax.php', post=post, patron=r'"pages":(\d+)')
data= res.data.replace('\\','')
# item.total_pages = int(res.match)
patron = r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>[^"]+?)\s+(?P<type>Movie)?\s*(?P<lang>Sub Ita|Ita)?\s*[sS]treaming' patron = r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>[^"]+?)\s+(?P<type>Movie)?\s*(?P<lang>Sub Ita|Ita)?\s*[sS]treaming'
typeContentDict = {'movie':['movie']} typeContentDict = {'movie':['movie']}
typeActionDict = {'findvideos':['movie']} typeActionDict = {'findvideos':['movie']}
@@ -91,15 +98,14 @@ def peliculas(item):
if item.search: if item.search:
itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ] itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ]
if len(itemlist) == int(perpage): if len(itemlist) == int(perpage):
item.pag += 1 support.nextPage(itemlist, item, function_or_level='peliculas', page=page + 1, total_pages=int(res.match))
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas'))
return itemlist return itemlist
return locals() return locals()
@support.scrape @support.scrape
def episodios(item): def episodios(item):
anime = True numerationEnabled = True
pagination = int(perpage) pagination = int(perpage)
patron = epPatron patron = epPatron
return locals() return locals()
+8 -8
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -38,7 +39,7 @@ def submenu(item):
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
try: try:
@@ -51,13 +52,13 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def search(item, text): def search(item, text):
support.info('search',text) logger.debug(text)
item.search = text item.search = text
item.url = host + '/lista-anime/' item.url = host + '/lista-anime/'
item.contentType = 'tvshow' item.contentType = 'tvshow'
@@ -67,14 +68,14 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
search = item.search search = item.search
anime = True numerationEnabled = True
if 'movie' in item.url: if 'movie' in item.url:
action = 'findvideos' action = 'findvideos'
else: else:
@@ -108,7 +109,7 @@ def check(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
anime = True numerationEnabled = True
data = item.data data = item.data
if '<h6>Streaming</h6>' in data: if '<h6>Streaming</h6>' in data:
@@ -116,7 +117,6 @@ def episodios(item):
else: else:
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">' patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">'
def itemHook(item): def itemHook(item):
support.info(item)
if item.url.startswith('//'): item.url= 'https:' + item.url if item.url.startswith('//'): item.url= 'https:' + item.url
elif item.url.startswith('/'): item.url= 'https:/' + item.url elif item.url.startswith('/'): item.url= 'https:/' + item.url
return item return item
@@ -125,7 +125,7 @@ def episodios(item):
def findvideos(item): def findvideos(item):
support.info(item) logger.debug()
itemlist = [] itemlist = []
if 'adf.ly' in item.url: if 'adf.ly' in item.url:
+9 -8
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
from lib.js2py.host import jsfunctions from lib.js2py.host import jsfunctions
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -30,10 +31,10 @@ def mainlist(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info(texto) logger.debug(text)
item.url = host + "/?s=" + texto item.url = host + "/?s=" + text
try: try:
return peliculas(item) return peliculas(item)
@@ -41,7 +42,7 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
@@ -56,7 +57,7 @@ def genres(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
anime = True numerationEnabled = True
blacklist = ['top 10 anime da vedere'] blacklist = ['top 10 anime da vedere']
if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside' if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside'
patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)">\s*<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+' patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)">\s*<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+'
@@ -83,7 +84,7 @@ def peliculas(item):
def episodios(item): def episodios(item):
data = support.match(item, headers=headers, patronBlock=r'entry-content clearfix">(.*?)class="mh-widget mh-posts-2 widget_text').block data = support.match(item, headers=headers, patronBlock=r'entry-content clearfix">(.*?)class="mh-widget mh-posts-2 widget_text').block
if not 'pagination clearfix' in data: if not 'pagination clearfix' in data:
support.info('NOT IN DATA') logger.debug('NOT IN DATA')
patron = r'<iframe.*?src="(?P<url>[^"]+)"' patron = r'<iframe.*?src="(?P<url>[^"]+)"'
title = item.title title = item.title
def fullItemlistHook(itemlist): def fullItemlistHook(itemlist):
@@ -100,7 +101,7 @@ def episodios(item):
return itemlist return itemlist
else: else:
url = item.url url = item.url
anime = True numerationEnabled = True
patronBlock = r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(?P<block>.*?)</span></a></div>' patronBlock = r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(?P<block>.*?)</span></a></div>'
patron = r'(?:<a href="(?P<url>[^"]+)"[^>]+>)?<span class="pagelink">(?P<episode>\d+)' patron = r'(?:<a href="(?P<url>[^"]+)"[^>]+>)?<span class="pagelink">(?P<episode>\d+)'
def itemHook(item): def itemHook(item):
@@ -124,7 +125,7 @@ def check(item):
return data return data
def findvideos(item): def findvideos(item):
support.info() logger.debug()
if item.data: if item.data:
data = item.data data = item.data
else: else:
+10 -11
View File
@@ -3,9 +3,8 @@
# Canale per AnimeSaturn # Canale per AnimeSaturn
# ---------------------------------------------------------- # ----------------------------------------------------------
from lib import js2py
from core import support from core import support
from platformcode import config from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
__channel__ = 'animesaturn' __channel__ = 'animesaturn'
@@ -43,9 +42,9 @@ def mainlist(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info(texto) logger.debug(text)
item.url = host + '/animelist?search=' + texto item.url = host + '/animelist?search=' + text
item.contentType = 'tvshow' item.contentType = 'tvshow'
try: try:
return peliculas(item) return peliculas(item)
@@ -53,12 +52,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info() logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
try: try:
@@ -70,7 +69,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
@@ -110,7 +109,7 @@ def menu(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
anime = True numerationEnabled = True
deflang= 'Sub-ITA' deflang= 'Sub-ITA'
action = 'check' action = 'check'
@@ -169,13 +168,13 @@ def check(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
if item.contentType != 'movie': anime = True if item.contentType != 'movie': numerationEnabled = True
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>' patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
return locals() return locals()
def findvideos(item): def findvideos(item):
support.info() logger.debug()
itemlist = [] itemlist = []
links = [] links = []
# page_data = '' # page_data = ''
+10 -13
View File
@@ -4,11 +4,8 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
import cloudscraper, json, copy, inspect import cloudscraper, json, copy, inspect
from core import jsontools, support, httptools, filetools from core import jsontools, support
from platformcode import autorenumber, logger from platformcode import autorenumber, logger
import re
import xbmc
session = cloudscraper.create_scraper() session = cloudscraper.create_scraper()
@@ -54,7 +51,7 @@ def menu(item):
def genres(item): def genres(item):
support.info() logger.debug()
# support.dbg() # support.dbg()
itemlist = [] itemlist = []
@@ -66,7 +63,7 @@ def genres(item):
return support.thumb(itemlist) return support.thumb(itemlist)
def years(item): def years(item):
support.info() logger.debug()
itemlist = [] itemlist = []
from datetime import datetime from datetime import datetime
@@ -80,7 +77,7 @@ def years(item):
def search(item, text): def search(item, text):
support.info('search', item) logger.debug(text)
if not item.args: if not item.args:
item.args = {'title':text} item.args = {'title':text}
else: else:
@@ -93,12 +90,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.debug('search log:', line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
item.url = host item.url = host
@@ -112,13 +109,13 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info(line) logger.debug(line)
return [] return []
return itemlist return itemlist
def news(item): def news(item):
support.info() logger.debug()
item.contentType = 'episode' item.contentType = 'episode'
itemlist = [] itemlist = []
import cloudscraper import cloudscraper
@@ -143,7 +140,7 @@ def news(item):
def peliculas(item): def peliculas(item):
support.info() logger.debug()
itemlist = [] itemlist = []
page = item.page if item.page else 0 page = item.page if item.page else 0
@@ -196,7 +193,7 @@ def peliculas(item):
return itemlist return itemlist
def episodios(item): def episodios(item):
support.info() logger.debug()
itemlist = [] itemlist = []
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio ' title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
for it in item.episodes: for it in item.episodes:
+9 -8
View File
@@ -4,6 +4,7 @@
# ---------------------------------------------------------- # ----------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
headers = {} headers = {}
@@ -34,21 +35,21 @@ def menu(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info(texto) logger.debug(text)
item.search = texto item.search = text
try: try:
return peliculas(item) return peliculas(item)
# Continua la ricerca in caso di errore # Continua la ricerca in caso di errore
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
if categoria == "anime": if categoria == "anime":
@@ -59,7 +60,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
@@ -85,7 +86,7 @@ def peliculas(item):
searchtext = item.url.split('/')[-2] if item.url != host else '' searchtext = item.url.split('/')[-2] if item.url != host else ''
if not item.pag: item.pag = 1 if not item.pag: item.pag = 1
anime=True numerationEnabled = False
# blacklist=['Altri Hentai'] # blacklist=['Altri Hentai']
data = support.match(host + '/wp-content/themes/animeuniverse/functions/ajax.php', post='sorter=recent&location=&loop=main+loop&action=sort&numarticles='+perpage+'&paginated='+str(item.pag)+'&currentquery%5B'+query+'%5D='+searchtext+'&thumbnail=1').data.replace('\\','') data = support.match(host + '/wp-content/themes/animeuniverse/functions/ajax.php', post='sorter=recent&location=&loop=main+loop&action=sort&numarticles='+perpage+'&paginated='+str(item.pag)+'&currentquery%5B'+query+'%5D='+searchtext+'&thumbnail=1').data.replace('\\','')
patron=r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>.*?)\s*(?P<lang>Sub ITA|ITA)?(?:"| \[)' patron=r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>.*?)\s*(?P<lang>Sub ITA|ITA)?(?:"| \[)'
@@ -102,7 +103,7 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
anime = True numerationEnabled = True
pagination = int(perpage) pagination = int(perpage)
patron = epPatron patron = epPatron
return locals() return locals()
+13 -13
View File
@@ -5,6 +5,7 @@
# ---------------------------------------------------------- # ----------------------------------------------------------
from core import httptools, support, jsontools from core import httptools, support, jsontools
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
__channel__ = 'animeworld' __channel__ = 'animeworld'
@@ -86,7 +87,7 @@ def submenu(item):
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
if categoria == "anime": if categoria == "anime":
@@ -97,12 +98,12 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
def search(item, texto): def search(item, texto):
support.info(texto) logger.debug(texto)
if item.search: if item.search:
item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort=' item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort='
else: else:
@@ -115,13 +116,13 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
anime = True numerationEnabled = True
# debug = True # debug = True
if item.args not in ['noorder', 'updated'] and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale if item.args not in ['noorder', 'updated'] and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale
data = get_data(item) data = get_data(item)
@@ -153,20 +154,20 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
data = get_data(item) data = get_data(item)
anime = True numerationEnabled = True
pagination = 50 # pagination = 50
patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)(?:<div class="server|<link)' patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)(?:<div class="server|<link)'
patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^-<]+)(?:-(?P<episode2>[^<]+))?' patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^-<]+)(?:-(?P<episode2>[^<]+))?'
def itemHook(item): # def itemHook(item):
item.title = item.fulltitle # item.title = item.fulltitle
return item # return item
action='findvideos' action='findvideos'
return locals() return locals()
def findvideos(item): def findvideos(item):
import time import time
support.info(item) logger.debug()
itemlist = [] itemlist = []
urls = [] urls = []
# resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<') # resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<')
@@ -186,8 +187,7 @@ def findvideos(item):
title = support.match(url, patron=r'http[s]?://(?:www.)?([^.]+)', string=True).match title = support.match(url, patron=r'http[s]?://(?:www.)?([^.]+)', string=True).match
itemlist.append(item.clone(action="play", title=title, url=url, server='directo')) itemlist.append(item.clone(action="play", title=title, url=url, server='directo'))
else: else:
dataJson = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).data json = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).response.json
json = jsontools.load(dataJson)
title = support.match(json['grabber'], patron=r'server\d+.([^.]+)', string=True).match title = support.match(json['grabber'], patron=r'server\d+.([^.]+)', string=True).match
if title: itemlist.append(item.clone(action="play", title=title, url=json['grabber'].split('=')[-1], server='directo')) if title: itemlist.append(item.clone(action="play", title=title, url=json['grabber'].split('=')[-1], server='directo'))
else: urls.append(json['grabber']) else: urls.append(json['grabber'])
+4 -4
View File
@@ -93,7 +93,7 @@ def submenu_top_of(item):
def search(item, texto): def search(item, texto):
support.info(texto) logger.debug(texto)
item.url = host + '/api/anime/advanced-search' item.url = host + '/api/anime/advanced-search'
item.variable = '&query=' + texto item.variable = '&query=' + texto
@@ -103,12 +103,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
if categoria == "anime": if categoria == "anime":
@@ -117,7 +117,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
+7 -6
View File
@@ -5,6 +5,7 @@
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -38,17 +39,17 @@ def genres(item):
def select(item): def select(item):
item.data = support.match(item).data item.data = support.match(item).data
if 'continua con il video' in item.data.lower(): if 'continua con il video' in item.data.lower():
support.info('select = ### è un film ###') logger.debug('select = ### è un film ###')
item.contentType = 'movie' item.contentType = 'movie'
return findvideos(item) return findvideos(item)
else: else:
support.info('select = ### è una serie ###') logger.debug('select = ### è una serie ###')
item.contentType = 'tvshow' item.contentType = 'tvshow'
return episodios(item) return episodios(item)
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '/?s=' + text item.url = host + '/?s=' + text
item.args = 'search' item.args = 'search'
@@ -58,7 +59,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error(line)
return [] return []
@@ -86,7 +87,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info("%s" % line) logger.error(line)
return [] return []
return itemlist return itemlist
@@ -148,7 +149,7 @@ def findvideos(item):
data = '' data = ''
from lib.unshortenit import unshorten_only from lib.unshortenit import unshorten_only
for link in links: for link in links:
support.info('URL=',link) logger.debug('URL=',link)
url, c = unshorten_only(link.replace('#', 'speedvideo.net')) url, c = unshorten_only(link.replace('#', 'speedvideo.net'))
data += url + '\n' data += url + '\n'
return support.server(item, data) return support.server(item, data)
+6 -5
View File
@@ -5,6 +5,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() + '/cb01-anime-cartoon' host = support.config.get_channel_url() + '/cb01-anime-cartoon'
@@ -37,19 +38,19 @@ def menu(item):
def search(item, texto): def search(item, texto):
support.info(texto) logger.debug(texto)
item.url = host + "/search/" + texto item.url = host + "/search/" + texto
try: try:
return peliculas(item) return peliculas(item)
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error(line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
try: try:
@@ -61,7 +62,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
@@ -93,7 +94,7 @@ def check(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
support.info('EPISODIOS ', item.data) logger.debug('EPISODIOS ', item.data)
data = '' data = ''
matches = item.data matches = item.data
season = 1 season = 1
+48 -42
View File
@@ -55,7 +55,7 @@ def menu(item):
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
@@ -133,60 +133,66 @@ def peliculas(item):
return locals() return locals()
@support.scrape
def episodios(item): def episodios(item):
@support.scrape @support.scrape
def folder(item, data): def listed(item, data):
"""
Quando c'è un link ad una cartella contenente più stagioni
"""
actLike = 'episodios' actLike = 'episodios'
addVideolibrary = False disableAll = True
downloadEnabled = False
folderUrl = scrapertools.find_single_match(data, r'TUTTA L[EA] \w+\s+(?:&#8211;|-)\s+<a href="?([^" ]+)') patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>'
data = httptools.downloadpage(folderUrl, disable_directIP=True).data patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:&#215;|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*&#8211;|\s*-|\s*<).*?)(?:<\/p>|<br)'
patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<url>[^"]+)[^>]+>'
sceneTitle = True return locals()
# debug = True
@support.scrape
def folder(item, data):
# Quando c'è un link ad una cartella contenente più stagioni
actLike = 'episodios'
disableAll = True
sceneTitle = True
folderUrl = scrapertools.find_single_match(data, r'TUTT[EA] L[EA] \w+\s+(?:&#8211;|-)\s+<a href="?([^" ]+)')
data = httptools.downloadpage(folderUrl, disable_directIP=True).data
patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<url>[^"]+)[^>]+>'
def itemHook(item):
item.serieFolder = True
return item
return locals() return locals()
# debugBlock=True
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
folderItemlist = folder(item, data) if '<p>TUTTA L' in data else [] itemlist = listed(item, data)
if not item.itemlist:
itemlist.extend(folder(item, data) if 'TUTTE LE' in data or 'TUTTA LA' in data else [])
patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>' itemDict = {'ITA':{}, 'Sub-ITA':{}}
patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:&#215;|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*&#8211;|\s*-|\s*<).*?)(?:<\/p>|<br)' seasons = []
def itemlistHook(itemlist):
title_dict = {}
itlist = []
for i in itemlist:
i.url = item.url
i.title = re.sub(r'\.(\D)',' \\1', i.title)
match = support.match(i.title, patron=r'(\d+.\d+)').match.replace('x','')
i.order = match
if match not in title_dict:
title_dict[match] = i
elif match in title_dict and i.contentLanguage == title_dict[match].contentLanguage \
or i.contentLanguage == 'ITA' and not title_dict[match].contentLanguage \
or title_dict[match].contentLanguage == 'ITA' and not i.contentLanguage:
title_dict[match].url = i.url
else:
title_dict[match + '1'] = i
for key, value in title_dict.items(): for it in itemlist:
itlist.append(value) if it.contentSeason and it.contentSeason not in seasons:
seasons.append(it.contentSeason)
itemDict['ITA'][it.contentSeason] = []
itemDict['Sub-ITA'][it.contentSeason] = []
if it.contentSeason:
itemDict[it.contentLanguage][it.contentSeason].append(it)
itlist = sorted(itlist, key=lambda it: (it.contentLanguage, int(it.order)))
itlist.extend(folderItemlist) itlist = []
for season in sorted(seasons):
itlist.extend(sorted(itemDict['ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
itlist.extend(sorted(itemDict['Sub-ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
itemlist = itlist
return itlist
return locals() import inspect
if inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']:
if len(seasons) > 1:
itemlist = support.season_pagination(itemlist, item, [], 'episodios')
else:
itemlist = support.pagination(itemlist, item, 'episodios')
support.videolibrary(itemlist, item)
support.download(itemlist, item)
return itemlist
def findvideos(item): def findvideos(item):
+9 -9
View File
@@ -7,7 +7,7 @@ import re
from core import httptools, support, scrapertools from core import httptools, support, scrapertools
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config, logger
# rimanda a .today che contiene tutti link a .plus # rimanda a .today che contiene tutti link a .plus
@@ -90,13 +90,13 @@ def episodios(item):
data=item.data data=item.data
# debug=True # debug=True
if item.args == 'anime': if item.args == 'anime':
support.info("Anime :", item) logger.debug("Anime :", item)
# blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo'] # blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo']
patron = r'<a target=(?P<url>[^>]+>(?P<title>Episodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))' patron = r'<a target=(?P<url>[^>]+>(?P<title>Episodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))'
patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)' patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)'
# item.contentType = 'tvshow' # item.contentType = 'tvshow'
elif item.args == 'serie': elif item.args == 'serie':
support.info("Serie :", item) logger.debug("Serie :", item)
patron = r'(?:>| )(?P<episode>\d+(?:x|×|&#215;)\d+)[;]?[ ]?(?:(?P<title>[^<-]+)(?P<data>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br /|</a></p|$)' patron = r'(?:>| )(?P<episode>\d+(?:x|×|&#215;)\d+)[;]?[ ]?(?:(?P<title>[^<-]+)(?P<data>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br /|</a></p|$)'
patronBlock = r'>(?:[^<]+[Ss]tagione\s|[Ss]tagione [Uu]nica)(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:<strong|<div class="at-below)' patronBlock = r'>(?:[^<]+[Ss]tagione\s|[Ss]tagione [Uu]nica)(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:<strong|<div class="at-below)'
# item.contentType = 'tvshow' # item.contentType = 'tvshow'
@@ -122,7 +122,7 @@ def genres(item):
def search(item, texto): def search(item, texto):
support.info(item.url,texto) logger.debug(item.url,texto)
texto = texto.replace(' ', '+') texto = texto.replace(' ', '+')
item.url = host + "/?s=" + texto item.url = host + "/?s=" + texto
# item.contentType = 'tv' # item.contentType = 'tv'
@@ -133,11 +133,11 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info('newest ->', categoria) logger.debug('newest ->', categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
item.args = 'newest' item.args = 'newest'
@@ -151,14 +151,14 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('newest log: ', (line)) logger.error('newest log: ', (line))
return [] return []
return itemlist return itemlist
def check(item): def check(item):
support.info() logger.debug()
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
if data: if data:
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower() ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
@@ -192,6 +192,6 @@ def check(item):
def findvideos(item): def findvideos(item):
support.info() logger.debug()
item.data = item.data.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca item.data = item.data.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca
return support.server(item, data=item.data) return support.server(item, data=item.data)
+4 -4
View File
@@ -2,9 +2,9 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
# Canale per cinetecadibologna # Canale per cinetecadibologna
# ------------------------------------------------------------ # ------------------------------------------------------------
from core.item import Item
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -34,7 +34,7 @@ def menu(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
item.args = 'noorder' item.args = 'noorder'
item.url = host + '/ricerca/type_ALL/ricerca_' + text item.url = host + '/ricerca/type_ALL/ricerca_' + text
item.contentType = 'movie' item.contentType = 'movie'
@@ -44,7 +44,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
@@ -62,7 +62,7 @@ def peliculas(item):
def findvideos(item): def findvideos(item):
support.info() logger.debug()
itemlist = [] itemlist = []
matches = support.match(item, patron=r'filename: "(.*?)"').matches matches = support.match(item, patron=r'filename: "(.*?)"').matches
+1 -1
View File
@@ -55,7 +55,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return itemlist return itemlist
+9 -11
View File
@@ -4,14 +4,13 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@support.menu @support.menu
def mainlist(item): def mainlist(item):
support.info(item)
anime = ['/search?typeY=tv', anime = ['/search?typeY=tv',
('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']), ('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']),
('OAV', ['/search?typeY=oav', 'peliculas', '', 'tvshow']), ('OAV', ['/search?typeY=oav', 'peliculas', '', 'tvshow']),
@@ -37,7 +36,6 @@ def menu(item):
patronGenreMenu = patronMenu patronGenreMenu = patronMenu
def itemHook(item): def itemHook(item):
support.info(item.type)
for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches: for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches:
item.url = host + '/search?' + Type + 'Y=' + ID item.url = host + '/search?' + Type + 'Y=' + ID
return item return item
@@ -45,7 +43,7 @@ def menu(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '/search/' + text item.url = host + '/search/' + text
@@ -56,12 +54,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error('search log:', line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
if categoria == "anime": if categoria == "anime":
@@ -72,7 +70,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
@@ -80,7 +78,7 @@ def newest(categoria):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
# debug = True # debug = True
anime = True numerationEnabled = True
if 'movie' in item.url: if 'movie' in item.url:
item.contentType = 'movie' item.contentType = 'movie'
action = 'findvideos' action = 'findvideos'
@@ -105,7 +103,7 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
anime = True numerationEnabled = True
pagination = 100 pagination = 100
if item.data: if item.data:
@@ -118,7 +116,7 @@ def episodios(item):
def findvideos(item): def findvideos(item):
itemlist = [] itemlist = []
support.info() logger.debug()
# support.dbg() # support.dbg()
matches = support.match(item, patron=r'href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"') matches = support.match(item, patron=r'href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"')
@@ -131,7 +129,7 @@ def findvideos(item):
if 'vvvvid' in matches.data: if 'vvvvid' in matches.data:
itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid')) itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid'))
else: else:
support.info('VIDEO') logger.debug('VIDEO')
for url in matches.matches: for url in matches.matches:
lang = url.split('/')[-2] lang = url.split('/')[-2]
if 'ita' in lang.lower(): if 'ita' in lang.lower():
+4 -4
View File
@@ -33,7 +33,7 @@ def menu(item):
return locals() return locals()
def newest(categoria): def newest(categoria):
support.info() logger.debug()
item = Item() item = Item()
try: try:
if categoria == "documentales": if categoria == "documentales":
@@ -45,12 +45,12 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
def search(item, texto): def search(item, texto):
support.info(texto) logger.debug(texto)
item.url = host + "/?s=" + texto item.url = host + "/?s=" + texto
try: try:
return peliculas(item) return peliculas(item)
@@ -133,7 +133,7 @@ def episodios(item):
def findvideos(item): def findvideos(item):
support.info() logger.debug()
if item.args == 'raccolta' or item.contentType == 'episode': if item.args == 'raccolta' or item.contentType == 'episode':
return support.server(item, item.url) return support.server(item, item.url)
else: else:
+9 -9
View File
@@ -4,8 +4,9 @@
# by Greko # by Greko
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import httptools, support from core import support
from core.item import Item from core.item import Item
from platformcode import logger
# def findhost(url): # def findhost(url):
# permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers # permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
@@ -17,7 +18,6 @@ headers = [['Referer', host]]
@support.menu @support.menu
def mainlist(item): def mainlist(item):
support.info()
tvshow = [] tvshow = []
anime = ['/category/anime-cartoni-animati/'] anime = ['/category/anime-cartoni-animati/']
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest']), mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest']),
@@ -58,10 +58,10 @@ def episodios(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info() logger.debug(text)
item.url = "%s/?s=%s" % (host, texto) item.url = "%s/?s=%s" % (host, text)
item.contentType = 'tvshow' item.contentType = 'tvshow'
try: try:
@@ -71,12 +71,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info(line) logger.error(line)
return [] return []
def newest(categoria): def newest(categoria):
support.info() logger.debug()
itemlist = [] itemlist = []
item = Item() item = Item()
@@ -90,12 +90,12 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
support.info() logger.debug()
return support.server(item, item.data) return support.server(item, item.data)
+8 -11
View File
@@ -16,10 +16,9 @@
- SOLO SUB-ITA - SOLO SUB-ITA
""" """
from core import support, httptools, scrapertools from core import support, httptools
from core.item import Item from core.item import Item
from core.support import info from platformcode import config, logger
from platformcode import config
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -40,7 +39,6 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
support.info(item)
# support.dbg() # support.dbg()
deflang = 'Sub-ITA' deflang = 'Sub-ITA'
@@ -97,13 +95,12 @@ def episodios_args(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
support.info(item)
return episodios_args(item) return episodios_args(item)
@support.scrape @support.scrape
def genres(item): def genres(item):
support.info() logger.debug()
#support.dbg() #support.dbg()
action = 'peliculas' action = 'peliculas'
@@ -120,7 +117,7 @@ def genres(item):
def search(item, text): def search(item, text):
support.info('search', item) logger.debug('search', text)
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '?s=' + text item.url = host + '?s=' + text
try: try:
@@ -131,12 +128,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info('search log:', line) logger.error('search log:', line)
return [] return []
def newest(categoria): def newest(categoria):
support.info('newest ->', categoria) logger.debug('newest ->', categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
if categoria == 'series': if categoria == 'series':
@@ -153,14 +150,14 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('newest log: ', line) logger.error('newest log: ', line)
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
support.info('findvideos ->', item) logger.debug('findvideos ->', item)
patron = r'<a href="([^"]+)">' patron = r'<a href="([^"]+)">'
itemlist = [] itemlist = []
+6 -11
View File
@@ -15,7 +15,7 @@ import re
from core import httptools, support from core import httptools, support
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config, logger
host = config.get_channel_url() host = config.get_channel_url()
@@ -41,7 +41,6 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
support.info()
if item.args == 'search': if item.args == 'search':
action = '' action = ''
@@ -88,8 +87,6 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
support.info()
action = 'findvideos' action = 'findvideos'
patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">' patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">'
patron = r'href="(?P<url>.*?)">(?:.+?)?\s+S(?P<season>\d+)\s\-\sEP\s(?P<episode>\d+)[^<]+<' patron = r'href="(?P<url>.*?)">(?:.+?)?\s+S(?P<season>\d+)\s\-\sEP\s(?P<episode>\d+)[^<]+<'
@@ -98,8 +95,6 @@ def episodios(item):
@support.scrape @support.scrape
def genres(item): def genres(item):
support.info()
if item.contentType == 'movie': if item.contentType == 'movie':
action = 'peliculas' action = 'peliculas'
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<' patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
@@ -115,7 +110,7 @@ def genres(item):
def search(item, text): def search(item, text):
support.info('search', item) logger.debug('search', text)
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '/search/?s=' + text item.url = host + '/search/?s=' + text
@@ -126,11 +121,11 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error('search log:', line)
return [] return []
def newest(categoria): def newest(categoria):
support.info('newest ->', categoria) logger.debug('newest ->', categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
try: try:
@@ -146,11 +141,11 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info({0}.format(line)) logger.error({0}.format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
support.info() logger.debug()
return support.server(item) return support.server(item)
+2 -3
View File
@@ -11,7 +11,6 @@
# possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità # possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità
from core import support from core import support
from core.support import info
from platformcode import logger, config from platformcode import logger, config
host = config.get_channel_url() host = config.get_channel_url()
@@ -51,7 +50,7 @@ def episodios(item):
def search(item, text): def search(item, text):
support.info('search', text) logger.debug('search', text)
item.contentType = 'tvshow' item.contentType = 'tvshow'
itemlist = [] itemlist = []
text = text.replace(' ', '+') text = text.replace(' ', '+')
@@ -61,7 +60,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info('search log:', line) logger.error('search log:', line)
return [] return []
+10 -11
View File
@@ -16,8 +16,7 @@
from core import support from core import support
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config, logger
from core.support import info
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -38,7 +37,7 @@ def mainlist(item):
##@support.scrape ##@support.scrape
##def peliculas(item): ##def peliculas(item):
#### import web_pdb; web_pdb.set_trace() #### import web_pdb; web_pdb.set_trace()
## info('peliculas ->\n', item) ## logger.debug('peliculas ->\n', item)
## ##
## action = 'episodios' ## action = 'episodios'
## block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">' ## block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
@@ -75,7 +74,7 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
## import web_pdb; web_pdb.set_trace() ## import web_pdb; web_pdb.set_trace()
info('peliculas ->\n', item) logger.debug('peliculas ->\n', item)
action = 'episodios' action = 'episodios'
blacklist = ['DMCA'] blacklist = ['DMCA']
@@ -120,7 +119,7 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
info() logger.debug()
action = 'findvideos' action = 'findvideos'
patron = r'<div class="number-episodes-on-img">\s?\d+.\d+\s?(?:\((?P<lang>[a-zA-Z\-]+)\))?</div>.+?(?:<span class="pull-left bottom-year">(?P<title2>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<[^>]+>[^>]+>[^>]+>\s?)?<span(?: meta-nextep="[^"]+")? class="[^"]+" meta-serie="(?P<title>[^"]+)" meta-stag="(?P<season>\d+)" meta-ep="(?P<episode>\d+)" meta-embed="(?P<url>[^>]+)">' patron = r'<div class="number-episodes-on-img">\s?\d+.\d+\s?(?:\((?P<lang>[a-zA-Z\-]+)\))?</div>.+?(?:<span class="pull-left bottom-year">(?P<title2>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<[^>]+>[^>]+>[^>]+>\s?)?<span(?: meta-nextep="[^"]+")? class="[^"]+" meta-serie="(?P<title>[^"]+)" meta-stag="(?P<season>\d+)" meta-ep="(?P<episode>\d+)" meta-embed="(?P<url>[^>]+)">'
@@ -136,7 +135,7 @@ def episodios(item):
@support.scrape @support.scrape
def genres(item): def genres(item):
info() logger.debug()
action = 'peliculas' action = 'peliculas'
patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>' patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>'
@@ -146,7 +145,7 @@ def genres(item):
def search(item, text): def search(item, text):
info(text) logger.debug(text)
item.url = host + "/?s=" + text item.url = host + "/?s=" + text
item.contentType = 'tvshow' item.contentType = 'tvshow'
item.args = 'search' item.args = 'search'
@@ -156,12 +155,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
info() logger.debug()
itemlist = [] itemlist = []
item = Item() item = Item()
item.contentType = 'tvshow' item.contentType = 'tvshow'
@@ -176,12 +175,12 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
info('--->', item) logger.debug('--->', item)
return support.server(item, item.url) return support.server(item, item.url)
+5 -5
View File
@@ -10,9 +10,9 @@
# possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito) # possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito)
from core.support import info
from core import support from core import support
from platformcode import config from platformcode import config, logger
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -40,7 +40,7 @@ def episodios(item):
return locals() return locals()
def search(item, text): def search(item, text):
info(text) logger.debug(text)
item.contentType = 'tvshow' item.contentType = 'tvshow'
item.url = host + "/?s=" + text item.url = host + "/?s=" + text
try: try:
@@ -49,11 +49,11 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("%s" % line) logger.error("%s" % line)
return [] return []
def findvideos(item): def findvideos(item):
support.info('findvideos', item) logger.debug('findvideos', item)
data = support.match(item, headers=headers, patron=r'div class="movieplay">([^>]+)').matches data = support.match(item, headers=headers, patron=r'div class="movieplay">([^>]+)').matches
return support.server(item, data=data ) return support.server(item, data=data )
+3 -2
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -43,7 +44,7 @@ def genre(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
item.url = host + '/?s=' + text item.url = host + '/?s=' + text
try: try:
return peliculas(item) return peliculas(item)
@@ -51,7 +52,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("search except: %s" % line) logger.error("search except: %s" % line)
return [] return []
+4 -3
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
# def findhost(url): # def findhost(url):
# data = support.httptools.downloadpage(url).data # data = support.httptools.downloadpage(url).data
@@ -11,7 +12,7 @@ from core import support
# return url[:-1] if url.endswith('/') else url # return url[:-1] if url.endswith('/') else url
host = support.config.get_channel_url() host = support.config.get_channel_url()
support.info('HOST',host) logger.debug('HOST',host)
# host = 'https://ilcorsaronero.xyz' # host = 'https://ilcorsaronero.xyz'
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -65,7 +66,7 @@ def peliculas(item):
def search(item, text): def search(item, text):
support.info(item, text) logger.debug( text)
if 'all' in item.args: if 'all' in item.args:
item.url += text item.url += text
else: else:
@@ -76,7 +77,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("search except: %s" % line) logger.error("search except: %s" % line)
return [] return []
+9 -11
View File
@@ -6,16 +6,14 @@
from core import support from core import support
from core.support import info
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config, logger
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@support.menu @support.menu
def mainlist(item): def mainlist(item):
support.info(item)
film = ['/film/', film = ['/film/',
('Generi',['', 'genres', 'genres']), ('Generi',['', 'genres', 'genres']),
@@ -46,7 +44,7 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
info() logger.debug()
# debugBlock = True # debugBlock = True
# debug=True # debug=True
@@ -96,7 +94,7 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
info() logger.debug()
patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" style="display:block">\s*<ul class="episodios">(?P<block>.*?)</ul>\s*</div>\s*</div>\s*</div>\s*</div>\s*</div>' patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" style="display:block">\s*<ul class="episodios">(?P<block>.*?)</ul>\s*</div>\s*</div>\s*</div>\s*</div>\s*</div>'
patron = r'<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)">.*?'\ patron = r'<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)">.*?'\
@@ -108,7 +106,7 @@ def episodios(item):
@support.scrape @support.scrape
def genres(item): def genres(item):
info(item) logger.debug(item)
action='peliculas' action='peliculas'
if item.args == 'genres': if item.args == 'genres':
@@ -126,7 +124,7 @@ def genres(item):
def search(item, text): def search(item, text):
info(text) logger.debug(text)
import uuid import uuid
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text
@@ -136,12 +134,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
@@ -162,14 +160,14 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
info() logger.debug()
matches = support.match(item, patron=[r'var ilinks\s?=\s?([^;]+)',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches matches = support.match(item, patron=[r'var ilinks\s?=\s?([^;]+)',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
itemlist = [] itemlist = []
list_url = [] list_url = []
+6 -7
View File
@@ -5,9 +5,8 @@
from core import support from core import support
from core.support import info
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config, logger
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -54,7 +53,7 @@ def genres(item):
return locals() return locals()
def search(item, text): def search(item, text):
info(text) logger.debug(text)
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + "/search/" + text item.url = host + "/search/" + text
try: try:
@@ -62,12 +61,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
@@ -81,14 +80,14 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
info() logger.debug()
urls = [] urls = []
data = support.match(item).data data = support.match(item).data
urls += support.match(data, patron=r'id="urlEmbed" value="([^"]+)').matches urls += support.match(data, patron=r'id="urlEmbed" value="([^"]+)').matches
+5 -5
View File
@@ -71,9 +71,9 @@ def category(item):
return locals() return locals()
def search(item, texto): def search(item, text):
support.info("s=", texto) logger.debug(text)
item.url = host + "/?s=" + texto item.url = host + "/?s=" + text
item.contentType = 'tvshow' item.contentType = 'tvshow'
try: try:
return peliculas(item) return peliculas(item)
@@ -81,12 +81,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info("newest", categoria) logger.debug("newest", categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
try: try:
+7 -5
View File
@@ -5,6 +5,7 @@
import requests import requests
from core import support from core import support
from platformcode import logger
DRM = 'com.widevine.alpha' DRM = 'com.widevine.alpha'
key_widevine = "https://la7.prod.conax.cloud/widevine/license" key_widevine = "https://la7.prod.conax.cloud/widevine/license"
@@ -69,6 +70,7 @@ def replay(item):
return locals() return locals()
def search(item, text): def search(item, text):
logger.debug(text)
item.url = host + '/tutti-i-programmi' item.url = host + '/tutti-i-programmi'
item.search = text item.search = text
try: try:
@@ -76,15 +78,15 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error('search log:', line)
return [] return []
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
search = item.search search = item.search
disabletmdb = True tmdbEnabled = False
addVideolibrary = False videlibraryEnabled = False
downloadEnabled = False downloadEnabled = False
action = 'episodios' action = 'episodios'
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<' patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
@@ -110,7 +112,7 @@ def episodios(item):
patron = r'(?:<a href="(?P<url>[^"]+)">[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]*)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?(?:[^>]+>){6}?)\s*(?P<title>[^<]+)<(?:[^>]+>[^>]+>[^>]+><div class="data">(?P<date>[^<]+))?|class="heading">[^>]+>(?P<Title>[^<]+).*?window.shareUrl = "(?P<Url>[^"]+)".*?poster:\s*"(?P<Thumb>[^"]+)", title: "(?P<desc>[^"]+)"' patron = r'(?:<a href="(?P<url>[^"]+)">[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]*)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?(?:[^>]+>){6}?)\s*(?P<title>[^<]+)<(?:[^>]+>[^>]+>[^>]+><div class="data">(?P<date>[^<]+))?|class="heading">[^>]+>(?P<Title>[^<]+).*?window.shareUrl = "(?P<Url>[^"]+)".*?poster:\s*"(?P<Thumb>[^"]+)", title: "(?P<desc>[^"]+)"'
patronNext = r'<a href="([^"]+)">' patronNext = r'<a href="([^"]+)">'
addVideolibrary = False videlibraryEnabled = False
downloadEnabled = False downloadEnabled = False
def itemHook(item): def itemHook(item):
@@ -128,7 +130,7 @@ def episodios(item):
def play(item): def play(item):
support.info() logger.debug()
if item.livefilter: if item.livefilter:
for it in live(item): for it in live(item):
if it.fulltitle == item.livefilter: if it.fulltitle == item.livefilter:
+1 -1
View File
@@ -103,7 +103,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
+1 -1
View File
@@ -104,7 +104,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return itemlist return itemlist
+3 -2
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support, config from core import support, config
from platformcode import logger
host = 'https://metalvideo.com' host = 'https://metalvideo.com'
headers = {'X-Requested-With': 'XMLHttpRequest'} headers = {'X-Requested-With': 'XMLHttpRequest'}
@@ -49,7 +50,7 @@ def findvideos(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
item.url = host + '/search.php?keywords=' + text + '&video-id=' item.url = host + '/search.php?keywords=' + text + '&video-id='
try: try:
return peliculas(item) return peliculas(item)
@@ -57,5 +58,5 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
+8 -7
View File
@@ -4,6 +4,7 @@
# ---------------------------------------------------------- # ----------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
headers = {'Referer': host} headers = {'Referer': host}
@@ -30,7 +31,7 @@ def mainlist(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
if item.contentType == 'movie' or item.extra == 'movie': if item.contentType == 'movie' or item.extra == 'movie':
action = 'findvideos' action = 'findvideos'
else: else:
@@ -43,12 +44,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
if categoria == "series": if categoria == "series":
@@ -64,14 +65,14 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
pagination = '' pagination = ''
anime = True numerationEnabled = True
patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"' patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"'
action = 'findvideos' action = 'findvideos'
# debug=True # debug=True
@@ -97,13 +98,13 @@ def peliculas(item):
patron = r'<li\s*><a href="(?P<url>[^"]+)" title="(?P<title>.*?)(?:\s(?P<year>\d{4}))?"[^>]*>' patron = r'<li\s*><a href="(?P<url>[^"]+)" title="(?P<title>.*?)(?:\s(?P<year>\d{4}))?"[^>]*>'
if item.contentType == 'tvshow': if item.contentType == 'tvshow':
action = 'episodios' action = 'episodios'
anime = True numerationEnabled = True
return locals() return locals()
@support.scrape @support.scrape
def episodios(item): def episodios(item):
anime = True numerationEnabled = True
pagination = 50 pagination = 50
patronBlock = r'<table>(?P<block>.*?)</table>' patronBlock = r'<table>(?P<block>.*?)</table>'
patron = r'<tr><td><b>(?P<title>(?:\d+)?.*?)\s*(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<data>.*?)<tr>' patron = r'<tr><td><b>(?P<title>(?:\d+)?.*?)\s*(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<data>.*?)<tr>'
+6 -5
View File
@@ -5,7 +5,8 @@
from core import support from core import support
from core.support import config, info from core.support import config
from platformcode import logger
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -23,7 +24,7 @@ def mainlist(item):
def search(item, texto): def search(item, texto):
info(texto) logger.debug(texto)
item.url = host + "/?s=" + texto item.url = host + "/?s=" + texto
try: try:
return peliculas(item) return peliculas(item)
@@ -31,12 +32,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
try: try:
@@ -56,7 +57,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
+11 -11
View File
@@ -6,7 +6,7 @@
from core import support, jsontools from core import support, jsontools
from core.item import Item from core.item import Item
from platformcode import config from platformcode import config, logger
import datetime import datetime
host = config.get_channel_url() host = config.get_channel_url()
@@ -34,7 +34,7 @@ def mainlist(item):
return locals() return locals()
def newest(categoria): def newest(categoria):
support.info() logger.debug()
item = Item() item = Item()
if categoria == 'peliculas': if categoria == 'peliculas':
item.contentType = 'movie' item.contentType = 'movie'
@@ -45,7 +45,7 @@ def newest(categoria):
return peliculas(item) return peliculas(item)
def peliculas(item): def peliculas(item):
support.info() logger.debug()
itemlist = [] itemlist = []
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
@@ -67,7 +67,7 @@ def peliculas(item):
return itemlist return itemlist
def episodios(item): def episodios(item):
support.info() logger.debug()
itemlist = [] itemlist = []
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
json_object = jsontools.load(data) json_object = jsontools.load(data)
@@ -83,7 +83,7 @@ def episodios(item):
return itemlist return itemlist
def get_season(item, seas_url, seasonNumber): def get_season(item, seas_url, seasonNumber):
support.info() logger.debug()
itemlist = [] itemlist = []
data = support.match(seas_url, headers=headers).data data = support.match(seas_url, headers=headers).data
json_object = jsontools.load(data) json_object = jsontools.load(data)
@@ -97,7 +97,7 @@ def get_season(item, seas_url, seasonNumber):
return itemlist[::-1] return itemlist[::-1]
def search(item, texto): def search(item, texto):
support.info(item.url, "search", texto) logger.debug(item.url, "search", texto)
itemlist=[] itemlist=[]
try: try:
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
@@ -118,12 +118,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def search_movie_by_genre(item): def search_movie_by_genre(item):
support.info() logger.debug()
itemlist = [] itemlist = []
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
json_object = jsontools.load(data) json_object = jsontools.load(data)
@@ -137,7 +137,7 @@ def search_movie_by_genre(item):
def search_movie_by_year(item): def search_movie_by_year(item):
support.info() logger.debug()
now = datetime.datetime.now() now = datetime.datetime.now()
year = int(now.year) year = int(now.year)
itemlist = [] itemlist = []
@@ -153,7 +153,7 @@ def search_movie_by_year(item):
def findvideos(item): def findvideos(item):
support.info() logger.debug()
itemlist = [] itemlist = []
try: try:
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
@@ -175,7 +175,7 @@ def findvideos(item):
def get_itemlist_element(element,item): def get_itemlist_element(element,item):
support.info() logger.debug()
contentSerieName = '' contentSerieName = ''
contentTitle ='' contentTitle =''
try: try:
+6 -5
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support from core import support
from platformcode import logger
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -38,7 +39,7 @@ def menu(item):
def search(item, text): def search(item, text):
support.info('search', item) logger.debug('search', item)
itemlist = [] itemlist = []
text = text.replace(' ', '+') text = text.replace(' ', '+')
item.url = host + '/search/keyword/' + text item.url = host + '/search/keyword/' + text
@@ -52,12 +53,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error('search log:', line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
item.url = host item.url = host
@@ -77,7 +78,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
return itemlist return itemlist
@@ -109,6 +110,6 @@ def episodios(item):
def findvideos(item): def findvideos(item):
support.info() logger.debug()
# match = support.match(item, patron='wstream', debug=True) # match = support.match(item, patron='wstream', debug=True)
return support.server(item) return support.server(item)
+1 -1
View File
@@ -83,7 +83,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
+6 -5
View File
@@ -5,6 +5,7 @@
from core import support from core import support
from platformcode import logger
# def findhost(url): # def findhost(url):
# return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match # return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match
@@ -27,7 +28,7 @@ def mainlist(item):
def search(item, texto): def search(item, texto):
support.info(texto) logger.debug(texto)
item.contentType = 'tvshow' item.contentType = 'tvshow'
@@ -38,12 +39,12 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = support.Item() item = support.Item()
@@ -57,7 +58,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
@@ -142,7 +143,7 @@ def menu(item):
def findvideos(item): def findvideos(item):
item.url = item.url.replace('&amp;', '&') item.url = item.url.replace('&amp;', '&')
support.info(item) logger.debug(item)
if item.args == 'last': if item.args == 'last':
url = support.match(item, patron = r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match url = support.match(item, patron = r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
matches = support.match(url,patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>').matches matches = support.match(url,patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>').matches
+14 -14
View File
@@ -15,9 +15,9 @@
Altrimenti: Altrimenti:
- Prima fare la 'Rinumerazione' dal menu contestuale dal titolo della serie - Prima fare la 'Rinumerazione' dal menu contestuale dal titolo della serie
""" """
import re
from core import support, httptools, scrapertools from core import support, scrapertools
from platformcode import config from platformcode import config, logger
from core.item import Item from core.item import Item
@@ -31,7 +31,7 @@ headers = [['Referer', host]]
@support.menu @support.menu
def mainlist(item): def mainlist(item):
support.info() logger.debug()
film = ['/ultimi-film-aggiunti/', film = ['/ultimi-film-aggiunti/',
@@ -56,8 +56,8 @@ def mainlist(item):
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
support.info() logger.debug()
anime = True numerationEnabled = True
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime'] blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime']
patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">' patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">'
@@ -79,7 +79,7 @@ def peliculas(item):
if not item.args and 'anime' not in item.url: if not item.args and 'anime' not in item.url:
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+? href="(?P<url>[^"]+)">.*?<h2>(?P<title>[^"]+)</h2>\s?(?:<span class="year">(?P<year>\d+|\-\d+))?<' patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+? href="(?P<url>[^"]+)">.*?<h2>(?P<title>[^"]+)</h2>\s?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
else: else:
anime = True numerationEnabled = True
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<' patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
else: else:
# SEZIONE FILM # SEZIONE FILM
@@ -106,8 +106,8 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
support.info() logger.debug()
anime = True numerationEnabled = True
action = 'findvideos' action = 'findvideos'
patronBlock = r'<table>(?P<block>.*)<\/table>' patronBlock = r'<table>(?P<block>.*)<\/table>'
patron = r'<tr><td>(?P<title>.*?)?[ ](?:Parte)?(?P<episode>\d+x\d+|\d+)(?:|[ ]?(?P<title2>.+?)?(?:avi)?)<(?P<data>.*?)<\/td><tr>' patron = r'<tr><td>(?P<title>.*?)?[ ](?:Parte)?(?P<episode>\d+x\d+|\d+)(?:|[ ]?(?P<title2>.+?)?(?:avi)?)<(?P<data>.*?)<\/td><tr>'
@@ -121,7 +121,7 @@ def episodios(item):
def search(item, text): def search(item, text):
support.info("CERCA :" ,text, item) logger.debug("CERCA :" ,text, item)
item.url = "%s/?s=%s" % (host, text) item.url = "%s/?s=%s" % (host, text)
@@ -132,11 +132,11 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
@@ -155,13 +155,13 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
support.info() logger.debug()
if item.contentType == 'movie': if item.contentType == 'movie':
return support.server(item, headers=headers) return support.server(item, headers=headers)
else: else:
+10 -12
View File
@@ -9,7 +9,6 @@ import time
from core import httptools, tmdb, scrapertools, support from core import httptools, tmdb, scrapertools, support
from core.item import Item from core.item import Item
from core.support import info
from platformcode import logger, config from platformcode import logger, config
host = config.get_channel_url() host = config.get_channel_url()
@@ -21,7 +20,6 @@ list_language = IDIOMAS.values()
@support.menu @support.menu
def mainlist(item): def mainlist(item):
info()
itemlist = [] itemlist = []
tvshowSub = [ tvshowSub = [
('Novità {bold}',[ '', 'peliculas_tv', '', 'tvshow']), ('Novità {bold}',[ '', 'peliculas_tv', '', 'tvshow']),
@@ -52,7 +50,7 @@ def cleantitle(scrapedtitle):
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
def findvideos(item): def findvideos(item):
info() logger.debug()
data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data
data = re.sub(r'\n|\t|\s+', ' ', data) data = re.sub(r'\n|\t|\s+', ' ', data)
# recupero il blocco contenente i link # recupero il blocco contenente i link
@@ -66,8 +64,8 @@ def findvideos(item):
episodio = item.infoLabels['episode'] episodio = item.infoLabels['episode']
patron = r'\.\.:: Episodio %s([\s\S]*?)(<div class="post|..:: Episodio)' % episodio patron = r'\.\.:: Episodio %s([\s\S]*?)(<div class="post|..:: Episodio)' % episodio
info(patron) logger.debug(patron)
info(blocco) logger.debug(blocco)
matches = scrapertools.find_multiple_matches(blocco, patron) matches = scrapertools.find_multiple_matches(blocco, patron)
if len(matches): if len(matches):
@@ -89,7 +87,7 @@ def findvideos(item):
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
def lista_serie(item): def lista_serie(item):
info() logger.debug()
itemlist = [] itemlist = []
PERPAGE = 15 PERPAGE = 15
@@ -137,7 +135,7 @@ def lista_serie(item):
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
def episodios(item, itemlist=[]): def episodios(item, itemlist=[]):
info() logger.debug()
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?' patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?'
patron += r'<p><a href="([^"]+)">' patron += r'<p><a href="([^"]+)">'
@@ -212,7 +210,7 @@ def episodios(item, itemlist=[]):
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
def peliculas_tv(item): def peliculas_tv(item):
info() logger.debug()
itemlist = [] itemlist = []
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>' patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>'
@@ -265,7 +263,7 @@ def peliculas_tv(item):
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
def newest(categoria): def newest(categoria):
info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
item.url = host item.url = host
@@ -289,7 +287,7 @@ def newest(categoria):
# ---------------------------------------------------------------------------------------------------------------- # ----------------------------------------------------------------------------------------------------------------
def search(item, texto): def search(item, texto):
info(texto) logger.debug(texto)
itemlist = [] itemlist = []
try: try:
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>' patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
@@ -313,7 +311,7 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.info('search log:', line) logger.error('search log:', line)
return [] return []
return itemlist return itemlist
@@ -325,7 +323,7 @@ def search(item, texto):
def list_az(item): def list_az(item):
info() logger.debug()
itemlist = [] itemlist = []
alphabet = dict() alphabet = dict()
+9 -10
View File
@@ -8,10 +8,9 @@
""" """
import re import re
from core import support, httptools, scrapertools from core import support
from core.item import Item from core.item import Item
from core.support import info from platformcode import config, logger
from platformcode import config
host = config.get_channel_url() host = config.get_channel_url()
headers = [['Referer', host]] headers = [['Referer', host]]
@@ -55,8 +54,8 @@ def episodios(item):
patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)' patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)'
def itemHook(i): def itemHook(i):
for value, season in seasons: for value, season in seasons:
info(value) logger.debug(value)
info(season) logger.debug(season)
i.title = i.title.replace(value+'x',season+'x') i.title = i.title.replace(value+'x',season+'x')
i.other += '\n' + i.url i.other += '\n' + i.url
i.url = item.url i.url = item.url
@@ -74,7 +73,7 @@ def genres(item):
def search(item, text): def search(item, text):
info(text) logger.debug(text)
item.url = host + "/?s=" + text item.url = host + "/?s=" + text
try: try:
item.contentType = 'tvshow' item.contentType = 'tvshow'
@@ -83,12 +82,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("%s" % line) logger.debug("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
info(categoria) logger.debug(categoria)
itemlist = [] itemlist = []
item = Item() item = Item()
try: try:
@@ -103,14 +102,14 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
info("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
return itemlist return itemlist
def findvideos(item): def findvideos(item):
info(item) logger.debug(item)
if item.args != 'update': if item.args != 'update':
return support.server(item, data=item.other) return support.server(item, data=item.other)
else: else:
+3 -4
View File
@@ -4,8 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import support, httptools from core import support, httptools
from core.item import Item from platformcode import config, logger
from platformcode import config
import sys import sys
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
from urllib.parse import unquote from urllib.parse import unquote
@@ -32,14 +31,14 @@ def mainlist(item):
def search(item, text): def search(item, text):
support.info("[streamingaltadefinizione.py] " + item.url + " search " + text) logger.debug(text)
item.url = item.url + "/?s=" + text item.url = item.url + "/?s=" + text
try: try:
return support.dooplay_search(item) return support.dooplay_search(item)
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
+12 -14
View File
@@ -3,11 +3,9 @@
# Canale per Tantifilm # Canale per Tantifilm
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import scrapertools, httptools, support from core import support
from core.item import Item from core.item import Item
from core.support import info from platformcode import logger, config
from platformcode import logger
from platformcode import config
# def findhost(url): # def findhost(url):
@@ -23,7 +21,7 @@ player_iframe = r'<iframe.*?src="([^"]+)"[^>]+></iframe>\s*<div class="player'
@support.menu @support.menu
def mainlist(item): def mainlist(item):
info() logger.debug()
top = [('Generi', ['', 'category'])] top = [('Generi', ['', 'category'])]
film = ['/film', film = ['/film',
@@ -114,7 +112,7 @@ def category(item):
def search(item, texto): def search(item, texto):
info(texto) logger.debug(texto)
item.url = host + "/?s=" + texto item.url = host + "/?s=" + texto
@@ -126,7 +124,7 @@ def search(item, texto):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
logger.error("%s" % line) logger.error('{}'.format(line))
return [] return []
@@ -155,17 +153,17 @@ def hdpass(item):
def findvideos(item): def findvideos(item):
info() logger.debug()
support.info("ITEMLIST: ", item) logger.debug("ITEMLIST: ", item)
data = support.match(item.url, headers=headers).data data = support.match(item.url, headers=headers).data
check = support.match(data, patron=r'<div class="category-film">(.*?)</div>').match check = support.match(data, patron=r'<div class="category-film">(.*?)</div>').match
if 'sub' in check.lower(): if 'sub' in check.lower():
item.contentLanguage = 'Sub-ITA' item.contentLanguage = 'Sub-ITA'
support.info("CHECK : ", check) logger.debug("CHECK : ", check)
if 'anime' in check.lower(): if 'anime' in check.lower():
item.contentType = 'tvshow' item.contentType = 'tvshow'
item.data = data item.data = data
support.info('select = ### è una anime ###') logger.debug('select = ### è una anime ###')
try: try:
return episodios(item) return episodios(item)
except: except:
@@ -180,7 +178,7 @@ def findvideos(item):
# if 'protectlink' in data: # if 'protectlink' in data:
# urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"') # urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
# support.info("SONO QUI: ", urls) # logger.debug("SONO QUI: ", urls)
# for url in urls: # for url in urls:
# url = url.decode('base64') # url = url.decode('base64')
# # tiro via l'ultimo carattere perchè non c'entra # # tiro via l'ultimo carattere perchè non c'entra
@@ -191,7 +189,7 @@ def findvideos(item):
# if url: # if url:
# listurl.add(url) # listurl.add(url)
# data += '\n'.join(listurl) # data += '\n'.join(listurl)
info(data) logger.debug(data)
itemlist = [] itemlist = []
# support.dbg() # support.dbg()
@@ -203,7 +201,7 @@ def findvideos(item):
if item.otherLinks: if item.otherLinks:
urls += support.match(item.otherLinks, patron=r'href="([^"]+)').matches urls += support.match(item.otherLinks, patron=r'href="([^"]+)').matches
info('URLS', urls) logger.debug('URLS', urls)
for u in urls: for u in urls:
if 'hdplayer.casa/series/' in u: if 'hdplayer.casa/series/' in u:
urls.remove(u) urls.remove(u)
+3 -2
View File
@@ -4,6 +4,7 @@
from core import support, httptools from core import support, httptools
from core.item import Item from core.item import Item
from platformcode import logger
import sys import sys
if sys.version_info[0] >= 3: from concurrent import futures if sys.version_info[0] >= 3: from concurrent import futures
else: from concurrent_py2 import futures else: from concurrent_py2 import futures
@@ -26,7 +27,7 @@ def mainlist(item):
def episodios(item): def episodios(item):
support.info(item) logger.debug(item)
itemlist = [] itemlist = []
with futures.ThreadPoolExecutor() as executor: with futures.ThreadPoolExecutor() as executor:
@@ -53,7 +54,7 @@ def genres(item):
def peliculas(item, text=''): def peliculas(item, text=''):
support.info('search', item) logger.debug('search', item)
itemlist = [] itemlist = []
filter_type = False filter_type = False
if item.genre: if item.genre:
+8 -7
View File
@@ -4,6 +4,7 @@
# ------------------------------------------------------------ # ------------------------------------------------------------
from core import scrapertools, support from core import scrapertools, support
from platformcode import logger
import sys import sys
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -24,7 +25,7 @@ def mainlist(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
# item.args='search' # item.args='search'
item.text = text item.text = text
item.url = item.url + '/?a=b&s=' + text.replace(' ', '+') item.url = item.url + '/?a=b&s=' + text.replace(' ', '+')
@@ -35,12 +36,12 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
def newest(categoria): def newest(categoria):
support.info(categoria) logger.debug(categoria)
item = support.Item() item = support.Item()
try: try:
item.contentType = 'undefined' item.contentType = 'undefined'
@@ -51,7 +52,7 @@ def newest(categoria):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("{0}".format(line)) logger.error("{0}".format(line))
return [] return []
@@ -60,7 +61,7 @@ def peliculas(item):
# debugBlock = True # debugBlock = True
# debug = True # debug = True
# search = item.text # search = item.text
if item.contentType != 'movie': anime = True if item.contentType != 'movie': numerationEnabled = True
action = 'findvideos' if item.contentType == 'movie' else 'episodios' action = 'findvideos' if item.contentType == 'movie' else 'episodios'
blacklist = ['-Film Animazione disponibili in attesa di recensione '] blacklist = ['-Film Animazione disponibili in attesa di recensione ']
@@ -82,7 +83,7 @@ def peliculas(item):
patronNext = '<a class="next page-numbers" href="([^"]+)">' patronNext = '<a class="next page-numbers" href="([^"]+)">'
def itemHook(item): def itemHook(item):
support.info(item.title) logger.debug(item.title)
if item.args == 'sub': if item.args == 'sub':
item.title += support.typo('Sub-ITA', 'bold color kod _ []') item.title += support.typo('Sub-ITA', 'bold color kod _ []')
item.contentLanguage = 'Sub-ITA' item.contentLanguage = 'Sub-ITA'
@@ -92,7 +93,7 @@ def peliculas(item):
@support.scrape @support.scrape
def episodios(item): def episodios(item):
anime = True numerationEnabled = True
# debug = True # debug = True
patron = r'>\s*(?:(?P<season>\d+)(?:&#215;|x|×))?(?P<episode>\d+)(?:\s+&#8211;\s+)?[ ]+(?P<title2>[^<]+)[ ]+<a (?P<data>.*?)(?:<br|</p)' patron = r'>\s*(?:(?P<season>\d+)(?:&#215;|x|×))?(?P<episode>\d+)(?:\s+&#8211;\s+)?[ ]+(?P<title2>[^<]+)[ ]+<a (?P<data>.*?)(?:<br|</p)'
# data = '' # data = ''
+2 -2
View File
@@ -28,7 +28,7 @@ def mainlist(item):
def radio(item): def radio(item):
support.info() logger.debug()
itemlist = [] itemlist = []
data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"') data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"')
if data.matches: if data.matches:
@@ -85,7 +85,7 @@ def findvideos(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
item.url = host + '/Search.ashx?query=' +text item.url = host + '/Search.ashx?query=' +text
try: try:
return radio(item) return radio(item)
+5 -5
View File
@@ -3,7 +3,7 @@
# Canale per vvvvid # Canale per vvvvid
# ---------------------------------------------------------- # ----------------------------------------------------------
import requests, sys, inspect import requests, sys, inspect
from core import jsontools, support, tmdb from core import support, tmdb
from platformcode import autorenumber, logger, config from platformcode import autorenumber, logger, config
host = support.config.get_channel_url() host = support.config.get_channel_url()
@@ -68,7 +68,7 @@ def mainlist(item):
def search(item, text): def search(item, text):
support.info(text) logger.debug(text)
itemlist = [] itemlist = []
if conn_id: if conn_id:
if 'film' in item.url: item.contentType = 'movie' if 'film' in item.url: item.contentType = 'movie'
@@ -79,7 +79,7 @@ def search(item, text):
except: except:
import sys import sys
for line in sys.exc_info(): for line in sys.exc_info():
support.logger.error("%s" % line) logger.error("%s" % line)
return [] return []
return itemlist return itemlist
@@ -105,7 +105,7 @@ def peliculas(item):
# support.dbg() # support.dbg()
if not item.args: if not item.args:
json_file =loadjs(item.url + 'channel/10005/last/') json_file =loadjs(item.url + 'channel/10005/last/')
support.logger.debug(json_file) logger.debug(json_file)
make_itemlist(itemlist, item, json_file) make_itemlist(itemlist, item, json_file)
itemlist = support.pagination(itemlist, item, item.page if item.page else 1, 20) itemlist = support.pagination(itemlist, item, item.page if item.page else 1, 20)
if item.contentType != 'movie': autorenumber.start(itemlist) if item.contentType != 'movie': autorenumber.start(itemlist)
@@ -241,7 +241,7 @@ def make_itemlist(itemlist, item, data):
def loadjs(url): def loadjs(url):
if '?category' not in url: if '?category' not in url:
url += '?full=true' url += '?full=true'
support.info('Json URL;',url) logger.debug('Json URL;',url)
json = current_session.get(url, headers=headers, params=payload).json() json = current_session.get(url, headers=headers, params=payload).json()
return json return json
+1049 -931
View File
File diff suppressed because it is too large Load Diff
+3 -2
View File
@@ -109,6 +109,7 @@ class autorenumber():
self.selectspecials = False self.selectspecials = False
self.manual = False self.manual = False
self.auto = False self.auto = False
if self.item: if self.item:
from core.videolibrarytools import check_renumber_options from core.videolibrarytools import check_renumber_options
check_renumber_options(self.item) check_renumber_options(self.item)
@@ -186,7 +187,7 @@ class autorenumber():
if number in self.episodes: if number in self.episodes:
item.contentSeason = int(self.episodes[number].split('x')[0]) item.contentSeason = int(self.episodes[number].split('x')[0])
item.contentEpisodeNumber = int(self.episodes[number].split('x')[1]) item.contentEpisodeNumber = int(self.episodes[number].split('x')[1])
# support.dbg() # support.dbg()
# for i in self.itemlist: # for i in self.itemlist:
# sub_thread(i) # sub_thread(i)
@@ -203,7 +204,7 @@ class autorenumber():
self.epdict = {} self.epdict = {}
self.group = self.renumberdict[self.title].get(GROUP, None) self.group = self.renumberdict[self.title].get(GROUP, None)
busy(True) busy(True)
itemlist = find_episodes(self.item) itemlist = self.itemlist if self.itemlist else find_episodes(self.item)
if not self.group: if not self.group:
+10 -10
View File
@@ -1,6 +1,6 @@
from core import filetools, downloadtools, support from core import filetools, downloadtools, support
from platformcode import config, platformtools, updater from platformcode import config, platformtools, updater, logger
import xbmc, xbmcaddon, sys, platform import xbmc, xbmcaddon, sys, platform
host = 'https://github.com' host = 'https://github.com'
@@ -28,9 +28,9 @@ def download(item=None):
if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70782)): if platformtools.dialog_yesno(config.get_localized_string(70784), config.get_localized_string(70782)):
pform = get_platform() pform = get_platform()
url = support.match(elementum_url, patronBlock=r'<div class="release-entry">(.*?)<!-- /.release-body -->', patron=r'<a href="([a-zA-Z0-9/\.-]+%s.zip)' % pform).match url = support.match(elementum_url, patronBlock=r'<div class="release-entry">(.*?)<!-- /.release-body -->', patron=r'<a href="([a-zA-Z0-9/\.-]+%s.zip)' % pform).match
support.info('OS:', pform) logger.debug('OS:', pform)
support.info('Extract IN:', elementum_path) logger.debug('Extract IN:', elementum_path)
support.info('URL:', url) logger.debug('URL:', url)
if url: if url:
downloadtools.downloadfile(host + url, filename) downloadtools.downloadfile(host + url, filename)
extract() extract()
@@ -44,19 +44,19 @@ def download(item=None):
def extract(): def extract():
import zipfile import zipfile
from platformcode.updater import fixZipGetHash from platformcode.updater import fixZipGetHash
support.info('Estraggo Elementum in:', elementum_path) logger.debug('Estraggo Elementum in:', elementum_path)
try: try:
# hash = fixZipGetHash(filename) # hash = fixZipGetHash(filename)
# support.info(hash) # logger.debug(hash)
with zipfile.ZipFile(filetools.file_open(filename, 'rb', vfs=False)) as zip_ref: with zipfile.ZipFile(filetools.file_open(filename, 'rb', vfs=False)) as zip_ref:
zip_ref.extractall(xbmc.translatePath(addon_path)) zip_ref.extractall(xbmc.translatePath(addon_path))
except Exception as e: except Exception as e:
support.info('Non sono riuscito ad estrarre il file zip') logger.debug('Non sono riuscito ad estrarre il file zip')
support.logger.error(e) logger.error(e)
import traceback import traceback
support.logger.error(traceback.print_exc()) logger.error(traceback.print_exc())
def setting(): def setting():
@@ -74,7 +74,7 @@ def setting():
__settings__.setSetting('do_not_disturb', 'true') __settings__.setSetting('do_not_disturb', 'true')
Continue = False Continue = False
except: except:
support.info('RIPROVO') logger.debug('RIPROVO')
xbmc.sleep(100) xbmc.sleep(100)
else: else:
if not filetools.exists(elementum_path): if not filetools.exists(elementum_path):
+14 -5
View File
@@ -161,12 +161,21 @@ def run(item=None):
if page and int(page) > -1: if page and int(page) > -1:
import xbmc import xbmc
item.action = item.real_action item.action = item.real_action
if item.page: item.page = page
item.page = page import re
else: item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>{}\g<2>'.format(page), item.url)
import re
item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>{}\g<2>'.format(page), item.url)
xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl())) xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], item.tourl()))
elif item.action == "gotoseason":
head = 'Seleziona la stagione'
seasons = [str(s) for s in item.allSeasons]
season = platformtools.dialog_select(head, seasons, item.nextSeason - 1)
if int(season) > -1:
import xbmc
item.action = item.real_action
item.nextSeason = item.allSeasons.index(season + 1)
run(item)
# logger.debug(item)
# xbmc.executebuiltin("Container.Update(%s?%s)" % (sys.argv[0], new_item.tourl()))
else: else:
# Checks if channel exists # Checks if channel exists
if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")): if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")):
+2 -2
View File
@@ -666,8 +666,8 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
return context_commands return context_commands
# Options according to criteria, only if the item is not a tag, nor is it "Add to the video library", etc... # Options according to criteria, only if the item is not a tag, nor is it "Add to the video library", etc...
if item.action and item.action not in ["add_movie_to_library", "add_serie_to_library", "buscartrailer", "actualizar_titulos"]: if item.action and item.action not in ["add_movie_to_library", "add_serie_to_library", "buscartrailer", "actualizar_titulos"]:
if item.nextPage: # if item.nextPage:
context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action))) # context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action)))
# Show information: if the item has a plot, we assume that it is a series, season, chapter or movie # Show information: if the item has a plot, we assume that it is a series, season, chapter or movie
# if item.infoLabels['plot'] and (num_version_xbmc < 17.0 or item.contentType == 'season'): # if item.infoLabels['plot'] and (num_version_xbmc < 17.0 or item.contentType == 'season'):
# context_commands.append((config.get_localized_string(60348), "Action(Info)")) # context_commands.append((config.get_localized_string(60348), "Action(Info)"))
+3 -3
View File
@@ -3,8 +3,8 @@
import re, os, sys, time, requests, xbmc, xbmcaddon import re, os, sys, time, requests, xbmc, xbmcaddon
from core import filetools, jsontools from core import filetools, jsontools
from core.support import info, match from core.support import match
from platformcode import config, platformtools from platformcode import config, platformtools, logger
from lib.guessit import guessit from lib.guessit import guessit
if sys.version_info[0] >= 3: if sys.version_info[0] >= 3:
@@ -26,7 +26,7 @@ def get_video_url(page_url, premium=False, user='', password='', video_password=
if len(torrent_options) == 0: if len(torrent_options) == 0:
from platformcode import elementum_download from platformcode import elementum_download
elementum_download.download() elementum_download.download()
info('server=torrent, the url is the good') logger.debug('server=torrent, the url is the good')
if page_url.startswith('magnet:'): if page_url.startswith('magnet:'):
video_urls = [{'type':'magnet', 'url':page_url}] video_urls = [{'type':'magnet', 'url':page_url}]
+33 -34
View File
@@ -12,12 +12,11 @@ from past.utils import old_div
import re, time, unicodedata, xbmc import re, time, unicodedata, xbmc
from core.support import thumb from core.support import thumb, typo
from core import filetools, jsontools, scraper, scrapertools, servertools, videolibrarytools, support from core import filetools, jsontools, scraper, scrapertools, servertools, videolibrarytools, support
from core.downloader import Downloader from core.downloader import Downloader
from core.item import Item from core.item import Item
from platformcode import config, logger, platformtools from platformcode import config, logger, platformtools
from core.support import info, typo
from servers import torrent from servers import torrent
kb = '0xFF65B3DA' kb = '0xFF65B3DA'
@@ -39,7 +38,7 @@ extensions_list = ['.aaf', '.3gp', '.asf', '.avi', '.flv', '.mpeg', '.m1v', '.m2
def mainlist(item): def mainlist(item):
info() logger.debug()
itemlist = [] itemlist = []
# File list # File list
@@ -142,7 +141,7 @@ def settings(item):
def browser(item): def browser(item):
info() logger.debug()
itemlist = [] itemlist = []
for file in filetools.listdir(item.url): for file in filetools.listdir(item.url):
@@ -176,7 +175,7 @@ def del_dir(item):
def clean_all(item): def clean_all(item):
info() logger.debug()
stop_all() stop_all()
removeFiles = False removeFiles = False
if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(30300)): if platformtools.dialog_yesno(config.get_localized_string(20000), config.get_localized_string(30300)):
@@ -202,7 +201,7 @@ def reload(item):
def stop_all(item=None): def stop_all(item=None):
info() logger.debug()
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)): for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
if fichero.endswith(".json"): if fichero.endswith(".json"):
@@ -220,7 +219,7 @@ def stop_all(item=None):
def clean_ready(item): def clean_ready(item):
info() logger.debug()
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)): for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
if fichero.endswith(".json"): if fichero.endswith(".json"):
download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero))) download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero)))
@@ -232,7 +231,7 @@ def clean_ready(item):
def restart_error(item): def restart_error(item):
info() logger.debug()
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)): for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
if fichero.endswith(".json"): if fichero.endswith(".json"):
download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero))) download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero)))
@@ -271,7 +270,7 @@ def download_all_background(item):
def menu(item): def menu(item):
info(item) logger.debug(item)
if item.downloadServer: if item.downloadServer:
servidor = item.downloadServer.get("server", "Auto") servidor = item.downloadServer.get("server", "Auto")
else: else:
@@ -367,7 +366,7 @@ def menu(item):
def move_to_libray(item): def move_to_libray(item):
info() logger.debug()
if item.contentType == 'movie': if item.contentType == 'movie':
FOLDER = FOLDER_MOVIES FOLDER = FOLDER_MOVIES
@@ -421,7 +420,7 @@ def move_to_libray(item):
if filename.startswith(name) and (filename.endswith('.strm') or (filename.endswith('.json') and 'downloads' not in filename)): if filename.startswith(name) and (filename.endswith('.strm') or (filename.endswith('.json') and 'downloads' not in filename)):
clean = True clean = True
file_path = filetools.join(config.get_setting("videolibrarypath"), FOLDER, path_title, File) file_path = filetools.join(config.get_setting("videolibrarypath"), FOLDER, path_title, File)
info('Delete File:', str(file_path)) logger.debug('Delete File:', str(file_path))
filetools.remove(file_path) filetools.remove(file_path)
if file_path.endswith('.strm'): if file_path.endswith('.strm'):
file_strm_path = file_path file_strm_path = file_path
@@ -577,7 +576,7 @@ def sort_method(item):
def download_from_url(url, item): def download_from_url(url, item):
info("Attempting to download:", url) logger.debug("Attempting to download:", url)
if '.m3u8' in url.lower().split('|')[0] or url.lower().startswith("rtmp"): if '.m3u8' in url.lower().split('|')[0] or url.lower().startswith("rtmp"):
save_server_statistics(item.server, 0, False) save_server_statistics(item.server, 0, False)
platformtools.dialog_notification('m3u8 Download',config.get_localized_string(60364), sound=False) platformtools.dialog_notification('m3u8 Download',config.get_localized_string(60364), sound=False)
@@ -606,22 +605,22 @@ def download_from_url(url, item):
update_json(item.path, {"downloadUrl": d.download_url, "downloadStatus": STATUS_CODES.downloading, "downloadSize": d.size[0], update_json(item.path, {"downloadUrl": d.download_url, "downloadStatus": STATUS_CODES.downloading, "downloadSize": d.size[0],
"downloadProgress": d.progress, "downloadCompleted": d.downloaded[0], "downloadFilename": file}) "downloadProgress": d.progress, "downloadCompleted": d.downloaded[0], "downloadFilename": file})
d.start_dialog(config.get_localized_string(60332)) d.start_dialog(config.get_localized_string(30006))
# Download stopped. We get the state: # Download stopped. We get the state:
# Download failed # Download failed
if d.state == d.states.error: if d.state == d.states.error:
info("Error trying to download", url) logger.debug("Error trying to download", url)
status = STATUS_CODES.error status = STATUS_CODES.error
# Download has stopped # Download has stopped
elif d.state == d.states.stopped: elif d.state == d.states.stopped:
info("Stop download") logger.debug("Stop download")
status = STATUS_CODES.canceled status = STATUS_CODES.canceled
# Download is complete # Download is complete
elif d.state == d.states.completed: elif d.state == d.states.completed:
info("Downloaded correctly") logger.debug("Downloaded correctly")
status = STATUS_CODES.completed status = STATUS_CODES.completed
if (item.downloadSize and item.downloadSize != d.size[0]) or d.size[0] < 5000000: # if size don't correspond or file is too little (gounlimited for example send a little video to say the server is overloaded) if (item.downloadSize and item.downloadSize != d.size[0]) or d.size[0] < 5000000: # if size don't correspond or file is too little (gounlimited for example send a little video to say the server is overloaded)
@@ -637,7 +636,7 @@ def download_from_url(url, item):
def download_from_server(item): def download_from_server(item):
info(item.tostring()) logger.debug(item.tostring())
unsupported_servers = ["torrent"] unsupported_servers = ["torrent"]
if item.contentChannel == 'local': if item.contentChannel == 'local':
@@ -667,11 +666,11 @@ def download_from_server(item):
item.video_urls = itemlist item.video_urls = itemlist
if not item.server: item.server = "directo" if not item.server: item.server = "directo"
else: else:
info("There is nothing to reproduce") logger.debug("There is nothing to reproduce")
return {"downloadStatus": STATUS_CODES.error} return {"downloadStatus": STATUS_CODES.error}
finally: finally:
progreso.close() progreso.close()
info("contentAction: %s | contentChannel: %s | server: %s | url: %s" % (item.contentAction, item.contentChannel, item.server, item.url)) logger.debug("contentAction: %s | contentChannel: %s | server: %s | url: %s" % (item.contentAction, item.contentChannel, item.server, item.url))
if item.server == 'torrent': if item.server == 'torrent':
import xbmcgui import xbmcgui
@@ -691,11 +690,11 @@ def download_from_server(item):
# If it is not available, we go out # If it is not available, we go out
if not puedes: if not puedes:
info("The video is NOT available") logger.debug("The video is NOT available")
return {"downloadStatus": STATUS_CODES.error} return {"downloadStatus": STATUS_CODES.error}
else: else:
info("YES Video is available") logger.debug("YES Video is available")
result = {} result = {}
@@ -716,14 +715,14 @@ def download_from_server(item):
def download_from_best_server(item): def download_from_best_server(item):
info("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url)) logger.debug("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url))
result = {"downloadStatus": STATUS_CODES.error} result = {"downloadStatus": STATUS_CODES.error}
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179)) progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179))
try: try:
if item.downloadItemlist: if item.downloadItemlist:
info('using cached servers') logger.debug('using cached servers')
play_items = [Item().fromurl(i) for i in item.downloadItemlist] play_items = [Item().fromurl(i) for i in item.downloadItemlist]
else: else:
if item.contentChannel in ['community', 'videolibrary']: if item.contentChannel in ['community', 'videolibrary']:
@@ -772,11 +771,11 @@ def download_from_best_server(item):
def select_server(item): def select_server(item):
if item.server: if item.server:
return "Auto" return "Auto"
info("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url)) logger.debug("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url))
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179)) progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179))
try: try:
if item.downloadItemlist: if item.downloadItemlist:
info('using cached servers') logger.debug('using cached servers')
play_items = [Item().fromurl(i) for i in item.downloadItemlist] play_items = [Item().fromurl(i) for i in item.downloadItemlist]
else: else:
if item.contentChannel in ['community', 'videolibrary']: if item.contentChannel in ['community', 'videolibrary']:
@@ -818,7 +817,7 @@ def select_server(item):
def start_download(item): def start_download(item):
info("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url)) logger.debug("contentAction: %s | contentChannel: %s | url: %s" % (item.contentAction, item.contentChannel, item.url))
# We already have a server, we just need to download # We already have a server, we just need to download
if item.contentAction == "play": if item.contentAction == "play":
ret = download_from_server(item) ret = download_from_server(item)
@@ -838,7 +837,7 @@ def start_download(item):
def get_episodes(item): def get_episodes(item):
info("contentAction: %s | contentChannel: %s | contentType: %s" % (item.contentAction, item.contentChannel, item.contentType)) logger.debug("contentAction: %s | contentChannel: %s | contentType: %s" % (item.contentAction, item.contentChannel, item.contentType))
if 'dlseason' in item: if 'dlseason' in item:
season = True season = True
@@ -915,7 +914,7 @@ def get_episodes(item):
# Any other result is not worth it, we ignore it # Any other result is not worth it, we ignore it
else: else:
info("Omitiendo item no válido:", episode.tostring()) logger.debug("Omitiendo item no válido:", episode.tostring())
# Any other result is not worth it, we ignore it... # Any other result is not worth it, we ignore it...
# itemlist = videolibrarytools.filter_list(itemlist) # itemlist = videolibrarytools.filter_list(itemlist)
@@ -924,7 +923,7 @@ def get_episodes(item):
def write_json(item): def write_json(item):
info() logger.debug()
channel = item.from_channel if item.from_channel else item.channel channel = item.from_channel if item.from_channel else item.channel
item.action = "menu" item.action = "menu"
@@ -969,7 +968,7 @@ def save_download(item):
def save_download_background(item): def save_download_background(item):
info() logger.debug()
# Menu contextual # Menu contextual
if item.from_action and item.from_channel: if item.from_action and item.from_channel:
item.channel = item.from_channel item.channel = item.from_channel
@@ -1018,7 +1017,7 @@ def save_download_background(item):
def save_download_videolibrary(item): def save_download_videolibrary(item):
info() logger.debug()
show_disclaimer() show_disclaimer()
item.contentChannel = 'videolibrary' item.contentChannel = 'videolibrary'
item.channel = "downloads" item.channel = "downloads"
@@ -1027,7 +1026,7 @@ def save_download_videolibrary(item):
def save_download_video(item): def save_download_video(item):
info("contentAction: %s | contentChannel: %s | contentTitle: %s" % (item.contentAction, item.contentChannel, item.contentTitle)) logger.debug("contentAction: %s | contentChannel: %s | contentTitle: %s" % (item.contentAction, item.contentChannel, item.contentTitle))
set_movie_title(item) set_movie_title(item)
@@ -1042,7 +1041,7 @@ def save_download_video(item):
def save_download_movie(item): def save_download_movie(item):
info("contentAction: %s | contentChannel: %s | contentTitle: %s" % ( item.contentAction, item.contentChannel, item.contentTitle)) logger.debug("contentAction: %s | contentChannel: %s | contentTitle: %s" % ( item.contentAction, item.contentChannel, item.contentTitle))
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70191)) progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70191))
@@ -1076,7 +1075,7 @@ def save_download_movie(item):
def save_download_tvshow(item): def save_download_tvshow(item):
info("contentAction: %s | contentChannel: %s | contentType: %s | contentSerieName: %s" % (item.contentAction, item.contentChannel, item.contentType, item.contentSerieName)) logger.debug("contentAction: %s | contentChannel: %s | contentType: %s | contentSerieName: %s" % (item.contentAction, item.contentChannel, item.contentType, item.contentSerieName))
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70188)) progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70188))
try: try:
item.show = item.fulltitle item.show = item.fulltitle
+1 -1
View File
@@ -166,7 +166,7 @@ class SearchWindow(xbmcgui.WindowXML):
tmdb_info = tmdb.Tmdb(searched_text=self.item.text, search_type=self.item.mode.replace('show', '')) tmdb_info = tmdb.Tmdb(searched_text=self.item.text, search_type=self.item.mode.replace('show', ''))
results = tmdb_info.results results = tmdb_info.results
def make(n, result): def make(n, result):
result = tmdb_info.get_infoLabels(result, origen=result) result = tmdb_info.get_infoLabels(result, origen=result)
if self.item.mode == 'movie': if self.item.mode == 'movie':
+2 -2
View File
@@ -388,7 +388,7 @@ def get_newest(channel_id, categoria):
def get_title(item): def get_title(item):
# support.info("ITEM NEWEST ->", item) # logger.debug("ITEM NEWEST ->", item)
# item.contentSerieName c'è anche se è un film # item.contentSerieName c'è anche se è un film
if item.contentSerieName and item.contentType != 'movie': # Si es una serie if item.contentSerieName and item.contentType != 'movie': # Si es una serie
title = item.contentSerieName title = item.contentSerieName
@@ -442,7 +442,7 @@ def no_group(list_result_canal):
global channels_id_name global channels_id_name
for i in list_result_canal: for i in list_result_canal:
# support.info("NO GROUP i -> ", i) # logger.debug("NO GROUP i -> ", i)
canale = channels_id_name[i.channel] canale = channels_id_name[i.channel]
canale = canale # to differentiate it from the color of the other items canale = canale # to differentiate it from the color of the other items
i.title = get_title(i) + " [" + canale + "]" i.title = get_title(i) + " [" + canale + "]"
+3 -3
View File
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from core import servertools from core import servertools
from core.support import match, info, server from core.support import match, server
from core.item import Item from core.item import Item
from platformcode import config, logger from platformcode import config, logger
def mainlist(item): def mainlist(item):
info() logger.debug()
itemlist = [] itemlist = []
itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60089), thumbnail=item.thumbnail, args='server')) itemlist.append(Item(channel=item.channel, action="search", title=config.get_localized_string(60089), thumbnail=item.thumbnail, args='server'))
@@ -19,7 +19,7 @@ def mainlist(item):
# When the function "search" is called, the launcher asks for a text to search for and adds it as a parameter # When the function "search" is called, the launcher asks for a text to search for and adds it as a parameter
def search(item, text): def search(item, text):
info(text) logger.debug(text)
if not text.startswith("http"): if not text.startswith("http"):
text = "http://" + text text = "http://" + text