riscritto logger
This commit is contained in:
@@ -76,7 +76,7 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
|
||||
# Ordine delle voci
|
||||
# Voce FILM, puoi solo impostare l'url
|
||||
@@ -147,7 +147,7 @@ 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.log(item)
|
||||
support.info(item)
|
||||
#support.dbg() # decommentare per attivare web_pdb
|
||||
|
||||
action = ''
|
||||
@@ -162,7 +162,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
#support.dbg()
|
||||
|
||||
action = ''
|
||||
@@ -179,7 +179,7 @@ def episodios(item):
|
||||
# per genere, per anno, per lettera, per qualità ecc ecc
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
#support.dbg()
|
||||
|
||||
action = ''
|
||||
@@ -199,7 +199,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.log('select --->', item)
|
||||
support.info('select --->', item)
|
||||
#support.dbg()
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
# pulizia di data, in caso commentare le prossime 2 righe
|
||||
@@ -207,7 +207,7 @@ def select(item):
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
block = scrapertools.find_single_match(data, r'')
|
||||
if re.findall('', data, re.IGNORECASE):
|
||||
support.log('select = ### è una serie ###')
|
||||
support.info('select = ### è una serie ###')
|
||||
return episodios(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
@@ -220,7 +220,7 @@ def select(item):
|
||||
############## Fondo Pagina
|
||||
# da adattare al canale
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
|
||||
@@ -233,7 +233,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log('search log:', line)
|
||||
info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -241,7 +241,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.log('newest ->', categoria)
|
||||
support.info('newest ->', categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -256,7 +256,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('newest log: ', {0}.format(line))
|
||||
support.info('newest log: ', {0}.format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -266,5 +266,5 @@ def newest(categoria):
|
||||
# sia per i siti con hdpass
|
||||
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
|
||||
def findvideos(item):
|
||||
support.log('findvideos ->', item)
|
||||
support.info('findvideos ->', item)
|
||||
return support.server(item, headers=headers)
|
||||
|
||||
@@ -47,7 +47,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log('peliculas',item)
|
||||
support.info('peliculas', item)
|
||||
|
||||
## deflang = 'ITA'
|
||||
action="findvideos"
|
||||
@@ -69,7 +69,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log('genres',item)
|
||||
support.info('genres',item)
|
||||
|
||||
if item.args != 'orderalf': action = "peliculas"
|
||||
else: action = 'orderalf'
|
||||
@@ -90,7 +90,7 @@ def genres(item):
|
||||
|
||||
@support.scrape
|
||||
def orderalf(item):
|
||||
support.log('orderalf',item)
|
||||
support.info('orderalf',item)
|
||||
|
||||
action= 'findvideos'
|
||||
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
|
||||
@@ -102,7 +102,7 @@ def orderalf(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(item, text)
|
||||
support.info(item, text)
|
||||
|
||||
|
||||
itemlist = []
|
||||
@@ -119,7 +119,7 @@ def search(item, text):
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
@@ -141,5 +141,5 @@ def newest(categoria):
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log('findvideos', item)
|
||||
support.info('findvideos', item)
|
||||
return support.server(item, headers=headers)
|
||||
|
||||
@@ -15,7 +15,7 @@ headers = [['Referer', host]]
|
||||
# =========== home menu ===================
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log('mainlist',item)
|
||||
support.info('mainlist',item)
|
||||
|
||||
film = [
|
||||
('Al Cinema', ['/film-del-cinema', 'peliculas', '']),
|
||||
@@ -33,7 +33,7 @@ def mainlist(item):
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
support.log('peliculas',item)
|
||||
support.info('peliculas',item)
|
||||
|
||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+)[^>]+>[^>]+>)?\s*(?P<quality>[a-zA-Z]+) [^>]+>[^>]+> (?P<lang>[^>]+) [^>]+>'
|
||||
patronNext = r'<span>\d</span> <a href="([^"]+)">'
|
||||
@@ -43,7 +43,7 @@ def peliculas(item):
|
||||
# =========== def pagina categorie ======================================
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log('genres',item)
|
||||
support.info('genres',item)
|
||||
|
||||
action = 'peliculas'
|
||||
if item.args == 'genres':
|
||||
@@ -63,7 +63,7 @@ def genres(item):
|
||||
# =========== def per cercare film/serietv =============
|
||||
#host+/index.php?do=search&story=avatar&subaction=search
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
itemlist = []
|
||||
text = text.replace(" ", "+")
|
||||
item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text)
|
||||
@@ -79,7 +79,7 @@ def search(item, text):
|
||||
# =========== def per le novità nel menu principale =============
|
||||
|
||||
def newest(categoria):
|
||||
support.log('newest', categoria)
|
||||
support.info('newest', categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -101,5 +101,5 @@ def newest(categoria):
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log('findvideos', item)
|
||||
support.info('findvideos', item)
|
||||
return support.server(item, support.match(item, patron='<ul class="playernav">.*?</ul>', headers=headers).match)
|
||||
|
||||
@@ -96,7 +96,7 @@ def genres(item):
|
||||
return locals()
|
||||
|
||||
def search(item, texto):
|
||||
support.log("search ", texto)
|
||||
support.info("search ", texto)
|
||||
|
||||
item.args = 'search'
|
||||
item.url = host + "/?s=" + texto
|
||||
@@ -106,11 +106,11 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -135,7 +135,7 @@ def newest(categoria):
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log('findvideos', item)
|
||||
support.info('findvideos', item)
|
||||
return support.hdpass_get_servers(item)
|
||||
|
||||
def play(item):
|
||||
|
||||
@@ -32,7 +32,7 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.search = texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -40,12 +40,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
@@ -56,7 +56,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ def submenu(item):
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
@@ -49,13 +49,13 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.args = 'noorder'
|
||||
item.url = host + '/?s=' + texto + '&cat=6010'
|
||||
item.contentType = 'tvshow'
|
||||
@@ -65,7 +65,7 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ 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.log(item)
|
||||
support.info(item)
|
||||
if item.url.startswith('//'): item.url= 'https:' + item.url
|
||||
elif item.url.startswith('/'): item.url= 'https:/' + item.url
|
||||
return item
|
||||
@@ -123,7 +123,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
itemlist = []
|
||||
|
||||
if 'adf.ly' in item.url:
|
||||
|
||||
@@ -31,7 +31,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
@@ -41,7 +41,7 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -83,7 +83,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.log('NOT IN DATA')
|
||||
support.info('NOT IN DATA')
|
||||
patron = r'<iframe.*?src="(?P<url>[^"]+)"'
|
||||
title = item.title
|
||||
def fullItemlistHook(itemlist):
|
||||
@@ -124,7 +124,7 @@ def check(item):
|
||||
return data
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
if item.data:
|
||||
data = item.data
|
||||
else:
|
||||
|
||||
@@ -62,7 +62,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.url = host + '/animelist?search=' + texto
|
||||
item.contentType = 'tvshow'
|
||||
try:
|
||||
@@ -71,12 +71,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
@@ -88,7 +88,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -163,7 +163,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
page_data = ''
|
||||
titles =['Primario', 'Secondario', 'Alternativo Primario', 'Alternativo Secondario']
|
||||
|
||||
@@ -51,7 +51,7 @@ def menu(item):
|
||||
|
||||
|
||||
def genres(item):
|
||||
support.log()
|
||||
support.info()
|
||||
# support.dbg()
|
||||
itemlist = []
|
||||
|
||||
@@ -63,7 +63,7 @@ def genres(item):
|
||||
return support.thumb(itemlist)
|
||||
|
||||
def years(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
from datetime import datetime
|
||||
@@ -77,7 +77,7 @@ def years(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
if not item.args:
|
||||
item.args = {'title':text}
|
||||
else:
|
||||
@@ -90,12 +90,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('search log:', line)
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.url = host
|
||||
@@ -109,13 +109,13 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log(line)
|
||||
support.info(line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def news(item):
|
||||
support.log()
|
||||
support.info()
|
||||
item.contentType = 'tvshow'
|
||||
itemlist = []
|
||||
|
||||
@@ -140,7 +140,7 @@ def news(item):
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
page = item.page if item.page else 0
|
||||
@@ -154,7 +154,7 @@ def peliculas(item):
|
||||
payload = json.dumps(item.args)
|
||||
records = requests.post(host + '/archivio/get-animes', headers=headers, data=payload).json()['records']
|
||||
# js = []
|
||||
# support.log(records)
|
||||
# support.info(records)
|
||||
# for record in records:
|
||||
# js += record
|
||||
for it in records:
|
||||
@@ -194,7 +194,7 @@ def peliculas(item):
|
||||
return itemlist
|
||||
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
|
||||
for it in item.episodes:
|
||||
@@ -219,5 +219,5 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
return support.server(item,itemlist=[item.clone(title=support.config.get_localized_string(30137), server='directo', action='play')])
|
||||
@@ -33,7 +33,7 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.search = texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -41,12 +41,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
@@ -57,7 +57,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ def submenu(item):
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
@@ -118,12 +118,12 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
if item.search:
|
||||
item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort='
|
||||
else:
|
||||
@@ -136,7 +136,7 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ def episodios(item):
|
||||
|
||||
def findvideos(item):
|
||||
import time
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
itemlist = []
|
||||
urls = []
|
||||
resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<')
|
||||
|
||||
@@ -39,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.log('select = ### è un film ###')
|
||||
support.info('select = ### è un film ###')
|
||||
item.contentType = 'movie'
|
||||
return findvideos(item)
|
||||
else:
|
||||
support.log('select = ### è una serie ###')
|
||||
support.info('select = ### è una serie ###')
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/?s=' + text
|
||||
item.args = 'search'
|
||||
@@ -59,7 +59,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('search log:', line)
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
support.info("%s" % line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -148,7 +148,7 @@ def findvideos(item):
|
||||
data = ''
|
||||
from lib.unshortenit import unshorten_only
|
||||
for link in links:
|
||||
support.log('URL=',link)
|
||||
support.info('URL=',link)
|
||||
url, c = unshorten_only(link.replace('#', 'speedvideo.net'))
|
||||
data += url + '\n'
|
||||
return support.server(item, data)
|
||||
|
||||
@@ -35,12 +35,12 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
return peliculas(item)
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
@@ -52,7 +52,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -80,7 +80,7 @@ def check(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log('EPISODIOS ', item.data)
|
||||
support.info('EPISODIOS ', item.data)
|
||||
data = ''
|
||||
matches = item.data
|
||||
season = 1
|
||||
|
||||
@@ -55,7 +55,7 @@ def menu(item):
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
|
||||
item = support.Item()
|
||||
try:
|
||||
@@ -71,12 +71,12 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(item.url, "search", text)
|
||||
support.info(item.url, "search", text)
|
||||
|
||||
try:
|
||||
item.url = item.url + "/?s=" + text.replace(' ', '+')
|
||||
@@ -127,7 +127,7 @@ def peliculas(item):
|
||||
def episodios(item):
|
||||
# support.dbg()
|
||||
data = support.match(item.url, headers=headers).data
|
||||
support.log(data)
|
||||
support.info(data)
|
||||
if 'TUTTA LA ' in data:
|
||||
folderUrl = scrapertools.find_single_match(data, r'TUTTA LA \w+\s+(?:–|-)\s+<a href="?([^" ]+)')
|
||||
data = httptools.downloadpage(folderUrl).data
|
||||
@@ -170,14 +170,14 @@ def findvideos(item):
|
||||
|
||||
def load_links(itemlist, re_txt, desc_txt, quality=""):
|
||||
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
|
||||
support.log('STREAMING', streaming)
|
||||
support.log('STREAMING=', streaming)
|
||||
support.info('STREAMING', streaming)
|
||||
support.info('STREAMING=', streaming)
|
||||
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
|
||||
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, server=scrapedtitle, quality=quality))
|
||||
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
itemlist = []
|
||||
|
||||
@@ -210,7 +210,7 @@ def findvideos(item):
|
||||
|
||||
def findvid_serie(item):
|
||||
def load_vid_series(html, item, itemlist, blktxt):
|
||||
support.log('HTML',html)
|
||||
support.info('HTML',html)
|
||||
# Estrae i contenuti
|
||||
matches = support.match(html, patron=r'<a href=(?:")?([^ "]+)[^>]+>(?!<!--)(.*?)(?:</a>|<img)').matches
|
||||
for url, server in matches:
|
||||
@@ -218,7 +218,7 @@ def findvid_serie(item):
|
||||
if 'swzz' in item.url: item.url = support.swzz_get_url(item)
|
||||
itemlist.append(item)
|
||||
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
itemlist = []
|
||||
|
||||
@@ -238,5 +238,5 @@ def findvid_serie(item):
|
||||
|
||||
|
||||
def play(item):
|
||||
support.log()
|
||||
support.info()
|
||||
return servertools.find_video_items(item, data=item.url)
|
||||
|
||||
@@ -89,13 +89,13 @@ def episodios(item):
|
||||
data=item.data
|
||||
# debugBlock=True
|
||||
if item.args == 'anime':
|
||||
support.log("Anime :", item)
|
||||
support.info("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'
|
||||
else:# item.extra == 'serie':
|
||||
support.log("Serie :", item)
|
||||
support.info("Serie :", item)
|
||||
patron = r'(?:>| )(?P<episode>\d+(?:x|×|×)\d+)[;]?[ ]?(?:(?P<title>[^<–-]+)(?P<url>.*?)|(\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'
|
||||
@@ -118,7 +118,7 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(item.url,texto)
|
||||
support.info(item.url,texto)
|
||||
texto = texto.replace(' ', '+')
|
||||
item.url = host + "/?s=" + texto
|
||||
# item.contentType = 'tv'
|
||||
@@ -129,11 +129,11 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
support.info("%s" % line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.log('newest ->', categoria)
|
||||
support.info('newest ->', categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.args = 'newest'
|
||||
@@ -147,13 +147,13 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('newest log: ', (line))
|
||||
support.info('newest log: ', (line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def check(item):
|
||||
support.log()
|
||||
support.info()
|
||||
data = support.match(item.url, headers=headers).data
|
||||
if data:
|
||||
blockAnime = support.match(data, patron=r'<div id="container" class="container">(.+?<div style="margin-left)').match
|
||||
@@ -175,6 +175,6 @@ def check(item):
|
||||
return findvideos(item)
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
item.url = item.url.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca
|
||||
return support.server(item, data= item.url)
|
||||
|
||||
@@ -34,7 +34,7 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(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)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ def peliculas(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
matches = support.match(item, patron=r'filename: "(.*?)"').matches
|
||||
|
||||
@@ -10,7 +10,7 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
|
||||
anime = ['/search?typeY=tv',
|
||||
('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']),
|
||||
@@ -34,7 +34,7 @@ def menu(item):
|
||||
patronMenu = r'<a class="[^"]+" data-state="[^"]+" (?P<other>[^>]+)>[^>]+></i>[^>]+></i>[^>]+></i>(?P<title>[^>]+)</a>'
|
||||
|
||||
def itemHook(item):
|
||||
support.log(item.type)
|
||||
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
|
||||
@@ -42,7 +42,7 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/search/' + text
|
||||
@@ -53,12 +53,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('search log:', line)
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
@@ -69,7 +69,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ def episodios(item):
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
support.log()
|
||||
support.info()
|
||||
# support.dbg()
|
||||
|
||||
matches = support.match(item, patron=r'href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"')
|
||||
@@ -124,7 +124,7 @@ def findvideos(item):
|
||||
itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid'))
|
||||
else:
|
||||
# matches.matches.sort()
|
||||
support.log('VIDEO')
|
||||
support.info('VIDEO')
|
||||
for url in matches.matches:
|
||||
lang = url.split('/')[-2]
|
||||
if 'ita' in lang.lower():
|
||||
|
||||
@@ -33,7 +33,7 @@ def menu(item):
|
||||
return locals()
|
||||
|
||||
def newest(categoria):
|
||||
support.log()
|
||||
support.info()
|
||||
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))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -133,7 +133,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
if item.args == 'raccolta' or item.contentType == 'episode':
|
||||
return support.server(item, item.url)
|
||||
else:
|
||||
|
||||
@@ -17,7 +17,7 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log()
|
||||
support.info()
|
||||
tvshow = []
|
||||
anime = ['/category/anime-cartoni-animati/']
|
||||
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest']),
|
||||
@@ -57,7 +57,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
item.url = "%s/?s=%s" % (host, texto)
|
||||
item.contentType = 'tvshow'
|
||||
@@ -69,12 +69,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log(line)
|
||||
support.info(line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
@@ -88,12 +88,12 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("{0}".format(line))
|
||||
support.info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
return support.server(item, item.url)
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"""
|
||||
from core import support, httptools, scrapertools
|
||||
from core.item import Item
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from platformcode import config
|
||||
|
||||
host = config.get_channel_url()
|
||||
@@ -42,7 +42,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
# support.dbg()
|
||||
deflang = 'Sub-ITA'
|
||||
|
||||
@@ -67,7 +67,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
#support.dbg()
|
||||
|
||||
deflang = 'Sub-ITA'
|
||||
@@ -82,7 +82,7 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log()
|
||||
support.info()
|
||||
#support.dbg()
|
||||
|
||||
action = 'peliculas'
|
||||
@@ -99,7 +99,7 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '?s=' + text
|
||||
try:
|
||||
@@ -110,12 +110,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log('search log:', line)
|
||||
info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log('newest ->', categoria)
|
||||
support.info('newest ->', categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
if categoria == 'series':
|
||||
@@ -132,14 +132,14 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('newest log: ', line)
|
||||
support.info('newest log: ', line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log('findvideos ->', item)
|
||||
support.info('findvideos ->', item)
|
||||
itemlist = []
|
||||
patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">'
|
||||
patron = r'<a href="([^"]+)">'
|
||||
|
||||
@@ -41,7 +41,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
if item.args == 'search':
|
||||
action = ''
|
||||
@@ -88,7 +88,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
action = 'findvideos'
|
||||
patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">'
|
||||
@@ -98,7 +98,7 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
if item.contentType == 'movie':
|
||||
action = 'peliculas'
|
||||
@@ -115,7 +115,7 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/search/?s=' + text
|
||||
@@ -126,11 +126,11 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('search log:', line)
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.log('newest ->', categoria)
|
||||
support.info('newest ->', categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -146,11 +146,11 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log({0}.format(line))
|
||||
support.info({0}.format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
return support.server(item)
|
||||
|
||||
@@ -33,7 +33,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
if item.args != 'newest':
|
||||
patronBlock = r'<ul class="posts">(?P<block>.*)<\/ul>'
|
||||
@@ -94,21 +94,21 @@ def genres(item):
|
||||
|
||||
|
||||
def select(item):
|
||||
support.log()
|
||||
support.info()
|
||||
patron=r'class="taxonomy category" ><span property="name">([^>]+)</span></a><meta property="position" content="2">'
|
||||
block = support.match(item.url, patron=patron,headers=headers).match
|
||||
if block.lower() != 'film':
|
||||
support.log('select = ### è una serie ###')
|
||||
support.info('select = ### è una serie ###')
|
||||
item.contentType='tvshow'
|
||||
return episodios(item)
|
||||
else:
|
||||
support.log('select = ### è un movie ###')
|
||||
support.info('select = ### è un movie ###')
|
||||
item.contentType='movie'
|
||||
return findvideos(item)
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log()
|
||||
support.info()
|
||||
item.url = host + "/?s=" + texto
|
||||
item.contentType = 'episode'
|
||||
item.args = 'search'
|
||||
@@ -118,12 +118,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
support.info("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -144,7 +144,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("{0}".format(line))
|
||||
support.info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
# possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità
|
||||
|
||||
from core import support
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from platformcode import logger, config
|
||||
|
||||
host = config.get_channel_url()
|
||||
@@ -51,7 +51,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
item.contentType = 'tvshow'
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
@@ -61,7 +61,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log('search log:', line)
|
||||
info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -40,7 +40,7 @@ def mainlist(item):
|
||||
##@support.scrape
|
||||
##def peliculas(item):
|
||||
#### import web_pdb; web_pdb.set_trace()
|
||||
## log('peliculas ->\n', item)
|
||||
## info('peliculas ->\n', item)
|
||||
##
|
||||
## action = 'episodios'
|
||||
## block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
|
||||
@@ -77,7 +77,7 @@ def mainlist(item):
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
## import web_pdb; web_pdb.set_trace()
|
||||
log('peliculas ->\n', item)
|
||||
info('peliculas ->\n', item)
|
||||
|
||||
action = 'episodios'
|
||||
blacklist = ['DMCA']
|
||||
@@ -122,7 +122,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
log()
|
||||
info()
|
||||
|
||||
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>[^>]+)">'
|
||||
@@ -137,7 +137,7 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
log()
|
||||
info()
|
||||
|
||||
action = 'peliculas'
|
||||
patron = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>'
|
||||
@@ -148,7 +148,7 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
log(text)
|
||||
info(text)
|
||||
item.url = host + "/?s=" + text
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'search'
|
||||
@@ -158,11 +158,11 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("%s" % line)
|
||||
info("%s" % line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
log()
|
||||
info()
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.contentType= 'tvshow'
|
||||
@@ -177,12 +177,12 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("{0}".format(line))
|
||||
info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log('--->', item)
|
||||
info('--->', item)
|
||||
return support.server(item, item.url)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
# possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito)
|
||||
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from core import support
|
||||
from platformcode import config
|
||||
|
||||
@@ -40,7 +40,7 @@ def episodios(item):
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
log(text)
|
||||
info(text)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + "/?s=" + text
|
||||
@@ -50,10 +50,10 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("%s" % line)
|
||||
info("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
def findvideos(item):
|
||||
support.log('findvideos', item)
|
||||
support.info('findvideos', item)
|
||||
return support.server(item, headers=headers)
|
||||
@@ -42,7 +42,7 @@ def genre(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
item.url = host + '/?s=' + text
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -50,7 +50,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("search except: %s" % line)
|
||||
support.infoger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ def findhost():
|
||||
return url[:-1] if url.endswith('/') else url
|
||||
|
||||
host = support.config.get_channel_url(findhost)
|
||||
support.log('HOST',host)
|
||||
support.info('HOST',host)
|
||||
# host = 'https://ilcorsaronero.xyz'
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -64,7 +64,7 @@ def peliculas(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(item, text)
|
||||
support.info(item, text)
|
||||
if 'all' in item.args:
|
||||
item.url += text
|
||||
else:
|
||||
@@ -75,7 +75,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("search except: %s" % line)
|
||||
support.infoger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
|
||||
@@ -15,7 +15,7 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log(item)
|
||||
support.info(item)
|
||||
|
||||
film = ['/film/',
|
||||
('Generi',['', 'genres', 'genres']),
|
||||
@@ -46,7 +46,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
log()
|
||||
info()
|
||||
# debug = True
|
||||
|
||||
if item.args == 'search':
|
||||
@@ -96,7 +96,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
log()
|
||||
info()
|
||||
|
||||
patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" '\
|
||||
'style="display:block"><ul class="episodios">(?P<block>.*?)</ul>'\
|
||||
@@ -109,7 +109,7 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
log(item)
|
||||
info(item)
|
||||
|
||||
action='peliculas'
|
||||
if item.args == 'genres':
|
||||
@@ -125,7 +125,7 @@ def genres(item):
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
log(text)
|
||||
info(text)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + "/search/" + text
|
||||
@@ -135,12 +135,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("%s" % line)
|
||||
info("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
log(categoria)
|
||||
info(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
|
||||
@@ -161,14 +161,14 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("{0}".format(line))
|
||||
info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log()
|
||||
info()
|
||||
matches = support.match(item, patron=[r'class="metaframe rptss" src="([^"]+)"',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
||||
itemlist = []
|
||||
list_url = []
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
|
||||
@@ -54,7 +54,7 @@ def genres(item):
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
log(text)
|
||||
info(text)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + "/search/" + text
|
||||
try:
|
||||
@@ -62,12 +62,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("%s" % line)
|
||||
info("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
log(categoria)
|
||||
info(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
|
||||
@@ -81,12 +81,12 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("{0}".format(line))
|
||||
info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log()
|
||||
info()
|
||||
return support.server(item)
|
||||
@@ -25,7 +25,7 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
tvshow = ['/category/serie-tv/',
|
||||
('Aggiornamenti', ['/ultimi-episodi/', 'peliculas', 'update']),
|
||||
@@ -37,7 +37,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
action = 'episodios'
|
||||
patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" '\
|
||||
@@ -54,7 +54,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
patronBlock = r'</i> Stagione (?P<block>(?P<season>\d+)</div> '\
|
||||
'<div class="su-spoiler-content".*?)<div class="clearfix">'
|
||||
@@ -70,7 +70,7 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def category(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
action = 'peliculas'
|
||||
patron = r'<li class="cat-item.*?href="(?P<url>[^"]+)".*?>(?P<title>.*?)</a>'
|
||||
@@ -79,7 +79,7 @@ def category(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log("s=", texto)
|
||||
support.info("s=", texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
item.contentType = 'tvshow'
|
||||
try:
|
||||
@@ -88,12 +88,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
support.info("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log("newest", categoria)
|
||||
support.info("newest", categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -111,14 +111,14 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("{0}".format(line))
|
||||
support.info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
if item.args == 'update':
|
||||
itemlist = []
|
||||
|
||||
@@ -117,7 +117,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def play(item):
|
||||
support.log()
|
||||
support.info()
|
||||
data = support.match(item).data
|
||||
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
||||
if match:
|
||||
|
||||
@@ -49,7 +49,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
item.search = text
|
||||
if not item.args:
|
||||
item.contentType = 'undefined'
|
||||
@@ -60,11 +60,11 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return itemlist
|
||||
|
||||
def menu(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = [item.clone(title=support.typo(item.args[0],'bullet bold'), url='', action='peliculas')]
|
||||
if item.url:
|
||||
json = get_from_id(item)
|
||||
@@ -74,7 +74,7 @@ def menu(item):
|
||||
return itemlist
|
||||
|
||||
def live(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
json = current_session.get(item.url).json()['entries']
|
||||
for it in json:
|
||||
@@ -99,7 +99,7 @@ def live(item):
|
||||
return support.thumb(itemlist, live=True)
|
||||
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
contentType = ''
|
||||
json = get_programs(item)
|
||||
@@ -144,7 +144,7 @@ def peliculas(item):
|
||||
return itemlist
|
||||
|
||||
def epmenu(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
entries = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + item.urls + '}').json()['entries']
|
||||
for entry in entries:
|
||||
@@ -159,7 +159,7 @@ def epmenu(item):
|
||||
|
||||
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
episode = ''
|
||||
|
||||
@@ -188,12 +188,12 @@ def episodios(item):
|
||||
return sorted(itemlist, key=lambda it: it.title)
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = [support.Item(server = 'directo', title = 'Direct', url = item.urls, action = 'play')]
|
||||
return support.server(item, itemlist=itemlist, Download=False)
|
||||
|
||||
def play(item):
|
||||
support.log()
|
||||
support.info()
|
||||
if not item.urls: urls = item.url
|
||||
else: urls = item.urls
|
||||
for url in urls:
|
||||
@@ -209,13 +209,13 @@ def play(item):
|
||||
return support.servertools.find_video_items(item, data=data)
|
||||
|
||||
def subBrand(json):
|
||||
support.log()
|
||||
support.info()
|
||||
subBrandId = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-brands?byCustomValue={brandId}{' + json + '}').json()['entries'][-1]['mediasetprogram$subBrandId']
|
||||
json = current_session.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs?byCustomValue={subBrandId}{' + subBrandId + '}').json()['entries']
|
||||
return json
|
||||
|
||||
def get_from_id(item):
|
||||
support.log()
|
||||
support.info()
|
||||
json = current_session.get(entry.format(id=item.url)).json()
|
||||
if 'components' in json:
|
||||
id = quote(",".join(json["components"]))
|
||||
@@ -225,7 +225,7 @@ def get_from_id(item):
|
||||
return {}
|
||||
|
||||
def get_programs(item, ret=[], args={}):
|
||||
support.log()
|
||||
support.info()
|
||||
hasMore = False
|
||||
if not args:
|
||||
if item.url:
|
||||
|
||||
@@ -56,7 +56,7 @@ def findvideos(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
item.url = host + '/search.php?keywords=' + text + '&video-id='
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -64,5 +64,5 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
@@ -35,7 +35,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
if item.contentType == 'movie' or item.extra == 'movie':
|
||||
action = 'findvideos'
|
||||
else:
|
||||
@@ -48,12 +48,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "series":
|
||||
@@ -69,7 +69,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
|
||||
item.search = text.replace(' ','+')
|
||||
try:
|
||||
@@ -36,7 +36,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ def live(item):
|
||||
if url not in urls:
|
||||
urls.append(url)
|
||||
info = jsontools.load(support.match(host +'/api/on-air?channelId=' + ch_dict[title]).data)
|
||||
support.log(info)
|
||||
support.info(info)
|
||||
plot= '[B]' + info['seriesTitle'] +'[/B]\n' + info['description'] if 'seriesTitle' in info else ''
|
||||
itemlist.append(item.clone(title=support.typo(title,'bold'), contentTitle=title, url=host+url, plot=plot, action='findvideos'))
|
||||
return itemlist
|
||||
@@ -76,7 +76,7 @@ def peliculas(item):
|
||||
|
||||
for it in data:
|
||||
title = it['meta']['header']['title']
|
||||
support.log(title, it)
|
||||
support.info(title, it)
|
||||
d = it['meta']['date'].split('/') if it['meta']['date'] else ['0000','00','00']
|
||||
date = int(d[2] + d[1] + d[0])
|
||||
if item.search.lower() in title.lower() \
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from core.support import config, log
|
||||
from core.support import config, info
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -23,7 +23,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
log(texto)
|
||||
info(texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
@@ -31,12 +31,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
@@ -56,7 +56,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -36,7 +36,7 @@ def mainlist(item):
|
||||
return locals()
|
||||
|
||||
def newest(categoria):
|
||||
support.log()
|
||||
support.info()
|
||||
item = Item()
|
||||
if categoria == 'peliculas':
|
||||
item.contentType = 'movie'
|
||||
@@ -47,7 +47,7 @@ def newest(categoria):
|
||||
return peliculas(item)
|
||||
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
data = support.match(item.url, headers=headers).data
|
||||
@@ -68,7 +68,7 @@ def peliculas(item):
|
||||
return itemlist
|
||||
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
@@ -84,7 +84,7 @@ def episodios(item):
|
||||
return itemlist
|
||||
|
||||
def get_season(item, seas_url, seasonNumber):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
data = support.match(seas_url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
@@ -98,7 +98,7 @@ def get_season(item, seas_url, seasonNumber):
|
||||
return itemlist[::-1]
|
||||
|
||||
def search(item, texto):
|
||||
support.log(item.url, "search", texto)
|
||||
support.info(item.url, "search", texto)
|
||||
itemlist=[]
|
||||
try:
|
||||
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
|
||||
@@ -118,11 +118,11 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
def search_movie_by_genre(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
@@ -135,7 +135,7 @@ def search_movie_by_genre(item):
|
||||
return support.thumb(itemlist, True)
|
||||
|
||||
def search_movie_by_year(item):
|
||||
support.log()
|
||||
support.info()
|
||||
now = datetime.datetime.now()
|
||||
year = int(now.year)
|
||||
itemlist = []
|
||||
@@ -150,7 +150,7 @@ def search_movie_by_year(item):
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
try:
|
||||
data = support.match(item.url, headers=headers).data
|
||||
@@ -171,7 +171,7 @@ def findvideos(item):
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
def get_itemlist_element(element,item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist=[]
|
||||
contentSerieName = ''
|
||||
contentTitle =''
|
||||
|
||||
@@ -38,7 +38,7 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/search/keyword/' + text
|
||||
@@ -52,12 +52,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('search log:', line)
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.url = host
|
||||
@@ -77,7 +77,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -109,6 +109,6 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
# match = support.match(item, patron='wstream', debug=True)
|
||||
return support.server(item)
|
||||
|
||||
@@ -38,7 +38,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def menu(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = [item.clone(title = support.typo('Tutti','bullet bold'), action = 'peliculas'),
|
||||
item.clone(title = support.typo('Generi','submenu'), args = 'genre', action = 'submenu'),
|
||||
item.clone(title = support.typo('A-Z','submenu'), args = 'az', action = 'submenu'),
|
||||
@@ -48,7 +48,7 @@ def menu(item):
|
||||
|
||||
|
||||
def learning(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist =[]
|
||||
json = current_session.get(item.url).json()['contents']
|
||||
for key in json:
|
||||
@@ -58,7 +58,7 @@ def learning(item):
|
||||
|
||||
|
||||
def submenu(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
json = current_session.get(item.url).json()['contents'][-1]['contents']
|
||||
if item.args == 'az':
|
||||
@@ -76,7 +76,7 @@ def submenu(item):
|
||||
|
||||
|
||||
def replay_menu(item):
|
||||
support.log()
|
||||
support.info()
|
||||
import datetime, xbmc
|
||||
|
||||
# create day and month list
|
||||
@@ -91,14 +91,14 @@ def replay_menu(item):
|
||||
today = datetime.date.today()
|
||||
for d in range(7):
|
||||
day = today - datetime.timedelta(days=d)
|
||||
support.log(day)
|
||||
support.info(day)
|
||||
itemlist.append(item.clone(action = 'replay_channels', date = day.strftime("%d-%m-%Y"),
|
||||
title = support.typo(days[int(day.strftime("%w"))] + " " + day.strftime("%d") + " " + months[int(day.strftime("%m"))-1], 'bold')))
|
||||
return itemlist
|
||||
|
||||
|
||||
def replay_channels(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
json = current_session.get(item.url).json()['dirette']
|
||||
for key in json:
|
||||
@@ -108,18 +108,18 @@ def replay_channels(item):
|
||||
|
||||
|
||||
def replay(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
json = current_session.get(item.url).json()[item.fulltitle][0]['palinsesto'][0]['programmi']
|
||||
for key in json:
|
||||
support.log('KEY=',key)
|
||||
support.info('KEY=',key)
|
||||
if key and key['pathID']: itemlist.append(item.clone(thumbnail = getUrl(key['images']['landscape']), fanart = getUrl(key['images']['landscape']), url = getUrl(key['pathID']), fulltitle = key['name'], show = key['name'],
|
||||
title = support.typo(key['timePublished'], 'color kod bold') + support.typo(' | ' + key['name'], ' bold'), plot = key['testoBreve'], action = 'findvideos'))
|
||||
return itemlist
|
||||
|
||||
def search(item, text):
|
||||
# support.dbg()
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist =[]
|
||||
try:
|
||||
if item.url != host:
|
||||
@@ -136,7 +136,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
return itemlist
|
||||
|
||||
@@ -153,12 +153,12 @@ def Type(item):
|
||||
|
||||
|
||||
def live(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist =[]
|
||||
info={}
|
||||
json = current_session.get(item.url).json()['dirette']
|
||||
onAir = current_session.get(onair).json()['on_air']
|
||||
support.log(onAir)
|
||||
support.info(onAir)
|
||||
for key in onAir:
|
||||
channel = key['channel']
|
||||
info[channel] = {}
|
||||
@@ -174,7 +174,7 @@ def live(item):
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
keys = []
|
||||
key_list = []
|
||||
@@ -222,7 +222,7 @@ def peliculas(item):
|
||||
|
||||
|
||||
def select(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
json = current_session.get(item.url).json()['blocks']
|
||||
for key in json:
|
||||
@@ -234,7 +234,7 @@ def select(item):
|
||||
|
||||
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
if type(item.url) in [list, dict] and len(item.url) > 1 and ('name' in item.url[0] and 'stagione' not in item.url[0]['name'].lower()):
|
||||
for key in item.url:
|
||||
@@ -276,7 +276,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
if item.url.endswith('json'):
|
||||
json = current_session.get(item.url).json()
|
||||
@@ -293,7 +293,7 @@ def findvideos(item):
|
||||
|
||||
|
||||
def getUrl(pathId):
|
||||
support.log()
|
||||
support.info()
|
||||
url = pathId.replace(" ", "%20")
|
||||
if url.startswith("/raiplay/"):
|
||||
url = url.replace("/raiplay/",host +'/')
|
||||
@@ -315,7 +315,7 @@ def getUrl(pathId):
|
||||
|
||||
|
||||
def addinfo(key, item):
|
||||
support.log()
|
||||
support.info()
|
||||
info = current_session.get(getUrl(key['info_url'])).json()
|
||||
if not item.search or item.search.lower() in key['name'].lower():
|
||||
it = item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'], show = key['name'],
|
||||
@@ -333,7 +333,7 @@ def addinfo(key, item):
|
||||
|
||||
|
||||
def load_episodes(key, item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
json = current_session.get(getUrl(key['path_id'])).json()['items']
|
||||
order = 0
|
||||
|
||||
@@ -25,7 +25,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
|
||||
|
||||
item.contentType = 'tvshow'
|
||||
@@ -36,12 +36,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
@@ -55,7 +55,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -134,7 +134,7 @@ def menu(item):
|
||||
|
||||
def findvideos(item):
|
||||
item.url = item.url.replace('&', '&')
|
||||
support.log(item)
|
||||
support.info(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
|
||||
|
||||
@@ -31,7 +31,7 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
|
||||
film = ['/ultimi-film-aggiunti/',
|
||||
@@ -56,7 +56,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
|
||||
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime']
|
||||
patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
@@ -105,7 +105,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
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<url>.*?)</td><tr>'
|
||||
@@ -119,7 +119,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log("CERCA :" ,text, item)
|
||||
support.info("CERCA :" ,text, item)
|
||||
|
||||
item.url = "%s/?s=%s" % (host, text)
|
||||
|
||||
@@ -130,11 +130,11 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
support.info("%s" % line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
@@ -153,13 +153,13 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("{0}".format(line))
|
||||
support.info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
if item.contentType == 'movie':
|
||||
return support.server(item, headers=headers)
|
||||
else:
|
||||
@@ -173,7 +173,7 @@ def findvideos(item):
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
data = re.sub('\n|\t', ' ', data)
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
#support.log("DATA - HTML:\n", data)
|
||||
#support.info("DATA - HTML:\n", data)
|
||||
url_video = scrapertools.find_single_match(data, r'<tr><td>(.+?)</td><tr>', -1)
|
||||
url_serie = scrapertools.find_single_match(data, r'<link rel="canonical" href="([^"]+)"\s?/>')
|
||||
goseries = support.typo("Vai alla Serie:", ' bold')
|
||||
|
||||
@@ -9,7 +9,7 @@ import time
|
||||
|
||||
from core import httptools, tmdb, scrapertools, support
|
||||
from core.item import Item
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from platformcode import logger, config
|
||||
|
||||
host = config.get_channel_url()
|
||||
@@ -21,7 +21,7 @@ list_language = IDIOMAS.values()
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
log()
|
||||
info()
|
||||
itemlist = []
|
||||
tvshowSub = [
|
||||
('Novità {bold}',[ '', 'peliculas_tv', '', 'tvshow']),
|
||||
@@ -52,7 +52,7 @@ def cleantitle(scrapedtitle):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def findvideos(item):
|
||||
log()
|
||||
info()
|
||||
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 +66,8 @@ def findvideos(item):
|
||||
|
||||
episodio = item.infoLabels['episode']
|
||||
patron = r'\.\.:: Episodio %s([\s\S]*?)(<div class="post|..:: Episodio)' % episodio
|
||||
log(patron)
|
||||
log(blocco)
|
||||
info(patron)
|
||||
info(blocco)
|
||||
|
||||
matches = scrapertools.find_multiple_matches(blocco, patron)
|
||||
if len(matches):
|
||||
@@ -89,7 +89,7 @@ def findvideos(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def lista_serie(item):
|
||||
log()
|
||||
info()
|
||||
itemlist = []
|
||||
|
||||
PERPAGE = 15
|
||||
@@ -137,7 +137,7 @@ def lista_serie(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def episodios(item, itemlist=[]):
|
||||
log()
|
||||
info()
|
||||
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?'
|
||||
patron += r'<p><a href="([^"]+)">'
|
||||
|
||||
@@ -212,7 +212,7 @@ def episodios(item, itemlist=[]):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def peliculas_tv(item):
|
||||
log()
|
||||
info()
|
||||
itemlist = []
|
||||
|
||||
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>'
|
||||
@@ -265,7 +265,7 @@ def peliculas_tv(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def newest(categoria):
|
||||
log(categoria)
|
||||
info(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.url = host
|
||||
@@ -289,7 +289,7 @@ def newest(categoria):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def search(item, texto):
|
||||
log(texto)
|
||||
info(texto)
|
||||
itemlist = []
|
||||
|
||||
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
||||
@@ -320,7 +320,7 @@ def search(item, texto):
|
||||
|
||||
|
||||
def list_az(item):
|
||||
log()
|
||||
info()
|
||||
itemlist = []
|
||||
|
||||
alphabet = dict()
|
||||
|
||||
@@ -10,7 +10,7 @@ import re
|
||||
|
||||
from core import support, httptools, scrapertools
|
||||
from core.item import Item
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from platformcode import config
|
||||
|
||||
host = config.get_channel_url()
|
||||
@@ -54,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(item):
|
||||
for value, season in seasons:
|
||||
log(value)
|
||||
log(season)
|
||||
info(value)
|
||||
info(season)
|
||||
item.title = item.title.replace(value+'x',season+'x')
|
||||
item.url += '\n' + item.other
|
||||
return item
|
||||
@@ -72,7 +72,7 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
log(text)
|
||||
info(text)
|
||||
item.url = host + "/?s=" + text
|
||||
try:
|
||||
item.contentType = 'tvshow'
|
||||
@@ -81,12 +81,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("%s" % line)
|
||||
info("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
log(categoria)
|
||||
info(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -101,14 +101,14 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log("{0}".format(line))
|
||||
info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log(item)
|
||||
info(item)
|
||||
if item.args != 'update':
|
||||
return support.server(item, data=item.url)
|
||||
else:
|
||||
|
||||
@@ -32,14 +32,14 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log("[streamingaltadefinizione.py] " + item.url + " search " + text)
|
||||
support.info("[streamingaltadefinizione.py] " + item.url + " search " + 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)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def genres(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
data = support.scrapertools.decodeHtmlentities(support.match(item).data)
|
||||
args = support.match(data, patronBlock=r'genre-options-json="([^\]]+)\]', patron=r'name"\s*:\s*"([^"]+)').matches
|
||||
@@ -48,7 +48,7 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
support.info('search', item)
|
||||
item.search = text
|
||||
|
||||
try:
|
||||
@@ -57,12 +57,12 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log('search log:', line)
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(category):
|
||||
support.log(category)
|
||||
support.info(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.args = 1
|
||||
@@ -80,7 +80,7 @@ def newest(category):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log(line)
|
||||
support.info(line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -88,7 +88,7 @@ def newest(category):
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
videoType = 'movie' if item.contentType == 'movie' else 'tv'
|
||||
|
||||
@@ -147,15 +147,15 @@ def peliculas(item):
|
||||
return itemlist
|
||||
|
||||
def episodios(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
js = json.loads(support.match(item.url, patron=r'seasons="([^"]+)').match.replace('"','"'))
|
||||
support.log(js)
|
||||
support.info(js)
|
||||
|
||||
for episodes in js:
|
||||
for it in episodes['episodes']:
|
||||
support.log(it)
|
||||
support.info(it)
|
||||
itemlist.append(
|
||||
support.Item(channel=item.channel,
|
||||
title=support.typo(str(episodes['number']) + 'x' + str(it['number']).zfill(2) + ' - ' + it['name'], 'bold'),
|
||||
@@ -174,7 +174,7 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
support.info()
|
||||
itemlist=[]
|
||||
url = support.match(support.match(item).data.replace('"','"').replace('\\',''), patron=r'video_url"\s*:\s*"([^"]+)"').match
|
||||
playlist = support.match(url.replace('https','http'), patron=r'\./([^.]+)').matches
|
||||
|
||||
@@ -7,7 +7,7 @@ import re
|
||||
|
||||
from core import scrapertools, httptools, support
|
||||
from core.item import Item
|
||||
from core.support import log
|
||||
from core.support import info
|
||||
from platformcode import logger
|
||||
from platformcode import config, unify
|
||||
|
||||
@@ -24,7 +24,7 @@ player_iframe = r'<iframe src="([^"]+)"[^>]+></iframe>\s?<div class="player'
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
log()
|
||||
info()
|
||||
|
||||
top = [('Generi', ['', 'category'])]
|
||||
film = ['/film',
|
||||
@@ -65,7 +65,7 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
log()
|
||||
info()
|
||||
if not item.data:
|
||||
data_check = httptools.downloadpage(item.url, headers=headers).data
|
||||
data_check = re.sub('\n|\t', ' ', data_check)
|
||||
@@ -125,7 +125,7 @@ def category(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
log(texto)
|
||||
info(texto)
|
||||
|
||||
|
||||
item.url = host + "/?s=" + texto
|
||||
@@ -166,17 +166,17 @@ def hdpass(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
log()
|
||||
support.log("ITEMLIST: ", item)
|
||||
info()
|
||||
support.info("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.log("CHECK : ", check)
|
||||
support.info("CHECK : ", check)
|
||||
if 'anime' in check.lower():
|
||||
item.contentType = 'tvshow'
|
||||
item.data = data
|
||||
support.log('select = ### è una anime ###')
|
||||
support.info('select = ### è una anime ###')
|
||||
try:
|
||||
return episodios(item)
|
||||
except:
|
||||
@@ -188,7 +188,7 @@ def findvideos(item):
|
||||
|
||||
# if 'protectlink' in data:
|
||||
# urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
|
||||
# support.log("SONO QUI: ", urls)
|
||||
# support.info("SONO QUI: ", urls)
|
||||
# for url in urls:
|
||||
# url = url.decode('base64')
|
||||
# # tiro via l'ultimo carattere perchè non c'entra
|
||||
@@ -199,7 +199,7 @@ def findvideos(item):
|
||||
# if url:
|
||||
# listurl.add(url)
|
||||
# data += '\n'.join(listurl)
|
||||
log(data)
|
||||
info(data)
|
||||
itemlist = []
|
||||
# support.dbg()
|
||||
|
||||
@@ -211,7 +211,7 @@ def findvideos(item):
|
||||
if item.otherLinks:
|
||||
urls += support.match(item.otherLinks, patron=r'href="([^"]+)').matches
|
||||
|
||||
log('URLS', urls)
|
||||
info('URLS', urls)
|
||||
for u in urls:
|
||||
if 'hdplayer.casa/series/' in u:
|
||||
urls.remove(u)
|
||||
|
||||
@@ -27,7 +27,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.log(texto)
|
||||
support.info(texto)
|
||||
item.args='search'
|
||||
item.contentType='tvshow'
|
||||
item.url = host + '/?s=' + texto
|
||||
@@ -37,12 +37,12 @@ def search(item, texto):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
support.info(categoria)
|
||||
item = support.Item()
|
||||
try:
|
||||
item.contentType = 'tvshow'
|
||||
@@ -53,7 +53,7 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
support.infoger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ def peliculas(item):
|
||||
patron = r'<li ><a href="(?P<url>[^"]+)" title="[^>]+">(?P<title>[^<|\(]+)?(?:\([^\d]*(?P<year>\d+)\))?[^<]*</a>'
|
||||
|
||||
def itemHook(item):
|
||||
support.log(item.title)
|
||||
support.info(item.title)
|
||||
item.title = support.re.sub(' (?:- )?[Ss]erie [Tt][Vv]', '', item.title)
|
||||
if item.args == 'sub':
|
||||
#corregge l'esatta lang per quelle pagine in cui c'è
|
||||
|
||||
@@ -34,7 +34,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def radio(item):
|
||||
support.log()
|
||||
support.info()
|
||||
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.log(text)
|
||||
support.info(text)
|
||||
item.url = host + '/Search.ashx?query=' +text
|
||||
try:
|
||||
return radio(item)
|
||||
@@ -93,5 +93,5 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
|
||||
@@ -71,7 +71,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log(text)
|
||||
support.info(text)
|
||||
itemlist = []
|
||||
if conn_id:
|
||||
if 'film' in item.url: item.contentType = 'movie'
|
||||
@@ -82,7 +82,7 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
support.infoger.error("%s" % line)
|
||||
return []
|
||||
return itemlist
|
||||
|
||||
@@ -106,7 +106,7 @@ def peliculas(item):
|
||||
itemlist = []
|
||||
if not item.args:
|
||||
json_file =loadjs(item.url + 'channel/10005/last/')
|
||||
support.log(json_file)
|
||||
support.logger.debug(json_file)
|
||||
make_itemlist(itemlist, item, json_file)
|
||||
|
||||
elif ('=' not in item.args) and ('=' not in item.url):
|
||||
@@ -142,7 +142,7 @@ def episodios(item):
|
||||
show_id = str(json_file['data'][0]['show_id'])
|
||||
season_id = str(json_file['data'][0]['season_id'])
|
||||
episodes = []
|
||||
support.log('SEASON ID= ',season_id)
|
||||
support.info('SEASON ID= ',season_id)
|
||||
for episode in json_file['data']:
|
||||
episodes.append(episode['episodes'])
|
||||
for episode in episodes:
|
||||
@@ -233,7 +233,7 @@ def make_itemlist(itemlist, item, data):
|
||||
def loadjs(url):
|
||||
if '?category' not in url:
|
||||
url += '?full=true'
|
||||
support.log('Json URL;',url)
|
||||
support.info('Json URL;',url)
|
||||
json = current_session.get(url, headers=headers, params=payload).json()
|
||||
return json
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ addon = config.__settings__
|
||||
downloadenabled = addon.getSetting('downloadenabled')
|
||||
|
||||
def getmainlist(view="thumb_"):
|
||||
logger.log()
|
||||
logger.info()
|
||||
itemlist = list()
|
||||
|
||||
if config.dev_mode():
|
||||
@@ -62,14 +62,14 @@ def getmainlist(view="thumb_"):
|
||||
|
||||
|
||||
def getchanneltypes(view="thumb_"):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
# Category List
|
||||
channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "live", "torrent", "music"] #, "direct"
|
||||
|
||||
# Channel Language
|
||||
channel_language = auto_filter()
|
||||
logger.log("channel_language=%s" % channel_language)
|
||||
logger.info("channel_language=%s" % channel_language)
|
||||
|
||||
# Build Itemlist
|
||||
itemlist = list()
|
||||
@@ -92,7 +92,7 @@ def getchanneltypes(view="thumb_"):
|
||||
|
||||
def filterchannels(category, view="thumb_"):
|
||||
from core import channeltools
|
||||
logger.log('Filter Channels ' + category)
|
||||
logger.info('Filter Channels ' + category)
|
||||
|
||||
channelslist = []
|
||||
|
||||
@@ -103,17 +103,17 @@ def filterchannels(category, view="thumb_"):
|
||||
appenddisabledchannels = True
|
||||
|
||||
channel_path = os.path.join(config.get_runtime_path(), 'channels', '*.json')
|
||||
logger.log("channel_path = %s" % channel_path)
|
||||
logger.info("channel_path = %s" % channel_path)
|
||||
|
||||
channel_files = glob.glob(channel_path)
|
||||
logger.log("channel_files found %s" % (len(channel_files)))
|
||||
logger.info("channel_files found %s" % (len(channel_files)))
|
||||
|
||||
# Channel Language
|
||||
channel_language = auto_filter()
|
||||
logger.log("channel_language=%s" % channel_language)
|
||||
logger.info("channel_language=%s" % channel_language)
|
||||
|
||||
for channel_path in channel_files:
|
||||
logger.log("channel in for = %s" % channel_path)
|
||||
logger.debug("channel in for = %s" % channel_path)
|
||||
|
||||
channel = os.path.basename(channel_path).replace(".json", "")
|
||||
|
||||
@@ -126,7 +126,7 @@ def filterchannels(category, view="thumb_"):
|
||||
# If it's not a channel we skip it
|
||||
if not channel_parameters["channel"]:
|
||||
continue
|
||||
logger.log("channel_parameters=%s" % repr(channel_parameters))
|
||||
logger.debug("channel_parameters=%s" % repr(channel_parameters))
|
||||
|
||||
# If you prefer the banner and the channel has it, now change your mind
|
||||
if view == "banner_" and "banner" in channel_parameters:
|
||||
@@ -221,7 +221,7 @@ def get_thumb(thumb_name, view="thumb_"):
|
||||
|
||||
|
||||
def set_channel_info(parameters):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
info = ''
|
||||
language = ''
|
||||
|
||||
@@ -15,7 +15,7 @@ default_file = dict()
|
||||
remote_path = 'https://raw.githubusercontent.com/kodiondemand/media/master/'
|
||||
|
||||
def is_enabled(channel_name):
|
||||
logger.log("channel_name=" + channel_name)
|
||||
logger.info("channel_name=" + channel_name)
|
||||
return get_channel_parameters(channel_name)["active"] and get_channel_setting("enabled", channel=channel_name,
|
||||
default=True)
|
||||
|
||||
@@ -87,7 +87,7 @@ def get_channel_parameters(channel_name):
|
||||
|
||||
|
||||
def get_channel_json(channel_name):
|
||||
# logger.log("channel_name=" + channel_name)
|
||||
# logger.info("channel_name=" + channel_name)
|
||||
from core import filetools
|
||||
channel_json = None
|
||||
try:
|
||||
@@ -101,9 +101,9 @@ def get_channel_json(channel_name):
|
||||
channel_name + ".json")
|
||||
|
||||
if filetools.isfile(channel_path):
|
||||
# logger.log("channel_data=" + channel_path)
|
||||
# logger.info("channel_data=" + channel_path)
|
||||
channel_json = jsontools.load(filetools.read(channel_path))
|
||||
# logger.log("channel_json= %s" % channel_json)
|
||||
# logger.info("channel_json= %s" % channel_json)
|
||||
|
||||
except Exception as ex:
|
||||
template = "An exception of type %s occured. Arguments:\n%r"
|
||||
@@ -114,7 +114,7 @@ def get_channel_json(channel_name):
|
||||
|
||||
|
||||
def get_channel_controls_settings(channel_name):
|
||||
# logger.log("channel_name=" + channel_name)
|
||||
# logger.info("channel_name=" + channel_name)
|
||||
dict_settings = {}
|
||||
# import web_pdb; web_pdb.set_trace()
|
||||
# list_controls = get_channel_json(channel_name).get('settings', list())
|
||||
@@ -137,7 +137,7 @@ def get_lang(channel_name):
|
||||
if hasattr(channel, 'list_language'):
|
||||
for language in channel.list_language:
|
||||
list_language.append(language)
|
||||
logger.log(list_language)
|
||||
logger.info(list_language)
|
||||
else:
|
||||
sub = False
|
||||
langs = []
|
||||
|
||||
@@ -253,12 +253,12 @@ class Downloader(object):
|
||||
self.file.seek(2 ** 31, 0)
|
||||
except OverflowError:
|
||||
self._seekable = False
|
||||
logger.log("Cannot do seek() or tell() in files larger than 2GB")
|
||||
logger.info("Cannot do seek() or tell() in files larger than 2GB")
|
||||
|
||||
self.__get_download_info__()
|
||||
|
||||
try:
|
||||
logger.log("Download started: Parts: %s | Path: %s | File: %s | Size: %s" % (str(len(self._download_info["parts"])), self._pathencode('utf-8'), self._filenameencode('utf-8'), str(self._download_info["size"])))
|
||||
logger.info("Download started: Parts: %s | Path: %s | File: %s | Size: %s" % (str(len(self._download_info["parts"])), self._pathencode('utf-8'), self._filenameencode('utf-8'), str(self._download_info["size"])))
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -410,7 +410,7 @@ class Downloader(object):
|
||||
return id == 0 or (len(self.completed_parts) >= id and sorted(self.completed_parts)[id - 1] == id - 1)
|
||||
|
||||
def __save_file__(self):
|
||||
logger.log("Thread started: %s" % threading.current_thread().name)
|
||||
logger.info("Thread started: %s" % threading.current_thread().name)
|
||||
|
||||
while self._state == self.states.downloading:
|
||||
if not self.pending_parts and not self.download_parts and not self.save_parts: # Download finished
|
||||
@@ -449,7 +449,7 @@ class Downloader(object):
|
||||
self._download_info["parts"][s]["status"] = self.states.stopped
|
||||
self._download_info["parts"][s]["current"] = self._download_info["parts"][s]["start"]
|
||||
|
||||
logger.log("Thread stopped: %s" % threading.current_thread().name)
|
||||
logger.info("Thread stopped: %s" % threading.current_thread().name)
|
||||
|
||||
def __get_part_id__(self):
|
||||
self._download_lock.acquire()
|
||||
@@ -464,21 +464,21 @@ class Downloader(object):
|
||||
return None
|
||||
|
||||
def __set_part_connecting__(self, id):
|
||||
logger.log("ID: %s Establishing connection" % id)
|
||||
logger.info("ID: %s Establishing connection" % id)
|
||||
self._download_info["parts"][id]["status"] = self.states.connecting
|
||||
|
||||
def __set_part__error__(self, id):
|
||||
logger.log("ID: %s Download failed" % id)
|
||||
logger.info("ID: %s Download failed" % id)
|
||||
self._download_info["parts"][id]["status"] = self.states.error
|
||||
self.pending_parts.add(id)
|
||||
self.download_parts.remove(id)
|
||||
|
||||
def __set_part__downloading__(self, id):
|
||||
logger.log("ID: %s Downloading data ..." % id)
|
||||
logger.info("ID: %s Downloading data ..." % id)
|
||||
self._download_info["parts"][id]["status"] = self.states.downloading
|
||||
|
||||
def __set_part_completed__(self, id):
|
||||
logger.log("ID: %s Download finished!" % id)
|
||||
logger.info("ID: %s Download finished!" % id)
|
||||
self._download_info["parts"][id]["status"] = self.states.saving
|
||||
self.download_parts.remove(id)
|
||||
self.save_parts.add(id)
|
||||
@@ -501,7 +501,7 @@ class Downloader(object):
|
||||
return file
|
||||
|
||||
def __start_part__(self):
|
||||
logger.log("Thread Started: %s" % threading.current_thread().name)
|
||||
logger.info("Thread Started: %s" % threading.current_thread().name)
|
||||
while self._state == self.states.downloading:
|
||||
id = self.__get_part_id__()
|
||||
if id is None: break
|
||||
@@ -528,7 +528,7 @@ class Downloader(object):
|
||||
buffer = connection.read(self._block_size)
|
||||
speed.append(old_div(len(buffer), ((time.time() - start) or 0.001)))
|
||||
except:
|
||||
logger.log("ID: %s Error downloading data" % id)
|
||||
logger.info("ID: %s Error downloading data" % id)
|
||||
self._download_info["parts"][id]["status"] = self.states.error
|
||||
self.pending_parts.add(id)
|
||||
self.download_parts.remove(id)
|
||||
@@ -546,7 +546,7 @@ class Downloader(object):
|
||||
|
||||
if velocidad_minima > speed[-1] and velocidad_minima > speed[-2] and self._download_info["parts"][id]["current"] < self._download_info["parts"][id]["end"]:
|
||||
if connection.fp: connection.fp._sock.close()
|
||||
logger.log("ID: %s Restarting connection! | Minimum Speed: %.2f %s/s | Speed: %.2f %s/s" % (id, vm[1], vm[2], v[1], v[2]))
|
||||
logger.info("ID: %s Restarting connection! | Minimum Speed: %.2f %s/s | Speed: %.2f %s/s" % (id, vm[1], vm[2], v[1], v[2]))
|
||||
# file.close()
|
||||
break
|
||||
else:
|
||||
@@ -556,7 +556,7 @@ class Downloader(object):
|
||||
break
|
||||
|
||||
self.__set_part_stopped__(id)
|
||||
logger.log("Thread stopped: %s" % threading.current_thread().name)
|
||||
logger.info("Thread stopped: %s" % threading.current_thread().name)
|
||||
|
||||
def __update_json(self, started=True):
|
||||
text = filetools.read(self._json_path)
|
||||
@@ -564,10 +564,10 @@ class Downloader(object):
|
||||
if self._json_text != text:
|
||||
self._json_text = text
|
||||
self._json_item = Item().fromjson(text)
|
||||
logger.log('item loaded')
|
||||
logger.info('item loaded')
|
||||
progress = int(self.progress)
|
||||
if started and self._json_item.downloadStatus == 0: # stopped
|
||||
logger.log('Download paused')
|
||||
logger.info('Download paused')
|
||||
self.stop()
|
||||
elif self._json_item.downloadProgress != progress or not started:
|
||||
params = {"downloadStatus": 4, "downloadComplete": 0, "downloadProgress": progress}
|
||||
|
||||
@@ -97,11 +97,11 @@ def limpia_nombre_excepto_1(s):
|
||||
try:
|
||||
s = unicode(s, "utf-8")
|
||||
except UnicodeError:
|
||||
# logger.log("no es utf-8")
|
||||
# logger.info("no es utf-8")
|
||||
try:
|
||||
s = unicode(s, "iso-8859-1")
|
||||
except UnicodeError:
|
||||
# logger.log("no es iso-8859-1")
|
||||
# logger.info("no es iso-8859-1")
|
||||
pass
|
||||
# Remove accents
|
||||
s = limpia_nombre_sin_acentos(s)
|
||||
@@ -125,29 +125,29 @@ def limpia_nombre_excepto_2(s):
|
||||
|
||||
def getfilefromtitle(url, title):
|
||||
# Print in the log what you will discard
|
||||
logger.log("title=" + title)
|
||||
logger.log("url=" + url)
|
||||
logger.info("title=" + title)
|
||||
logger.info("url=" + url)
|
||||
plataforma = config.get_system_platform()
|
||||
logger.log("platform=" + plataforma)
|
||||
logger.info("platform=" + plataforma)
|
||||
|
||||
# filename = xbmc.makeLegalFilename(title + url[-4:])
|
||||
from core import scrapertools
|
||||
|
||||
nombrefichero = title + scrapertools.get_filename_from_url(url)[-4:]
|
||||
logger.log("filename= %s" % nombrefichero)
|
||||
logger.info("filename= %s" % nombrefichero)
|
||||
if "videobb" in url or "videozer" in url or "putlocker" in url:
|
||||
nombrefichero = title + ".flv"
|
||||
if "videobam" in url:
|
||||
nombrefichero = title + "." + url.rsplit(".", 1)[1][0:3]
|
||||
|
||||
logger.log("filename= %s" % nombrefichero)
|
||||
logger.info("filename= %s" % nombrefichero)
|
||||
|
||||
nombrefichero = limpia_nombre_caracteres_especiales(nombrefichero)
|
||||
|
||||
logger.log("filename= %s" % nombrefichero)
|
||||
logger.info("filename= %s" % nombrefichero)
|
||||
|
||||
fullpath = filetools.join(config.get_setting("downloadpath"), nombrefichero)
|
||||
logger.log("fullpath= %s" % fullpath)
|
||||
logger.info("fullpath= %s" % fullpath)
|
||||
|
||||
if config.is_xbmc() and fullpath.startswith("special://"):
|
||||
import xbmc
|
||||
@@ -162,7 +162,7 @@ def downloadtitle(url, title):
|
||||
|
||||
|
||||
def downloadbest(video_urls, title, continuar=False):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
# Flip it over, to put the highest quality one first (list () is for you to make a copy of)
|
||||
invertida = list(video_urls)
|
||||
@@ -172,9 +172,9 @@ def downloadbest(video_urls, title, continuar=False):
|
||||
# videotitle = elemento[0]
|
||||
url = elemento[1]
|
||||
if not PY3:
|
||||
logger.log("Downloading option " + title + " " + url.encode('ascii', 'ignore'))
|
||||
logger.info("Downloading option " + title + " " + url.encode('ascii', 'ignore'))
|
||||
else:
|
||||
logger.log("Downloading option " + title + " " + url.encode('ascii', 'ignore').decode('utf-8'))
|
||||
logger.info("Downloading option " + title + " " + url.encode('ascii', 'ignore').decode('utf-8'))
|
||||
|
||||
# Calculate the file where you should record
|
||||
try:
|
||||
@@ -200,25 +200,25 @@ def downloadbest(video_urls, title, continuar=False):
|
||||
else:
|
||||
# EThe file doesn't even exist
|
||||
if not filetools.exists(fullpath):
|
||||
logger.log("-> You have not downloaded anything, testing with the following option if there is")
|
||||
logger.info("-> You have not downloaded anything, testing with the following option if there is")
|
||||
# The file exists
|
||||
else:
|
||||
tamanyo = filetools.getsize(fullpath)
|
||||
|
||||
# It has size 0
|
||||
if tamanyo == 0:
|
||||
logger.log("-> Download a file with size 0, testing with the following option if it exists")
|
||||
logger.info("-> Download a file with size 0, testing with the following option if it exists")
|
||||
os.remove(fullpath)
|
||||
else:
|
||||
logger.log("-> Download a file with size %d, he takes it for good" % tamanyo)
|
||||
logger.info("-> Download a file with size %d, he takes it for good" % tamanyo)
|
||||
return 0
|
||||
|
||||
return -2
|
||||
|
||||
|
||||
def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False, resumir=True, header=''):
|
||||
logger.log("url= " + url)
|
||||
logger.log("filename= " + nombrefichero)
|
||||
logger.info("url= " + url)
|
||||
logger.info("filename= " + nombrefichero)
|
||||
|
||||
if headers is None:
|
||||
headers = []
|
||||
@@ -242,14 +242,14 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
nombrefichero = xbmc.makeLegalFilename(nombrefichero)
|
||||
except:
|
||||
pass
|
||||
logger.log("filename= " + nombrefichero)
|
||||
logger.info("filename= " + nombrefichero)
|
||||
|
||||
# The file exists and you want to continue
|
||||
if filetools.exists(nombrefichero) and continuar:
|
||||
f = filetools.file_open(nombrefichero, 'r+b', vfs=VFS)
|
||||
if resumir:
|
||||
exist_size = filetools.getsize(nombrefichero)
|
||||
logger.log("the file exists, size= %d" % exist_size)
|
||||
logger.info("the file exists, size= %d" % exist_size)
|
||||
grabado = exist_size
|
||||
f.seek(exist_size)
|
||||
else:
|
||||
@@ -258,13 +258,13 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
|
||||
# the file already exists and you don't want to continue, it aborts
|
||||
elif filetools.exists(nombrefichero) and not continuar:
|
||||
logger.log("the file exists, it does not download again")
|
||||
logger.info("the file exists, it does not download again")
|
||||
return -3
|
||||
|
||||
# the file does not exist
|
||||
else:
|
||||
exist_size = 0
|
||||
logger.log("the file does not exist")
|
||||
logger.info("the file does not exist")
|
||||
|
||||
f = filetools.file_open(nombrefichero, 'wb', vfs=VFS)
|
||||
grabado = 0
|
||||
@@ -285,13 +285,13 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
additional_headers = [additional_headers]
|
||||
|
||||
for additional_header in additional_headers:
|
||||
logger.log("additional_header: " + additional_header)
|
||||
logger.info("additional_header: " + additional_header)
|
||||
name = re.findall("(.*?)=.*?", additional_header)[0]
|
||||
value = urllib.parse.unquote_plus(re.findall(".*?=(.*?)$", additional_header)[0])
|
||||
headers.append([name, value])
|
||||
|
||||
url = url.split("|")[0]
|
||||
logger.log("url=" + url)
|
||||
logger.info("url=" + url)
|
||||
|
||||
# Socket timeout at 60 seconds
|
||||
socket.setdefaulttimeout(60)
|
||||
@@ -299,7 +299,7 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
h = urllib.request.HTTPHandler(debuglevel=0)
|
||||
request = urllib.request.Request(url)
|
||||
for header in headers:
|
||||
logger.log("Header= " + header[0] + ": " + header[1])
|
||||
logger.info("Header= " + header[0] + ": " + header[1])
|
||||
request.add_header(header[0], header[1])
|
||||
|
||||
if exist_size > 0:
|
||||
@@ -328,12 +328,12 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
if exist_size > 0:
|
||||
totalfichero = totalfichero + exist_size
|
||||
|
||||
logger.log("Content-Length= %s" % totalfichero)
|
||||
logger.info("Content-Length= %s" % totalfichero)
|
||||
|
||||
blocksize = 100 * 1024
|
||||
|
||||
bloqueleido = connexion.read(blocksize)
|
||||
logger.log("Starting downloading the file, blocked= %s" % len(bloqueleido))
|
||||
logger.info("Starting downloading the file, blocked= %s" % len(bloqueleido))
|
||||
|
||||
maxreintentos = 10
|
||||
|
||||
@@ -360,7 +360,7 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
tiempofalta = old_div(falta, velocidad)
|
||||
else:
|
||||
tiempofalta = 0
|
||||
# logger.log(sec_to_hms(tiempofalta))
|
||||
# logger.info(sec_to_hms(tiempofalta))
|
||||
if not silent:
|
||||
progreso.update(percent, "%.2fMB/%.2fMB (%d%%) %.2f Kb/s %s" %
|
||||
(descargadosmb, totalmb, percent, old_div(velocidad, 1024),
|
||||
@@ -368,14 +368,14 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
break
|
||||
except:
|
||||
reintentos += 1
|
||||
logger.log("ERROR in block download, retry %d" % reintentos)
|
||||
logger.info("ERROR in block download, retry %d" % reintentos)
|
||||
import traceback
|
||||
logger.error(traceback.print_exc())
|
||||
|
||||
# The user cancels the download
|
||||
try:
|
||||
if progreso.iscanceled():
|
||||
logger.log("Download of file canceled")
|
||||
logger.info("Download of file canceled")
|
||||
f.close()
|
||||
progreso.close()
|
||||
return -1
|
||||
@@ -384,7 +384,7 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
|
||||
# There was an error in the download
|
||||
if reintentos > maxreintentos:
|
||||
logger.log("ERROR in the file download")
|
||||
logger.info("ERROR in the file download")
|
||||
f.close()
|
||||
if not silent:
|
||||
progreso.close()
|
||||
@@ -430,7 +430,7 @@ def downloadfile(url, nombrefichero, headers=None, silent=False, continuar=False
|
||||
except:
|
||||
pass
|
||||
|
||||
logger.log("End of file download")
|
||||
logger.info("End of file download")
|
||||
|
||||
|
||||
def downloadfileRTMP(url, nombrefichero, silent):
|
||||
@@ -476,7 +476,7 @@ def downloadfileRTMP(url, nombrefichero, silent):
|
||||
try:
|
||||
rtmpdump_args = [rtmpdump_cmd] + rtmpdump_args + ["-o", nombrefichero]
|
||||
from os import spawnv, P_NOWAIT
|
||||
logger.log("Initiating file download: %s" % " ".join(rtmpdump_args))
|
||||
logger.info("Initiating file download: %s" % " ".join(rtmpdump_args))
|
||||
rtmpdump_exit = spawnv(P_NOWAIT, rtmpdump_cmd, rtmpdump_args)
|
||||
if not silent:
|
||||
from platformcode import platformtools
|
||||
@@ -488,18 +488,18 @@ def downloadfileRTMP(url, nombrefichero, silent):
|
||||
|
||||
|
||||
def downloadfileGzipped(url, pathfichero):
|
||||
logger.log("url= " + url)
|
||||
logger.info("url= " + url)
|
||||
nombrefichero = pathfichero
|
||||
logger.log("filename= " + nombrefichero)
|
||||
logger.info("filename= " + nombrefichero)
|
||||
|
||||
import xbmc
|
||||
nombrefichero = xbmc.makeLegalFilename(nombrefichero)
|
||||
logger.log("filename= " + nombrefichero)
|
||||
logger.info("filename= " + nombrefichero)
|
||||
patron = "(http://[^/]+)/.+"
|
||||
matches = re.compile(patron, re.DOTALL).findall(url)
|
||||
|
||||
if len(matches):
|
||||
logger.log("Main URL: " + matches[0])
|
||||
logger.info("Main URL: " + matches[0])
|
||||
url1 = matches[0]
|
||||
else:
|
||||
url1 = url
|
||||
@@ -546,9 +546,9 @@ def downloadfileGzipped(url, pathfichero):
|
||||
|
||||
nombre_fichero_base = filetools.basename(nombrefichero)
|
||||
if len(nombre_fichero_base) == 0:
|
||||
logger.log("Searching for name in the answer Headers")
|
||||
logger.info("Searching for name in the answer Headers")
|
||||
nombre_base = connexion.headers["Content-Disposition"]
|
||||
logger.log(nombre_base)
|
||||
logger.info(nombre_base)
|
||||
patron = 'filename="([^"]+)"'
|
||||
matches = re.compile(patron, re.DOTALL).findall(nombre_base)
|
||||
if len(matches) > 0:
|
||||
@@ -556,7 +556,7 @@ def downloadfileGzipped(url, pathfichero):
|
||||
titulo = GetTitleFromFile(titulo)
|
||||
nombrefichero = filetools.join(pathfichero, titulo)
|
||||
else:
|
||||
logger.log("Name of the file not found, Placing temporary name: no_name.txt")
|
||||
logger.info("Name of the file not found, Placing temporary name: no_name.txt")
|
||||
titulo = "no_name.txt"
|
||||
nombrefichero = filetools.join(pathfichero, titulo)
|
||||
totalfichero = int(connexion.headers["Content-Length"])
|
||||
@@ -564,10 +564,10 @@ def downloadfileGzipped(url, pathfichero):
|
||||
# then
|
||||
f = filetools.file_open(nombrefichero, 'w', vfs=VFS)
|
||||
|
||||
logger.log("new file open")
|
||||
logger.info("new file open")
|
||||
|
||||
grabado = 0
|
||||
logger.log("Content-Length= %s" % totalfichero)
|
||||
logger.info("Content-Length= %s" % totalfichero)
|
||||
|
||||
blocksize = 100 * 1024
|
||||
|
||||
@@ -580,7 +580,7 @@ def downloadfileGzipped(url, pathfichero):
|
||||
gzipper = gzip.GzipFile(fileobj=compressedstream)
|
||||
bloquedata = gzipper.read()
|
||||
gzipper.close()
|
||||
logger.log("Starting downloading the file, blocked= %s" % len(bloqueleido))
|
||||
logger.info("Starting downloading the file, blocked= %s" % len(bloqueleido))
|
||||
except:
|
||||
logger.error("ERROR: The file to be downloaded is not compressed with Gzip")
|
||||
f.close()
|
||||
@@ -619,32 +619,32 @@ def downloadfileGzipped(url, pathfichero):
|
||||
tiempofalta = old_div(falta, velocidad)
|
||||
else:
|
||||
tiempofalta = 0
|
||||
logger.log(sec_to_hms(tiempofalta))
|
||||
logger.info(sec_to_hms(tiempofalta))
|
||||
progreso.update(percent, "%.2fMB/%.2fMB (%d%%) %.2f Kb/s %s left " % (descargadosmb, totalmb, percent, old_div(velocidad, 1024), sec_to_hms(tiempofalta)))
|
||||
break
|
||||
except:
|
||||
reintentos += 1
|
||||
logger.log("ERROR in block download, retry %d" % reintentos)
|
||||
logger.info("ERROR in block download, retry %d" % reintentos)
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
|
||||
# The user cancels the download
|
||||
if progreso.iscanceled():
|
||||
logger.log("Download of file canceled")
|
||||
logger.info("Download of file canceled")
|
||||
f.close()
|
||||
progreso.close()
|
||||
return -1
|
||||
|
||||
# There was an error in the download
|
||||
if reintentos > maxreintentos:
|
||||
logger.log("ERROR in the file download")
|
||||
logger.info("ERROR in the file download")
|
||||
f.close()
|
||||
progreso.close()
|
||||
|
||||
return -2
|
||||
|
||||
except:
|
||||
logger.log("ERROR in the file download")
|
||||
logger.info("ERROR in the file download")
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
f.close()
|
||||
@@ -655,15 +655,15 @@ def downloadfileGzipped(url, pathfichero):
|
||||
|
||||
# print data
|
||||
progreso.close()
|
||||
logger.log("End download of the file")
|
||||
logger.info("End download of the file")
|
||||
return nombrefichero
|
||||
|
||||
|
||||
def GetTitleFromFile(title):
|
||||
# Print in the log what you will discard
|
||||
logger.log("title= " + title)
|
||||
logger.info("title= " + title)
|
||||
plataforma = config.get_system_platform()
|
||||
logger.log("plataform= " + plataforma)
|
||||
logger.info("plataform= " + plataforma)
|
||||
|
||||
# nombrefichero = xbmc.makeLegalFilename(title + url[-4:])
|
||||
nombrefichero = title
|
||||
@@ -677,11 +677,11 @@ def sec_to_hms(seconds):
|
||||
|
||||
|
||||
def downloadIfNotModifiedSince(url, timestamp):
|
||||
logger.log("(" + url + "," + time.ctime(timestamp) + ")")
|
||||
logger.info("(" + url + "," + time.ctime(timestamp) + ")")
|
||||
|
||||
# Convert date to GMT
|
||||
fecha_formateada = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.gmtime(timestamp))
|
||||
logger.log("Formatted date= %s" % fecha_formateada)
|
||||
logger.info("Formatted date= %s" % fecha_formateada)
|
||||
|
||||
# Check if it has changed
|
||||
inicio = time.clock()
|
||||
@@ -702,9 +702,9 @@ def downloadIfNotModifiedSince(url, timestamp):
|
||||
except urllib.error.URLError as e:
|
||||
# If it returns 304 it is that it has not changed
|
||||
if hasattr(e, 'code'):
|
||||
logger.log("HTTP response code : %d" % e.code)
|
||||
logger.info("HTTP response code : %d" % e.code)
|
||||
if e.code == 304:
|
||||
logger.log("It has not changed")
|
||||
logger.info("It has not changed")
|
||||
updated = False
|
||||
# Grab errors with response code from requested external server
|
||||
else:
|
||||
@@ -713,13 +713,13 @@ def downloadIfNotModifiedSince(url, timestamp):
|
||||
data = ""
|
||||
|
||||
fin = time.clock()
|
||||
logger.log("Downloaded in %d seconds " % (fin - inicio + 1))
|
||||
logger.info("Downloaded in %d seconds " % (fin - inicio + 1))
|
||||
|
||||
return updated, data
|
||||
|
||||
|
||||
def download_all_episodes(item, channel, first_episode="", preferred_server="vidspot", filter_language=""):
|
||||
logger.log("show= " + item.show)
|
||||
logger.info("show= " + item.show)
|
||||
show_title = item.show
|
||||
|
||||
# Gets the listing from which it was called
|
||||
@@ -749,9 +749,9 @@ def download_all_episodes(item, channel, first_episode="", preferred_server="vid
|
||||
|
||||
for episode_item in episode_itemlist:
|
||||
try:
|
||||
logger.log("episode= " + episode_item.title)
|
||||
logger.info("episode= " + episode_item.title)
|
||||
episode_title = scrapertools.find_single_match(episode_item.title, r"(\d+x\d+)")
|
||||
logger.log("episode= " + episode_title)
|
||||
logger.info("episode= " + episode_title)
|
||||
except:
|
||||
import traceback
|
||||
logger.error(traceback.format_exc())
|
||||
@@ -815,7 +815,7 @@ def download_all_episodes(item, channel, first_episode="", preferred_server="vid
|
||||
new_mirror_itemlist_4 + new_mirror_itemlist_5 + new_mirror_itemlist_6)
|
||||
|
||||
for mirror_item in mirrors_itemlist:
|
||||
logger.log("mirror= " + mirror_item.title)
|
||||
logger.info("mirror= " + mirror_item.title)
|
||||
|
||||
if "(Italiano)" in mirror_item.title:
|
||||
idioma = "(Italiano)"
|
||||
@@ -836,11 +836,11 @@ def download_all_episodes(item, channel, first_episode="", preferred_server="vid
|
||||
idioma = "(Desconocido)"
|
||||
codigo_idioma = "desconocido"
|
||||
|
||||
logger.log("filter_language=#" + filter_language + "#, codigo_idioma=#" + codigo_idioma + "#")
|
||||
logger.info("filter_language=#" + filter_language + "#, codigo_idioma=#" + codigo_idioma + "#")
|
||||
if filter_language == "" or (filter_language != "" and filter_language == codigo_idioma):
|
||||
logger.log("downloading mirror")
|
||||
logger.info("downloading mirror")
|
||||
else:
|
||||
logger.log("language " + codigo_idioma + " filtered, skipping")
|
||||
logger.info("language " + codigo_idioma + " filtered, skipping")
|
||||
continue
|
||||
|
||||
if hasattr(channel, 'play'):
|
||||
@@ -856,14 +856,14 @@ def download_all_episodes(item, channel, first_episode="", preferred_server="vid
|
||||
|
||||
# Adds it to the download list
|
||||
if puedes:
|
||||
logger.log("downloading mirror started...")
|
||||
logger.info("downloading mirror started...")
|
||||
# The highest quality video is the latest
|
||||
# mediaurl = video_urls[len(video_urls) - 1][1]
|
||||
devuelve = downloadbest(video_urls, show_title + " " + episode_title + " " + idioma +
|
||||
" [" + video_item.server + "]", continuar=False)
|
||||
|
||||
if devuelve == 0:
|
||||
logger.log("download ok")
|
||||
logger.info("download ok")
|
||||
descargado = True
|
||||
break
|
||||
elif devuelve == -1:
|
||||
@@ -874,14 +874,14 @@ def download_all_episodes(item, channel, first_episode="", preferred_server="vid
|
||||
pass
|
||||
return
|
||||
else:
|
||||
logger.log("download error, try another mirror")
|
||||
logger.info("download error, try another mirror")
|
||||
continue
|
||||
|
||||
else:
|
||||
logger.log("downloading mirror not available... trying next")
|
||||
logger.info("downloading mirror not available... trying next")
|
||||
|
||||
if not descargado:
|
||||
logger.log("UNDOWNLOADED EPISODE " + episode_title)
|
||||
logger.info("UNDOWNLOADED EPISODE " + episode_title)
|
||||
|
||||
|
||||
def episodio_ya_descargado(show_title, episode_title):
|
||||
@@ -889,9 +889,9 @@ def episodio_ya_descargado(show_title, episode_title):
|
||||
ficheros = filetools.listdir(".")
|
||||
|
||||
for fichero in ficheros:
|
||||
# logger.log("fichero="+fichero)
|
||||
# logger.info("fichero="+fichero)
|
||||
if fichero.lower().startswith(show_title.lower()) and scrapertools.find_single_match(fichero, "(\d+x\d+)") == episode_title:
|
||||
logger.log("found!")
|
||||
logger.info("found!")
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
@@ -814,7 +814,7 @@ def remove_tags(title):
|
||||
@rtype: str
|
||||
@return: string without tags
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
title_without_tags = scrapertools.find_single_match(title, r'\[color .+?\](.+)\[\/color\]')
|
||||
|
||||
@@ -832,7 +832,7 @@ def remove_smb_credential(path):
|
||||
@return: chain without credentials
|
||||
@rtype: str
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
if not scrapertools.find_single_match(path, r'(^\w+:\/\/)'):
|
||||
return path
|
||||
|
||||
@@ -125,11 +125,11 @@ def set_cookies(dict_cookie, clear=True, alfa_s=False):
|
||||
def load_cookies(alfa_s=False):
|
||||
cookies_lock.acquire()
|
||||
if os.path.isfile(cookies_file):
|
||||
if not alfa_s: logger.log("Reading cookies file")
|
||||
if not alfa_s: logger.info("Reading cookies file")
|
||||
try:
|
||||
cj.load(cookies_file, ignore_discard=True)
|
||||
except:
|
||||
if not alfa_s: logger.log("The cookie file exists but is illegible, it is deleted")
|
||||
if not alfa_s: logger.info("The cookie file exists but is illegible, it is deleted")
|
||||
os.remove(cookies_file)
|
||||
cookies_lock.release()
|
||||
|
||||
@@ -137,7 +137,7 @@ load_cookies()
|
||||
|
||||
def save_cookies(alfa_s=False):
|
||||
cookies_lock.acquire()
|
||||
if not alfa_s: logger.log("Saving cookies...")
|
||||
if not alfa_s: logger.debug("Saving cookies...")
|
||||
cj.save(cookies_file, ignore_discard=True)
|
||||
cookies_lock.release()
|
||||
|
||||
@@ -161,7 +161,7 @@ def random_useragent():
|
||||
|
||||
|
||||
def show_infobox(info_dict):
|
||||
logger.log()
|
||||
logger.debug()
|
||||
from textwrap import wrap
|
||||
|
||||
box_items_kodi = {'r_up_corner': u'\u250c',
|
||||
@@ -193,9 +193,9 @@ def show_infobox(info_dict):
|
||||
else:
|
||||
box = box_items
|
||||
|
||||
logger.log('%s%s%s' % (box['r_up_corner'], box['fill'] * width, box['l_up_corner']))
|
||||
logger.log('%s%s%s' % (box['center'], version.center(width), box['center']))
|
||||
logger.log('%s%s%s' % (box['r_center'], box['fill'] * width, box['l_center']))
|
||||
logger.debug('%s%s%s' % (box['r_up_corner'], box['fill'] * width, box['l_up_corner']))
|
||||
logger.debug('%s%s%s' % (box['center'], version.center(width), box['center']))
|
||||
logger.debug('%s%s%s' % (box['r_center'], box['fill'] * width, box['l_center']))
|
||||
|
||||
count = 0
|
||||
for key, value in info_dict:
|
||||
@@ -210,19 +210,19 @@ def show_infobox(info_dict):
|
||||
for line in text:
|
||||
if len(line) < width:
|
||||
line = line.ljust(width, ' ')
|
||||
logger.log('%s%s%s' % (box['center'], line, box['center']))
|
||||
logger.debug('%s%s%s' % (box['center'], line, box['center']))
|
||||
else:
|
||||
logger.log('%s%s%s' % (box['center'], text, box['center']))
|
||||
logger.debug('%s%s%s' % (box['center'], text, box['center']))
|
||||
if count < len(info_dict):
|
||||
logger.log('%s%s%s' % (box['r_center'], box['fill'] * width, box['l_center']))
|
||||
logger.debug('%s%s%s' % (box['r_center'], box['fill'] * width, box['l_center']))
|
||||
else:
|
||||
logger.log('%s%s%s' % (box['r_dn_corner'], box['fill'] * width, box['l_dn_corner']))
|
||||
logger.debug('%s%s%s' % (box['r_dn_corner'], box['fill'] * width, box['l_dn_corner']))
|
||||
return
|
||||
|
||||
|
||||
|
||||
def downloadpage(url, **opt):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
"""
|
||||
Open a url and return the data obtained
|
||||
|
||||
|
||||
@@ -298,7 +298,7 @@ class Item(object):
|
||||
def tostring(self, separator=", "):
|
||||
"""
|
||||
Generate a text string with the item's data for the log
|
||||
Use: logger.log(item.tostring())
|
||||
Use: logger.info(item.tostring())
|
||||
@param separator: string to be used as a separator
|
||||
@type separator: str
|
||||
'"""
|
||||
|
||||
@@ -11,24 +11,24 @@ from inspect import stack
|
||||
try:
|
||||
import json
|
||||
except:
|
||||
logger.log("json included in the interpreter **NOT** available")
|
||||
logger.info("json included in the interpreter **NOT** available")
|
||||
|
||||
try:
|
||||
import simplejson as json
|
||||
except:
|
||||
logger.log("simplejson included in the interpreter **NOT** available")
|
||||
logger.info("simplejson included in the interpreter **NOT** available")
|
||||
try:
|
||||
from lib import simplejson as json
|
||||
except:
|
||||
logger.log("simplejson in lib directory **NOT** available")
|
||||
logger.info("simplejson in lib directory **NOT** available")
|
||||
logger.error("A valid JSON parser was not found")
|
||||
json = None
|
||||
else:
|
||||
logger.log("Using simplejson in the lib directory")
|
||||
logger.info("Using simplejson in the lib directory")
|
||||
else:
|
||||
logger.log("Using simplejson included in the interpreter")
|
||||
logger.info("Using simplejson included in the interpreter")
|
||||
# ~ else:
|
||||
# ~ logger.log("Usando json incluido en el interprete")
|
||||
# ~ logger.info("Usando json incluido en el interprete")
|
||||
|
||||
import sys
|
||||
PY3 = False
|
||||
@@ -90,7 +90,7 @@ def get_node_from_file(name_file, node, path=None):
|
||||
@return: dict with the node to return
|
||||
@rtype: dict
|
||||
"""
|
||||
logger.log()
|
||||
logger.debug()
|
||||
from platformcode import config
|
||||
from core import filetools
|
||||
|
||||
@@ -129,7 +129,7 @@ def check_to_backup(data, fname, dict_data):
|
||||
@param dict_data: dictionary name
|
||||
@type dict_data: dict
|
||||
"""
|
||||
logger.log()
|
||||
logger.debug()
|
||||
|
||||
if not dict_data:
|
||||
logger.error("Error loading json from file %s" % fname)
|
||||
@@ -161,7 +161,7 @@ def update_node(dict_node, name_file, node, path=None, silent=False):
|
||||
@return json_data
|
||||
@rtype: dict
|
||||
"""
|
||||
if not silent: logger.log()
|
||||
if not silent: logger.info()
|
||||
|
||||
from platformcode import config
|
||||
from core import filetools
|
||||
|
||||
@@ -61,7 +61,7 @@ def find_and_set_infoLabels(item):
|
||||
# Check if there is a 'code'
|
||||
if scraper_result and item.infoLabels['code']:
|
||||
# correct code
|
||||
logger.log("Identificador encontrado: %s" % item.infoLabels['code'])
|
||||
logger.info("Identificador encontrado: %s" % item.infoLabels['code'])
|
||||
scraper.completar_codigos(item)
|
||||
return True
|
||||
elif scraper_result:
|
||||
@@ -71,7 +71,7 @@ def find_and_set_infoLabels(item):
|
||||
# Content not found
|
||||
msg = config.get_localized_string(60228) % title
|
||||
|
||||
logger.log(msg)
|
||||
logger.info(msg)
|
||||
# Show box with other options:
|
||||
if scrapers_disponibles[scraper_actual] in list_opciones_cuadro:
|
||||
list_opciones_cuadro.remove(scrapers_disponibles[scraper_actual])
|
||||
@@ -95,10 +95,10 @@ def find_and_set_infoLabels(item):
|
||||
|
||||
elif index == 1:
|
||||
# You have to create a dialog box to enter the data
|
||||
logger.log("Complete information")
|
||||
logger.info("Complete information")
|
||||
if cuadro_completar(item):
|
||||
# correct code
|
||||
logger.log("Identifier found: %s" % str(item.infoLabels['code']))
|
||||
logger.info("Identifier found: %s" % str(item.infoLabels['code']))
|
||||
return True
|
||||
# raise
|
||||
|
||||
@@ -121,7 +121,7 @@ def find_and_set_infoLabels(item):
|
||||
|
||||
|
||||
def cuadro_completar(item):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
global dict_default
|
||||
dict_default = {}
|
||||
@@ -234,7 +234,7 @@ def get_nfo(item):
|
||||
@rtype: str
|
||||
@return:
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
if "infoLabels" in item and "noscrap_id" in item.infoLabels:
|
||||
# Create the xml file with the data obtained from the item since there is no active scraper
|
||||
info_nfo = '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'
|
||||
|
||||
@@ -34,7 +34,7 @@ from platformcode import logger
|
||||
def printMatches(matches):
|
||||
i = 0
|
||||
for match in matches:
|
||||
logger.log("%d %s" % (i, match))
|
||||
logger.info("%d %s" % (i, match))
|
||||
i = i + 1
|
||||
|
||||
|
||||
@@ -447,7 +447,7 @@ def get_season_and_episode(title):
|
||||
except:
|
||||
pass
|
||||
|
||||
logger.log("'" + title + "' -> '" + filename + "'")
|
||||
logger.info("'" + title + "' -> '" + filename + "'")
|
||||
|
||||
return filename
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ def find_video_items(item=None, data=None):
|
||||
@return: returns the itemlist with the results
|
||||
@rtype: list
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
itemlist = []
|
||||
|
||||
# Download the page
|
||||
@@ -97,7 +97,7 @@ def get_servers_itemlist(itemlist, fnc=None, sort=False):
|
||||
|
||||
# Walk the patterns
|
||||
for pattern in server_parameters.get("find_videos", {}).get("patterns", []):
|
||||
logger.log(pattern["pattern"])
|
||||
logger.info(pattern["pattern"])
|
||||
# Scroll through the results
|
||||
for match in re.compile(pattern["pattern"], re.DOTALL).finditer(
|
||||
"\n".join([item.url.split('|')[0] for item in itemlist if not item.server])):
|
||||
@@ -144,7 +144,7 @@ def findvideos(data, skip=False):
|
||||
return some link. It can also be an integer greater than 1, which would represent the maximum number of links to search.
|
||||
:return:
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
devuelve = []
|
||||
skip = int(skip)
|
||||
servers_list = list(get_servers_list().keys())
|
||||
@@ -181,7 +181,7 @@ def findvideosbyserver(data, serverid):
|
||||
value = translate_server_name(server_parameters["name"]) , url, serverid, server_parameters.get("thumbnail", "")
|
||||
if value not in devuelve and url not in server_parameters["find_videos"].get("ignore_urls", []):
|
||||
devuelve.append(value)
|
||||
logger.log(msg)
|
||||
logger.info(msg)
|
||||
|
||||
return devuelve
|
||||
|
||||
@@ -193,7 +193,7 @@ def guess_server_thumbnail(serverid):
|
||||
|
||||
|
||||
def get_server_from_url(url):
|
||||
logger.log()
|
||||
logger.info()
|
||||
servers_list = list(get_servers_list().keys())
|
||||
|
||||
# Run findvideos on each active server
|
||||
@@ -211,7 +211,7 @@ def get_server_from_url(url):
|
||||
for n, pattern in enumerate(server_parameters["find_videos"].get("patterns", [])):
|
||||
msg = "%s\npattern: %s" % (serverid, pattern["pattern"])
|
||||
if not "pattern_compiled" in pattern:
|
||||
# logger.log('compiled ' + serverid)
|
||||
# logger.info('compiled ' + serverid)
|
||||
pattern["pattern_compiled"] = re.compile(pattern["pattern"])
|
||||
dict_servers_parameters[serverid]["find_videos"]["patterns"][n]["pattern_compiled"] = pattern["pattern_compiled"]
|
||||
# Scroll through the results
|
||||
@@ -224,7 +224,7 @@ def get_server_from_url(url):
|
||||
msg += "\nurl encontrada: %s" % url
|
||||
value = translate_server_name(server_parameters["name"]), url, serverid, server_parameters.get("thumbnail", "")
|
||||
if url not in server_parameters["find_videos"].get("ignore_urls", []):
|
||||
logger.log(msg)
|
||||
logger.info(msg)
|
||||
return value
|
||||
|
||||
return None
|
||||
@@ -247,7 +247,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
@return: returns the url of the video
|
||||
@rtype: list
|
||||
"""
|
||||
logger.log("Server: %s, Url: %s" % (server, url))
|
||||
logger.info("Server: %s, Url: %s" % (server, url))
|
||||
|
||||
server = server.lower()
|
||||
|
||||
@@ -260,7 +260,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
if server == "directo" or server == "local":
|
||||
if isinstance(video_password, list):
|
||||
return video_password, len(video_password) > 0, "<br/>".join(error_messages)
|
||||
logger.log("Server: %s, url is good" % server)
|
||||
logger.info("Server: %s, url is good" % server)
|
||||
video_urls.append(["%s [%s]" % (urlparse.urlparse(url)[2][-4:], config.get_localized_string(30137)), url])
|
||||
|
||||
# Find out the video URL
|
||||
@@ -291,7 +291,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
priority = int(config.get_setting("resolve_priority"))
|
||||
opciones = sorted(opciones, key=lambda x: orden[priority].index(x))
|
||||
|
||||
logger.log("Available options: %s | %s" % (len(opciones), opciones))
|
||||
logger.info("Available options: %s | %s" % (len(opciones), opciones))
|
||||
else:
|
||||
logger.error("There is no connector for the server %s" % server)
|
||||
error_messages.append(config.get_localized_string(60004) % server)
|
||||
@@ -300,7 +300,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
# Import the server
|
||||
try:
|
||||
server_module = __import__('servers.%s' % server, None, None, ["servers.%s" % server])
|
||||
logger.log("Imported server: %s" % server_module)
|
||||
logger.info("Imported server: %s" % server_module)
|
||||
except:
|
||||
server_module = None
|
||||
if muestra_dialogo:
|
||||
@@ -311,17 +311,17 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
|
||||
# If it has a function to see if the video exists, check it now
|
||||
if hasattr(server_module, 'test_video_exists'):
|
||||
logger.log("Invoking a %s.test_video_exists" % server)
|
||||
logger.info("Invoking a %s.test_video_exists" % server)
|
||||
try:
|
||||
video_exists, message = server_module.test_video_exists(page_url=url)
|
||||
|
||||
if not video_exists:
|
||||
error_messages.append(message)
|
||||
logger.log("test_video_exists says video doesn't exist")
|
||||
logger.info("test_video_exists says video doesn't exist")
|
||||
if muestra_dialogo:
|
||||
progreso.close()
|
||||
else:
|
||||
logger.log("test_video_exists says the video DOES exist")
|
||||
logger.info("test_video_exists says the video DOES exist")
|
||||
except:
|
||||
logger.error("Could not verify if the video exists")
|
||||
import traceback
|
||||
@@ -348,7 +348,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
# Free mode
|
||||
if opcion == "free":
|
||||
try:
|
||||
logger.log("Invoking a %s.get_video_url" % server)
|
||||
logger.info("Invoking a %s.get_video_url" % server)
|
||||
response = serverid.get_video_url(page_url=url, video_password=video_password)
|
||||
video_urls.extend(response)
|
||||
except:
|
||||
@@ -360,7 +360,7 @@ def resolve_video_urls_for_playing(server, url, video_password="", muestra_dialo
|
||||
# Premium mode
|
||||
else:
|
||||
try:
|
||||
logger.log("Invoking a %s.get_video_url" % opcion)
|
||||
logger.info("Invoking a %s.get_video_url" % opcion)
|
||||
response = serverid.get_video_url(page_url=url, premium=True,
|
||||
user=config.get_setting("user", server=opcion),
|
||||
password=config.get_setting("password", server=opcion),
|
||||
@@ -470,7 +470,7 @@ def get_server_parameters(server):
|
||||
@return: server data
|
||||
@rtype: dict
|
||||
"""
|
||||
# logger.log("server %s" % server)
|
||||
# logger.info("server %s" % server)
|
||||
global dict_servers_parameters
|
||||
server = server.split('.')[0]
|
||||
if not server:
|
||||
@@ -520,15 +520,15 @@ def get_server_parameters(server):
|
||||
|
||||
|
||||
# def get_server_json(server_name):
|
||||
# # logger.log("server_name=" + server_name)
|
||||
# # logger.info("server_name=" + server_name)
|
||||
# try:
|
||||
# server_path = filetools.join(config.get_runtime_path(), "servers", server_name + ".json")
|
||||
# if not filetools.exists(server_path):
|
||||
# server_path = filetools.join(config.get_runtime_path(), "servers", "debriders", server_name + ".json")
|
||||
#
|
||||
# # logger.log("server_path=" + server_path)
|
||||
# # logger.info("server_path=" + server_path)
|
||||
# server_json = jsontools.load(filetools.read(server_path))
|
||||
# # logger.log("server_json= %s" % server_json)
|
||||
# # logger.info("server_json= %s" % server_json)
|
||||
#
|
||||
# except Exception as ex:
|
||||
# template = "An exception of type %s occured. Arguments:\n%r"
|
||||
@@ -600,7 +600,7 @@ def get_server_setting(name, server, default=None):
|
||||
if isinstance(dict_file, dict) and 'settings' in dict_file:
|
||||
dict_settings = dict_file['settings']
|
||||
except EnvironmentError:
|
||||
logger.log("ERROR when reading the file: %s" % file_settings)
|
||||
logger.info("ERROR when reading the file: %s" % file_settings)
|
||||
|
||||
if not dict_settings or name not in dict_settings:
|
||||
# We get controls from the file ../servers/server.json
|
||||
@@ -614,7 +614,7 @@ def get_server_setting(name, server, default=None):
|
||||
dict_file['settings'] = dict_settings
|
||||
# We create the file ../settings/channel_data.json
|
||||
if not filetools.write(file_settings, jsontools.dump(dict_file)):
|
||||
logger.log("ERROR saving file: %s" % file_settings)
|
||||
logger.info("ERROR saving file: %s" % file_settings)
|
||||
|
||||
# We return the value of the local parameter 'name' if it exists, if default is not returned
|
||||
return dict_settings.get(name, default)
|
||||
@@ -636,7 +636,7 @@ def set_server_setting(name, value, server):
|
||||
dict_file = jsontools.load(filetools.read(file_settings))
|
||||
dict_settings = dict_file.get('settings', {})
|
||||
except EnvironmentError:
|
||||
logger.log("ERROR when reading the file: %s" % file_settings)
|
||||
logger.info("ERROR when reading the file: %s" % file_settings)
|
||||
|
||||
dict_settings[name] = value
|
||||
|
||||
@@ -648,7 +648,7 @@ def set_server_setting(name, value, server):
|
||||
|
||||
# We create the file ../settings/channel_data.json
|
||||
if not filetools.write(file_settings, jsontools.dump(dict_file)):
|
||||
logger.log("ERROR saving file: %s" % file_settings)
|
||||
logger.info("ERROR saving file: %s" % file_settings)
|
||||
return None
|
||||
|
||||
return value
|
||||
@@ -683,7 +683,7 @@ def get_debriders_list():
|
||||
if server.endswith(".json"):
|
||||
server_parameters = get_server_parameters(server)
|
||||
if server_parameters["active"] == True:
|
||||
logger.log(server_parameters)
|
||||
logger.info(server_parameters)
|
||||
server_list[server.split(".")[0]] = server_parameters
|
||||
return server_list
|
||||
|
||||
@@ -729,7 +729,7 @@ def check_list_links(itemlist, numero='', timeout=3):
|
||||
it = res[0]
|
||||
verificacion = res[1]
|
||||
it.title = verificacion + ' ' + it.title.strip()
|
||||
logger.log('VERIFICATION= ' + verificacion)
|
||||
logger.info('VERIFICATION= ' + verificacion)
|
||||
it.alive = verificacion
|
||||
return itemlist
|
||||
|
||||
@@ -750,7 +750,7 @@ def check_video_link(item, timeout=3):
|
||||
server_module = __import__('servers.%s' % server, None, None, ["servers.%s" % server])
|
||||
except:
|
||||
server_module = None
|
||||
logger.log("[check_video_link] Cannot import server! %s" % server)
|
||||
logger.info("[check_video_link] Cannot import server! %s" % server)
|
||||
return item, NK
|
||||
|
||||
if hasattr(server_module, 'test_video_exists'):
|
||||
@@ -760,20 +760,20 @@ def check_video_link(item, timeout=3):
|
||||
try:
|
||||
video_exists, message = server_module.test_video_exists(page_url=url)
|
||||
if not video_exists:
|
||||
logger.log("[check_video_link] Does not exist! %s %s %s" % (message, server, url))
|
||||
logger.info("[check_video_link] Does not exist! %s %s %s" % (message, server, url))
|
||||
resultado = KO
|
||||
else:
|
||||
logger.log("[check_video_link] check ok %s %s" % (server, url))
|
||||
logger.info("[check_video_link] check ok %s %s" % (server, url))
|
||||
resultado = OK
|
||||
except:
|
||||
logger.log("[check_video_link] Can't check now! %s %s" % (server, url))
|
||||
logger.info("[check_video_link] Can't check now! %s %s" % (server, url))
|
||||
resultado = NK
|
||||
|
||||
finally:
|
||||
httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT = ant_timeout # Restore download time
|
||||
return item, resultado
|
||||
|
||||
logger.log("[check_video_link] There is no test_video_exists for server: %s" % server)
|
||||
logger.info("[check_video_link] There is no test_video_exists for server: %s" % server)
|
||||
return item, NK
|
||||
|
||||
def translate_server_name(name):
|
||||
|
||||
@@ -7,13 +7,12 @@ PY3 = False
|
||||
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
||||
if PY3:
|
||||
from concurrent import futures
|
||||
import urllib.request as urllib
|
||||
from urllib.request import Request, urlopen
|
||||
import urllib.parse as urlparse
|
||||
from urllib.parse import urlencode
|
||||
else:
|
||||
from concurrent_py2 import futures
|
||||
import urllib, urlparse
|
||||
import urlparse
|
||||
from urllib2 import Request, urlopen
|
||||
from urllib import urlencode
|
||||
|
||||
@@ -22,7 +21,7 @@ from core import httptools, scrapertools, servertools, tmdb, channeltools
|
||||
from core.item import Item
|
||||
from lib import unshortenit
|
||||
from platformcode import config
|
||||
from platformcode.logger import log
|
||||
from platformcode.logger import info
|
||||
from platformcode import logger
|
||||
from specials import autoplay
|
||||
|
||||
@@ -35,7 +34,7 @@ def hdpass_get_servers(item):
|
||||
|
||||
for mir_url, srv in scrapertools.find_multiple_matches(mir, patron_option):
|
||||
mir_url = scrapertools.decodeHtmlentities(mir_url)
|
||||
log(mir_url)
|
||||
info(mir_url)
|
||||
it = item.clone(action="play", quality=quality, title=srv, server=srv, url= mir_url)
|
||||
if not servertools.get_server_parameters(srv.lower()): it = hdpass_get_url(it)[0] # do not exists or it's empty
|
||||
ret.append(it)
|
||||
@@ -83,7 +82,7 @@ def color(text, color):
|
||||
|
||||
|
||||
def search(channel, item, texto):
|
||||
log(item.url + " search " + texto)
|
||||
info(item.url + " search " + texto)
|
||||
if 'findhost' in dir(channel): channel.findhost()
|
||||
item.url = channel.host + "/?s=" + texto
|
||||
try:
|
||||
@@ -162,11 +161,10 @@ def unifyEp(ep):
|
||||
|
||||
def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, typeContentDict, typeActionDict, blacklist, search, pag, function, lang, sceneTitle):
|
||||
itemlist = []
|
||||
log("scrapeBlock qui")
|
||||
if debug:
|
||||
regexDbg(item, patron, headers, block)
|
||||
matches = scrapertools.find_multiple_matches_groups(block, patron)
|
||||
log('MATCHES =', matches)
|
||||
logger.debug('MATCHES =', matches)
|
||||
|
||||
known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang', 'other', 'size', 'seed']
|
||||
# Legenda known_keys per i groups nei patron
|
||||
@@ -283,7 +281,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
try:
|
||||
parsedTitle = guessit(title)
|
||||
title = longtitle = parsedTitle.get('title', '')
|
||||
log('TITOLO',title)
|
||||
logger.debug('TITOLO',title)
|
||||
if parsedTitle.get('source'):
|
||||
quality = str(parsedTitle.get('source'))
|
||||
if parsedTitle.get('screen_size'):
|
||||
@@ -317,7 +315,7 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
||||
longtitle += s + parsedTitle.get('episode_title')
|
||||
item.contentEpisodeTitle = parsedTitle.get('episode_title')
|
||||
except:
|
||||
log('Error')
|
||||
logger.debug('Error')
|
||||
|
||||
longtitle = typo(longtitle, 'bold')
|
||||
lang1, longtitle = scrapeLang(scraped, lang, longtitle)
|
||||
@@ -404,7 +402,7 @@ def scrape(func):
|
||||
|
||||
args = func(*args)
|
||||
function = func.__name__ if not 'actLike' in args else args['actLike']
|
||||
# log('STACK= ',inspect.stack()[1][3])
|
||||
# info('STACK= ',inspect.stack()[1][3])
|
||||
|
||||
item = args['item']
|
||||
|
||||
@@ -436,7 +434,7 @@ def scrape(func):
|
||||
matches = []
|
||||
|
||||
for n in range(2):
|
||||
log('PATRON= ', patron)
|
||||
logger.debug('PATRON= ', patron)
|
||||
if not data:
|
||||
page = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True)
|
||||
data = re.sub("='([^']+)'", '="\\1"', page.data)
|
||||
@@ -452,7 +450,7 @@ def scrape(func):
|
||||
blocks = scrapertools.find_multiple_matches_groups(data, patronBlock)
|
||||
block = ""
|
||||
for bl in blocks:
|
||||
# log(len(blocks),bl)
|
||||
# info(len(blocks),bl)
|
||||
if 'season' in bl and bl['season']:
|
||||
item.season = bl['season']
|
||||
blockItemlist, blockMatches = scrapeBlock(item, args, bl['block'], patron, headers, action, pagination, debug,
|
||||
@@ -477,7 +475,7 @@ def scrape(func):
|
||||
|
||||
# if url may be changed and channel has findhost to update
|
||||
if 'findhost' in func.__globals__ and not itemlist:
|
||||
log('running findhost ' + func.__module__)
|
||||
info('running findhost ' + func.__module__)
|
||||
host = func.__globals__['findhost']()
|
||||
parse = list(urlparse.urlparse(item.url))
|
||||
from core import jsontools
|
||||
@@ -534,7 +532,7 @@ def scrape(func):
|
||||
if config.get_setting('trakt_sync'):
|
||||
from core import trakt_tools
|
||||
trakt_tools.trakt_check(itemlist)
|
||||
log('scraping time: ', time()-scrapingTime)
|
||||
logger.debug('scraping time: ', time()-scrapingTime)
|
||||
return itemlist
|
||||
|
||||
return wrapper
|
||||
@@ -712,15 +710,11 @@ def menuItem(itemlist, filename, title='', action='', url='', contentType='undef
|
||||
|
||||
def menu(func):
|
||||
def wrapper(*args):
|
||||
log()
|
||||
args = func(*args)
|
||||
|
||||
item = args['item']
|
||||
log(item.channel + ' start')
|
||||
logger.debug(item.channel + ' menu start')
|
||||
host = func.__globals__['host']
|
||||
list_servers = func.__globals__['list_servers'] if 'list_servers' in func.__globals__ else ['directo']
|
||||
list_quality = func.__globals__['list_quality'] if 'list_quality' in func.__globals__ else ['default']
|
||||
log('LIST QUALITY', list_quality)
|
||||
filename = func.__module__.split('.')[1]
|
||||
single_search = False
|
||||
# listUrls = ['film', 'filmSub', 'tvshow', 'tvshowSub', 'anime', 'animeSub', 'search', 'top', 'topSub']
|
||||
@@ -735,7 +729,7 @@ def menu(func):
|
||||
|
||||
for name in listUrls:
|
||||
dictUrl[name] = args[name] if name in args else None
|
||||
log(dictUrl[name])
|
||||
logger.debug(dictUrl[name])
|
||||
if name == 'film': title = 'Film'
|
||||
if name == 'tvshow': title = 'Serie TV'
|
||||
if name == 'anime': title = 'Anime'
|
||||
@@ -803,7 +797,7 @@ def menu(func):
|
||||
|
||||
# Apply auto Thumbnails at the menus
|
||||
thumb(itemlist)
|
||||
log(item.channel + ' end')
|
||||
logger.debug(item.channel + ' menu end')
|
||||
return itemlist
|
||||
|
||||
return wrapper
|
||||
@@ -1066,7 +1060,7 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
||||
# Simply add this function to add video library support
|
||||
# Function_level is useful if the function is called by another function.
|
||||
# If the call is direct, leave it blank
|
||||
log()
|
||||
info()
|
||||
|
||||
if item.contentType == 'movie':
|
||||
action = 'add_pelicula_to_library'
|
||||
@@ -1116,7 +1110,7 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
|
||||
def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page='', resub=[]):
|
||||
# Function_level is useful if the function is called by another function.
|
||||
# If the call is direct, leave it blank
|
||||
log()
|
||||
info()
|
||||
action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level
|
||||
if next_page == '':
|
||||
next_page = scrapertools.find_single_match(data, patron)
|
||||
@@ -1126,7 +1120,7 @@ def nextPage(itemlist, item, data='', patron='', function_or_level=1, next_page=
|
||||
if 'http' not in next_page:
|
||||
next_page = scrapertools.find_single_match(item.url, 'https?://[a-z0-9.-]+') + (next_page if next_page.startswith('/') else '/' + next_page)
|
||||
next_page = next_page.replace('&', '&')
|
||||
log('NEXT= ', next_page)
|
||||
info('NEXT= ', next_page)
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action = action,
|
||||
@@ -1154,7 +1148,7 @@ def pagination(itemlist, item, page, perpage, function_level=1):
|
||||
|
||||
|
||||
def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True, Download=True, patronTag=None, Videolibrary=True):
|
||||
log()
|
||||
info()
|
||||
blacklisted_servers = config.get_setting("black_list", server='servers')
|
||||
if not blacklisted_servers: blacklisted_servers = []
|
||||
if not data and not itemlist:
|
||||
@@ -1167,7 +1161,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
def getItem(videoitem):
|
||||
if not servertools.get_server_parameters(videoitem.server.lower()): # do not exists or it's empty
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
log(findS)
|
||||
info(findS)
|
||||
if not findS:
|
||||
if item.channel == 'community':
|
||||
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
||||
@@ -1175,7 +1169,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
||||
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
||||
findS = servertools.get_server_from_url(videoitem.url)
|
||||
if not findS:
|
||||
log(videoitem, 'Non supportato')
|
||||
info(videoitem, 'Non supportato')
|
||||
return
|
||||
videoitem.server = findS[2]
|
||||
videoitem.title = findS[0]
|
||||
@@ -1328,7 +1322,7 @@ def addQualityTag(item, itemlist, data, patron):
|
||||
folder=False,
|
||||
thumbnail=thumb('info')))
|
||||
else:
|
||||
log('nessun tag qualità trovato')
|
||||
info('nessun tag qualità trovato')
|
||||
|
||||
def get_jwplayer_mediaurl(data, srvName, onlyHttp=False):
|
||||
video_urls = []
|
||||
@@ -1419,7 +1413,7 @@ def thumb(item_itemlist_string=None, genre=False, live=False):
|
||||
'_tvshow':['serie','tv', 'fiction']}
|
||||
|
||||
def autoselect_thumb(item, genre):
|
||||
log('SPLIT',re.split(r'\.|\{|\}|\[|\]|\(|\)|/| ',item.title.lower()))
|
||||
info('SPLIT',re.split(r'\.|\{|\}|\[|\]|\(|\)|/| ',item.title.lower()))
|
||||
if genre == False:
|
||||
for thumb, titles in icon_dict.items():
|
||||
if any(word in re.split(r'\.|\{|\}|\[|\]|\(|\)|/| ',item.title.lower()) for word in search):
|
||||
|
||||
18
core/tmdb.py
18
core/tmdb.py
@@ -87,7 +87,7 @@ create_bd()
|
||||
|
||||
# The function name is the name of the decorator and receives the function that decorates.
|
||||
def cache_response(fn):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
# import time
|
||||
# start_time = time.time()
|
||||
@@ -498,7 +498,7 @@ def set_infoLabels_item(item, seekTmdb=True, idioma_busqueda=def_lang, lock=None
|
||||
|
||||
|
||||
def find_and_set_infoLabels(item):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
global otmdb_global
|
||||
tmdb_result = None
|
||||
@@ -908,7 +908,7 @@ class Tmdb(object):
|
||||
cls.dic_generos[idioma][tipo] = {}
|
||||
url = ('http://api.themoviedb.org/3/genre/%s/list?api_key=a1ab8b8669da03637a4b98fa39c39228&language=%s' % (tipo, idioma))
|
||||
try:
|
||||
logger.log("[Tmdb.py] Filling in dictionary of genres")
|
||||
logger.info("[Tmdb.py] Filling in dictionary of genres")
|
||||
|
||||
resultado = cls.get_json(url)
|
||||
if not isinstance(resultado, dict):
|
||||
@@ -940,7 +940,7 @@ class Tmdb(object):
|
||||
'&language=%s' % (self.busqueda_id, source, self.busqueda_idioma))
|
||||
buscando = "%s: %s" % (source.capitalize(), self.busqueda_id)
|
||||
|
||||
logger.log("[Tmdb.py] Searching %s:\n%s" % (buscando, url))
|
||||
logger.info("[Tmdb.py] Searching %s:\n%s" % (buscando, url))
|
||||
resultado = self.get_json(url)
|
||||
if not isinstance(resultado, dict):
|
||||
resultado = ast.literal_eval(resultado.decode('utf-8'))
|
||||
@@ -985,7 +985,7 @@ class Tmdb(object):
|
||||
url += '&year=%s' % self.busqueda_year
|
||||
|
||||
buscando = self.busqueda_texto.capitalize()
|
||||
logger.log("[Tmdb.py] Searching %s on page %s:\n%s" % (buscando, page, url))
|
||||
logger.info("[Tmdb.py] Searching %s on page %s:\n%s" % (buscando, page, url))
|
||||
resultado = self.get_json(url)
|
||||
if not isinstance(resultado, dict):
|
||||
resultado = ast.literal_eval(resultado.decode('utf-8'))
|
||||
@@ -1046,7 +1046,7 @@ class Tmdb(object):
|
||||
url = ('http://api.themoviedb.org/3/%s?api_key=a1ab8b8669da03637a4b98fa39c39228&%s'
|
||||
% (type_search, "&".join(params)))
|
||||
|
||||
logger.log("[Tmdb.py] Searcing %s:\n%s" % (type_search, url))
|
||||
logger.info("[Tmdb.py] Searcing %s:\n%s" % (type_search, url))
|
||||
resultado = self.get_json(url)
|
||||
if not isinstance(resultado, dict):
|
||||
resultado = ast.literal_eval(resultado.decode('utf-8'))
|
||||
@@ -1111,7 +1111,7 @@ class Tmdb(object):
|
||||
return True
|
||||
|
||||
def get_list_resultados(self, num_result=20):
|
||||
# logger.log("self %s" % str(self))
|
||||
# logger.info("self %s" % str(self))
|
||||
res = []
|
||||
|
||||
if num_result <= 0:
|
||||
@@ -1331,7 +1331,7 @@ class Tmdb(object):
|
||||
"&append_to_response=credits" % (self.result["id"], numtemporada, self.busqueda_idioma)
|
||||
|
||||
buscando = "id_Tmdb: " + str(self.result["id"]) + " season: " + str(numtemporada) + "\nURL: " + url
|
||||
logger.log("[Tmdb.py] Searcing " + buscando)
|
||||
logger.info("[Tmdb.py] Searcing " + buscando)
|
||||
try:
|
||||
self.temporada[numtemporada] = self.get_json(url)
|
||||
if not isinstance(self.temporada[numtemporada], dict):
|
||||
@@ -1520,7 +1520,7 @@ class Tmdb(object):
|
||||
|
||||
items.extend(list(self.get_episodio(ret_infoLabels['season'], episodio).items()))
|
||||
|
||||
# logger.log("ret_infoLabels" % ret_infoLabels)
|
||||
# logger.info("ret_infoLabels" % ret_infoLabels)
|
||||
|
||||
for k, v in items:
|
||||
if not v:
|
||||
|
||||
@@ -128,7 +128,7 @@ def token_trakt(item):
|
||||
|
||||
|
||||
def set_trakt_info(item):
|
||||
logger.log()
|
||||
logger.info()
|
||||
import xbmcgui
|
||||
# Envia los datos a trakt
|
||||
try:
|
||||
@@ -139,7 +139,7 @@ def set_trakt_info(item):
|
||||
pass
|
||||
|
||||
def get_trakt_watched(id_type, mediatype, update=False):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
id_list = []
|
||||
id_dict = dict()
|
||||
@@ -229,7 +229,7 @@ def trakt_check(itemlist):
|
||||
|
||||
|
||||
def get_sync_from_file():
|
||||
logger.log()
|
||||
logger.info()
|
||||
sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt_data.json')
|
||||
trakt_node = {}
|
||||
if os.path.exists(sync_path):
|
||||
@@ -241,7 +241,7 @@ def get_sync_from_file():
|
||||
|
||||
|
||||
def update_trakt_data(mediatype, trakt_data):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
sync_path = os.path.join(config.get_data_path(), 'settings_channels', 'trakt_data.json')
|
||||
if os.path.exists(sync_path):
|
||||
@@ -251,7 +251,7 @@ def update_trakt_data(mediatype, trakt_data):
|
||||
|
||||
|
||||
def ask_install_script():
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
from platformcode import platformtools
|
||||
|
||||
@@ -265,7 +265,7 @@ def ask_install_script():
|
||||
|
||||
|
||||
def wait_for_update_trakt():
|
||||
logger.log()
|
||||
logger.info()
|
||||
t = Thread(update_all)
|
||||
t.setDaemon(True)
|
||||
t.start()
|
||||
@@ -274,7 +274,7 @@ def wait_for_update_trakt():
|
||||
def update_all():
|
||||
# from core.support import dbg;dbg()
|
||||
from time import sleep
|
||||
logger.log()
|
||||
logger.info()
|
||||
sleep(20)
|
||||
while xbmc.Player().isPlaying():
|
||||
sleep(20)
|
||||
|
||||
32
core/tvdb.py
32
core/tvdb.py
@@ -73,8 +73,8 @@ otvdb_global = None
|
||||
|
||||
|
||||
def find_and_set_infoLabels(item):
|
||||
logger.log()
|
||||
# logger.log("item es %s" % item)
|
||||
logger.info()
|
||||
# logger.info("item es %s" % item)
|
||||
|
||||
p_dialog = None
|
||||
if not item.contentSeason:
|
||||
@@ -368,7 +368,7 @@ class Tvdb(object):
|
||||
|
||||
@classmethod
|
||||
def __check_token(cls):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
if TOKEN == "":
|
||||
cls.__login()
|
||||
else:
|
||||
@@ -383,7 +383,7 @@ class Tvdb(object):
|
||||
|
||||
@staticmethod
|
||||
def __login():
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
global TOKEN
|
||||
|
||||
apikey = "106B699FDC04301C"
|
||||
@@ -413,7 +413,7 @@ class Tvdb(object):
|
||||
|
||||
@classmethod
|
||||
def __refresh_token(cls):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
global TOKEN
|
||||
is_success = False
|
||||
|
||||
@@ -512,7 +512,7 @@ class Tvdb(object):
|
||||
]
|
||||
}
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
if id_episode and self.episodes.get(id_episode):
|
||||
return self.episodes.get(id_episode)
|
||||
|
||||
@@ -582,7 +582,7 @@ class Tvdb(object):
|
||||
}
|
||||
}
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
try:
|
||||
url = HOST + "/series/%s/episodes?page=%s" % (_id, page)
|
||||
@@ -600,7 +600,7 @@ class Tvdb(object):
|
||||
else:
|
||||
self.list_episodes[page] = jsontools.load(html)
|
||||
|
||||
# logger.log("dict_html %s" % self.list_episodes)
|
||||
# logger.info("dict_html %s" % self.list_episodes)
|
||||
|
||||
return self.list_episodes[page]
|
||||
|
||||
@@ -668,7 +668,7 @@ class Tvdb(object):
|
||||
"""
|
||||
if semaforo:
|
||||
semaforo.acquire()
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
url = HOST + "/episodes/%s" % _id
|
||||
|
||||
@@ -691,7 +691,7 @@ class Tvdb(object):
|
||||
dict_html = jsontools.load(html)
|
||||
dict_html = dict_html.pop("data")
|
||||
|
||||
logger.log("dict_html %s" % dict_html)
|
||||
logger.info("dict_html %s" % dict_html)
|
||||
self.episodes[_id] = dict_html
|
||||
|
||||
if semaforo:
|
||||
@@ -722,7 +722,7 @@ class Tvdb(object):
|
||||
"status": "string"
|
||||
}
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
try:
|
||||
|
||||
@@ -743,7 +743,7 @@ class Tvdb(object):
|
||||
req = urllib.request.Request(url, headers=DEFAULT_HEADERS)
|
||||
response = urllib.request.urlopen(req)
|
||||
html = response.read()
|
||||
logger.log(html)
|
||||
logger.info(html)
|
||||
response.close()
|
||||
|
||||
except Exception as ex:
|
||||
@@ -821,7 +821,7 @@ class Tvdb(object):
|
||||
}
|
||||
}
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
resultado = {}
|
||||
|
||||
url = HOST + "/series/%s" % _id
|
||||
@@ -880,7 +880,7 @@ class Tvdb(object):
|
||||
@rtype: dict
|
||||
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
if self.result.get('image_season_%s' % season):
|
||||
return self.result['image_season_%s' % season]
|
||||
@@ -932,7 +932,7 @@ class Tvdb(object):
|
||||
@return: dictionary with actors
|
||||
@rtype: dict
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
url = HOST + "/series/%s/actors" % _id
|
||||
DEFAULT_HEADERS["Accept-Language"] = lang
|
||||
@@ -962,7 +962,7 @@ class Tvdb(object):
|
||||
@rtype: list
|
||||
@return: list of results
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
list_results = []
|
||||
|
||||
# if we have a result and it has seriesName, we already have the info of the series, it is not necessary to search again
|
||||
|
||||
@@ -78,7 +78,7 @@ def save_movie(item, silent=False):
|
||||
@rtype fallidos: int
|
||||
@return: the number of failed items or -1 if all failed
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug(item.tostring('\n'))
|
||||
insertados = 0
|
||||
sobreescritos = 0
|
||||
@@ -144,7 +144,7 @@ def save_movie(item, silent=False):
|
||||
if not path:
|
||||
# Create folder
|
||||
path = filetools.join(MOVIES_PATH, ("%s [%s]" % (base_name, _id)).strip())
|
||||
logger.log("Creating movie directory:" + path)
|
||||
logger.info("Creating movie directory:" + path)
|
||||
if not filetools.mkdir(path):
|
||||
logger.debug("Could not create directory")
|
||||
return 0, 0, -1, path
|
||||
@@ -159,7 +159,7 @@ def save_movie(item, silent=False):
|
||||
|
||||
if not nfo_exists:
|
||||
# We create .nfo if it doesn't exist
|
||||
logger.log("Creating .nfo: " + nfo_path)
|
||||
logger.info("Creating .nfo: " + nfo_path)
|
||||
head_nfo = scraper.get_nfo(item)
|
||||
|
||||
item_nfo = Item(title=item.contentTitle, channel="videolibrary", action='findvideos',
|
||||
@@ -182,7 +182,7 @@ def save_movie(item, silent=False):
|
||||
if item_nfo and strm_exists:
|
||||
|
||||
if json_exists:
|
||||
logger.log("The file exists. Is overwritten")
|
||||
logger.info("The file exists. Is overwritten")
|
||||
sobreescritos += 1
|
||||
else:
|
||||
insertados += 1
|
||||
@@ -209,7 +209,7 @@ def save_movie(item, silent=False):
|
||||
item_nfo.library_urls[item.channel] = item.url
|
||||
|
||||
if filetools.write(nfo_path, head_nfo + item_nfo.tojson()):
|
||||
#logger.log("FOLDER_MOVIES : %s" % FOLDER_MOVIES)
|
||||
#logger.info("FOLDER_MOVIES : %s" % FOLDER_MOVIES)
|
||||
# We update the Kodi video library with the movie
|
||||
if config.is_xbmc() and config.get_setting("videolibrary_kodi") and not silent:
|
||||
from platformcode import xbmc_videolibrary
|
||||
@@ -238,7 +238,7 @@ def update_renumber_options(item, head_nfo, path):
|
||||
json = json_file['TVSHOW_AUTORENUMBER']
|
||||
if item.fulltitle in json:
|
||||
item.channel_prefs[channel]['TVSHOW_AUTORENUMBER'] = json[item.fulltitle]
|
||||
logger.log('UPDATED=\n' + str(item.channel_prefs))
|
||||
logger.info('UPDATED=\n' + str(item.channel_prefs))
|
||||
filetools.write(tvshow_path, head_nfo + item.tojson())
|
||||
|
||||
def add_renumber_options(item, head_nfo, path):
|
||||
@@ -426,7 +426,7 @@ def save_tvshow(item, episodelist, silent=False):
|
||||
@rtype path: str
|
||||
@return: serial directory
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug(item.tostring('\n'))
|
||||
path = ""
|
||||
|
||||
@@ -483,7 +483,7 @@ def save_tvshow(item, episodelist, silent=False):
|
||||
|
||||
if not path:
|
||||
path = filetools.join(TVSHOWS_PATH, ("%s [%s]" % (base_name, _id)).strip())
|
||||
logger.log("Creating series directory: " + path)
|
||||
logger.info("Creating series directory: " + path)
|
||||
try:
|
||||
filetools.mkdir(path)
|
||||
except OSError as exception:
|
||||
@@ -493,7 +493,7 @@ def save_tvshow(item, episodelist, silent=False):
|
||||
tvshow_path = filetools.join(path, "tvshow.nfo")
|
||||
if not filetools.exists(tvshow_path):
|
||||
# We create tvshow.nfo, if it does not exist, with the head_nfo, series info and watched episode marks
|
||||
logger.log("Creating tvshow.nfo: " + tvshow_path)
|
||||
logger.info("Creating tvshow.nfo: " + tvshow_path)
|
||||
head_nfo = scraper.get_nfo(item)
|
||||
item.infoLabels['mediatype'] = "tvshow"
|
||||
item.infoLabels['title'] = item.contentSerieName
|
||||
@@ -567,11 +567,11 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
@rtype fallidos: int
|
||||
@return: the number of failed episodes
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
episodelist = filter_list(episodelist, serie.action, path)
|
||||
# No episode list, nothing to save
|
||||
if not len(episodelist):
|
||||
logger.log("There is no episode list, we go out without creating strm")
|
||||
logger.info("There is no episode list, we go out without creating strm")
|
||||
return 0, 0, 0
|
||||
|
||||
# process local episodes
|
||||
@@ -586,7 +586,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
elif config.get_setting("local_episodes", "videolibrary"):
|
||||
done, local_episodes_path = config_local_episodes_path(path, serie)
|
||||
if done < 0:
|
||||
logger.log("An issue has occurred while configuring local episodes, going out without creating strm")
|
||||
logger.info("An issue has occurred while configuring local episodes, going out without creating strm")
|
||||
return 0, 0, done
|
||||
item_nfo.local_episodes_path = local_episodes_path
|
||||
filetools.write(nfo_path, head_nfo + item_nfo.tojson())
|
||||
@@ -710,7 +710,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
|
||||
# No episode list, nothing to save
|
||||
if not len(new_episodelist):
|
||||
logger.log("There is no episode list, we go out without creating strm")
|
||||
logger.info("There is no episode list, we go out without creating strm")
|
||||
return 0, 0, 0
|
||||
|
||||
local_episodelist += get_local_content(path)
|
||||
@@ -742,12 +742,12 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
json_path = filetools.join(path, ("%s [%s].json" % (season_episode, e.channel)).lower())
|
||||
|
||||
if season_episode in local_episodelist:
|
||||
logger.log('Skipped: Serie ' + serie.contentSerieName + ' ' + season_episode + ' available as local content')
|
||||
logger.info('Skipped: Serie ' + serie.contentSerieName + ' ' + season_episode + ' available as local content')
|
||||
continue
|
||||
|
||||
# check if the episode has been downloaded
|
||||
if filetools.join(path, "%s [downloads].json" % season_episode) in ficheros:
|
||||
logger.log('INFO: "%s" episode %s has been downloaded, skipping it' % (serie.contentSerieName, season_episode))
|
||||
logger.info('INFO: "%s" episode %s has been downloaded, skipping it' % (serie.contentSerieName, season_episode))
|
||||
continue
|
||||
|
||||
strm_exists = strm_path in ficheros
|
||||
@@ -800,7 +800,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
|
||||
if filetools.write(json_path, e.tojson()):
|
||||
if not json_exists:
|
||||
logger.log("Inserted: %s" % json_path)
|
||||
logger.info("Inserted: %s" % json_path)
|
||||
insertados += 1
|
||||
# We mark episode as unseen
|
||||
news_in_playcounts[season_episode] = 0
|
||||
@@ -811,14 +811,14 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
news_in_playcounts[serie.contentSerieName] = 0
|
||||
|
||||
else:
|
||||
logger.log("Overwritten: %s" % json_path)
|
||||
logger.info("Overwritten: %s" % json_path)
|
||||
sobreescritos += 1
|
||||
else:
|
||||
logger.log("Failed: %s" % json_path)
|
||||
logger.info("Failed: %s" % json_path)
|
||||
fallidos += 1
|
||||
|
||||
else:
|
||||
logger.log("Failed: %s" % json_path)
|
||||
logger.info("Failed: %s" % json_path)
|
||||
fallidos += 1
|
||||
|
||||
if not silent and p_dialog.iscanceled():
|
||||
@@ -888,7 +888,7 @@ def save_episodes(path, episodelist, serie, silent=False, overwrite=True):
|
||||
|
||||
|
||||
def config_local_episodes_path(path, item, silent=False):
|
||||
logger.log(item)
|
||||
logger.info(item)
|
||||
from platformcode.xbmc_videolibrary import search_local_path
|
||||
local_episodes_path=search_local_path(item)
|
||||
if not local_episodes_path:
|
||||
@@ -900,11 +900,11 @@ def config_local_episodes_path(path, item, silent=False):
|
||||
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(80043))
|
||||
local_episodes_path = platformtools.dialog_browse(0, config.get_localized_string(80046))
|
||||
if local_episodes_path == '':
|
||||
logger.log("User has canceled the dialog")
|
||||
logger.info("User has canceled the dialog")
|
||||
return -2, local_episodes_path
|
||||
elif path in local_episodes_path:
|
||||
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(80045))
|
||||
logger.log("Selected folder is the same of the TV show one")
|
||||
logger.info("Selected folder is the same of the TV show one")
|
||||
return -2, local_episodes_path
|
||||
|
||||
if local_episodes_path:
|
||||
@@ -919,7 +919,7 @@ def config_local_episodes_path(path, item, silent=False):
|
||||
|
||||
|
||||
def process_local_episodes(local_episodes_path, path):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
sub_extensions = ['.srt', '.sub', '.sbv', '.ass', '.idx', '.ssa', '.smi']
|
||||
artwork_extensions = ['.jpg', '.jpeg', '.png']
|
||||
@@ -958,7 +958,7 @@ def process_local_episodes(local_episodes_path, path):
|
||||
|
||||
|
||||
def get_local_content(path):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
local_episodelist = []
|
||||
for root, folders, files in filetools.walk(path):
|
||||
@@ -987,7 +987,7 @@ def add_movie(item):
|
||||
@type item: item
|
||||
@param item: item to be saved.
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
||||
|
||||
# To disambiguate titles, TMDB is caused to ask for the really desired title
|
||||
@@ -1034,7 +1034,7 @@ def add_tvshow(item, channel=None):
|
||||
@param channel: channel from which the series will be saved. By default, item.from_channel or item.channel will be imported.
|
||||
|
||||
"""
|
||||
logger.log("show=#" + item.show + "#")
|
||||
logger.info("show=#" + item.show + "#")
|
||||
from platformcode.launcher import set_search_temp; set_search_temp(item)
|
||||
|
||||
if item.channel == "downloads":
|
||||
@@ -1105,7 +1105,7 @@ def add_tvshow(item, channel=None):
|
||||
|
||||
else:
|
||||
platformtools.dialog_ok(config.get_localized_string(30131), config.get_localized_string(60070) % item.show)
|
||||
logger.log("%s episodes of series %s have been added to the video library" % (insertados, item.show))
|
||||
logger.info("%s episodes of series %s have been added to the video library" % (insertados, item.show))
|
||||
if config.is_xbmc():
|
||||
if config.get_setting("sync_trakt_new_tvshow", "videolibrary"):
|
||||
import xbmc
|
||||
@@ -1121,7 +1121,7 @@ def add_tvshow(item, channel=None):
|
||||
|
||||
|
||||
def emergency_urls(item, channel=None, path=None, headers={}):
|
||||
logger.log()
|
||||
logger.info()
|
||||
import re
|
||||
from servers import torrent
|
||||
try:
|
||||
|
||||
@@ -17,8 +17,8 @@ from core import filetools
|
||||
|
||||
class ziptools(object):
|
||||
def extract(self, file, dir, folder_to_extract="", overwrite_question=False, backup=False):
|
||||
logger.log("file= %s" % file)
|
||||
logger.log("dir= %s" % dir)
|
||||
logger.info("file= %s" % file)
|
||||
logger.info("dir= %s" % dir)
|
||||
|
||||
if not dir.endswith(':') and not filetools.exists(dir):
|
||||
filetools.mkdir(dir)
|
||||
@@ -30,13 +30,13 @@ class ziptools(object):
|
||||
|
||||
for nameo in zf.namelist():
|
||||
name = nameo.replace(':', '_').replace('<', '_').replace('>', '_').replace('|', '_').replace('"', '_').replace('?', '_').replace('*', '_')
|
||||
logger.log("name=%s" % nameo)
|
||||
logger.info("name=%s" % nameo)
|
||||
if not name.endswith('/'):
|
||||
logger.log("it's not a directory")
|
||||
logger.info("it's not a directory")
|
||||
try:
|
||||
(path, filename) = filetools.split(filetools.join(dir, name))
|
||||
logger.log("path=%s" % path)
|
||||
logger.log("name=%s" % name)
|
||||
logger.info("path=%s" % path)
|
||||
logger.info("name=%s" % name)
|
||||
if folder_to_extract:
|
||||
if path != filetools.join(dir, folder_to_extract):
|
||||
break
|
||||
@@ -49,7 +49,7 @@ class ziptools(object):
|
||||
|
||||
else:
|
||||
outfilename = filetools.join(dir, name)
|
||||
logger.log("outfilename=%s" % outfilename)
|
||||
logger.info("outfilename=%s" % outfilename)
|
||||
try:
|
||||
if filetools.exists(outfilename) and overwrite_question:
|
||||
from platformcode import platformtools
|
||||
@@ -74,7 +74,7 @@ class ziptools(object):
|
||||
try:
|
||||
zf.close()
|
||||
except:
|
||||
logger.log("Error closing .zip " + file)
|
||||
logger.info("Error closing .zip " + file)
|
||||
|
||||
def _createstructure(self, file, dir):
|
||||
self._makedirs(self._listdirs(file), dir)
|
||||
|
||||
@@ -9,7 +9,7 @@ import sys
|
||||
import xbmc
|
||||
from platformcode import config, logger
|
||||
|
||||
logger.log("init...")
|
||||
logger.info("init...")
|
||||
|
||||
librerias = xbmc.translatePath(os.path.join(config.get_runtime_path(), 'lib'))
|
||||
sys.path.insert(0, librerias)
|
||||
|
||||
@@ -27,7 +27,7 @@ class ChromeOSImage:
|
||||
"""
|
||||
|
||||
def __init__(self, imgpath):
|
||||
logger.log('Image Path: ' + imgpath)
|
||||
logger.info('Image Path: ' + imgpath)
|
||||
"""Prepares the image"""
|
||||
self.imgpath = imgpath
|
||||
self.bstream = self.get_bstream(imgpath)
|
||||
@@ -59,7 +59,7 @@ class ChromeOSImage:
|
||||
self.seek_stream(entries_start * lba_size)
|
||||
|
||||
if not calcsize(part_format) == entry_size:
|
||||
logger.log('Partition table entries are not 128 bytes long')
|
||||
logger.info('Partition table entries are not 128 bytes long')
|
||||
return 0
|
||||
|
||||
for index in range(1, entries_num + 1): # pylint: disable=unused-variable
|
||||
@@ -71,7 +71,7 @@ class ChromeOSImage:
|
||||
break
|
||||
|
||||
if not offset:
|
||||
logger.log('Failed to calculate losetup offset.')
|
||||
logger.info('Failed to calculate losetup offset.')
|
||||
return 0
|
||||
|
||||
return offset
|
||||
@@ -93,7 +93,7 @@ class ChromeOSImage:
|
||||
while True:
|
||||
chunk2 = self.read_stream(chunksize)
|
||||
if not chunk2:
|
||||
logger.log('File %s not found in the ChromeOS image' % filename)
|
||||
logger.info('File %s not found in the ChromeOS image' % filename)
|
||||
return False
|
||||
|
||||
chunk = chunk1 + chunk2
|
||||
|
||||
@@ -25,7 +25,7 @@ intervenido_sucuri = 'Access Denied - Sucuri Website Firewall'
|
||||
|
||||
|
||||
def update_title(item):
|
||||
logger.log()
|
||||
logger.info()
|
||||
from core import scraper,support
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ def update_title(item):
|
||||
The channel must add a method to be able to receive the call from Kodi / Alfa, and be able to call this method:
|
||||
|
||||
def actualizar_titulos(item):
|
||||
logger.log()
|
||||
logger.info()
|
||||
itemlist = []
|
||||
from lib import generictools
|
||||
from platformcode import launcher
|
||||
@@ -205,7 +205,7 @@ def update_title(item):
|
||||
|
||||
|
||||
def refresh_screen(item):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
"""
|
||||
#### Kodi 18 compatibility ####
|
||||
@@ -239,7 +239,7 @@ def refresh_screen(item):
|
||||
|
||||
|
||||
def post_tmdb_listado(item, itemlist):
|
||||
logger.log()
|
||||
logger.info()
|
||||
itemlist_fo = []
|
||||
|
||||
"""
|
||||
@@ -484,7 +484,7 @@ def post_tmdb_listado(item, itemlist):
|
||||
|
||||
|
||||
def post_tmdb_seasons(item, itemlist):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
"""
|
||||
|
||||
@@ -644,7 +644,7 @@ def post_tmdb_seasons(item, itemlist):
|
||||
|
||||
|
||||
def post_tmdb_episodios(item, itemlist):
|
||||
logger.log()
|
||||
logger.info()
|
||||
itemlist_fo = []
|
||||
|
||||
"""
|
||||
@@ -995,7 +995,7 @@ def post_tmdb_episodios(item, itemlist):
|
||||
|
||||
|
||||
def post_tmdb_findvideos(item, itemlist):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
"""
|
||||
|
||||
@@ -1215,7 +1215,7 @@ def post_tmdb_findvideos(item, itemlist):
|
||||
|
||||
|
||||
def get_field_from_kodi_DB(item, from_fields='*', files='file'):
|
||||
logger.log()
|
||||
logger.info()
|
||||
"""
|
||||
|
||||
Call to read from the Kodi DB the input fields received (from_fields, by default "*") of the video indicated in Item
|
||||
@@ -1293,7 +1293,7 @@ def get_field_from_kodi_DB(item, from_fields='*', files='file'):
|
||||
|
||||
|
||||
def fail_over_newpct1(item, patron, patron2=None, timeout=None):
|
||||
logger.log()
|
||||
logger.info()
|
||||
import ast
|
||||
|
||||
"""
|
||||
@@ -1494,7 +1494,7 @@ def fail_over_newpct1(item, patron, patron2=None, timeout=None):
|
||||
|
||||
|
||||
def web_intervenida(item, data, desactivar=True):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
"""
|
||||
|
||||
@@ -1577,7 +1577,7 @@ def web_intervenida(item, data, desactivar=True):
|
||||
|
||||
|
||||
def regenerate_clones():
|
||||
logger.log()
|
||||
logger.info()
|
||||
import json
|
||||
from core import videolibrarytools
|
||||
|
||||
@@ -1591,7 +1591,7 @@ def regenerate_clones():
|
||||
# Find the paths where to leave the control .json file, and the Video Library
|
||||
json_path = filetools.exists(filetools.join(config.get_runtime_path(), 'verify_cached_torrents.json'))
|
||||
if json_path:
|
||||
logger.log('Previously repaired video library: WE ARE GOING')
|
||||
logger.info('Previously repaired video library: WE ARE GOING')
|
||||
return False
|
||||
json_path = filetools.join(config.get_runtime_path(), 'verify_cached_torrents.json')
|
||||
filetools.write(json_path, json.dumps({"CINE_verify": True})) # Prevents another simultaneous process from being launched
|
||||
@@ -1631,7 +1631,7 @@ def regenerate_clones():
|
||||
|
||||
# Delete the Tvshow.nfo files and check if the .nfo has more than one channel and one is clone Newpct1
|
||||
for file in files:
|
||||
# logger.log('file - nfos: ' + file)
|
||||
# logger.info('file - nfos: ' + file)
|
||||
if 'tvshow.nfo' in file:
|
||||
file_path = filetools.join(root, 'tvshow.nfo')
|
||||
filetools.remove(file_path)
|
||||
@@ -1697,7 +1697,7 @@ def regenerate_clones():
|
||||
for file in files:
|
||||
file_path = filetools.join(root, file)
|
||||
if '.json' in file:
|
||||
logger.log('** file: ' + file)
|
||||
logger.info('** file: ' + file)
|
||||
canal_json = scrapertools.find_single_match(file, r'\[(\w+)\].json')
|
||||
if canal_json not in nfo.library_urls:
|
||||
filetools.remove(file_path) # we delete the .json is a zombie
|
||||
@@ -1740,7 +1740,7 @@ def regenerate_clones():
|
||||
|
||||
|
||||
def dejuice(data):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# Method to unobtrusive JuicyCodes data
|
||||
|
||||
import base64
|
||||
|
||||
@@ -47,7 +47,7 @@ class Client(object):
|
||||
t= Thread(target=self._auto_shutdown)
|
||||
t.setDaemon(True)
|
||||
t.start()
|
||||
logger.log("MEGA Server Started")
|
||||
logger.info("MEGA Server Started")
|
||||
|
||||
def _auto_shutdown(self):
|
||||
while self.running:
|
||||
@@ -77,7 +77,7 @@ class Client(object):
|
||||
def stop(self):
|
||||
self.running = False
|
||||
self._server.stop()
|
||||
logger.log("MEGA Server Stopped")
|
||||
logger.info("MEGA Server Stopped")
|
||||
|
||||
def get_play_list(self):
|
||||
if len(self.files) > 1:
|
||||
@@ -105,7 +105,7 @@ class Client(object):
|
||||
return files
|
||||
|
||||
except:
|
||||
logger.log(traceback.format_exc())
|
||||
logger.info(traceback.format_exc())
|
||||
pass
|
||||
|
||||
return files
|
||||
|
||||
@@ -14,7 +14,7 @@ remote = None
|
||||
|
||||
|
||||
def parse_url(url):
|
||||
# logger.log("Url: %s" % url)
|
||||
# logger.info("Url: %s" % url)
|
||||
url = url.strip()
|
||||
patron = "^smb://(?:([^;\n]+);)?(?:([^:@\n]+)[:|@])?(?:([^@\n]+)@)?([^/]+)/([^/\n]+)([/]?.*?)$"
|
||||
domain, user, password, server_name, share_name, path = re.compile(patron, re.DOTALL).match(url).groups()
|
||||
@@ -27,7 +27,7 @@ def parse_url(url):
|
||||
if path.endswith("/"): path = path[:-1]
|
||||
if not path: path = "/"
|
||||
|
||||
# logger.log("Dominio: '%s' |Usuario: '%s' | Password: '%s' | Servidor: '%s' | IP: '%s' | Share Name: '%s' | Path: '%s'" % (domain, user, password, server_name, server_ip, share_name, path))
|
||||
# logger.info("Dominio: '%s' |Usuario: '%s' | Password: '%s' | Servidor: '%s' | IP: '%s' | Share Name: '%s' | Path: '%s'" % (domain, user, password, server_name, server_ip, share_name, path))
|
||||
return server_name, server_ip, share_name, unicode(path, "utf8"), user, password, domain
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ def get_server_name_ip(server):
|
||||
|
||||
|
||||
def connect(url):
|
||||
# logger.log("Url: %s" % url)
|
||||
# logger.info("Url: %s" % url)
|
||||
global remote
|
||||
server_name, server_ip, share_name, path, user, password, domain = parse_url(url)
|
||||
|
||||
@@ -63,7 +63,7 @@ def connect(url):
|
||||
|
||||
|
||||
def listdir(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
files = [f.filename for f in remote.listPath(share_name, path) if not f.filename in [".", ".."]]
|
||||
@@ -73,7 +73,7 @@ def listdir(url):
|
||||
|
||||
|
||||
def walk(url, topdown=True, onerror=None):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
|
||||
try:
|
||||
@@ -103,7 +103,7 @@ def walk(url, topdown=True, onerror=None):
|
||||
|
||||
|
||||
def get_attributes(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
return remote.getAttributes(share_name, path)
|
||||
@@ -112,7 +112,7 @@ def get_attributes(url):
|
||||
|
||||
|
||||
def mkdir(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
remote.createDirectory(share_name, path)
|
||||
@@ -121,12 +121,12 @@ def mkdir(url):
|
||||
|
||||
|
||||
def smb_open(url, mode):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
return SMBFile(url, mode)
|
||||
|
||||
|
||||
def isfile(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
files = [f.filename for f in remote.listPath(share_name, os.path.dirname(path)) if not f.isDirectory]
|
||||
@@ -136,7 +136,7 @@ def isfile(url):
|
||||
|
||||
|
||||
def isdir(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
folders = [f.filename for f in remote.listPath(share_name, os.path.dirname(path)) if f.isDirectory]
|
||||
@@ -146,7 +146,7 @@ def isdir(url):
|
||||
|
||||
|
||||
def exists(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
files = [f.filename for f in remote.listPath(share_name, os.path.dirname(path))]
|
||||
@@ -156,7 +156,7 @@ def exists(url):
|
||||
|
||||
|
||||
def remove(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
remote.deleteFiles(share_name, path)
|
||||
@@ -165,7 +165,7 @@ def remove(url):
|
||||
|
||||
|
||||
def rmdir(url):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
try:
|
||||
remote.deleteDirectory(share_name, path)
|
||||
@@ -174,7 +174,7 @@ def rmdir(url):
|
||||
|
||||
|
||||
def rename(url, new_name):
|
||||
logger.log("Url: %s" % url)
|
||||
logger.info("Url: %s" % url)
|
||||
remote, share_name, path = connect(url)
|
||||
_, _, _, new_name, _, _, _ = parse_url(new_name)
|
||||
try:
|
||||
|
||||
@@ -96,7 +96,7 @@ class UnshortenIt(object):
|
||||
if oldUri == uri:
|
||||
break
|
||||
|
||||
logger.log(uri)
|
||||
logger.info(uri)
|
||||
|
||||
return uri, code
|
||||
|
||||
@@ -531,12 +531,12 @@ class UnshortenIt(object):
|
||||
r = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False)
|
||||
if 'Wait 1 hour' in r.data:
|
||||
uri = ''
|
||||
logger.log('IP bannato da vcrypt, aspetta un ora')
|
||||
logger.info('IP bannato da vcrypt, aspetta un ora')
|
||||
else:
|
||||
prev_uri = uri
|
||||
uri = r.headers['location']
|
||||
if uri == prev_uri:
|
||||
logger.log('Use Cloudscraper')
|
||||
logger.info('Use Cloudscraper')
|
||||
uri = httptools.downloadpage(uri, timeout=self._timeout, headers=headers, follow_redirects=False, cf=True).headers['location']
|
||||
|
||||
if "4snip" in uri:
|
||||
@@ -593,7 +593,7 @@ class UnshortenIt(object):
|
||||
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
|
||||
if 'get/' in r.url:
|
||||
uri = 'https://linkhub.icu/view/' + re.search('\.\./view/([^"]+)', r.data).group(1)
|
||||
logger.log(uri)
|
||||
logger.info(uri)
|
||||
r = httptools.downloadpage(uri, follow_redirect=True, timeout=self._timeout, cookies=False)
|
||||
uri = re.search('<div id="text-url".*\n\s+<a href="([^"]+)', r.data).group(0)
|
||||
return uri, r.code
|
||||
@@ -683,7 +683,7 @@ def findlinks(text):
|
||||
regex = '(?:https?://(?:[\w\d]+\.)?)?(?:' + regex + ')/[a-zA-Z0-9_=/]+'
|
||||
for match in re.findall(regex, text):
|
||||
matches.append(match)
|
||||
logger.log('matches=' + str(matches))
|
||||
logger.info('matches=' + str(matches))
|
||||
if len(matches) == 1:
|
||||
text += '\n' + unshorten(matches[0])[0]
|
||||
elif matches:
|
||||
|
||||
@@ -215,23 +215,23 @@ def get_setting(name, channel="", server="", default=None):
|
||||
|
||||
# Specific channel setting
|
||||
if channel:
|
||||
# logger.log("get_setting reading channel setting '"+name+"' from channel json")
|
||||
# logger.info("get_setting reading channel setting '"+name+"' from channel json")
|
||||
from core import channeltools
|
||||
value = channeltools.get_channel_setting(name, channel, default)
|
||||
# logger.log("get_setting -> '"+repr(value)+"'")
|
||||
# logger.info("get_setting -> '"+repr(value)+"'")
|
||||
return value
|
||||
|
||||
# Specific server setting
|
||||
elif server:
|
||||
# logger.log("get_setting reading server setting '"+name+"' from server json")
|
||||
# logger.info("get_setting reading server setting '"+name+"' from server json")
|
||||
from core import servertools
|
||||
value = servertools.get_server_setting(name, server, default)
|
||||
# logger.log("get_setting -> '"+repr(value)+"'")
|
||||
# logger.info("get_setting -> '"+repr(value)+"'")
|
||||
return value
|
||||
|
||||
# Global setting
|
||||
else:
|
||||
# logger.log("get_setting reading main setting '"+name+"'")
|
||||
# logger.info("get_setting reading main setting '"+name+"'")
|
||||
value = __settings__.getSetting(name)
|
||||
if not value:
|
||||
return default
|
||||
|
||||
@@ -22,17 +22,17 @@ from platformcode import config, logger
|
||||
# Download a file and start playing while downloading
|
||||
def download_and_play(url, file_name, download_path):
|
||||
# Start thread
|
||||
logger.log("Active threads " + str(threading.active_count()))
|
||||
logger.log("" + repr(threading.enumerate()))
|
||||
logger.log("Starting download thread...")
|
||||
logger.info("Active threads " + str(threading.active_count()))
|
||||
logger.info("" + repr(threading.enumerate()))
|
||||
logger.info("Starting download thread...")
|
||||
download_thread = DownloadThread(url, file_name, download_path)
|
||||
download_thread.start()
|
||||
logger.log("Download thread started")
|
||||
logger.log("Active threads " + str(threading.active_count()))
|
||||
logger.log("" + repr(threading.enumerate()))
|
||||
logger.info("Download thread started")
|
||||
logger.info("Active threads " + str(threading.active_count()))
|
||||
logger.info("" + repr(threading.enumerate()))
|
||||
|
||||
# Wait
|
||||
logger.log("Waiting...")
|
||||
logger.info("Waiting...")
|
||||
|
||||
while True:
|
||||
cancelled = False
|
||||
@@ -53,7 +53,7 @@ def download_and_play(url, file_name, download_path):
|
||||
|
||||
dialog.close()
|
||||
|
||||
logger.log("End of waiting")
|
||||
logger.info("End of waiting")
|
||||
|
||||
# Launch the player
|
||||
player = CustomPlayer()
|
||||
@@ -61,66 +61,66 @@ def download_and_play(url, file_name, download_path):
|
||||
player.PlayStream(download_thread.get_file_name())
|
||||
|
||||
# End of playback
|
||||
logger.log("End of playback")
|
||||
logger.info("End of playback")
|
||||
|
||||
if player.is_stopped():
|
||||
logger.log("Terminated by user")
|
||||
logger.info("Terminated by user")
|
||||
break
|
||||
else:
|
||||
if not download_thread.isAlive():
|
||||
logger.log("Download has finished")
|
||||
logger.info("Download has finished")
|
||||
break
|
||||
else:
|
||||
logger.log("Continua la descarga")
|
||||
logger.info("Continua la descarga")
|
||||
|
||||
# When the player finishes, if you continue downloading it for now
|
||||
logger.log("Download thread alive=" + str(download_thread.isAlive()))
|
||||
logger.info("Download thread alive=" + str(download_thread.isAlive()))
|
||||
if download_thread.isAlive():
|
||||
logger.log("Killing download thread")
|
||||
logger.info("Killing download thread")
|
||||
download_thread.force_stop()
|
||||
|
||||
|
||||
class CustomPlayer(xbmc.Player):
|
||||
def __init__(self, *args, **kwargs):
|
||||
logger.log()
|
||||
logger.info()
|
||||
self.actualtime = 0
|
||||
self.totaltime = 0
|
||||
self.stopped = False
|
||||
xbmc.Player.__init__(self)
|
||||
|
||||
def PlayStream(self, url):
|
||||
logger.log("url=" + url)
|
||||
logger.info("url=" + url)
|
||||
self.play(url)
|
||||
self.actualtime = 0
|
||||
self.url = url
|
||||
while self.isPlaying():
|
||||
self.actualtime = self.getTime()
|
||||
self.totaltime = self.getTotalTime()
|
||||
logger.log("actualtime=" + str(self.actualtime) + " totaltime=" + str(self.totaltime))
|
||||
logger.info("actualtime=" + str(self.actualtime) + " totaltime=" + str(self.totaltime))
|
||||
xbmc.sleep(3000)
|
||||
|
||||
def set_download_thread(self, download_thread):
|
||||
logger.log()
|
||||
logger.info()
|
||||
self.download_thread = download_thread
|
||||
|
||||
def force_stop_download_thread(self):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
if self.download_thread.isAlive():
|
||||
logger.log("Killing download thread")
|
||||
logger.info("Killing download thread")
|
||||
self.download_thread.force_stop()
|
||||
|
||||
# while self.download_thread.isAlive():
|
||||
# xbmc.sleep(1000)
|
||||
|
||||
def onPlayBackStarted(self):
|
||||
logger.log("PLAYBACK STARTED")
|
||||
logger.info("PLAYBACK STARTED")
|
||||
|
||||
def onPlayBackEnded(self):
|
||||
logger.log("PLAYBACK ENDED")
|
||||
logger.info("PLAYBACK ENDED")
|
||||
|
||||
def onPlayBackStopped(self):
|
||||
logger.log("PLAYBACK STOPPED")
|
||||
logger.info("PLAYBACK STOPPED")
|
||||
self.stopped = True
|
||||
self.force_stop_download_thread()
|
||||
|
||||
@@ -131,7 +131,7 @@ class CustomPlayer(xbmc.Player):
|
||||
# Download in background
|
||||
class DownloadThread(threading.Thread):
|
||||
def __init__(self, url, file_name, download_path):
|
||||
# logger.log(repr(file))
|
||||
# logger.info(repr(file))
|
||||
self.url = url
|
||||
self.download_path = download_path
|
||||
self.file_name = os.path.join(download_path, file_name)
|
||||
@@ -148,16 +148,16 @@ class DownloadThread(threading.Thread):
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
def run(self):
|
||||
logger.log("Download starts...")
|
||||
logger.info("Download starts...")
|
||||
|
||||
if "megacrypter.com" in self.url:
|
||||
self.download_file_megacrypter()
|
||||
else:
|
||||
self.download_file()
|
||||
logger.log("Download ends")
|
||||
logger.info("Download ends")
|
||||
|
||||
def force_stop(self):
|
||||
logger.log()
|
||||
logger.info()
|
||||
force_stop_file = open(self.force_stop_file_name, "w")
|
||||
force_stop_file.write("0")
|
||||
force_stop_file.close()
|
||||
@@ -181,38 +181,38 @@ class DownloadThread(threading.Thread):
|
||||
return self.total_size
|
||||
|
||||
def download_file_megacrypter(self):
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
comando = "./megacrypter.sh"
|
||||
logger.log("command= " + comando)
|
||||
logger.info("command= " + comando)
|
||||
|
||||
oldcwd = os.getcwd()
|
||||
logger.log("oldcwd= " + oldcwd)
|
||||
logger.info("oldcwd= " + oldcwd)
|
||||
|
||||
cwd = os.path.join(config.get_runtime_path(), "tools")
|
||||
logger.log("cwd= " + cwd)
|
||||
logger.info("cwd= " + cwd)
|
||||
os.chdir(cwd)
|
||||
logger.log("directory changed to= " + os.getcwd())
|
||||
logger.info("directory changed to= " + os.getcwd())
|
||||
|
||||
logger.log("destination= " + self.download_path)
|
||||
logger.info("destination= " + self.download_path)
|
||||
|
||||
os.system(comando + " '" + self.url + "' \"" + self.download_path + "\"")
|
||||
# p = subprocess.Popen([comando , self.url , self.download_path], cwd=cwd, stdout=subprocess.PIPE , stderr=subprocess.PIPE )
|
||||
# out, err = p.communicate()
|
||||
# logger.log("DownloadThread.download_file out="+out)
|
||||
# logger.info("DownloadThread.download_file out="+out)
|
||||
|
||||
os.chdir(oldcwd)
|
||||
|
||||
def download_file(self):
|
||||
logger.log("Direct download")
|
||||
logger.info("Direct download")
|
||||
|
||||
headers = []
|
||||
|
||||
# Ensures that the file can be created
|
||||
logger.log("filename= " + self.file_name)
|
||||
logger.info("filename= " + self.file_name)
|
||||
self.file_name = xbmc.makeLegalFilename(self.file_name)
|
||||
logger.log("filename= " + self.file_name)
|
||||
logger.log("url= " + self.url)
|
||||
logger.info("filename= " + self.file_name)
|
||||
logger.info("url= " + self.url)
|
||||
|
||||
# Create the file
|
||||
existSize = 0
|
||||
@@ -228,13 +228,13 @@ class DownloadThread(threading.Thread):
|
||||
additional_headers = [additional_headers]
|
||||
|
||||
for additional_header in additional_headers:
|
||||
logger.log("additional_header: " + additional_header)
|
||||
logger.info("additional_header: " + additional_header)
|
||||
name = re.findall("(.*?)=.*?", additional_header)[0]
|
||||
value = urllib.parse.unquote_plus(re.findall(".*?=(.*?)$", additional_header)[0])
|
||||
headers.append([name, value])
|
||||
|
||||
self.url = self.url.split("|")[0]
|
||||
logger.log("url= " + self.url)
|
||||
logger.info("url= " + self.url)
|
||||
|
||||
# Timeout del socket a 60 segundos
|
||||
socket.setdefaulttimeout(60)
|
||||
@@ -243,7 +243,7 @@ class DownloadThread(threading.Thread):
|
||||
h = urllib.request.HTTPHandler(debuglevel=0)
|
||||
request = urllib.request.Request(self.url)
|
||||
for header in headers:
|
||||
logger.log("Header= " + header[0] + ": " + header[1])
|
||||
logger.info("Header= " + header[0] + ": " + header[1])
|
||||
request.add_header(header[0], header[1])
|
||||
|
||||
# Lanza la petición
|
||||
@@ -272,18 +272,18 @@ class DownloadThread(threading.Thread):
|
||||
|
||||
self.total_size = int(float(totalfichero) / float(1024 * 1024))
|
||||
|
||||
logger.log("Content-Length=%s" % totalfichero)
|
||||
logger.info("Content-Length=%s" % totalfichero)
|
||||
blocksize = 100 * 1024
|
||||
|
||||
bloqueleido = connexion.read(blocksize)
|
||||
logger.log("Starting file download, blocked= %s" % len(bloqueleido))
|
||||
logger.info("Starting file download, blocked= %s" % len(bloqueleido))
|
||||
|
||||
maxreintentos = 10
|
||||
|
||||
while len(bloqueleido) > 0:
|
||||
try:
|
||||
if os.path.exists(self.force_stop_file_name):
|
||||
logger.log("Force_stop file detected, download is interrupted")
|
||||
logger.info("Force_stop file detected, download is interrupted")
|
||||
f.close()
|
||||
|
||||
xbmc.executebuiltin("Notification(%s,%s,300)" % (config.get_localized_string(60319),config.get_localized_string(60320)))
|
||||
@@ -297,7 +297,7 @@ class DownloadThread(threading.Thread):
|
||||
# except:
|
||||
f.write(bloqueleido)
|
||||
grabado = grabado + len(bloqueleido)
|
||||
logger.log("grabado=%d de %d" % (grabado, totalfichero))
|
||||
logger.info("grabado=%d de %d" % (grabado, totalfichero))
|
||||
percent = int(float(grabado) * 100 / float(totalfichero))
|
||||
self.progress = percent
|
||||
totalmb = float(float(totalfichero) / (1024 * 1024))
|
||||
@@ -323,7 +323,7 @@ class DownloadThread(threading.Thread):
|
||||
except:
|
||||
import sys
|
||||
reintentos = reintentos + 1
|
||||
logger.log("ERROR in block download, retry %d" % reintentos)
|
||||
logger.info("ERROR in block download, retry %d" % reintentos)
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ from platformcode import logger, config, platformtools
|
||||
def get_environment():
|
||||
"""
|
||||
Returns the most common OS, Kodi and Alpha environment variables,
|
||||
necessary for fault diagnosis
|
||||
necessary for fault diagnosis
|
||||
"""
|
||||
|
||||
try:
|
||||
@@ -341,34 +341,31 @@ def list_env(environment={}):
|
||||
if not environment:
|
||||
environment = get_environment()
|
||||
|
||||
if environment['debug'] == 'False':
|
||||
logger.log_enable(True)
|
||||
logger.info(sep)
|
||||
logger.info('KoD environment variables: ' + environment['addon_version'] + ' Debug: ' + environment['debug'])
|
||||
logger.info(sep)
|
||||
|
||||
logger.log(sep)
|
||||
logger.log('KoD environment variables: ' + environment['addon_version'] + ' Debug: ' + environment['debug'])
|
||||
logger.log(sep)
|
||||
|
||||
logger.log(environment['os_name'] + ' ' + environment['prod_model'] + ' ' +
|
||||
logger.info(environment['os_name'] + ' ' + environment['prod_model'] + ' ' +
|
||||
environment['os_release'] + ' ' + environment['machine'] + ' ' +
|
||||
environment['architecture'] + ' ' + environment['language'])
|
||||
|
||||
logger.log('Kodi ' + environment['num_version'] + ', Vídeo: ' +
|
||||
logger.info('Kodi ' + environment['num_version'] + ', Vídeo: ' +
|
||||
environment['video_db'] + ', Python ' + environment['python_version'])
|
||||
|
||||
if environment['cpu_usage']:
|
||||
logger.log('CPU: ' + environment['cpu_usage'])
|
||||
logger.info('CPU: ' + environment['cpu_usage'])
|
||||
|
||||
if environment['mem_total'] or environment['mem_free']:
|
||||
logger.log('Memory: Total: ' + environment['mem_total'] + ' MB | Disp.: ' +
|
||||
logger.info('Memory: Total: ' + environment['mem_total'] + ' MB | Disp.: ' +
|
||||
environment['mem_free'] + ' MB | Buffers: ' +
|
||||
str(int(environment['kodi_buffer']) * 3) + ' MB | Buffermode: ' +
|
||||
environment['kodi_bmode'] + ' | Readfactor: ' +
|
||||
environment['kodi_rfactor'])
|
||||
|
||||
logger.log('Userdata: ' + environment['userdata_path'] + ' - Free: ' +
|
||||
logger.info('Userdata: ' + environment['userdata_path'] + ' - Free: ' +
|
||||
environment['userdata_free'].replace('.', ',') + ' GB')
|
||||
|
||||
logger.log('Videolibrary: Series/Episodes: ' + environment['videolab_series'] + '/' +
|
||||
logger.info('Videolibrary: Series/Episodes: ' + environment['videolab_series'] + '/' +
|
||||
environment['videolab_episodios'] + ' - Pelis: ' +
|
||||
environment['videolab_pelis'] + ' - Upd: ' +
|
||||
environment['videolab_update'] + ' - Path: ' +
|
||||
@@ -380,27 +377,24 @@ def list_env(environment={}):
|
||||
# if x == 0:
|
||||
# cliente_alt = cliente.copy()
|
||||
# del cliente_alt['Torrent_opt']
|
||||
# logger.log('Torrent: Opt: %s, %s' % (str(cliente['Torrent_opt']), \
|
||||
# logger.info('Torrent: Opt: %s, %s' % (str(cliente['Torrent_opt']), \
|
||||
# str(cliente_alt).replace('{', '').replace('}', '') \
|
||||
# .replace("'", '').replace('_', ' ')))
|
||||
# elif x == 1 and environment['torrent_error']:
|
||||
# logger.log('- ' + str(cliente).replace('{', '').replace('}', '') \
|
||||
# logger.info('- ' + str(cliente).replace('{', '').replace('}', '') \
|
||||
# .replace("'", '').replace('_', ' '))
|
||||
# else:
|
||||
# cliente_alt = cliente.copy()
|
||||
# del cliente_alt['Plug_in']
|
||||
# cliente_alt['Libre'] = cliente_alt['Libre'].replace('.', ',') + ' GB'
|
||||
# logger.log('- %s: %s' % (str(cliente['Plug_in']), str(cliente_alt) \
|
||||
# logger.info('- %s: %s' % (str(cliente['Plug_in']), str(cliente_alt) \
|
||||
# .replace('{', '').replace('}', '').replace("'", '') \
|
||||
# .replace('\\\\', '\\')))
|
||||
|
||||
# logger.log('Proxy: ' + environment['proxy_active'])
|
||||
# logger.info('Proxy: ' + environment['proxy_active'])
|
||||
|
||||
logger.log('LOG Size: ' + environment['log_size'].replace('.', ',') + ' MB')
|
||||
logger.log(sep)
|
||||
|
||||
if environment['debug'] == 'False':
|
||||
logger.log_enable(False)
|
||||
logger.info('LOG Size: ' + environment['log_size'].replace('.', ',') + ' MB')
|
||||
logger.info(sep)
|
||||
|
||||
return environment
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ def start():
|
||||
Within this function all calls should go to
|
||||
functions that we want to execute as soon as we open the plugin.
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
# config.set_setting('show_once', True)
|
||||
# Test if all the required directories are created
|
||||
config.verify_directories_created()
|
||||
@@ -37,7 +37,8 @@ def start():
|
||||
updater.showSavedChangelog()
|
||||
|
||||
def run(item=None):
|
||||
logger.log()
|
||||
from core.support import dbg
|
||||
logger.info()
|
||||
if not item:
|
||||
# Extract item from sys.argv
|
||||
if sys.argv[2]:
|
||||
@@ -76,7 +77,7 @@ def run(item=None):
|
||||
xbmc_videolibrary.ask_set_content(silent=False)
|
||||
config.set_setting('show_once', True)
|
||||
|
||||
logger.log(item.tostring())
|
||||
logger.info(item.tostring())
|
||||
|
||||
try:
|
||||
if not config.get_setting('tmdb_active'):
|
||||
@@ -84,7 +85,7 @@ def run(item=None):
|
||||
|
||||
# If item has no action, stops here
|
||||
if item.action == "":
|
||||
logger.log("Item without action")
|
||||
logger.info("Item without action")
|
||||
return
|
||||
|
||||
# Action for main menu in channelselector
|
||||
@@ -154,7 +155,7 @@ def run(item=None):
|
||||
|
||||
channel_file = os.path.join(config.get_runtime_path(), CHANNELS, item.channel + ".py")
|
||||
|
||||
logger.log("channel_file= " + channel_file + ' - ' + CHANNELS + ' - ' + item.channel)
|
||||
logger.info("channel_file= " + channel_file + ' - ' + CHANNELS + ' - ' + item.channel)
|
||||
|
||||
channel = None
|
||||
|
||||
@@ -164,7 +165,7 @@ def run(item=None):
|
||||
except ImportError:
|
||||
exec("import " + CHANNELS + "." + item.channel + " as channel")
|
||||
|
||||
logger.log("Running channel %s | %s" % (channel.__name__, channel.__file__))
|
||||
logger.info("Running channel %s | %s" % (channel.__name__, channel.__file__))
|
||||
|
||||
# Special play action
|
||||
if item.action == "play":
|
||||
@@ -174,12 +175,12 @@ def run(item=None):
|
||||
trakt_tools.set_trakt_info(item)
|
||||
except:
|
||||
pass
|
||||
logger.log("item.action=%s" % item.action.upper())
|
||||
logger.info("item.action=%s" % item.action.upper())
|
||||
# logger.debug("item_toPlay: " + "\n" + item.tostring('\n'))
|
||||
|
||||
# First checks if channel has a "play" function
|
||||
if hasattr(channel, 'play'):
|
||||
logger.log("Executing channel 'play' method")
|
||||
logger.info("Executing channel 'play' method")
|
||||
itemlist = channel.play(item)
|
||||
b_favourite = item.isFavourite
|
||||
# Play should return a list of playable URLS
|
||||
@@ -200,7 +201,7 @@ def run(item=None):
|
||||
|
||||
# If player don't have a "play" function, not uses the standard play from platformtools
|
||||
else:
|
||||
logger.log("Executing core 'play' method")
|
||||
logger.info("Executing core 'play' method")
|
||||
platformtools.play_video(item)
|
||||
|
||||
# Special action for findvideos, where the plugin looks for known urls
|
||||
@@ -213,7 +214,7 @@ def run(item=None):
|
||||
|
||||
# If not, uses the generic findvideos function
|
||||
else:
|
||||
logger.log("No channel 'findvideos' method, "
|
||||
logger.info("No channel 'findvideos' method, "
|
||||
"executing core method")
|
||||
itemlist = servertools.find_video_items(item)
|
||||
|
||||
@@ -258,7 +259,7 @@ def run(item=None):
|
||||
else:
|
||||
filetools.remove(temp_search_file)
|
||||
|
||||
logger.log("item.action=%s" % item.action.upper())
|
||||
logger.info("item.action=%s" % item.action.upper())
|
||||
from core import channeltools
|
||||
|
||||
if config.get_setting('last_search'):
|
||||
@@ -279,7 +280,7 @@ def run(item=None):
|
||||
# For all other actions
|
||||
else:
|
||||
# import web_pdb; web_pdb.set_trace()
|
||||
logger.log("Executing channel '%s' method" % item.action)
|
||||
logger.info("Executing channel '%s' method" % item.action)
|
||||
itemlist = getattr(channel, item.action)(item)
|
||||
if config.get_setting('trakt_sync'):
|
||||
from core import trakt_tools
|
||||
@@ -360,7 +361,7 @@ def set_search_temp(item):
|
||||
filetools.write(temp_search_file, f)
|
||||
|
||||
def reorder_itemlist(itemlist):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("Inlet itemlist size: %i" % len(itemlist))
|
||||
|
||||
new_list = []
|
||||
@@ -398,7 +399,7 @@ def reorder_itemlist(itemlist):
|
||||
new_list.extend(mod_list)
|
||||
new_list.extend(not_mod_list)
|
||||
|
||||
logger.log("Modified Titles:%i |Unmodified:%i" % (modified, not_modified))
|
||||
logger.info("Modified Titles:%i |Unmodified:%i" % (modified, not_modified))
|
||||
|
||||
if len(new_list) == 0:
|
||||
new_list = itemlist
|
||||
@@ -408,7 +409,7 @@ def reorder_itemlist(itemlist):
|
||||
|
||||
|
||||
def limit_itemlist(itemlist):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("Inlet itemlist size: %i" % len(itemlist))
|
||||
|
||||
try:
|
||||
@@ -441,7 +442,7 @@ def play_from_library(item):
|
||||
|
||||
itemlist=[]
|
||||
item.fromLibrary = True
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("item: \n" + item.tostring('\n'))
|
||||
|
||||
# Try to reproduce an image (this does nothing and also does not give an error)
|
||||
|
||||
@@ -2,113 +2,41 @@
|
||||
# --------------------------------------------------------------------------------
|
||||
# Logger (kodi)
|
||||
# --------------------------------------------------------------------------------
|
||||
|
||||
import inspect, sys, os, xbmc
|
||||
from __future__ import unicode_literals
|
||||
import inspect, os, xbmc, sys
|
||||
from platformcode import config
|
||||
|
||||
PY3 = False
|
||||
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
|
||||
|
||||
loggeractive = (config.get_setting("debug") == True)
|
||||
LOG_FORMAT = '{addname}[{filename}.{function}:{line}]{sep} {message}'
|
||||
DEBUG_ENABLED = config.get_setting("debug")
|
||||
DEF_LEVEL = xbmc.LOGINFO if sys.version_info[0] >= 3 else xbmc.LOGNOTICE
|
||||
|
||||
|
||||
def log_enable(active):
|
||||
global loggeractive
|
||||
loggeractive = active
|
||||
def info(*args):
|
||||
log(*args)
|
||||
|
||||
|
||||
def encode_log(message=""):
|
||||
|
||||
# Unicode to utf8
|
||||
if isinstance(message, unicode):
|
||||
message = message.encode("utf8")
|
||||
if PY3: message = message.decode("utf8")
|
||||
|
||||
# All encodings to utf8
|
||||
elif not PY3 and isinstance(message, str):
|
||||
message = unicode(message, "utf8", errors="replace").encode("utf8")
|
||||
|
||||
# Bytes encodings to utf8
|
||||
elif PY3 and isinstance(message, bytes):
|
||||
message = message.decode("utf8")
|
||||
|
||||
# Objects to string
|
||||
else:
|
||||
message = str(message)
|
||||
|
||||
return message
|
||||
def debug(*args):
|
||||
if DEBUG_ENABLED:
|
||||
log(*args)
|
||||
|
||||
|
||||
def get_caller(message=None):
|
||||
|
||||
if message and isinstance(message, unicode):
|
||||
message = message.encode("utf8")
|
||||
if PY3: message = message.decode("utf8")
|
||||
elif message and PY3 and isinstance(message, bytes):
|
||||
message = message.decode("utf8")
|
||||
elif message and not PY3:
|
||||
message = unicode(message, "utf8", errors="replace").encode("utf8")
|
||||
elif message:
|
||||
message = str(message)
|
||||
|
||||
module = inspect.getmodule(inspect.currentframe().f_back.f_back)
|
||||
|
||||
if module == None:
|
||||
module = "None"
|
||||
else:
|
||||
module = module.__name__
|
||||
|
||||
function = inspect.currentframe().f_back.f_back.f_code.co_name
|
||||
|
||||
if module == "__main__":
|
||||
module = "kod"
|
||||
else:
|
||||
module = "kod." + module
|
||||
if message:
|
||||
if module not in message:
|
||||
if function == "<module>":
|
||||
return module + " " + message
|
||||
else:
|
||||
return module + " [" + function + "] " + message
|
||||
else:
|
||||
return message
|
||||
else:
|
||||
if function == "<module>":
|
||||
return module
|
||||
else:
|
||||
return module + "." + function
|
||||
def error(*args):
|
||||
log("######## ERROR #########", level=xbmc.LOGERROR)
|
||||
log(*args, level=xbmc.LOGERROR)
|
||||
|
||||
|
||||
def info(texto=""):
|
||||
if loggeractive:
|
||||
xbmc.log(get_caller(encode_log(texto)), xbmc.LOGNOTICE)
|
||||
|
||||
|
||||
def debug(texto=""):
|
||||
if loggeractive:
|
||||
texto = " [" + get_caller() + "] " + encode_log(texto)
|
||||
|
||||
xbmc.log("######## DEBUG #########", xbmc.LOGNOTICE)
|
||||
xbmc.log(texto, xbmc.LOGNOTICE)
|
||||
|
||||
|
||||
def error(texto=""):
|
||||
texto = " [" + get_caller() + "] " + encode_log(texto)
|
||||
|
||||
xbmc.log("######## ERROR #########", xbmc.LOGERROR)
|
||||
xbmc.log(texto, xbmc.LOGERROR)
|
||||
|
||||
|
||||
def log(*args):
|
||||
# Function to simplify the log
|
||||
# Automatically returns File Name and Function Name
|
||||
if loggeractive:
|
||||
string = ''
|
||||
for arg in args: string += ' '+str(arg)
|
||||
frame = inspect.stack()[1]
|
||||
filename = frame[0].f_code.co_filename
|
||||
filename = os.path.basename(filename)
|
||||
xbmc.log("[" + filename + "] [" + inspect.stack()[1][3] + "] " + string, xbmc.LOGNOTICE)
|
||||
def log(*args, **kwargs):
|
||||
msg = ''
|
||||
for arg in args: msg += ' ' + str(arg)
|
||||
frame = inspect.currentframe().f_back.f_back
|
||||
filename = frame.f_code.co_filename
|
||||
filename = os.path.basename(filename).split('.')[0]
|
||||
xbmc.log(LOG_FORMAT.format(addname=config.PLUGIN_NAME,
|
||||
filename=filename,
|
||||
line=frame.f_lineno,
|
||||
sep=':' if msg else '',
|
||||
function=frame.f_code.co_name,
|
||||
message=msg), kwargs.get('level', DEF_LEVEL))
|
||||
|
||||
|
||||
class WebErrorException(Exception):
|
||||
|
||||
@@ -112,7 +112,7 @@ def dialog_browse(_type, heading, shares="files", mask="", useThumbs=False, trea
|
||||
|
||||
def itemlist_refresh():
|
||||
# pos = Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath')).itemlistPosition
|
||||
# logger.log('Current position: ' + str(pos))
|
||||
# logger.info('Current position: ' + str(pos))
|
||||
xbmc.executebuiltin("Container.Refresh")
|
||||
|
||||
# while Item().fromurl(xbmc.getInfoLabel('ListItem.FileNameAndPath')).itemlistPosition != pos:
|
||||
@@ -133,7 +133,7 @@ def render_items(itemlist, parent_item):
|
||||
"""
|
||||
Function used to render itemlist on kodi
|
||||
"""
|
||||
logger.log('START render_items')
|
||||
logger.info('START render_items')
|
||||
thumb_type = config.get_setting('video_thumbnail_type')
|
||||
from specials import shortcuts
|
||||
from core import httptools
|
||||
@@ -218,7 +218,7 @@ def render_items(itemlist, parent_item):
|
||||
set_view_mode(itemlist[0], parent_item)
|
||||
|
||||
xbmcplugin.endOfDirectory(_handle)
|
||||
logger.log('END render_items')
|
||||
logger.info('END render_items')
|
||||
|
||||
|
||||
def getCurrentView(item=None, parent_item=None):
|
||||
@@ -275,11 +275,11 @@ def set_view_mode(item, parent_item):
|
||||
if content:
|
||||
mode = int(config.get_setting('view_mode_%s' % content).split(',')[-1])
|
||||
if mode == 0:
|
||||
logger.log('default mode')
|
||||
logger.info('default mode')
|
||||
mode = 55
|
||||
xbmcplugin.setContent(handle=int(sys.argv[1]), content=Type)
|
||||
xbmc.executebuiltin('Container.SetViewMode(%s)' % mode)
|
||||
logger.log('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content)
|
||||
logger.info('TYPE: ' + Type + ' - ' + 'CONTENT: ' + content)
|
||||
|
||||
|
||||
def set_infolabels(listitem, item, player=False):
|
||||
@@ -499,10 +499,10 @@ def is_playing():
|
||||
|
||||
|
||||
def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
logger.log()
|
||||
logger.info()
|
||||
logger.debug(item.tostring('\n'))
|
||||
if item.channel == 'downloads':
|
||||
logger.log("Play local video: %s [%s]" % (item.title, item.url))
|
||||
logger.info("Play local video: %s [%s]" % (item.title, item.url))
|
||||
xlistitem = xbmcgui.ListItem(path=item.url)
|
||||
xlistitem.setArt({"thumb": item.thumbnail})
|
||||
set_infolabels(xlistitem, item, True)
|
||||
@@ -510,7 +510,7 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
return
|
||||
|
||||
default_action = config.get_setting("default_action")
|
||||
logger.log("default_action=%s" % default_action)
|
||||
logger.info("default_action=%s" % default_action)
|
||||
|
||||
# Open the selection dialog to see the available options
|
||||
opciones, video_urls, seleccion, salir = get_dialogo_opciones(item, default_action, strm, autoplay)
|
||||
@@ -520,8 +520,8 @@ def play_video(item, strm=False, force_direct=False, autoplay=False):
|
||||
seleccion = get_seleccion(default_action, opciones, seleccion, video_urls)
|
||||
if seleccion < 0: return # Canceled box
|
||||
|
||||
logger.log("selection=%d" % seleccion)
|
||||
logger.log("selection=%s" % opciones[seleccion])
|
||||
logger.info("selection=%d" % seleccion)
|
||||
logger.info("selection=%s" % opciones[seleccion])
|
||||
|
||||
# run the available option, jdwonloader, download, favorites, add to the video library ... IF IT IS NOT PLAY
|
||||
salir = set_opcion(item, seleccion, opciones, video_urls)
|
||||
@@ -682,7 +682,7 @@ def alert_unsopported_server():
|
||||
|
||||
|
||||
def handle_wait(time_to_wait, title, text):
|
||||
logger.log("handle_wait(time_to_wait=%d)" % time_to_wait)
|
||||
logger.info("handle_wait(time_to_wait=%d)" % time_to_wait)
|
||||
espera = dialog_progress(' ' + title, "")
|
||||
|
||||
secs = 0
|
||||
@@ -701,15 +701,15 @@ def handle_wait(time_to_wait, title, text):
|
||||
break
|
||||
|
||||
if cancelled:
|
||||
logger.log('Wait canceled')
|
||||
logger.info('Wait canceled')
|
||||
return False
|
||||
else:
|
||||
logger.log('Wait finished')
|
||||
logger.info('Wait finished')
|
||||
return True
|
||||
|
||||
|
||||
def get_dialogo_opciones(item, default_action, strm, autoplay):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug(item.tostring('\n'))
|
||||
from core import servertools
|
||||
|
||||
@@ -793,7 +793,7 @@ def get_dialogo_opciones(item, default_action, strm, autoplay):
|
||||
|
||||
|
||||
def set_opcion(item, seleccion, opciones, video_urls):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug(item.tostring('\n'))
|
||||
salir = False
|
||||
# You have not chosen anything, most likely because you have given the ESC
|
||||
@@ -843,7 +843,7 @@ def set_opcion(item, seleccion, opciones, video_urls):
|
||||
|
||||
|
||||
def get_video_seleccionado(item, seleccion, video_urls):
|
||||
logger.log()
|
||||
logger.info()
|
||||
mediaurl = ""
|
||||
view = False
|
||||
wait_time = 0
|
||||
@@ -869,7 +869,7 @@ def get_video_seleccionado(item, seleccion, video_urls):
|
||||
mpd = True
|
||||
|
||||
# If there is no mediaurl it is because the video is not there :)
|
||||
logger.log("mediaurl=" + mediaurl)
|
||||
logger.info("mediaurl=" + mediaurl)
|
||||
if mediaurl == "":
|
||||
if item.server == "unknown":
|
||||
alert_unsopported_server()
|
||||
@@ -886,7 +886,7 @@ def get_video_seleccionado(item, seleccion, video_urls):
|
||||
|
||||
|
||||
def set_player(item, xlistitem, mediaurl, view, strm, nfo_path=None, head_nfo=None, item_nfo=None):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
# Moved del conector "torrent" here
|
||||
if item.server == "torrent":
|
||||
@@ -903,10 +903,10 @@ def set_player(item, xlistitem, mediaurl, view, strm, nfo_path=None, head_nfo=No
|
||||
player_mode = config.get_setting("player_mode")
|
||||
if (player_mode == 3 and mediaurl.startswith("rtmp")) or item.play_from == 'window' or item.nfo: player_mode = 0
|
||||
elif "megacrypter.com" in mediaurl: player_mode = 3
|
||||
logger.log("mediaurl=" + mediaurl)
|
||||
logger.info("mediaurl=" + mediaurl)
|
||||
|
||||
if player_mode == 0:
|
||||
logger.log('Player Mode: Direct')
|
||||
logger.info('Player Mode: Direct')
|
||||
# Add the listitem to a playlist
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||
playlist.clear()
|
||||
@@ -919,24 +919,24 @@ def set_player(item, xlistitem, mediaurl, view, strm, nfo_path=None, head_nfo=No
|
||||
trakt_tools.wait_for_update_trakt()
|
||||
|
||||
elif player_mode == 1:
|
||||
logger.log('Player Mode: setResolvedUrl')
|
||||
logger.info('Player Mode: setResolvedUrl')
|
||||
xlistitem.setPath(mediaurl)
|
||||
xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xlistitem)
|
||||
xbmc.sleep(2500)
|
||||
|
||||
elif player_mode == 2:
|
||||
logger.log('Player Mode: Built-In')
|
||||
logger.info('Player Mode: Built-In')
|
||||
xbmc.executebuiltin("PlayMedia(" + mediaurl + ")")
|
||||
|
||||
elif player_mode == 3:
|
||||
logger.log('Player Mode: Download and Play')
|
||||
logger.info('Player Mode: Download and Play')
|
||||
from platformcode import download_and_play
|
||||
download_and_play.download_and_play(mediaurl, "download_and_play.tmp", config.get_setting("downloadpath"))
|
||||
return
|
||||
|
||||
# ALL LOOKING TO REMOVE VIEW
|
||||
if item.subtitle and view:
|
||||
logger.log("External subtitles: " + item.subtitle)
|
||||
logger.info("External subtitles: " + item.subtitle)
|
||||
xbmc.sleep(2000)
|
||||
xbmc_player.setSubtitles(item.subtitle)
|
||||
|
||||
@@ -962,7 +962,7 @@ def torrent_client_installed(show_tuple=False):
|
||||
|
||||
|
||||
def play_torrent(item, xlistitem, mediaurl):
|
||||
logger.log()
|
||||
logger.info()
|
||||
import time
|
||||
from servers import torrent
|
||||
|
||||
@@ -1002,9 +1002,6 @@ def play_torrent(item, xlistitem, mediaurl):
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
def log(texto):
|
||||
xbmc.log(texto, xbmc.LOGNOTICE)
|
||||
|
||||
def resume_playback(item, return_played_time=False):
|
||||
class ResumePlayback(xbmcgui.WindowXMLDialog):
|
||||
Close = False
|
||||
@@ -1082,17 +1079,17 @@ def install_inputstream():
|
||||
# Check if InputStream add-on exists!
|
||||
Addon('inputstream.adaptive')
|
||||
|
||||
logger.log('InputStream add-on installed from repo.')
|
||||
logger.info('InputStream add-on installed from repo.')
|
||||
except RuntimeError:
|
||||
logger.log('InputStream add-on not installed.')
|
||||
logger.info('InputStream add-on not installed.')
|
||||
dialog_ok(config.get_localized_string(20000), config.get_localized_string(30126))
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
Addon('inputstream.adaptive')
|
||||
logger.log('InputStream add-on is installed and enabled')
|
||||
logger.info('InputStream add-on is installed and enabled')
|
||||
except:
|
||||
logger.log('enabling InputStream add-on')
|
||||
logger.info('enabling InputStream add-on')
|
||||
xbmc.executebuiltin('UpdateLocalAddons')
|
||||
xbmc.executeJSONRPC('{"jsonrpc": "2.0", "id":1, "method": "Addons.SetAddonEnabled", "params": { "addonid": "inputstream.adaptive", "enabled": true }}')
|
||||
return True
|
||||
@@ -1207,13 +1204,13 @@ def best_chromeos_image(devices):
|
||||
# Select the newest version
|
||||
from distutils.version import LooseVersion # pylint: disable=import-error,no-name-in-module,useless-suppression
|
||||
if LooseVersion(device['version']) > LooseVersion(best['version']):
|
||||
logger.log('%s (%s) is newer than %s (%s)' % (device['hwid'], device['version'], best['hwid'], best['version']))
|
||||
logger.info('%s (%s) is newer than %s (%s)' % (device['hwid'], device['version'], best['hwid'], best['version']))
|
||||
best = device
|
||||
|
||||
# Select the smallest image (disk space requirement)
|
||||
elif LooseVersion(device['version']) == LooseVersion(best['version']):
|
||||
if int(device['filesize']) + int(device['zipfilesize']) < int(best['filesize']) + int(best['zipfilesize']):
|
||||
logger.log('%s (%d) is smaller than %s (%d)' % (device['hwid'], int(device['filesize']) + int(device['zipfilesize']), best['hwid'], int(best['filesize']) + int(best['zipfilesize'])))
|
||||
logger.info('%s (%d) is smaller than %s (%d)' % (device['hwid'], int(device['filesize']) + int(device['zipfilesize']), best['hwid'], int(best['filesize']) + int(best['zipfilesize'])))
|
||||
best = device
|
||||
return best
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class Recaptcha(xbmcgui.WindowXMLDialog):
|
||||
|
||||
data = httptools.downloadpage(self.url, post=post, headers=self.headers).data
|
||||
from platformcode import logger
|
||||
logger.log(data)
|
||||
logger.info(data)
|
||||
self.result = scrapertools.find_single_match(data, '<div class="fbc-verification-token">.*?>([^<]+)<')
|
||||
if self.result:
|
||||
platformtools.dialog_notification("Captcha corretto", "Verifica conclusa")
|
||||
|
||||
@@ -84,7 +84,7 @@ def regex_tvshow(compare, file, sub=""):
|
||||
|
||||
|
||||
def set_Subtitle():
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
exts = [".srt", ".sub", ".txt", ".smi", ".ssa", ".ass"]
|
||||
subtitle_folder_path = filetools.join(config.get_data_path(), "subtitles")
|
||||
@@ -93,7 +93,7 @@ def set_Subtitle():
|
||||
|
||||
if subtitle_type == "2":
|
||||
subtitle_path = config.get_setting("subtitlepath_file")
|
||||
logger.log("Con subtitulo : " + subtitle_path)
|
||||
logger.info("Con subtitulo : " + subtitle_path)
|
||||
xbmc.Player().setSubtitles(subtitle_path)
|
||||
else:
|
||||
if subtitle_type == "0":
|
||||
@@ -106,7 +106,7 @@ def set_Subtitle():
|
||||
long_v = len(subtitle_path)
|
||||
if long_v > 0:
|
||||
if subtitle_path.startswith("http") or subtitle_path[long_v - 4, long] in exts:
|
||||
logger.log("Con subtitulo : " + subtitle_path)
|
||||
logger.info("Con subtitulo : " + subtitle_path)
|
||||
xbmc.Player().setSubtitles(subtitle_path)
|
||||
return
|
||||
else:
|
||||
@@ -125,7 +125,7 @@ def set_Subtitle():
|
||||
Subnames = glob.glob(filetools.join(subtitle_path, "Movies", subtitle_name + "*.??.???"))
|
||||
for Subname in Subnames:
|
||||
if os.path.splitext(Subname)[1] in exts:
|
||||
logger.log("Con subtitulo : " + filetools.split(Subname)[1])
|
||||
logger.info("Con subtitulo : " + filetools.split(Subname)[1])
|
||||
xbmc.Player().setSubtitles((Subname))
|
||||
except:
|
||||
logger.error("error al cargar subtitulos")
|
||||
@@ -216,7 +216,7 @@ def searchSubtitle(item):
|
||||
filetools.mkdir(full_path_tvshow) # title_new + ".mp4"
|
||||
full_path_video_new = xbmc.translatePath(
|
||||
filetools.join(full_path_tvshow, "%s %sx%s.mp4" % (tvshow_title, season, episode)))
|
||||
logger.log(full_path_video_new)
|
||||
logger.info(full_path_video_new)
|
||||
listitem = xbmcgui.ListItem(title_new, iconImage="DefaultVideo.png", thumbnailImage="")
|
||||
listitem.setInfo("video", {"Title": title_new, "Genre": "Tv shows", "episode": int(episode), "season": int(season), "tvshowtitle": tvshow_title})
|
||||
|
||||
@@ -230,7 +230,7 @@ def searchSubtitle(item):
|
||||
try:
|
||||
filetools.copy(path_video_temp, full_path_video_new)
|
||||
copy = True
|
||||
logger.log("nuevo path =" + full_path_video_new)
|
||||
logger.info("nuevo path =" + full_path_video_new)
|
||||
time.sleep(2)
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
|
||||
playlist.clear()
|
||||
@@ -288,7 +288,7 @@ def get_from_subdivx(sub_url):
|
||||
:return: The path to the unzipped subtitle
|
||||
"""
|
||||
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
sub = ''
|
||||
sub_dir = os.path.join(config.get_data_path(), 'temp_subs')
|
||||
@@ -312,9 +312,9 @@ def get_from_subdivx(sub_url):
|
||||
filetools.write(filename, data_dl)
|
||||
sub = extract_file_online(sub_dir, filename)
|
||||
except:
|
||||
logger.log('sub invalid')
|
||||
logger.info('sub invalid')
|
||||
else:
|
||||
logger.log('sub invalid')
|
||||
logger.info('sub invalid')
|
||||
return sub
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ def extract_file_online(path, filename):
|
||||
:return:
|
||||
"""
|
||||
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
url = "http://online.b1.org/rest/online/upload"
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ thumb_dict = {"movies": "https://s10.postimg.cc/fxtqzdog9/peliculas.png",
|
||||
|
||||
|
||||
def set_genre(string):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
|
||||
genres_dict = {'accion': ['accion', 'action', 'accion y aventura', 'action & adventure'],
|
||||
'adultos': ['adultos', 'adultos +', 'adulto'],
|
||||
@@ -140,7 +140,7 @@ def set_genre(string):
|
||||
|
||||
|
||||
def remove_format(string):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
# logger.debug('enter remove: %s' % string)
|
||||
string = string.rstrip()
|
||||
string = re.sub(r'(\[|\[\/)(?:color|COLOR|b|B|i|I).*?\]|\[|\]|\(|\)|\:|\.', '', string)
|
||||
@@ -156,7 +156,7 @@ def normalize(string):
|
||||
|
||||
|
||||
def simplify(string):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
# logger.debug('enter simplify: %s'%string)
|
||||
string = remove_format(string)
|
||||
string = string.replace('-', ' ').replace('_', ' ')
|
||||
@@ -175,7 +175,7 @@ def simplify(string):
|
||||
|
||||
|
||||
def add_languages(title, languages):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
|
||||
if isinstance(languages, list):
|
||||
for language in languages:
|
||||
@@ -186,7 +186,7 @@ def add_languages(title, languages):
|
||||
|
||||
|
||||
def add_info_plot(plot, languages, quality):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
last = '[/I][/B]\n'
|
||||
|
||||
if languages:
|
||||
@@ -221,7 +221,7 @@ def add_info_plot(plot, languages, quality):
|
||||
|
||||
|
||||
def set_color(title, category):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
from core import jsontools
|
||||
|
||||
styles_path = os.path.join(config.get_runtime_path(), 'resources', 'color_styles.json')
|
||||
@@ -262,7 +262,7 @@ def set_color(title, category):
|
||||
|
||||
|
||||
def set_lang(language):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
|
||||
cast = ['castellano', 'español', 'espanol', 'cast', 'esp', 'espaol', 'es', 'zc', 'spa', 'spanish', 'vc']
|
||||
ita = ['italiano', 'italian', 'ita', 'it']
|
||||
@@ -303,7 +303,7 @@ def set_lang(language):
|
||||
|
||||
|
||||
def title_format(item):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
|
||||
lang = False
|
||||
valid = True
|
||||
@@ -567,7 +567,7 @@ def title_format(item):
|
||||
|
||||
|
||||
def thumbnail_type(item):
|
||||
# logger.log()
|
||||
# logger.info()
|
||||
# Check what type of thumbnail will be used in findvideos, Poster or Logo of the server
|
||||
|
||||
thumb_type = config.get_setting('video_thumbnail_type')
|
||||
|
||||
@@ -34,7 +34,7 @@ changelogFile = "special://profile/addon_data/plugin.video.kod/changelog.txt"
|
||||
|
||||
def loadCommits(page=1):
|
||||
apiLink = 'https://api.github.com/repos/' + user + '/' + repo + '/commits?sha=' + branch + "&page=" + str(page)
|
||||
logger.log(apiLink)
|
||||
logger.info(apiLink)
|
||||
# riprova ogni secondo finchè non riesce (ad esempio per mancanza di connessione)
|
||||
for n in range(10):
|
||||
try:
|
||||
@@ -54,7 +54,7 @@ def loadCommits(page=1):
|
||||
def check(background=False):
|
||||
if not addon.getSetting('addon_update_enabled'):
|
||||
return False, False
|
||||
logger.log('Cerco aggiornamenti..')
|
||||
logger.info('Cerco aggiornamenti..')
|
||||
commits = loadCommits()
|
||||
if not commits:
|
||||
return False, False
|
||||
@@ -66,7 +66,7 @@ def check(background=False):
|
||||
localCommitFile = open(os.path.join(addonDir, trackingFile), 'r+')
|
||||
localCommitSha = localCommitFile.read()
|
||||
localCommitSha = localCommitSha.replace('\n', '') # da testare
|
||||
logger.log('Commit locale: ' + localCommitSha)
|
||||
logger.info('Commit locale: ' + localCommitSha)
|
||||
updated = False
|
||||
serviceChanged = False
|
||||
|
||||
@@ -91,7 +91,7 @@ def check(background=False):
|
||||
# evitiamo di applicare i merge commit
|
||||
if 'Merge' in commitJson['commit']['message']:
|
||||
continue
|
||||
logger.log('aggiornando a ' + commitJson['sha'])
|
||||
logger.info('aggiornando a ' + commitJson['sha'])
|
||||
|
||||
# major update
|
||||
if len(commitJson['files']) > 50:
|
||||
@@ -112,7 +112,7 @@ def check(background=False):
|
||||
if file["filename"] == trackingFile: # il file di tracking non si modifica
|
||||
continue
|
||||
else:
|
||||
logger.log(file["filename"])
|
||||
logger.info(file["filename"])
|
||||
if 'resources/language' in file["filename"]:
|
||||
poFilesChanged = True
|
||||
if 'service.py' in file["filename"]:
|
||||
@@ -156,7 +156,7 @@ def check(background=False):
|
||||
elif changelog:
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80041) + changelog)
|
||||
else:
|
||||
logger.log('Nessun nuovo aggiornamento')
|
||||
logger.info('Nessun nuovo aggiornamento')
|
||||
|
||||
return updated, serviceChanged
|
||||
|
||||
@@ -173,7 +173,7 @@ def showSavedChangelog():
|
||||
|
||||
def calcCurrHash():
|
||||
treeHash = githash.tree_hash(addonDir).hexdigest()
|
||||
logger.log('tree hash: ' + treeHash)
|
||||
logger.info('tree hash: ' + treeHash)
|
||||
commits = loadCommits()
|
||||
lastCommitSha = commits[0]['sha']
|
||||
page = 1
|
||||
@@ -193,7 +193,7 @@ def calcCurrHash():
|
||||
if found:
|
||||
break
|
||||
else:
|
||||
logger.log('Non sono riuscito a trovare il commit attuale, scarico lo zip')
|
||||
logger.info('Non sono riuscito a trovare il commit attuale, scarico lo zip')
|
||||
hash = updateFromZip()
|
||||
# se ha scaricato lo zip si trova di sicuro all'ultimo commit
|
||||
localCommitFile = open(os.path.join(xbmc.translatePath("special://home/addons/"), 'plugin.video.kod', trackingFile), 'w')
|
||||
@@ -228,9 +228,9 @@ def updateFromZip(message=config.get_localized_string(80050)):
|
||||
destpathname = xbmc.translatePath("special://home/addons/")
|
||||
extractedDir = filetools.join(destpathname, "addon-" + branch)
|
||||
|
||||
logger.log("remotefilename=%s" % remotefilename)
|
||||
logger.log("localfilename=%s" % localfilename)
|
||||
logger.log('extract dir: ' + extractedDir)
|
||||
logger.info("remotefilename=%s" % remotefilename)
|
||||
logger.info("localfilename=%s" % localfilename)
|
||||
logger.info('extract dir: ' + extractedDir)
|
||||
|
||||
# pulizia preliminare
|
||||
remove(localfilename)
|
||||
@@ -241,24 +241,24 @@ def updateFromZip(message=config.get_localized_string(80050)):
|
||||
lambda nb, bs, fs, url=remotefilename: _pbhook(nb, bs, fs, url, dp))
|
||||
except Exception as e:
|
||||
platformtools.dialog_ok(config.get_localized_string(20000), config.get_localized_string(80031))
|
||||
logger.log('Non sono riuscito a scaricare il file zip')
|
||||
logger.log(e)
|
||||
logger.info('Non sono riuscito a scaricare il file zip')
|
||||
logger.info(e)
|
||||
dp.close()
|
||||
return False
|
||||
|
||||
# Lo descomprime
|
||||
logger.log("decompressione...")
|
||||
logger.log("destpathname=%s" % destpathname)
|
||||
logger.info("decompressione...")
|
||||
logger.info("destpathname=%s" % destpathname)
|
||||
|
||||
if os.path.isfile(localfilename):
|
||||
logger.log('il file esiste')
|
||||
logger.info('il file esiste')
|
||||
|
||||
dp.update(80, config.get_localized_string(20000) + '\n' + config.get_localized_string(80032))
|
||||
|
||||
import zipfile
|
||||
try:
|
||||
hash = fixZipGetHash(localfilename)
|
||||
logger.log(hash)
|
||||
logger.info(hash)
|
||||
|
||||
with zipfile.ZipFile(filetools.file_open(localfilename, 'rb', vfs=False)) as zip:
|
||||
size = sum([zinfo.file_size for zinfo in zip.filelist])
|
||||
@@ -269,7 +269,7 @@ def updateFromZip(message=config.get_localized_string(80050)):
|
||||
dp.update(int(80 + cur_size * 15 / size))
|
||||
|
||||
except Exception as e:
|
||||
logger.log('Non sono riuscito ad estrarre il file zip')
|
||||
logger.info('Non sono riuscito ad estrarre il file zip')
|
||||
logger.error(e)
|
||||
import traceback
|
||||
logger.error(traceback.print_exc())
|
||||
@@ -289,7 +289,7 @@ def updateFromZip(message=config.get_localized_string(80050)):
|
||||
rename(extractedDir, 'plugin.video.kod')
|
||||
addonDir = filetools.join(destpathname, 'plugin.video.kod')
|
||||
|
||||
logger.log("Cancellando il file zip...")
|
||||
logger.info("Cancellando il file zip...")
|
||||
remove(localfilename)
|
||||
|
||||
dp.update(100)
|
||||
@@ -318,7 +318,7 @@ def remove(file):
|
||||
try:
|
||||
os.remove(file)
|
||||
except:
|
||||
logger.log('File ' + file + ' NON eliminato')
|
||||
logger.info('File ' + file + ' NON eliminato')
|
||||
|
||||
|
||||
def onerror(func, path, exc_info):
|
||||
@@ -345,7 +345,7 @@ def removeTree(dir):
|
||||
try:
|
||||
shutil.rmtree(dir, ignore_errors=False, onerror=onerror)
|
||||
except Exception as e:
|
||||
logger.log('Cartella ' + dir + ' NON eliminata')
|
||||
logger.info('Cartella ' + dir + ' NON eliminata')
|
||||
logger.error(e)
|
||||
|
||||
|
||||
@@ -353,7 +353,7 @@ def rename(dir1, dir2):
|
||||
try:
|
||||
filetools.rename(dir1, dir2, silent=True, vfs=False)
|
||||
except:
|
||||
logger.log('cartella ' + dir1 + ' NON rinominata')
|
||||
logger.info('cartella ' + dir1 + ' NON rinominata')
|
||||
|
||||
|
||||
# https://stackoverflow.com/questions/3083235/unzipping-file-results-in-badzipfile-file-is-not-a-zip-file
|
||||
|
||||
@@ -12,7 +12,7 @@ from past.utils import old_div
|
||||
|
||||
from core import channeltools, servertools, scrapertools
|
||||
from platformcode import config, logger, platformtools
|
||||
from core.support import log, dbg, match
|
||||
from core.support import info, dbg, match
|
||||
|
||||
|
||||
class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
@@ -141,7 +141,7 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
||||
"""
|
||||
|
||||
def start(self, list_controls=None, dict_values=None, caption="", callback=None, item=None, custom_button=None, channelpath=None):
|
||||
log()
|
||||
info()
|
||||
|
||||
# Media Path
|
||||
self.mediapath = os.path.join(config.get_runtime_path(), 'resources', 'skins', 'Default', 'media')
|
||||
|
||||
@@ -261,7 +261,7 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
||||
return self.return_value
|
||||
|
||||
def onClick(self, _id):
|
||||
logger.log("onClick id=" + repr(_id))
|
||||
logger.info("onClick id=" + repr(_id))
|
||||
if _id == ID_BUTTON_PREVIOUS and self.indexList > 0:
|
||||
self.indexList -= 1
|
||||
self.get_scraper_data(self.listData[self.indexList])
|
||||
@@ -281,7 +281,7 @@ class InfoWindow(xbmcgui.WindowXMLDialog):
|
||||
self.return_value = None
|
||||
|
||||
def onAction(self, action):
|
||||
logger.log("action=" + repr(action.getId()))
|
||||
logger.info("action=" + repr(action.getId()))
|
||||
action = action.getId()
|
||||
|
||||
# Find Focus
|
||||
|
||||
@@ -17,7 +17,7 @@ from xml.dom import minidom
|
||||
|
||||
def mark_auto_as_watched(item, nfo_path=None, head_nfo=None, item_nfo=None):
|
||||
def mark_as_watched_subThread(item, nfo_path, head_nfo, item_nfo):
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
|
||||
time_limit = time.time() + 30
|
||||
@@ -99,7 +99,7 @@ def sync_trakt_addon(path_folder):
|
||||
"""
|
||||
Updates the values of episodes seen if
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
# if the addon exists we do the search
|
||||
if xbmc.getCondVisibility('System.HasAddon("script.trakt")'):
|
||||
# we import dependencies
|
||||
@@ -225,7 +225,7 @@ def sync_trakt_kodi(silent=True):
|
||||
notificacion = False
|
||||
|
||||
xbmc.executebuiltin('RunScript(script.trakt,action=sync,silent=%s)' % silent)
|
||||
logger.log("Synchronization with Trakt started")
|
||||
logger.info("Synchronization with Trakt started")
|
||||
|
||||
if notificacion:
|
||||
platformtools.dialog_notification(config.get_localized_string(20000), config.get_localized_string(60045), sound=False, time=2000)
|
||||
@@ -239,7 +239,7 @@ def mark_content_as_watched_on_kodi(item, value=1):
|
||||
@type value: int
|
||||
@param value: > 0 for seen, 0 for not seen
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
payload_f = ''
|
||||
|
||||
@@ -311,7 +311,7 @@ def mark_season_as_watched_on_kodi(item, value=1):
|
||||
@type value: int
|
||||
@param value: > 0 for seen, 0 for not seen
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
# logger.debug("item:\n" + item.tostring('\n'))
|
||||
|
||||
# We can only mark the season as seen in the Kodi database if the database is local, in case of sharing database this functionality will not work
|
||||
@@ -345,7 +345,7 @@ def mark_content_as_watched_on_kod(path):
|
||||
@type str: path
|
||||
@param path: content folder to mark
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
#logger.debug("path: " + path)
|
||||
|
||||
FOLDER_MOVIES = config.get_setting("folder_movies")
|
||||
@@ -435,7 +435,7 @@ def get_data(payload):
|
||||
:return:
|
||||
"""
|
||||
import urllib.request, urllib.error
|
||||
logger.log("payload: %s" % payload)
|
||||
logger.info("payload: %s" % payload)
|
||||
# Required header for XBMC JSON-RPC calls, otherwise you'll get a 415 HTTP response code - Unsupported media type
|
||||
headers = {'content-type': 'application/json'}
|
||||
|
||||
@@ -452,7 +452,7 @@ def get_data(payload):
|
||||
response = f.read()
|
||||
f.close()
|
||||
|
||||
logger.log("get_data: response %s" % response)
|
||||
logger.info("get_data: response %s" % response)
|
||||
data = jsontools.load(response)
|
||||
except Exception as ex:
|
||||
template = "An exception of type %s occured. Arguments:\n%r"
|
||||
@@ -468,7 +468,7 @@ def get_data(payload):
|
||||
logger.error("error en xbmc.executeJSONRPC: %s" % message)
|
||||
data = ["error"]
|
||||
|
||||
logger.log("data: %s" % data)
|
||||
logger.info("data: %s" % data)
|
||||
|
||||
return data
|
||||
|
||||
@@ -482,7 +482,7 @@ def update(folder_content=config.get_setting("folder_tvshows"), folder=""):
|
||||
@type folder: str
|
||||
@param folder: name of the folder to scan.
|
||||
"""
|
||||
logger.log(folder)
|
||||
logger.info(folder)
|
||||
|
||||
payload = {
|
||||
"jsonrpc": "2.0",
|
||||
@@ -546,7 +546,7 @@ def set_content(content_type, silent=False, custom=False):
|
||||
@type content_type: str ('movie' o 'tvshow')
|
||||
@param content_type: content type to configure, series or movies
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
continuar = True
|
||||
msg_text = ""
|
||||
videolibrarypath = config.get_setting("videolibrarypath")
|
||||
@@ -572,7 +572,7 @@ def set_content(content_type, silent=False, custom=False):
|
||||
try:
|
||||
# Install metadata.themoviedb.org
|
||||
xbmc.executebuiltin('InstallAddon(metadata.themoviedb.org)', True)
|
||||
logger.log("Instalado el Scraper de películas de TheMovieDB")
|
||||
logger.info("Instalado el Scraper de películas de TheMovieDB")
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -626,7 +626,7 @@ def set_content(content_type, silent=False, custom=False):
|
||||
try:
|
||||
# Install metadata.tvdb.com
|
||||
xbmc.executebuiltin('InstallAddon(metadata.tvdb.com)', True)
|
||||
logger.log("The TVDB series Scraper installed ")
|
||||
logger.info("The TVDB series Scraper installed ")
|
||||
except:
|
||||
pass
|
||||
|
||||
@@ -721,7 +721,7 @@ def set_content(content_type, silent=False, custom=False):
|
||||
strScraper = 'metadata.universal'
|
||||
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.universal/settings.xml")
|
||||
if not os.path.exists(path_settings):
|
||||
logger.log("%s: %s" % (content_type, path_settings + " doesn't exist"))
|
||||
logger.info("%s: %s" % (content_type, path_settings + " doesn't exist"))
|
||||
return continuar
|
||||
settings_data = filetools.read(path_settings)
|
||||
strSettings = ' '.join(settings_data.split()).replace("> <", "><")
|
||||
@@ -740,7 +740,7 @@ def set_content(content_type, silent=False, custom=False):
|
||||
strScraper = 'metadata.tvshows.themoviedb.org'
|
||||
path_settings = xbmc.translatePath("special://profile/addon_data/metadata.tvshows.themoviedb.org/settings.xml")
|
||||
if not os.path.exists(path_settings):
|
||||
logger.log("%s: %s" % (content_type, path_settings + " doesn't exist"))
|
||||
logger.info("%s: %s" % (content_type, path_settings + " doesn't exist"))
|
||||
return continuar
|
||||
settings_data = filetools.read(path_settings)
|
||||
strSettings = ' '.join(settings_data.split()).replace("> <", "><")
|
||||
@@ -750,7 +750,7 @@ def set_content(content_type, silent=False, custom=False):
|
||||
videolibrarypath += sep
|
||||
strPath = videolibrarypath + config.get_setting("folder_tvshows") + sep
|
||||
|
||||
logger.log("%s: %s" % (content_type, strPath))
|
||||
logger.info("%s: %s" % (content_type, strPath))
|
||||
# We check if strPath already exists in the DB to avoid duplicates
|
||||
sql = 'SELECT idPath FROM path where strPath="%s"' % strPath
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
@@ -792,15 +792,15 @@ def set_content(content_type, silent=False, custom=False):
|
||||
heading = config.get_localized_string(70103) % content_type
|
||||
msg_text = config.get_localized_string(70104)
|
||||
|
||||
logger.log("%s: %s" % (heading, msg_text))
|
||||
logger.info("%s: %s" % (heading, msg_text))
|
||||
return continuar
|
||||
|
||||
|
||||
def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvshows_folder, new_tvshows_folder, progress):
|
||||
def path_replace(path, old, new):
|
||||
|
||||
logger.log()
|
||||
logger.log('path: ' + path + ', old: ' + old + ', new: ' + new)
|
||||
logger.info()
|
||||
logger.info('path: ' + path + ', old: ' + old + ', new: ' + new)
|
||||
|
||||
if new.startswith("special://") or '://' in new: sep = '/'
|
||||
else: sep = os.sep
|
||||
@@ -811,7 +811,7 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
|
||||
return path
|
||||
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
sql_old_path = old_path
|
||||
if sql_old_path.startswith("special://"):
|
||||
@@ -823,10 +823,10 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
if not sql_old_path.endswith(sep):
|
||||
sql_old_path += sep
|
||||
|
||||
logger.log('sql_old_path: ' + sql_old_path)
|
||||
logger.info('sql_old_path: ' + sql_old_path)
|
||||
# search MAIN path in the DB
|
||||
sql = 'SELECT idPath, strPath FROM path where strPath LIKE "%s"' % sql_old_path
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
|
||||
# change main path
|
||||
@@ -834,7 +834,7 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
idPath = records[0][0]
|
||||
strPath = path_replace(records[0][1], old_path, new_path)
|
||||
sql = 'UPDATE path SET strPath="%s" WHERE idPath=%s' % (strPath, idPath)
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
else:
|
||||
progress.update(100)
|
||||
@@ -851,7 +851,7 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
|
||||
# Search Main Sub Folder
|
||||
sql = 'SELECT idPath, strPath FROM path where strPath LIKE "%s"' % sql_old_folder
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
|
||||
# Change Main Sub Folder
|
||||
@@ -860,13 +860,13 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
idPath = record[0]
|
||||
strPath = path_replace(record[1], filetools.join(old_path, OldFolder), filetools.join(new_path, NewFolder))
|
||||
sql = 'UPDATE path SET strPath="%s" WHERE idPath=%s' % (strPath, idPath)
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
|
||||
# Search if Sub Folder exixt in all paths
|
||||
sql_old_folder += '%'
|
||||
sql = 'SELECT idPath, strPath FROM path where strPath LIKE "%s"' % sql_old_folder
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
|
||||
#Change Sub Folder in all paths
|
||||
@@ -875,7 +875,7 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
idPath = record[0]
|
||||
strPath = path_replace(record[1], filetools.join(old_path, OldFolder), filetools.join(new_path, NewFolder))
|
||||
sql = 'UPDATE path SET strPath="%s" WHERE idPath=%s' % (strPath, idPath)
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
|
||||
|
||||
@@ -883,27 +883,27 @@ def update_db(old_path, new_path, old_movies_folder, new_movies_folder, old_tvsh
|
||||
# if is Movie Folder
|
||||
# search and modify in "movie"
|
||||
sql = 'SELECT idMovie, c22 FROM movie where c22 LIKE "%s"' % sql_old_folder
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
if records:
|
||||
for record in records:
|
||||
idMovie = record[0]
|
||||
strPath = path_replace(record[1], filetools.join(old_path, OldFolder), filetools.join(new_path, NewFolder))
|
||||
sql = 'UPDATE movie SET c22="%s" WHERE idMovie=%s' % (strPath, idMovie)
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
else:
|
||||
# if is TV Show Folder
|
||||
# search and modify in "episode"
|
||||
sql = 'SELECT idEpisode, c18 FROM episode where c18 LIKE "%s"' % sql_old_folder
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
if records:
|
||||
for record in records:
|
||||
idEpisode = record[0]
|
||||
strPath = path_replace(record[1], filetools.join(old_path, OldFolder), filetools.join(new_path, NewFolder))
|
||||
sql = 'UPDATE episode SET c18="%s" WHERE idEpisode=%s' % (strPath, idEpisode)
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
p += 5
|
||||
progress.update(p, config.get_localized_string(20000) + '\n' + config.get_localized_string(80013))
|
||||
@@ -928,26 +928,26 @@ def clean(path_list=[]):
|
||||
|
||||
return path, sep
|
||||
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
progress = platformtools.dialog_progress_bg(config.get_localized_string(20000), config.get_localized_string(80025))
|
||||
progress.update(0)
|
||||
|
||||
# if the path list is empty, clean the entire video library
|
||||
if not path_list:
|
||||
logger.log('the path list is empty, clean the entire video library')
|
||||
logger.info('the path list is empty, clean the entire video library')
|
||||
if not config.get_setting("videolibrary_kodi"):
|
||||
sql_path, sep = sql_format(config.get_setting("videolibrarypath"))
|
||||
if not sql_path.endswith(sep): sql_path += sep
|
||||
sql = 'SELECT idPath FROM path where strPath LIKE "%s"' % sql_path
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
idPath = records[0][0]
|
||||
sql = 'DELETE from path WHERE idPath=%s' % idPath
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
sql = 'DELETE from path WHERE idParentPath=%s' % idPath
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
|
||||
from core import videolibrarytools
|
||||
@@ -961,7 +961,7 @@ def clean(path_list=[]):
|
||||
if filetools.exists(tvshow_nfo):
|
||||
path_list.append(filetools.join(config.get_setting("videolibrarypath"), videolibrarytools.FOLDER_TVSHOWS, folder))
|
||||
|
||||
logger.log('path_list: ' + str(path_list))
|
||||
logger.info('path_list: ' + str(path_list))
|
||||
if path_list: t = float(100) / len(path_list)
|
||||
for i, path in enumerate(path_list):
|
||||
progress.update(int(math.ceil((i + 1) * t)))
|
||||
@@ -971,13 +971,13 @@ def clean(path_list=[]):
|
||||
|
||||
sql_path, sep = sql_format(path)
|
||||
if filetools.isdir(path) and not sql_path.endswith(sep): sql_path += sep
|
||||
logger.log('path: ' + path)
|
||||
logger.log('sql_path: ' + sql_path)
|
||||
logger.info('path: ' + path)
|
||||
logger.info('sql_path: ' + sql_path)
|
||||
|
||||
if filetools.isdir(path):
|
||||
# search movie in the DB
|
||||
sql = 'SELECT idMovie FROM movie where c22 LIKE "%s"' % (sql_path + '%')
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
# delete movie
|
||||
if records:
|
||||
@@ -986,7 +986,7 @@ def clean(path_list=[]):
|
||||
continue
|
||||
# search TV show in the DB
|
||||
sql = 'SELECT idShow FROM tvshow_view where strPath LIKE "%s"' % sql_path
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
# delete TV show
|
||||
if records:
|
||||
@@ -995,7 +995,7 @@ def clean(path_list=[]):
|
||||
elif config.get_setting("folder_movies") in sql_path:
|
||||
# search movie in the DB
|
||||
sql = 'SELECT idMovie FROM movie where c22 LIKE "%s"' % sql_path
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
# delete movie
|
||||
if records:
|
||||
@@ -1004,7 +1004,7 @@ def clean(path_list=[]):
|
||||
else:
|
||||
# search episode in the DB
|
||||
sql = 'SELECT idEpisode FROM episode where c18 LIKE "%s"' % sql_path
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
# delete episode
|
||||
if records:
|
||||
@@ -1023,7 +1023,7 @@ def check_db(path):
|
||||
ret = False
|
||||
sql_path = '%' + sep + path.split(sep)[-1] + sep + '%'
|
||||
sql = 'SELECT idShow FROM tvshow_view where strPath LIKE "%s"' % sql_path
|
||||
logger.log('sql: ' + sql)
|
||||
logger.info('sql: ' + sql)
|
||||
nun_records, records = execute_sql_kodi(sql)
|
||||
if records:
|
||||
ret = True
|
||||
@@ -1040,7 +1040,7 @@ def execute_sql_kodi(sql):
|
||||
@return: list with the query result
|
||||
@rtype records: list of tuples
|
||||
"""
|
||||
logger.log()
|
||||
logger.info()
|
||||
file_db = ""
|
||||
nun_records = 0
|
||||
records = None
|
||||
@@ -1061,14 +1061,14 @@ def execute_sql_kodi(sql):
|
||||
break
|
||||
|
||||
if file_db:
|
||||
logger.log("DB file: %s" % file_db)
|
||||
logger.info("DB file: %s" % file_db)
|
||||
conn = None
|
||||
try:
|
||||
import sqlite3
|
||||
conn = sqlite3.connect(file_db)
|
||||
cursor = conn.cursor()
|
||||
|
||||
logger.log("Running sql: %s" % sql)
|
||||
logger.info("Running sql: %s" % sql)
|
||||
cursor.execute(sql)
|
||||
conn.commit()
|
||||
|
||||
@@ -1082,7 +1082,7 @@ def execute_sql_kodi(sql):
|
||||
nun_records = conn.total_changes
|
||||
|
||||
conn.close()
|
||||
logger.log("Query executed. Records: %s" % nun_records)
|
||||
logger.info("Query executed. Records: %s" % nun_records)
|
||||
|
||||
except:
|
||||
logger.error("Error executing sql query")
|
||||
@@ -1102,7 +1102,7 @@ def check_sources(new_movies_path='', new_tvshows_path=''):
|
||||
if not path.endswith(sep): path += sep
|
||||
return path
|
||||
|
||||
logger.log()
|
||||
logger.info()
|
||||
|
||||
new_movies_path = format_path(new_movies_path)
|
||||
new_tvshows_path = format_path(new_tvshows_path)
|
||||
@@ -1132,7 +1132,7 @@ def check_sources(new_movies_path='', new_tvshows_path=''):
|
||||
|
||||
|
||||
def update_sources(new='', old=''):
|
||||
logger.log()
|
||||
logger.info()
|
||||
if new == old: return
|
||||
|
||||
SOURCES_PATH = xbmc.translatePath("special://userdata/sources.xml")
|
||||
@@ -1174,9 +1174,9 @@ def update_sources(new='', old=''):
|
||||
# create new path
|
||||
list_path = [p.firstChild.data for p in paths_node]
|
||||
if new in list_path:
|
||||
logger.log("The path %s already exists in sources.xml" % new)
|
||||
logger.info("The path %s already exists in sources.xml" % new)
|
||||
return
|
||||
logger.log("The path %s does not exist in sources.xml" % new)
|
||||
logger.info("The path %s does not exist in sources.xml" % new)
|
||||
|
||||
# if the path does not exist we create one
|
||||
source_node = xmldoc.createElement("source")
|
||||
@@ -1215,7 +1215,7 @@ def update_sources(new='', old=''):
|
||||
|
||||
|
||||
def ask_set_content(silent=False):
|
||||
logger.log()
|
||||
logger.info()
|
||||
logger.debug("videolibrary_kodi %s" % config.get_setting("videolibrary_kodi"))
|
||||
|
||||
def do_config(custom=False):
|
||||
@@ -1272,7 +1272,7 @@ def ask_set_content(silent=False):
|
||||
|
||||
def next_ep(item):
|
||||
from core.item import Item
|
||||
logger.log()
|
||||
logger.info()
|
||||
item.next_ep = False
|
||||
|
||||
# check if next file exist
|
||||
@@ -1288,7 +1288,7 @@ def next_ep(item):
|
||||
nextIndex = fileList.index(current_filename) + 1
|
||||
if nextIndex == 0 or nextIndex == len(fileList): next_file = None
|
||||
else: next_file = fileList[nextIndex]
|
||||
logger.log('Next File:' + str(next_file))
|
||||
logger.info('Next File:' + str(next_file))
|
||||
|
||||
# start next episode window afther x time
|
||||
if next_file:
|
||||
|
||||
@@ -9,7 +9,7 @@ from platformcode import logger, config
|
||||
headers = [['User-Agent', 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0']]
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
# page_url = re.sub('akvideo.stream/(?:video/|video\\.php\\?file_code=)?(?:embed-)?([a-zA-Z0-9]+)','akvideo.stream/video/\\1',page_url)
|
||||
global data
|
||||
page = httptools.downloadpage(page_url, headers=headers)
|
||||
@@ -28,18 +28,18 @@ def test_video_exists(page_url):
|
||||
|
||||
# ID, code = scrapertools.find_single_match(data, r"""input\D*id=(?:'|")([^'"]+)(?:'|").*?value='([a-z0-9]+)""")
|
||||
# post = urllib.urlencode({ID: code})
|
||||
# logger.log('PAGE DATA' + data)
|
||||
# logger.info('PAGE DATA' + data)
|
||||
if "File Not Found" in data:
|
||||
return False, config.get_localized_string(70449) % "Akvideo"
|
||||
return True, ""
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log(" url=" + page_url)
|
||||
logger.info(" url=" + page_url)
|
||||
video_urls = []
|
||||
|
||||
global data
|
||||
# logger.log('PAGE DATA' + data)
|
||||
# logger.info('PAGE DATA' + data)
|
||||
# sitekey = scrapertools.find_single_match(data, 'data-sitekey="([^"]+)')
|
||||
# captcha = platformtools.show_recaptcha(sitekey, page_url) if sitekey else ''
|
||||
#
|
||||
|
||||
@@ -6,7 +6,7 @@ from platformcode import config, logger
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url, cookies=False).data
|
||||
if 'File you are looking for is not found.' in data:
|
||||
|
||||
@@ -6,7 +6,7 @@ from platformcode import logger
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if "no longer exists" in data or "to copyright issues" in data:
|
||||
return False, config.get_localized_string(70449) % "animeid"
|
||||
@@ -16,7 +16,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, user="", password="", video_password=""):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
video_urls = []
|
||||
label, videourl = scrapertools.find_single_match(data, 'label":"([^"]+)".*?file":"([^"]+)')
|
||||
|
||||
@@ -9,7 +9,7 @@ from platformcode import logger, config
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
response = httptools.downloadpage(page_url)
|
||||
if not response.success or "Not Found" in response.data or "File was deleted" in response.data or "is no longer available" in response.data:
|
||||
return False, config.get_localized_string(70449) % "anonfile"
|
||||
@@ -17,7 +17,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
data = httptools.downloadpage(page_url).data
|
||||
patron = 'download-url.*?href="([^"]+)"'
|
||||
|
||||
@@ -9,7 +9,7 @@ from platformcode import logger
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url)
|
||||
if data.code == 404:
|
||||
return False, config.get_localized_string(70449) % "ArchiveOrg"
|
||||
@@ -17,7 +17,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("url=" + page_url)
|
||||
logger.info("url=" + page_url)
|
||||
video_urls = []
|
||||
data = httptools.downloadpage(page_url).data
|
||||
patron = '<meta property="og:video" content="([^"]+)">'
|
||||
|
||||
@@ -9,7 +9,7 @@ except ImportError:
|
||||
from urllib import urlencode
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
if 'http://' in page_url: # fastids
|
||||
page_url = httptools.downloadpage(page_url, follow_redirects=False, only_headers=True).headers['location']
|
||||
@@ -24,7 +24,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("page_url=" + page_url)
|
||||
logger.info("page_url=" + page_url)
|
||||
|
||||
video_urls = []
|
||||
|
||||
@@ -36,18 +36,18 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
if data_pack:
|
||||
from lib import jsunpack
|
||||
data = jsunpack.unpack(data_pack)
|
||||
logger.log("page_url=" + data)
|
||||
logger.info("page_url=" + data)
|
||||
|
||||
# URL
|
||||
url = scrapertools.find_single_match(data, r'"src"value="([^"]+)"')
|
||||
if not url:
|
||||
url = scrapertools.find_single_match(data, r'file\s*:\s*"([^"]+)"')
|
||||
logger.log("URL=" + str(url))
|
||||
logger.info("URL=" + str(url))
|
||||
|
||||
# URL del vídeo
|
||||
video_urls.append([".mp4" + " [backin]", url])
|
||||
|
||||
for video_url in video_urls:
|
||||
logger.log("%s - %s" % (video_url[0], httptools.get_url_headers(video_url[1])))
|
||||
logger.info("%s - %s" % (video_url[0], httptools.get_url_headers(video_url[1])))
|
||||
|
||||
return video_urls
|
||||
|
||||
@@ -11,7 +11,7 @@ from platformcode import logger
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global page
|
||||
page = httptools.downloadpage(page_url)
|
||||
if not page.success:
|
||||
@@ -20,7 +20,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("url=" + page_url)
|
||||
logger.info("url=" + page_url)
|
||||
video_urls = []
|
||||
ext = '.mp4'
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ headers = {'User-Agent': 'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N)
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if "Archive no Encontrado" in data:
|
||||
return False, config.get_localized_string(70449) % "bdupload"
|
||||
@@ -19,7 +19,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, user="", password="", video_password=""):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url).data
|
||||
post = ""
|
||||
patron = '(?s)type="hidden" name="([^"]+)".*?value="([^"]*)"'
|
||||
|
||||
@@ -11,7 +11,7 @@ from platformcode import logger
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
data = httptools.downloadpage(page_url)
|
||||
if data.code == 404:
|
||||
return False, config.get_localized_string(70449) % "CinemaUpload"
|
||||
@@ -19,7 +19,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("url=" + page_url)
|
||||
logger.info("url=" + page_url)
|
||||
video_urls = []
|
||||
data = httptools.downloadpage(page_url).data
|
||||
data = re.sub(r'\n|\r|\t| |<br>|\s{2,}', "", data)
|
||||
|
||||
@@ -22,7 +22,7 @@ excption = False
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
data = get_data(page_url.replace(".org", ".me"))
|
||||
if "File Not Found" in data: return False, config.get_localized_string(70449) % "Clicknupload"
|
||||
@@ -31,7 +31,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("url=" + page_url)
|
||||
logger.info("url=" + page_url)
|
||||
|
||||
data = get_data(page_url.replace(".org", ".me"))
|
||||
|
||||
@@ -51,7 +51,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
media_url = media.rsplit('/', 1)[0] + "/" + url_strip
|
||||
video_urls.append([scrapertools.get_filename_from_url(media_url)[-4:] + " [clicknupload]", media_url])
|
||||
for video_url in video_urls:
|
||||
logger.log("%s - %s" % (video_url[0], video_url[1]))
|
||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
||||
|
||||
return video_urls
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from lib import jsunpack
|
||||
from platformcode import logger, config
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global data
|
||||
data = httptools.downloadpage(page_url).data
|
||||
if "File Not Found" in data or "File was deleted" in data:
|
||||
@@ -15,7 +15,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, user="", password="", video_password=""):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
|
||||
try:
|
||||
|
||||
@@ -8,7 +8,7 @@ from lib import jsunpack
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
html = httptools.downloadpage(page_url)
|
||||
global data
|
||||
data = html.data
|
||||
@@ -18,7 +18,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("url=" + page_url)
|
||||
logger.info("url=" + page_url)
|
||||
video_urls = []
|
||||
global data
|
||||
# data = httptools.downloadpage(page_url).data
|
||||
|
||||
@@ -30,7 +30,7 @@ proxy = "https://www.usa-proxy.org/"
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
|
||||
data = httptools.downloadpage(page_url, headers=GLOBAL_HEADER).data
|
||||
if "Este es un clip de muestra" in data:
|
||||
@@ -44,7 +44,7 @@ def test_video_exists(page_url):
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
#page_url='https://www.crunchyroll.com/es-es/one-piece/episode-891-climbing-up-a-waterfall-a-great-journey-through-the-land-of-wanos-sea-zone-786643'
|
||||
logger.log("url=" + page_url)
|
||||
logger.info("url=" + page_url)
|
||||
video_urls = []
|
||||
if "crunchyroll.com" in page_url:
|
||||
media_id = page_url.rsplit("-", 1)[1]
|
||||
@@ -94,7 +94,7 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
file_sub = ""
|
||||
video_urls.append(["%s %sp [crunchyroll]" % (filename, quality), media_url, 0, file_sub])
|
||||
for video_url in video_urls:
|
||||
logger.log("%s - %s" % (video_url[0], video_url[1]))
|
||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
||||
return video_urls
|
||||
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from platformcode import logger, config
|
||||
|
||||
|
||||
def test_video_exists(page_url):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
global response
|
||||
|
||||
response = httptools.downloadpage(page_url, cookies=False)
|
||||
@@ -18,7 +18,7 @@ def test_video_exists(page_url):
|
||||
|
||||
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log("(page_url='%s')" % page_url)
|
||||
logger.info("(page_url='%s')" % page_url)
|
||||
video_urls = []
|
||||
cookie = {'Cookie': response.headers["set-cookie"]}
|
||||
data = response.data.replace("\\", "")
|
||||
@@ -40,5 +40,5 @@ def get_video_url(page_url, premium=False, user="", password="", video_password=
|
||||
stream_url = stream_url_http
|
||||
video_urls.append(["%sp .%s [dailymotion]" % (calidad, stream_type), stream_url, 0, subtitle])
|
||||
for video_url in video_urls:
|
||||
logger.log("%s - %s" % (video_url[0], video_url[1]))
|
||||
logger.info("%s - %s" % (video_url[0], video_url[1]))
|
||||
return video_urls
|
||||
@@ -7,7 +7,7 @@ from platformcode import logger
|
||||
|
||||
# Returns an array of possible video url's from the page_url
|
||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
||||
logger.log()
|
||||
logger.info()
|
||||
page_url = correct_url(page_url)
|
||||
dd1 = httptools.downloadpage("https://api.alldebrid.com/user/login?agent=mySoft&username=%s&password=%s" %(user, password)).data
|
||||
token = scrapertools.find_single_match(dd1, 'token":"([^"]+)')
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user