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

View File

@@ -75,7 +75,6 @@ headers = [['Referer', host]]
@support.menu
def mainlist(item):
support.info(item)
# Ordine delle voci
# 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.!!!!
@support.scrape
def peliculas(item):
support.info(item)
#support.dbg() # decommentare per attivare web_pdb
action = ''
@@ -161,7 +159,6 @@ def peliculas(item):
@support.scrape
def episodios(item):
support.info(item)
#support.dbg()
action = ''
@@ -178,7 +175,6 @@ def episodios(item):
# per genere, per anno, per lettera, per qualità ecc ecc
@support.scrape
def genres(item):
support.info(item)
#support.dbg()
action = ''
@@ -198,7 +194,7 @@ def genres(item):
# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro
# andranno modificate anche le def peliculas e episodios ove occorre
def select(item):
support.info('select --->', item)
logger.debug()
#support.dbg()
data = httptools.downloadpage(item.url, headers=headers).data
# pulizia di data, in caso commentare le prossime 2 righe
@@ -206,7 +202,7 @@ def select(item):
data = re.sub(r'>\s+<', '> <', data)
block = scrapertools.find_single_match(data, r'')
if re.findall('', data, re.IGNORECASE):
support.info('select = ### è una serie ###')
logger.debug('select = ### è una serie ###')
return episodios(Item(channel=item.channel,
title=item.title,
fulltitle=item.fulltitle,
@@ -219,7 +215,7 @@ def select(item):
############## Fondo Pagina
# da adattare al canale
def search(item, text):
support.info('search', item)
logger.debug(text)
itemlist = []
text = text.replace(' ', '+')
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
@@ -232,7 +228,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info('search log:', line)
logger.error('search log:', line)
return []
@@ -240,7 +236,7 @@ def search(item, text):
# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte
# altrimenti NON inserirlo
def newest(categoria):
support.info('newest ->', categoria)
logger.debug(categoria)
itemlist = []
item = Item()
try:
@@ -255,7 +251,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info('newest log: ', {0}.format(line))
logger.debug('newest log: ', {0}.format(line))
return []
return itemlist
@@ -265,5 +261,5 @@ def newest(categoria):
# sia per i siti con hdpass
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
def findvideos(item):
support.info('findvideos ->', item)
logger.debug()
return support.server(item, headers=headers)

View File

@@ -32,7 +32,7 @@ def mainlist(item):
@support.scrape
def peliculas(item):
disabletmdb = True
tmdbEnabled = False
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>[^<]+)'
return locals()
@@ -66,7 +66,7 @@ def playradio(item):
def search(item, text):
support.info(text)
logger.debug(text)
item.url = host + '/search/' + text
itemlist = []
try:

View File

@@ -2,22 +2,11 @@
# ------------------------------------------------------------
# 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.item import Item
from platformcode import config, logger
# def findhost(url):
# data = httptools.downloadpage(url).data
# 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']),
('Ultimi Aggiornati-Aggiunti', ['','peliculas', 'update']),
('Generi', ['', 'genres', 'genres']),
('Lettera', ['/catalog/a/', 'genres', 'orderalf']),
('Lettera', ['/catalog/a/', 'genres', 'az']),
('Anni', ['', 'genres', 'years']),
('Sub-ITA', ['/sub-ita/', 'peliculas', 'pellicola'])
]
@@ -45,35 +34,32 @@ def mainlist(item):
@support.scrape
def peliculas(item):
support.info('peliculas', item)
## deflang = 'ITA'
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>[^<]+)'
if item.args == "search":
patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">'
elif item.args == 'update':
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>[^"]+)'
elif item.args == 'orderalf':
elif item.args == 'az':
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"' \
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<' \
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
else:
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;'
# debugBlock = True
return locals()
@support.scrape
def genres(item):
support.info('genres',item)
action = "peliculas"
blacklist = ['Altadefinizione01']
@@ -83,16 +69,14 @@ def genres(item):
elif item.args == 'years':
patronBlock = r'<ul class="anno_list">(?P<block>.*?)</li> </ul> </div>'
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">'
patronMenu = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
#debug = True
return locals()
@support.scrape
def orderalf(item):
support.info('orderalf',item)
def az(item):
action = 'findvideos'
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
@@ -103,7 +87,7 @@ def orderalf(item):
def search(item, text):
support.info(item, text)
logger.debug(text)
itemlist = []
@@ -120,7 +104,7 @@ def search(item, text):
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
@@ -142,7 +126,7 @@ def newest(categoria):
return itemlist
def findvideos(item):
support.info('findvideos', item)
logger.debug()
data = httptools.downloadpage(item.url).data
iframe = support.match(data, patron='player-container[^>]+>\s*<iframe[^>]+src="([^"]+)').match
if iframe:

View File

@@ -15,8 +15,6 @@ headers = [['Referer', host]]
# =========== home menu ===================
@support.menu
def mainlist(item):
support.info('mainlist',item)
film = [
('Al Cinema', ['/film-del-cinema', 'peliculas', '']),
('Generi', ['', 'genres', 'genres']),
@@ -39,7 +37,6 @@ def peliculas(item):
# =========== def pagina categorie ======================================
@support.scrape
def genres(item):
support.info('genres',item)
action = 'peliculas'
if item.args == 'genres':
@@ -57,7 +54,7 @@ def genres(item):
# =========== def per cercare film/serietv =============
#host+/index.php?do=search&story=avatar&subaction=search
def search(item, text):
support.info('search', item)
logger.debug(text)
itemlist = []
text = text.replace(" ", "+")
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 newest(categoria):
support.info('newest', categoria)
logger.debug(categoria)
itemlist = []
item = Item()
try:
@@ -95,5 +92,5 @@ def newest(categoria):
return itemlist
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)

View File

@@ -82,22 +82,22 @@ def genres(item):
return locals()
def search(item, texto):
support.info("search ", texto)
def search(item, text):
logger.debug(text)
item.args = 'search'
item.url = host + "?s=" + texto
item.url = host + "?s=" + text
try:
return peliculas(item)
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
try:

View File

@@ -132,7 +132,7 @@ def peliculas(item):
json = {}
if item.contentType == 'undefined':
# disabletmdb = True
# tmdbEnabled = False
action = 'check'
elif item.contentType == 'movie':
action = 'findvideos'
@@ -159,7 +159,7 @@ def peliculas(item):
url = '='.join(spl[:-1])
page = str(int(spl[-1])+1)
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 locals()
@@ -176,7 +176,7 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []

View File

@@ -3,7 +3,9 @@
# Canale per animealtadefinizione
# ----------------------------------------------------------
from platformcode import platformtools
from core import support
from platformcode import logger
host = support.config.get_channel_url()
headers = [['Referer', host]]
@@ -33,21 +35,21 @@ def menu(item):
return locals()
def search(item, texto):
support.info(texto)
item.search = texto
def search(item, text):
logger.debug(text)
item.search = text
try:
return peliculas(item)
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
if categoria == "anime":
@@ -58,7 +60,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
@@ -79,10 +81,15 @@ def peliculas(item):
else:
query='category_name'
searchtext = item.url.split('/')[-2]
if not item.pag: item.pag = 1
# debug = True
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('\\','')
page = 1 if not item.page else item.page
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'
typeContentDict = {'movie':['movie']}
typeActionDict = {'findvideos':['movie']}
@@ -91,15 +98,14 @@ def peliculas(item):
if item.search:
itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ]
if len(itemlist) == int(perpage):
item.pag += 1
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas'))
support.nextPage(itemlist, item, function_or_level='peliculas', page=page + 1, total_pages=int(res.match))
return itemlist
return locals()
@support.scrape
def episodios(item):
anime = True
numerationEnabled = True
pagination = int(perpage)
patron = epPatron
return locals()

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url()
headers = [['Referer', host]]
@@ -38,7 +39,7 @@ def submenu(item):
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = support.Item()
try:
@@ -51,13 +52,13 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def search(item, text):
support.info('search',text)
logger.debug(text)
item.search = text
item.url = host + '/lista-anime/'
item.contentType = 'tvshow'
@@ -67,14 +68,14 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
@support.scrape
def peliculas(item):
search = item.search
anime = True
numerationEnabled = True
if 'movie' in item.url:
action = 'findvideos'
else:
@@ -108,7 +109,7 @@ def check(item):
@support.scrape
def episodios(item):
anime = True
numerationEnabled = True
data = item.data
if '<h6>Streaming</h6>' in data:
@@ -116,7 +117,6 @@ def episodios(item):
else:
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">'
def itemHook(item):
support.info(item)
if item.url.startswith('//'): item.url= 'https:' + item.url
elif item.url.startswith('/'): item.url= 'https:/' + item.url
return item
@@ -125,7 +125,7 @@ def episodios(item):
def findvideos(item):
support.info(item)
logger.debug()
itemlist = []
if 'adf.ly' in item.url:

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
from lib.js2py.host import jsfunctions
host = support.config.get_channel_url()
@@ -30,10 +31,10 @@ def mainlist(item):
return locals()
def search(item, texto):
support.info(texto)
def search(item, text):
logger.debug(text)
item.url = host + "/?s=" + texto
item.url = host + "/?s=" + text
try:
return peliculas(item)
@@ -41,7 +42,7 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
@@ -56,7 +57,7 @@ def genres(item):
@support.scrape
def peliculas(item):
anime = True
numerationEnabled = True
blacklist = ['top 10 anime da vedere']
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>[^"]+)"[^>]+'
@@ -83,7 +84,7 @@ def peliculas(item):
def episodios(item):
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:
support.info('NOT IN DATA')
logger.debug('NOT IN DATA')
patron = r'<iframe.*?src="(?P<url>[^"]+)"'
title = item.title
def fullItemlistHook(itemlist):
@@ -100,7 +101,7 @@ def episodios(item):
return itemlist
else:
url = item.url
anime = True
numerationEnabled = True
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+)'
def itemHook(item):
@@ -124,7 +125,7 @@ def check(item):
return data
def findvideos(item):
support.info()
logger.debug()
if item.data:
data = item.data
else:

View File

@@ -3,9 +3,8 @@
# Canale per AnimeSaturn
# ----------------------------------------------------------
from lib import js2py
from core import support
from platformcode import config
from platformcode import logger
host = support.config.get_channel_url()
__channel__ = 'animesaturn'
@@ -43,9 +42,9 @@ def mainlist(item):
return locals()
def search(item, texto):
support.info(texto)
item.url = host + '/animelist?search=' + texto
def search(item, text):
logger.debug(text)
item.url = host + '/animelist?search=' + text
item.contentType = 'tvshow'
try:
return peliculas(item)
@@ -53,12 +52,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info()
logger.debug(categoria)
itemlist = []
item = support.Item()
try:
@@ -70,7 +69,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
@@ -110,7 +109,7 @@ def menu(item):
@support.scrape
def peliculas(item):
anime = True
numerationEnabled = True
deflang= 'Sub-ITA'
action = 'check'
@@ -169,13 +168,13 @@ def check(item):
@support.scrape
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>'
return locals()
def findvideos(item):
support.info()
logger.debug()
itemlist = []
links = []
# page_data = ''

View File

@@ -4,11 +4,8 @@
# ------------------------------------------------------------
import cloudscraper, json, copy, inspect
from core import jsontools, support, httptools, filetools
from core import jsontools, support
from platformcode import autorenumber, logger
import re
import xbmc
session = cloudscraper.create_scraper()
@@ -54,7 +51,7 @@ def menu(item):
def genres(item):
support.info()
logger.debug()
# support.dbg()
itemlist = []
@@ -66,7 +63,7 @@ def genres(item):
return support.thumb(itemlist)
def years(item):
support.info()
logger.debug()
itemlist = []
from datetime import datetime
@@ -80,7 +77,7 @@ def years(item):
def search(item, text):
support.info('search', item)
logger.debug(text)
if not item.args:
item.args = {'title':text}
else:
@@ -93,12 +90,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.debug('search log:', line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = support.Item()
item.url = host
@@ -112,13 +109,13 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info(line)
logger.debug(line)
return []
return itemlist
def news(item):
support.info()
logger.debug()
item.contentType = 'episode'
itemlist = []
import cloudscraper
@@ -143,7 +140,7 @@ def news(item):
def peliculas(item):
support.info()
logger.debug()
itemlist = []
page = item.page if item.page else 0
@@ -196,7 +193,7 @@ def peliculas(item):
return itemlist
def episodios(item):
support.info()
logger.debug()
itemlist = []
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
for it in item.episodes:

View File

@@ -4,6 +4,7 @@
# ----------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url()
headers = {}
@@ -34,21 +35,21 @@ def menu(item):
return locals()
def search(item, texto):
support.info(texto)
item.search = texto
def search(item, text):
logger.debug(text)
item.search = text
try:
return peliculas(item)
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
if categoria == "anime":
@@ -59,7 +60,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
@@ -85,7 +86,7 @@ def peliculas(item):
searchtext = item.url.split('/')[-2] if item.url != host else ''
if not item.pag: item.pag = 1
anime=True
numerationEnabled = False
# 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('\\','')
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
def episodios(item):
anime = True
numerationEnabled = True
pagination = int(perpage)
patron = epPatron
return locals()

View File

@@ -5,6 +5,7 @@
# ----------------------------------------------------------
from core import httptools, support, jsontools
from platformcode import logger
host = support.config.get_channel_url()
__channel__ = 'animeworld'
@@ -86,7 +87,7 @@ def submenu(item):
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
if categoria == "anime":
@@ -97,12 +98,12 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
def search(item, texto):
support.info(texto)
logger.debug(texto)
if item.search:
item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort='
else:
@@ -115,13 +116,13 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
@support.scrape
def peliculas(item):
anime = True
numerationEnabled = 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
data = get_data(item)
@@ -153,20 +154,20 @@ def peliculas(item):
@support.scrape
def episodios(item):
data = get_data(item)
anime = True
pagination = 50
numerationEnabled = True
# pagination = 50
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>[^<]+))?'
def itemHook(item):
item.title = item.fulltitle
return item
# def itemHook(item):
# item.title = item.fulltitle
# return item
action='findvideos'
return locals()
def findvideos(item):
import time
support.info(item)
logger.debug()
itemlist = []
urls = []
# 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
itemlist.append(item.clone(action="play", title=title, url=url, server='directo'))
else:
dataJson = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).data
json = jsontools.load(dataJson)
json = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).response.json
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'))
else: urls.append(json['grabber'])

View File

@@ -93,7 +93,7 @@ def submenu_top_of(item):
def search(item, texto):
support.info(texto)
logger.debug(texto)
item.url = host + '/api/anime/advanced-search'
item.variable = '&query=' + texto
@@ -103,12 +103,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
if categoria == "anime":
@@ -117,7 +117,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []

View File

@@ -5,6 +5,7 @@
from core import support
from platformcode import logger
host = support.config.get_channel_url()
headers = [['Referer', host]]
@@ -38,17 +39,17 @@ def genres(item):
def select(item):
item.data = support.match(item).data
if 'continua con il video' in item.data.lower():
support.info('select = ### è un film ###')
logger.debug('select = ### è un film ###')
item.contentType = 'movie'
return findvideos(item)
else:
support.info('select = ### è una serie ###')
logger.debug('select = ### è una serie ###')
item.contentType = 'tvshow'
return episodios(item)
def search(item, text):
support.info(text)
logger.debug(text)
text = text.replace(' ', '+')
item.url = host + '/?s=' + text
item.args = 'search'
@@ -58,7 +59,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error(line)
return []
@@ -86,7 +87,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info("%s" % line)
logger.error(line)
return []
return itemlist
@@ -148,7 +149,7 @@ def findvideos(item):
data = ''
from lib.unshortenit import unshorten_only
for link in links:
support.info('URL=',link)
logger.debug('URL=',link)
url, c = unshorten_only(link.replace('#', 'speedvideo.net'))
data += url + '\n'
return support.server(item, data)

View File

@@ -5,6 +5,7 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url() + '/cb01-anime-cartoon'
@@ -37,19 +38,19 @@ def menu(item):
def search(item, texto):
support.info(texto)
logger.debug(texto)
item.url = host + "/search/" + texto
try:
return peliculas(item)
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error(line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = support.Item()
try:
@@ -61,7 +62,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
@@ -93,7 +94,7 @@ def check(item):
@support.scrape
def episodios(item):
support.info('EPISODIOS ', item.data)
logger.debug('EPISODIOS ', item.data)
data = ''
matches = item.data
season = 1

View File

@@ -55,7 +55,7 @@ def menu(item):
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
@@ -133,60 +133,66 @@ def peliculas(item):
return locals()
@support.scrape
def episodios(item):
@support.scrape
def folder(item, data):
"""
Quando c'è un link ad una cartella contenente più stagioni
"""
def listed(item, data):
actLike = 'episodios'
addVideolibrary = False
downloadEnabled = False
disableAll = True
folderUrl = scrapertools.find_single_match(data, r'TUTTA 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>[^"]+)[^>]+>'
sceneTitle = True
# debug = True
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[^>]*>'
patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:&#215;|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*&#8211;|\s*-|\s*<).*?)(?:<\/p>|<br)'
return locals()
@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()
# debugBlock=True
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[^>]*>'
patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:&#215;|×)[0-9]+)\s*(?P<title2>.*?)?(?:\s*&#8211;|\s*-|\s*<).*?)(?:<\/p>|<br)'
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
itemDict = {'ITA':{}, 'Sub-ITA':{}}
seasons = []
for key, value in title_dict.items():
itlist.append(value)
for it in itemlist:
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):

View File

@@ -7,7 +7,7 @@ import re
from core import httptools, support, scrapertools
from core.item import Item
from platformcode import config
from platformcode import config, logger
# rimanda a .today che contiene tutti link a .plus
@@ -90,13 +90,13 @@ def episodios(item):
data=item.data
# debug=True
if item.args == 'anime':
support.info("Anime :", item)
logger.debug("Anime :", item)
# blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo']
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">)'
# item.contentType = 'tvshow'
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|$)'
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'
@@ -122,7 +122,7 @@ def genres(item):
def search(item, texto):
support.info(item.url,texto)
logger.debug(item.url,texto)
texto = texto.replace(' ', '+')
item.url = host + "/?s=" + texto
# item.contentType = 'tv'
@@ -133,11 +133,11 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.info("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info('newest ->', categoria)
logger.debug('newest ->', categoria)
itemlist = []
item = Item()
item.args = 'newest'
@@ -151,14 +151,14 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info('newest log: ', (line))
logger.error('newest log: ', (line))
return []
return itemlist
def check(item):
support.info()
logger.debug()
data = support.match(item.url, headers=headers).data
if data:
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
@@ -192,6 +192,6 @@ def check(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
return support.server(item, data=item.data)

View File

@@ -2,9 +2,9 @@
# ------------------------------------------------------------
# Canale per cinetecadibologna
# ------------------------------------------------------------
from core.item import Item
from core import support
from platformcode import logger
host = support.config.get_channel_url()
@@ -34,7 +34,7 @@ def menu(item):
def search(item, text):
support.info(text)
logger.debug(text)
item.args = 'noorder'
item.url = host + '/ricerca/type_ALL/ricerca_' + text
item.contentType = 'movie'
@@ -44,7 +44,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
@@ -62,7 +62,7 @@ def peliculas(item):
def findvideos(item):
support.info()
logger.debug()
itemlist = []
matches = support.match(item, patron=r'filename: "(.*?)"').matches

View File

@@ -55,7 +55,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return itemlist

View File

@@ -4,14 +4,13 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url()
headers = [['Referer', host]]
@support.menu
def mainlist(item):
support.info(item)
anime = ['/search?typeY=tv',
('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']),
('OAV', ['/search?typeY=oav', 'peliculas', '', 'tvshow']),
@@ -37,7 +36,6 @@ def menu(item):
patronGenreMenu = patronMenu
def itemHook(item):
support.info(item.type)
for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches:
item.url = host + '/search?' + Type + 'Y=' + ID
return item
@@ -45,7 +43,7 @@ def menu(item):
def search(item, text):
support.info(text)
logger.debug(text)
text = text.replace(' ', '+')
item.url = host + '/search/' + text
@@ -56,12 +54,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error('search log:', line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
if categoria == "anime":
@@ -72,7 +70,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
@@ -80,7 +78,7 @@ def newest(categoria):
@support.scrape
def peliculas(item):
# debug = True
anime = True
numerationEnabled = True
if 'movie' in item.url:
item.contentType = 'movie'
action = 'findvideos'
@@ -105,7 +103,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
anime = True
numerationEnabled = True
pagination = 100
if item.data:
@@ -118,7 +116,7 @@ def episodios(item):
def findvideos(item):
itemlist = []
support.info()
logger.debug()
# support.dbg()
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:
itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid'))
else:
support.info('VIDEO')
logger.debug('VIDEO')
for url in matches.matches:
lang = url.split('/')[-2]
if 'ita' in lang.lower():

View File

@@ -33,7 +33,7 @@ def menu(item):
return locals()
def newest(categoria):
support.info()
logger.debug()
item = Item()
try:
if categoria == "documentales":
@@ -45,12 +45,12 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
def search(item, texto):
support.info(texto)
logger.debug(texto)
item.url = host + "/?s=" + texto
try:
return peliculas(item)
@@ -133,7 +133,7 @@ def episodios(item):
def findvideos(item):
support.info()
logger.debug()
if item.args == 'raccolta' or item.contentType == 'episode':
return support.server(item, item.url)
else:

View File

@@ -4,8 +4,9 @@
# by Greko
# ------------------------------------------------------------
from core import httptools, support
from core import support
from core.item import Item
from platformcode import logger
# def findhost(url):
# permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
@@ -17,7 +18,6 @@ headers = [['Referer', host]]
@support.menu
def mainlist(item):
support.info()
tvshow = []
anime = ['/category/anime-cartoni-animati/']
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest']),
@@ -58,10 +58,10 @@ def episodios(item):
return locals()
def search(item, texto):
support.info()
def search(item, text):
logger.debug(text)
item.url = "%s/?s=%s" % (host, texto)
item.url = "%s/?s=%s" % (host, text)
item.contentType = 'tvshow'
try:
@@ -71,12 +71,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.info(line)
logger.error(line)
return []
def newest(categoria):
support.info()
logger.debug()
itemlist = []
item = Item()
@@ -90,12 +90,12 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def findvideos(item):
support.info()
logger.debug()
return support.server(item, item.data)

View File

@@ -16,10 +16,9 @@
- SOLO SUB-ITA
"""
from core import support, httptools, scrapertools
from core import support, httptools
from core.item import Item
from core.support import info
from platformcode import config
from platformcode import config, logger
host = config.get_channel_url()
headers = [['Referer', host]]
@@ -40,7 +39,6 @@ def mainlist(item):
@support.scrape
def peliculas(item):
support.info(item)
# support.dbg()
deflang = 'Sub-ITA'
@@ -97,13 +95,12 @@ def episodios_args(item):
@support.scrape
def episodios(item):
support.info(item)
return episodios_args(item)
@support.scrape
def genres(item):
support.info()
logger.debug()
#support.dbg()
action = 'peliculas'
@@ -120,7 +117,7 @@ def genres(item):
def search(item, text):
support.info('search', item)
logger.debug('search', text)
text = text.replace(' ', '+')
item.url = host + '?s=' + text
try:
@@ -131,12 +128,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info('search log:', line)
logger.error('search log:', line)
return []
def newest(categoria):
support.info('newest ->', categoria)
logger.debug('newest ->', categoria)
itemlist = []
item = Item()
if categoria == 'series':
@@ -153,14 +150,14 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info('newest log: ', line)
logger.error('newest log: ', line)
return []
return itemlist
def findvideos(item):
support.info('findvideos ->', item)
logger.debug('findvideos ->', item)
patron = r'<a href="([^"]+)">'
itemlist = []

View File

@@ -15,7 +15,7 @@ import re
from core import httptools, support
from core.item import Item
from platformcode import config
from platformcode import config, logger
host = config.get_channel_url()
@@ -41,7 +41,6 @@ def mainlist(item):
@support.scrape
def peliculas(item):
support.info()
if item.args == 'search':
action = ''
@@ -88,8 +87,6 @@ def peliculas(item):
@support.scrape
def episodios(item):
support.info()
action = 'findvideos'
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+)[^<]+<'
@@ -98,8 +95,6 @@ def episodios(item):
@support.scrape
def genres(item):
support.info()
if item.contentType == 'movie':
action = 'peliculas'
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
@@ -115,7 +110,7 @@ def genres(item):
def search(item, text):
support.info('search', item)
logger.debug('search', text)
text = text.replace(' ', '+')
item.url = host + '/search/?s=' + text
@@ -126,11 +121,11 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error('search log:', line)
return []
def newest(categoria):
support.info('newest ->', categoria)
logger.debug('newest ->', categoria)
itemlist = []
item = Item()
try:
@@ -146,11 +141,11 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info({0}.format(line))
logger.error({0}.format(line))
return []
return itemlist
def findvideos(item):
support.info()
logger.debug()
return support.server(item)

View File

@@ -11,7 +11,6 @@
# possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità
from core import support
from core.support import info
from platformcode import logger, config
host = config.get_channel_url()
@@ -51,7 +50,7 @@ def episodios(item):
def search(item, text):
support.info('search', text)
logger.debug('search', text)
item.contentType = 'tvshow'
itemlist = []
text = text.replace(' ', '+')
@@ -61,7 +60,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info('search log:', line)
logger.error('search log:', line)
return []

View File

@@ -16,8 +16,7 @@
from core import support
from core.item import Item
from platformcode import config
from core.support import info
from platformcode import config, logger
host = config.get_channel_url()
headers = [['Referer', host]]
@@ -38,7 +37,7 @@ def mainlist(item):
##@support.scrape
##def peliculas(item):
#### import web_pdb; web_pdb.set_trace()
## info('peliculas ->\n', item)
## logger.debug('peliculas ->\n', item)
##
## action = 'episodios'
## 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
def peliculas(item):
## import web_pdb; web_pdb.set_trace()
info('peliculas ->\n', item)
logger.debug('peliculas ->\n', item)
action = 'episodios'
blacklist = ['DMCA']
@@ -120,7 +119,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
info()
logger.debug()
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>[^>]+)">'
@@ -136,7 +135,7 @@ def episodios(item):
@support.scrape
def genres(item):
info()
logger.debug()
action = 'peliculas'
patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>'
@@ -146,7 +145,7 @@ def genres(item):
def search(item, text):
info(text)
logger.debug(text)
item.url = host + "/?s=" + text
item.contentType = 'tvshow'
item.args = 'search'
@@ -156,12 +155,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
info()
logger.debug()
itemlist = []
item = Item()
item.contentType = 'tvshow'
@@ -176,12 +175,12 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
info("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def findvideos(item):
info('--->', item)
logger.debug('--->', item)
return support.server(item, item.url)

View File

@@ -10,9 +10,9 @@
# possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito)
from core.support import info
from core import support
from platformcode import config
from platformcode import config, logger
host = config.get_channel_url()
headers = [['Referer', host]]
@@ -40,7 +40,7 @@ def episodios(item):
return locals()
def search(item, text):
info(text)
logger.debug(text)
item.contentType = 'tvshow'
item.url = host + "/?s=" + text
try:
@@ -49,11 +49,11 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info("%s" % line)
logger.error("%s" % line)
return []
def findvideos(item):
support.info('findvideos', item)
logger.debug('findvideos', item)
data = support.match(item, headers=headers, patron=r'div class="movieplay">([^>]+)').matches
return support.server(item, data=data )

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url()
@@ -43,7 +44,7 @@ def genre(item):
def search(item, text):
support.info(text)
logger.debug(text)
item.url = host + '/?s=' + text
try:
return peliculas(item)
@@ -51,7 +52,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("search except: %s" % line)
logger.error("search except: %s" % line)
return []

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
# def findhost(url):
# data = support.httptools.downloadpage(url).data
@@ -11,7 +12,7 @@ from core import support
# return url[:-1] if url.endswith('/') else url
host = support.config.get_channel_url()
support.info('HOST',host)
logger.debug('HOST',host)
# host = 'https://ilcorsaronero.xyz'
headers = [['Referer', host]]
@@ -65,7 +66,7 @@ def peliculas(item):
def search(item, text):
support.info(item, text)
logger.debug( text)
if 'all' in item.args:
item.url += text
else:
@@ -76,7 +77,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("search except: %s" % line)
logger.error("search except: %s" % line)
return []

View File

@@ -6,16 +6,14 @@
from core import support
from core.support import info
from core.item import Item
from platformcode import config
from platformcode import config, logger
host = config.get_channel_url()
headers = [['Referer', host]]
@support.menu
def mainlist(item):
support.info(item)
film = ['/film/',
('Generi',['', 'genres', 'genres']),
@@ -46,7 +44,7 @@ def mainlist(item):
@support.scrape
def peliculas(item):
info()
logger.debug()
# debugBlock = True
# debug=True
@@ -96,7 +94,7 @@ def peliculas(item):
@support.scrape
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>'
patron = r'<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)">.*?'\
@@ -108,7 +106,7 @@ def episodios(item):
@support.scrape
def genres(item):
info(item)
logger.debug(item)
action='peliculas'
if item.args == 'genres':
@@ -126,7 +124,7 @@ def genres(item):
def search(item, text):
info(text)
logger.debug(text)
import uuid
text = text.replace(' ', '+')
item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text
@@ -136,12 +134,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
@@ -162,14 +160,14 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
info("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def findvideos(item):
info()
logger.debug()
matches = support.match(item, patron=[r'var ilinks\s?=\s?([^;]+)',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
itemlist = []
list_url = []

View File

@@ -5,9 +5,8 @@
from core import support
from core.support import info
from core.item import Item
from platformcode import config
from platformcode import config, logger
host = config.get_channel_url()
headers = [['Referer', host]]
@@ -54,7 +53,7 @@ def genres(item):
return locals()
def search(item, text):
info(text)
logger.debug(text)
text = text.replace(' ', '+')
item.url = host + "/search/" + text
try:
@@ -62,12 +61,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
@@ -81,14 +80,14 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
info("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def findvideos(item):
info()
logger.debug()
urls = []
data = support.match(item).data
urls += support.match(data, patron=r'id="urlEmbed" value="([^"]+)').matches

View File

@@ -71,9 +71,9 @@ def category(item):
return locals()
def search(item, texto):
support.info("s=", texto)
item.url = host + "/?s=" + texto
def search(item, text):
logger.debug(text)
item.url = host + "/?s=" + text
item.contentType = 'tvshow'
try:
return peliculas(item)
@@ -81,12 +81,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.info("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info("newest", categoria)
logger.debug("newest", categoria)
itemlist = []
item = Item()
try:

View File

@@ -5,6 +5,7 @@
import requests
from core import support
from platformcode import logger
DRM = 'com.widevine.alpha'
key_widevine = "https://la7.prod.conax.cloud/widevine/license"
@@ -69,6 +70,7 @@ def replay(item):
return locals()
def search(item, text):
logger.debug(text)
item.url = host + '/tutti-i-programmi'
item.search = text
try:
@@ -76,15 +78,15 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error('search log:', line)
return []
@support.scrape
def peliculas(item):
search = item.search
disabletmdb = True
addVideolibrary = False
tmdbEnabled = False
videlibraryEnabled = False
downloadEnabled = False
action = 'episodios'
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>[^"]+)"'
patronNext = r'<a href="([^"]+)">'
addVideolibrary = False
videlibraryEnabled = False
downloadEnabled = False
def itemHook(item):
@@ -128,7 +130,7 @@ def episodios(item):
def play(item):
support.info()
logger.debug()
if item.livefilter:
for it in live(item):
if it.fulltitle == item.livefilter:

View File

@@ -103,7 +103,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []

View File

@@ -104,7 +104,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return itemlist

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import support, config
from platformcode import logger
host = 'https://metalvideo.com'
headers = {'X-Requested-With': 'XMLHttpRequest'}
@@ -49,7 +50,7 @@ def findvideos(item):
def search(item, text):
support.info(text)
logger.debug(text)
item.url = host + '/search.php?keywords=' + text + '&video-id='
try:
return peliculas(item)
@@ -57,5 +58,5 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []

View File

@@ -4,6 +4,7 @@
# ----------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url()
headers = {'Referer': host}
@@ -30,7 +31,7 @@ def mainlist(item):
def search(item, text):
support.info(text)
logger.debug(text)
if item.contentType == 'movie' or item.extra == 'movie':
action = 'findvideos'
else:
@@ -43,12 +44,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
if categoria == "series":
@@ -64,14 +65,14 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
@support.scrape
def peliculas(item):
pagination = ''
anime = True
numerationEnabled = True
patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"'
action = 'findvideos'
# 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}))?"[^>]*>'
if item.contentType == 'tvshow':
action = 'episodios'
anime = True
numerationEnabled = True
return locals()
@support.scrape
def episodios(item):
anime = True
numerationEnabled = True
pagination = 50
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>'

View File

@@ -5,7 +5,8 @@
from core import support
from core.support import config, info
from core.support import config
from platformcode import logger
host = config.get_channel_url()
headers = [['Referer', host]]
@@ -23,7 +24,7 @@ def mainlist(item):
def search(item, texto):
info(texto)
logger.debug(texto)
item.url = host + "/?s=" + texto
try:
return peliculas(item)
@@ -31,12 +32,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = support.Item()
try:
@@ -56,7 +57,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist

View File

@@ -6,7 +6,7 @@
from core import support, jsontools
from core.item import Item
from platformcode import config
from platformcode import config, logger
import datetime
host = config.get_channel_url()
@@ -34,7 +34,7 @@ def mainlist(item):
return locals()
def newest(categoria):
support.info()
logger.debug()
item = Item()
if categoria == 'peliculas':
item.contentType = 'movie'
@@ -45,7 +45,7 @@ def newest(categoria):
return peliculas(item)
def peliculas(item):
support.info()
logger.debug()
itemlist = []
data = support.match(item.url, headers=headers).data
@@ -67,7 +67,7 @@ def peliculas(item):
return itemlist
def episodios(item):
support.info()
logger.debug()
itemlist = []
data = support.match(item.url, headers=headers).data
json_object = jsontools.load(data)
@@ -83,7 +83,7 @@ def episodios(item):
return itemlist
def get_season(item, seas_url, seasonNumber):
support.info()
logger.debug()
itemlist = []
data = support.match(seas_url, headers=headers).data
json_object = jsontools.load(data)
@@ -97,7 +97,7 @@ def get_season(item, seas_url, seasonNumber):
return itemlist[::-1]
def search(item, texto):
support.info(item.url, "search", texto)
logger.debug(item.url, "search", texto)
itemlist=[]
try:
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
@@ -118,12 +118,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def search_movie_by_genre(item):
support.info()
logger.debug()
itemlist = []
data = support.match(item.url, headers=headers).data
json_object = jsontools.load(data)
@@ -137,7 +137,7 @@ def search_movie_by_genre(item):
def search_movie_by_year(item):
support.info()
logger.debug()
now = datetime.datetime.now()
year = int(now.year)
itemlist = []
@@ -153,7 +153,7 @@ def search_movie_by_year(item):
def findvideos(item):
support.info()
logger.debug()
itemlist = []
try:
data = support.match(item.url, headers=headers).data
@@ -175,7 +175,7 @@ def findvideos(item):
def get_itemlist_element(element,item):
support.info()
logger.debug()
contentSerieName = ''
contentTitle =''
try:

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import support
from platformcode import logger
host = support.config.get_channel_url()
@@ -38,7 +39,7 @@ def menu(item):
def search(item, text):
support.info('search', item)
logger.debug('search', item)
itemlist = []
text = text.replace(' ', '+')
item.url = host + '/search/keyword/' + text
@@ -52,12 +53,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error('search log:', line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = support.Item()
item.url = host
@@ -77,7 +78,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
return itemlist
@@ -109,6 +110,6 @@ def episodios(item):
def findvideos(item):
support.info()
logger.debug()
# match = support.match(item, patron='wstream', debug=True)
return support.server(item)

View File

@@ -83,7 +83,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []

View File

@@ -5,6 +5,7 @@
from core import support
from platformcode import logger
# def findhost(url):
# return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match
@@ -27,7 +28,7 @@ def mainlist(item):
def search(item, texto):
support.info(texto)
logger.debug(texto)
item.contentType = 'tvshow'
@@ -38,12 +39,12 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = support.Item()
@@ -57,7 +58,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
@@ -142,7 +143,7 @@ def menu(item):
def findvideos(item):
item.url = item.url.replace('&amp;', '&')
support.info(item)
logger.debug(item)
if item.args == 'last':
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

View File

@@ -15,9 +15,9 @@
Altrimenti:
- Prima fare la 'Rinumerazione' dal menu contestuale dal titolo della serie
"""
import re
from core import support, httptools, scrapertools
from platformcode import config
from core import support, scrapertools
from platformcode import config, logger
from core.item import Item
@@ -31,7 +31,7 @@ headers = [['Referer', host]]
@support.menu
def mainlist(item):
support.info()
logger.debug()
film = ['/ultimi-film-aggiunti/',
@@ -56,8 +56,8 @@ def mainlist(item):
@support.scrape
def peliculas(item):
support.info()
anime = True
logger.debug()
numerationEnabled = True
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime']
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:
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:
anime = True
numerationEnabled = True
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
else:
# SEZIONE FILM
@@ -106,8 +106,8 @@ def peliculas(item):
@support.scrape
def episodios(item):
support.info()
anime = True
logger.debug()
numerationEnabled = True
action = 'findvideos'
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>'
@@ -121,7 +121,7 @@ def episodios(item):
def search(item, text):
support.info("CERCA :" ,text, item)
logger.debug("CERCA :" ,text, item)
item.url = "%s/?s=%s" % (host, text)
@@ -132,11 +132,11 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.info("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
@@ -155,13 +155,13 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.info("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def findvideos(item):
support.info()
logger.debug()
if item.contentType == 'movie':
return support.server(item, headers=headers)
else:

View File

@@ -9,7 +9,6 @@ import time
from core import httptools, tmdb, scrapertools, support
from core.item import Item
from core.support import info
from platformcode import logger, config
host = config.get_channel_url()
@@ -21,7 +20,6 @@ list_language = IDIOMAS.values()
@support.menu
def mainlist(item):
info()
itemlist = []
tvshowSub = [
('Novità {bold}',[ '', 'peliculas_tv', '', 'tvshow']),
@@ -52,7 +50,7 @@ def cleantitle(scrapedtitle):
# ----------------------------------------------------------------------------------------------------------------
def findvideos(item):
info()
logger.debug()
data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data
data = re.sub(r'\n|\t|\s+', ' ', data)
# recupero il blocco contenente i link
@@ -66,8 +64,8 @@ def findvideos(item):
episodio = item.infoLabels['episode']
patron = r'\.\.:: Episodio %s([\s\S]*?)(<div class="post|..:: Episodio)' % episodio
info(patron)
info(blocco)
logger.debug(patron)
logger.debug(blocco)
matches = scrapertools.find_multiple_matches(blocco, patron)
if len(matches):
@@ -89,7 +87,7 @@ def findvideos(item):
# ----------------------------------------------------------------------------------------------------------------
def lista_serie(item):
info()
logger.debug()
itemlist = []
PERPAGE = 15
@@ -137,7 +135,7 @@ def lista_serie(item):
# ----------------------------------------------------------------------------------------------------------------
def episodios(item, itemlist=[]):
info()
logger.debug()
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?'
patron += r'<p><a href="([^"]+)">'
@@ -212,7 +210,7 @@ def episodios(item, itemlist=[]):
# ----------------------------------------------------------------------------------------------------------------
def peliculas_tv(item):
info()
logger.debug()
itemlist = []
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):
info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
item.url = host
@@ -289,7 +287,7 @@ def newest(categoria):
# ----------------------------------------------------------------------------------------------------------------
def search(item, texto):
info(texto)
logger.debug(texto)
itemlist = []
try:
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
@@ -313,7 +311,7 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
support.info('search log:', line)
logger.error('search log:', line)
return []
return itemlist
@@ -325,7 +323,7 @@ def search(item, texto):
def list_az(item):
info()
logger.debug()
itemlist = []
alphabet = dict()

View File

@@ -8,10 +8,9 @@
"""
import re
from core import support, httptools, scrapertools
from core import support
from core.item import Item
from core.support import info
from platformcode import config
from platformcode import config, logger
host = config.get_channel_url()
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)'
def itemHook(i):
for value, season in seasons:
info(value)
info(season)
logger.debug(value)
logger.debug(season)
i.title = i.title.replace(value+'x',season+'x')
i.other += '\n' + i.url
i.url = item.url
@@ -74,7 +73,7 @@ def genres(item):
def search(item, text):
info(text)
logger.debug(text)
item.url = host + "/?s=" + text
try:
item.contentType = 'tvshow'
@@ -83,12 +82,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
info("%s" % line)
logger.debug("%s" % line)
return []
def newest(categoria):
info(categoria)
logger.debug(categoria)
itemlist = []
item = Item()
try:
@@ -103,14 +102,14 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
info("{0}".format(line))
logger.error("{0}".format(line))
return []
return itemlist
def findvideos(item):
info(item)
logger.debug(item)
if item.args != 'update':
return support.server(item, data=item.other)
else:

View File

@@ -4,8 +4,7 @@
# ------------------------------------------------------------
from core import support, httptools
from core.item import Item
from platformcode import config
from platformcode import config, logger
import sys
if sys.version_info[0] >= 3:
from urllib.parse import unquote
@@ -32,14 +31,14 @@ def mainlist(item):
def search(item, text):
support.info("[streamingaltadefinizione.py] " + item.url + " search " + text)
logger.debug(text)
item.url = item.url + "/?s=" + text
try:
return support.dooplay_search(item)
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []

View File

@@ -3,11 +3,9 @@
# Canale per Tantifilm
# ------------------------------------------------------------
from core import scrapertools, httptools, support
from core import support
from core.item import Item
from core.support import info
from platformcode import logger
from platformcode import config
from platformcode import logger, config
# def findhost(url):
@@ -23,7 +21,7 @@ player_iframe = r'<iframe.*?src="([^"]+)"[^>]+></iframe>\s*<div class="player'
@support.menu
def mainlist(item):
info()
logger.debug()
top = [('Generi', ['', 'category'])]
film = ['/film',
@@ -114,7 +112,7 @@ def category(item):
def search(item, texto):
info(texto)
logger.debug(texto)
item.url = host + "/?s=" + texto
@@ -126,7 +124,7 @@ def search(item, texto):
except:
import sys
for line in sys.exc_info():
logger.error("%s" % line)
logger.error('{}'.format(line))
return []
@@ -155,17 +153,17 @@ def hdpass(item):
def findvideos(item):
info()
support.info("ITEMLIST: ", item)
logger.debug()
logger.debug("ITEMLIST: ", item)
data = support.match(item.url, headers=headers).data
check = support.match(data, patron=r'<div class="category-film">(.*?)</div>').match
if 'sub' in check.lower():
item.contentLanguage = 'Sub-ITA'
support.info("CHECK : ", check)
logger.debug("CHECK : ", check)
if 'anime' in check.lower():
item.contentType = 'tvshow'
item.data = data
support.info('select = ### è una anime ###')
logger.debug('select = ### è una anime ###')
try:
return episodios(item)
except:
@@ -180,7 +178,7 @@ def findvideos(item):
# if 'protectlink' in data:
# urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
# support.info("SONO QUI: ", urls)
# logger.debug("SONO QUI: ", urls)
# for url in urls:
# url = url.decode('base64')
# # tiro via l'ultimo carattere perchè non c'entra
@@ -191,7 +189,7 @@ def findvideos(item):
# if url:
# listurl.add(url)
# data += '\n'.join(listurl)
info(data)
logger.debug(data)
itemlist = []
# support.dbg()
@@ -203,7 +201,7 @@ def findvideos(item):
if item.otherLinks:
urls += support.match(item.otherLinks, patron=r'href="([^"]+)').matches
info('URLS', urls)
logger.debug('URLS', urls)
for u in urls:
if 'hdplayer.casa/series/' in u:
urls.remove(u)

View File

@@ -4,6 +4,7 @@
from core import support, httptools
from core.item import Item
from platformcode import logger
import sys
if sys.version_info[0] >= 3: from concurrent import futures
else: from concurrent_py2 import futures
@@ -26,7 +27,7 @@ def mainlist(item):
def episodios(item):
support.info(item)
logger.debug(item)
itemlist = []
with futures.ThreadPoolExecutor() as executor:
@@ -53,7 +54,7 @@ def genres(item):
def peliculas(item, text=''):
support.info('search', item)
logger.debug('search', item)
itemlist = []
filter_type = False
if item.genre:

View File

@@ -4,6 +4,7 @@
# ------------------------------------------------------------
from core import scrapertools, support
from platformcode import logger
import sys
host = support.config.get_channel_url()
@@ -24,7 +25,7 @@ def mainlist(item):
def search(item, text):
support.info(text)
logger.debug(text)
# item.args='search'
item.text = text
item.url = item.url + '/?a=b&s=' + text.replace(' ', '+')
@@ -35,12 +36,12 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
def newest(categoria):
support.info(categoria)
logger.debug(categoria)
item = support.Item()
try:
item.contentType = 'undefined'
@@ -51,7 +52,7 @@ def newest(categoria):
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
logger.error("{0}".format(line))
return []
@@ -60,7 +61,7 @@ def peliculas(item):
# debugBlock = True
# debug = True
# search = item.text
if item.contentType != 'movie': anime = True
if item.contentType != 'movie': numerationEnabled = True
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
@@ -82,7 +83,7 @@ def peliculas(item):
patronNext = '<a class="next page-numbers" href="([^"]+)">'
def itemHook(item):
support.info(item.title)
logger.debug(item.title)
if item.args == 'sub':
item.title += support.typo('Sub-ITA', 'bold color kod _ []')
item.contentLanguage = 'Sub-ITA'
@@ -92,7 +93,7 @@ def peliculas(item):
@support.scrape
def episodios(item):
anime = True
numerationEnabled = True
# debug = True
patron = r'>\s*(?:(?P<season>\d+)(?:&#215;|x|×))?(?P<episode>\d+)(?:\s+&#8211;\s+)?[ ]+(?P<title2>[^<]+)[ ]+<a (?P<data>.*?)(?:<br|</p)'
# data = ''

View File

@@ -28,7 +28,7 @@ def mainlist(item):
def radio(item):
support.info()
logger.debug()
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>[^"]+)"')
if data.matches:
@@ -85,7 +85,7 @@ def findvideos(item):
def search(item, text):
support.info(text)
logger.debug(text)
item.url = host + '/Search.ashx?query=' +text
try:
return radio(item)

View File

@@ -3,7 +3,7 @@
# Canale per vvvvid
# ----------------------------------------------------------
import requests, sys, inspect
from core import jsontools, support, tmdb
from core import support, tmdb
from platformcode import autorenumber, logger, config
host = support.config.get_channel_url()
@@ -68,7 +68,7 @@ def mainlist(item):
def search(item, text):
support.info(text)
logger.debug(text)
itemlist = []
if conn_id:
if 'film' in item.url: item.contentType = 'movie'
@@ -79,7 +79,7 @@ def search(item, text):
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
logger.error("%s" % line)
return []
return itemlist
@@ -105,7 +105,7 @@ def peliculas(item):
# support.dbg()
if not item.args:
json_file =loadjs(item.url + 'channel/10005/last/')
support.logger.debug(json_file)
logger.debug(json_file)
make_itemlist(itemlist, item, json_file)
itemlist = support.pagination(itemlist, item, item.page if item.page else 1, 20)
if item.contentType != 'movie': autorenumber.start(itemlist)
@@ -241,7 +241,7 @@ def make_itemlist(itemlist, item, data):
def loadjs(url):
if '?category' not in url:
url += '?full=true'
support.info('Json URL;',url)
logger.debug('Json URL;',url)
json = current_session.get(url, headers=headers, params=payload).json()
return json

File diff suppressed because it is too large Load Diff

View File

@@ -109,6 +109,7 @@ class autorenumber():
self.selectspecials = False
self.manual = False
self.auto = False
if self.item:
from core.videolibrarytools import check_renumber_options
check_renumber_options(self.item)
@@ -186,7 +187,7 @@ class autorenumber():
if number in self.episodes:
item.contentSeason = int(self.episodes[number].split('x')[0])
item.contentEpisodeNumber = int(self.episodes[number].split('x')[1])
# support.dbg()
# for i in self.itemlist:
# sub_thread(i)
@@ -203,7 +204,7 @@ class autorenumber():
self.epdict = {}
self.group = self.renumberdict[self.title].get(GROUP, None)
busy(True)
itemlist = find_episodes(self.item)
itemlist = self.itemlist if self.itemlist else find_episodes(self.item)
if not self.group:

View File

@@ -1,6 +1,6 @@
from core import filetools, downloadtools, support
from platformcode import config, platformtools, updater
from platformcode import config, platformtools, updater, logger
import xbmc, xbmcaddon, sys, platform
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)):
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
support.info('OS:', pform)
support.info('Extract IN:', elementum_path)
support.info('URL:', url)
logger.debug('OS:', pform)
logger.debug('Extract IN:', elementum_path)
logger.debug('URL:', url)
if url:
downloadtools.downloadfile(host + url, filename)
extract()
@@ -44,19 +44,19 @@ def download(item=None):
def extract():
import zipfile
from platformcode.updater import fixZipGetHash
support.info('Estraggo Elementum in:', elementum_path)
logger.debug('Estraggo Elementum in:', elementum_path)
try:
# hash = fixZipGetHash(filename)
# support.info(hash)
# logger.debug(hash)
with zipfile.ZipFile(filetools.file_open(filename, 'rb', vfs=False)) as zip_ref:
zip_ref.extractall(xbmc.translatePath(addon_path))
except Exception as e:
support.info('Non sono riuscito ad estrarre il file zip')
support.logger.error(e)
logger.debug('Non sono riuscito ad estrarre il file zip')
logger.error(e)
import traceback
support.logger.error(traceback.print_exc())
logger.error(traceback.print_exc())
def setting():
@@ -74,7 +74,7 @@ def setting():
__settings__.setSetting('do_not_disturb', 'true')
Continue = False
except:
support.info('RIPROVO')
logger.debug('RIPROVO')
xbmc.sleep(100)
else:
if not filetools.exists(elementum_path):

View File

@@ -161,12 +161,21 @@ def run(item=None):
if page and int(page) > -1:
import xbmc
item.action = item.real_action
if item.page:
item.page = page
else:
import re
item.url = re.sub('([=/])[0-9]+(/?)$', '\g<1>{}\g<2>'.format(page), item.url)
item.page = page
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()))
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:
# Checks if channel exists
if os.path.isfile(os.path.join(config.get_runtime_path(), 'channels', item.channel + ".py")):

View File

@@ -666,8 +666,8 @@ def set_context_commands(item, item_url, parent_item, **kwargs):
return context_commands
# 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.nextPage:
context_commands.append((config.get_localized_string(70511), "RunPlugin(%s?%s&%s)" % (sys.argv[0], item_url, 'action=gotopage&real_action='+item.action)))
# 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)))
# 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'):
# context_commands.append((config.get_localized_string(60348), "Action(Info)"))

View File

@@ -3,8 +3,8 @@
import re, os, sys, time, requests, xbmc, xbmcaddon
from core import filetools, jsontools
from core.support import info, match
from platformcode import config, platformtools
from core.support import match
from platformcode import config, platformtools, logger
from lib.guessit import guessit
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:
from platformcode import elementum_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:'):
video_urls = [{'type':'magnet', 'url':page_url}]

View File

@@ -12,12 +12,11 @@ from past.utils import old_div
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.downloader import Downloader
from core.item import Item
from platformcode import config, logger, platformtools
from core.support import info, typo
from servers import torrent
kb = '0xFF65B3DA'
@@ -39,7 +38,7 @@ extensions_list = ['.aaf', '.3gp', '.asf', '.avi', '.flv', '.mpeg', '.m1v', '.m2
def mainlist(item):
info()
logger.debug()
itemlist = []
# File list
@@ -142,7 +141,7 @@ def settings(item):
def browser(item):
info()
logger.debug()
itemlist = []
for file in filetools.listdir(item.url):
@@ -176,7 +175,7 @@ def del_dir(item):
def clean_all(item):
info()
logger.debug()
stop_all()
removeFiles = False
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):
info()
logger.debug()
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
if fichero.endswith(".json"):
@@ -220,7 +219,7 @@ def stop_all(item=None):
def clean_ready(item):
info()
logger.debug()
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
if fichero.endswith(".json"):
download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero)))
@@ -232,7 +231,7 @@ def clean_ready(item):
def restart_error(item):
info()
logger.debug()
for fichero in sorted(filetools.listdir(DOWNLOAD_LIST_PATH)):
if fichero.endswith(".json"):
download_item = Item().fromjson(filetools.read(filetools.join(DOWNLOAD_LIST_PATH, fichero)))
@@ -271,7 +270,7 @@ def download_all_background(item):
def menu(item):
info(item)
logger.debug(item)
if item.downloadServer:
servidor = item.downloadServer.get("server", "Auto")
else:
@@ -367,7 +366,7 @@ def menu(item):
def move_to_libray(item):
info()
logger.debug()
if item.contentType == 'movie':
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)):
clean = True
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)
if file_path.endswith('.strm'):
file_strm_path = file_path
@@ -577,7 +576,7 @@ def sort_method(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"):
save_server_statistics(item.server, 0, 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],
"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 failed
if d.state == d.states.error:
info("Error trying to download", url)
logger.debug("Error trying to download", url)
status = STATUS_CODES.error
# Download has stopped
elif d.state == d.states.stopped:
info("Stop download")
logger.debug("Stop download")
status = STATUS_CODES.canceled
# Download is complete
elif d.state == d.states.completed:
info("Downloaded correctly")
logger.debug("Downloaded correctly")
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)
@@ -637,7 +636,7 @@ def download_from_url(url, item):
def download_from_server(item):
info(item.tostring())
logger.debug(item.tostring())
unsupported_servers = ["torrent"]
if item.contentChannel == 'local':
@@ -667,11 +666,11 @@ def download_from_server(item):
item.video_urls = itemlist
if not item.server: item.server = "directo"
else:
info("There is nothing to reproduce")
logger.debug("There is nothing to reproduce")
return {"downloadStatus": STATUS_CODES.error}
finally:
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':
import xbmcgui
@@ -691,11 +690,11 @@ def download_from_server(item):
# If it is not available, we go out
if not puedes:
info("The video is NOT available")
logger.debug("The video is NOT available")
return {"downloadStatus": STATUS_CODES.error}
else:
info("YES Video is available")
logger.debug("YES Video is available")
result = {}
@@ -716,14 +715,14 @@ def download_from_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}
progreso = platformtools.dialog_progress_bg(config.get_localized_string(30101), config.get_localized_string(70179))
try:
if item.downloadItemlist:
info('using cached servers')
logger.debug('using cached servers')
play_items = [Item().fromurl(i) for i in item.downloadItemlist]
else:
if item.contentChannel in ['community', 'videolibrary']:
@@ -772,11 +771,11 @@ def download_from_best_server(item):
def select_server(item):
if item.server:
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))
try:
if item.downloadItemlist:
info('using cached servers')
logger.debug('using cached servers')
play_items = [Item().fromurl(i) for i in item.downloadItemlist]
else:
if item.contentChannel in ['community', 'videolibrary']:
@@ -818,7 +817,7 @@ def select_server(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
if item.contentAction == "play":
ret = download_from_server(item)
@@ -838,7 +837,7 @@ def start_download(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:
season = True
@@ -915,7 +914,7 @@ def get_episodes(item):
# Any other result is not worth it, we ignore it
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...
# itemlist = videolibrarytools.filter_list(itemlist)
@@ -924,7 +923,7 @@ def get_episodes(item):
def write_json(item):
info()
logger.debug()
channel = item.from_channel if item.from_channel else item.channel
item.action = "menu"
@@ -969,7 +968,7 @@ def save_download(item):
def save_download_background(item):
info()
logger.debug()
# Menu contextual
if item.from_action and item.from_channel:
item.channel = item.from_channel
@@ -1018,7 +1017,7 @@ def save_download_background(item):
def save_download_videolibrary(item):
info()
logger.debug()
show_disclaimer()
item.contentChannel = 'videolibrary'
item.channel = "downloads"
@@ -1027,7 +1026,7 @@ def save_download_videolibrary(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)
@@ -1042,7 +1041,7 @@ def save_download_video(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))
@@ -1076,7 +1075,7 @@ def save_download_movie(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))
try:
item.show = item.fulltitle

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', ''))
results = tmdb_info.results
def make(n, result):
result = tmdb_info.get_infoLabels(result, origen=result)
if self.item.mode == 'movie':

View File

@@ -388,7 +388,7 @@ def get_newest(channel_id, categoria):
def get_title(item):
# support.info("ITEM NEWEST ->", item)
# logger.debug("ITEM NEWEST ->", item)
# item.contentSerieName c'è anche se è un film
if item.contentSerieName and item.contentType != 'movie': # Si es una serie
title = item.contentSerieName
@@ -442,7 +442,7 @@ def no_group(list_result_canal):
global channels_id_name
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 = canale # to differentiate it from the color of the other items
i.title = get_title(i) + " [" + canale + "]"

View File

@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
from core import servertools
from core.support import match, info, server
from core.support import match, server
from core.item import Item
from platformcode import config, logger
def mainlist(item):
info()
logger.debug()
itemlist = []
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
def search(item, text):
info(text)
logger.debug(text)
if not text.startswith("http"):
text = "http://" + text