This commit is contained in:
Whiplash
2019-10-27 13:57:57 +01:00
261 changed files with 291 additions and 8009 deletions

View File

@@ -219,7 +219,7 @@ Occorrente: Browser, KOD! e il file canale.py ( da browser o da file )
Avviso:
- Sul Browser disattiva eventuali componenti aggiuntivi che bloccano i JS (javascript), li riattivi alla fine del test.
Entra in ogni menu e controlla che i risultati siano gli stessi che trovi sul sito, comprese le varie info (ita/sub-ita, qualità ecc..), inoltre entra, se ci sono, nei menu dei generi - anni - lettera, verifica che cliccando su una voce si visualizzino i titoli.
Entra in ogni menu e controlla che i risultati, delle prime 5-6 pagine, siano gli stessi che trovi sul sito, comprese le varie info (ita/sub-ita, qualità ecc..), inoltre entra, se ci sono, nei menu dei generi - anni - lettera, verifica che cliccando su una voce si visualizzino i titoli.
*Copia questa sezione per ogni voce che presenta problemi:*

View File

@@ -23,7 +23,7 @@ headers = [['Referer', host]]
@support.menu
def mainlist(item):
anime = ['/lista-anime/',
('In Corso',['/lista-anime-in-corso/']),
('In Corso',['/lista-anime-in-corso/', 'peliculas', 'corso']),
('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last'])
]
return locals()
@@ -50,9 +50,10 @@ def newest(categoria):
@support.scrape
def search(item, texto):
# debug = True
search = texto
item.contentType = 'tvshow'
patron = '<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
patron = r'<a href="(?P<url>[^"]+)">\s*<strong[^>]+>(?P<title>[^<]+)<'
action = 'episodios'
return locals()
@@ -63,9 +64,10 @@ def peliculas(item):
action = 'episodios'
if item.args == 'newest':
patron = r'src="(?P<thumb>[^"]+)" class="attachment-grid-post[^"]+" alt="[^"]*" title="(?P<title>[^"]+").*?<h2><a href="(?P<url>[^"]+)"'
def itemHook(item):
item.url = support.match(item, '<a href="([^"]+)" class="btn', headers=headers)[0][0]
patron = r'<a href="(?P<url>[^"]+)">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
def itemHook(item):
url = support.match(item, '<a href="([^"]+)" title="[^"]+" target="[^"]+" class="btn', headers=headers)[0]
item.url = url[0] if url else ''
delete = support.scrapertoolsV2.find_single_match(item.fulltitle, r'( Episodi.*)')
number = support.scrapertoolsV2.find_single_match(item.title, r'Episodi(?:o)? (?:\d+÷)?(\d+)')
item.title = support.typo(number + ' - ','bold') + item.title.replace(delete,'')
@@ -75,11 +77,13 @@ def peliculas(item):
action = 'findvideos'
elif item.args == 'last':
patron = r'src="(?P<thumb>[^"]+)" class="attachment-grid-post[^"]+" alt="[^"]*" title="(?P<title>.*?)(?: Sub| sub| SUB|").*?<h2><a href="(?P<url>[^"]+)"'
patron = r'<a href="(?P<url>[^"]+)">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
else:
elif item.args == 'corso':
pagination = ''
patron = r'<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
else:
patron = r'<a href="(?P<url>[^"]+)">\s*<strong[^>]+>(?P<title>[^<]+)<'
return locals()
@@ -101,7 +105,10 @@ def findvideos(item):
itemlist = []
if item.number:
item.url = support.match(item, r'<a href="([^"]+)"[^>]*>', patronBlock=r'Episodio %s(.*?)</tr>' % item.number)[0][0]
from lib import unshortenit
url, c = unshortenit.unshorten(item.url)
url = support.match(item, r'<a href="([^"]+)"[^>]*>', patronBlock=r'Episodio %s(.*?)</tr>' % item.number ,url=url)[0]
item.url = url[0] if url else ''
if 'http' not in item.url:
if '//' in item.url[:2]:

View File

@@ -75,14 +75,16 @@ def peliculas(item):
def itemHook(item):
if item.quality1:
item.title = item.title + support.typo(item.quality1, '_ [] color kod')
item.quality = item.quality1
item.title += support.typo(item.quality, '_ [] color kod')
if item.lang2:
item.contentLanguage = item.lang2
item.title = item.title + support.typo(item.lang2, '_ [] color kod')
item.title += support.typo(item.lang2, '_ [] color kod')
if item.args == 'novita':
item.title = item.title
return item
#debug = True # True per testare le regex sul sito
## debug = True # True per testare le regex sul sito
return locals()
@support.scrape
@@ -95,7 +97,7 @@ def episodios(item):
item.contentType = 'tvshow'
blacklist = ['']
patron = r'(?P<episode>\d+(?:&#215;|×)?\d+\-\d+|\d+(?:&#215;|×)\d+)[;]?(?:(?P<title>[^<]+)<(?P<url>.*?)|(\2[ ])(?:<(\3.*?)))(?:<br />|</p>)'
patronBlock = r'<strong>(?P<block>(?:.+?Stagione*.+?(?P<lang>ITA|Sub-ITA))?(?:.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
patronBlock = r'<strong>(?P<block>(?:.+?Stagione*.+?(?P<lang>[Ii][Tt][Aa]|[Ss][Uu][Bb][\-]?[iI][tT][aA]))?(?:.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
## debug = True
return locals()
@@ -172,6 +174,7 @@ def newest(categoria):
if categoria == 'series':
item.contentType = 'tvshow'
item.url = host+'/aggiornamenti-serie-tv'
item.args = 'novita'
else:
item.contentType = 'movie'
item.url = host+'/category/film'

View File

@@ -4,8 +4,8 @@
"language": ["ita", "sub-ita"],
"active": true,
"adult": false,
"thumbnail": "",
"banner": "",
"thumbnail": "casacinemainfo.png",
"banner": "casacinemainfo.png",
"categories": ["movie", "vos"],
"settings": []
}

View File

@@ -33,11 +33,6 @@ list_quality = ['HD', 'SD', 'default']
checklinks = config.get_setting('checklinks', 'cineblog01')
checklinks_number = config.get_setting('checklinks_number', 'cineblog01')
# esclusione degli articoli 'di servizio'
blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO &#x25b6; TROVA L&#8217;INDIRIZZO UFFICIALE ',
'Aggiornamento Quotidiano Serie TV', 'OSCAR 2019 ▶ CB01.UNO: Vota il tuo film preferito! 🎬',
'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?']
@support.menu
def mainlist(item):
@@ -46,12 +41,13 @@ def mainlist(item):
('HD', ['', 'menu', 'Film HD Streaming']),
('Generi', ['', 'menu', 'Film per Genere']),
('Anni', ['', 'menu', 'Film per Anno']),
('Ultimi aggiornati', ['/lista-film-ultimi-100-film-aggiornati/', 'newest', 'aggiornati'])
('Ultimi aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'newest'])
]
tvshow = ['/serietv/',
('Per Lettera', ['/serietv/', 'menu', 'Serie-Tv per Lettera']),
('Per Genere', ['/serietv/', 'menu', 'Serie-Tv per Genere']),
('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno'])
('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']),
('Aggiornamento quotidiano', ['/serietv/aggiornamento-quotidiano-serie-tv/', 'newest'])
]
return locals()
@@ -70,16 +66,29 @@ def menu(item):
@support.scrape
def newest(categoria):
findhost()
# debug = True
patron = r'<a href="?(?P<url>[^">]+)"?>(?P<title>[^<([]+)(?:\[(?P<lang>Sub-ITA|B/N|SUB-ITA)\])?\s*(?:\[(?P<quality>HD|SD|HD/3D)\])?\s*\((?P<year>[0-9]{4})\)<\/a>'
if type(categoria) != Item:
item = Item()
else:
item = categoria
categoria = 'series' if item.contentType != 'movie' else 'movie'
pagination = 20
if categoria == 'series':
item.contentType = 'tvshow'
action = 'episodios'
item.url = host + 'serietv/aggiornamento-quotidiano-serie-tv/'
patronBlock = r'<article class="sequex-post-content">(?P<block>.*?)</article>'
patron = '<a href="(?P<url>[^"]+)".*?>(?P<title>[^<([|]+).*?(?P<lang>ITA|SUB-ITA)?</a'
else:
item.contentType = 'movie'
item.url = host + '/lista-film-ultimi-100-film-aggiunti/'
patronBlock = r'Ultimi 100 film aggiunti:(?P<block>.*?)<\/td>'
else:
patronBlock = r'Ultimi 100 film Aggiornati:(?P<block>.*?)<\/td>'
item = categoria
patron = r'<a href="(?P<url>[^"]+)"\s*>(?P<title>[^<([]+)(?:\[(?P<lang>Sub-ITA|B/N)\])?\s?(?:\[(?P<quality>HD|SD|HD/3D)\])?\s?\((?P<year>[0-9]{4})\)<\/a>'
pagination = 20
# else:
# patronBlock = r'Ultimi 100 film Aggiornati:(?P<block>.*?)<\/td>'
# item = categoria
return locals()
@@ -101,11 +110,16 @@ def search(item, text):
@support.scrape
def peliculas(item):
# esclusione degli articoli 'di servizio'
blacklist = ['BENVENUTI', 'Richieste Serie TV', 'CB01.UNO &#x25b6; TROVA L&#8217;INDIRIZZO UFFICIALE ',
'Aggiornamento Quotidiano Serie TV', 'OSCAR 2019 ▶ CB01.UNO: Vota il tuo film preferito! 🎬',
'Openload: la situazione. Benvenuto Verystream', 'Openload: lo volete ancora?']
if '/serietv/' not in item.url:
patron = r'<div class="?card-image"?>.*?<img src="?(?P<thumb>[^" ]+)"? alt.*?<a href="?(?P<url>[^" >]+)(?:\/|")>(?P<title>[^<[(]+)(?:\[(?P<quality>[A-Za-z0-9/-]+)])? (?:\((?P<year>[0-9]{4})\))?.*?<strong>(?P<genre>[^<>&]+).*?DURATA (?P<duration>[0-9]+).*?<br(?: /)?>(?P<plot>[^<>]+)'
action = 'findvideos'
else:
patron = r'div class="card-image">.*?<img src="(?P<thumb>[^ ]+)" alt.*?<a href="(?P<url>[^ >]+)">(?P<title>[^<[(]+)<\/a>.*?<strong><span style="[^"]+">(?P<genre>[^<>0-9(]+)\((?P<year>[0-9]{4}).*?</(?:p|div)>(?P<plot>.*?)</div'
patron = r'div class="card-image">.*?<img src="(?P<thumb>[^ ]+)" alt.*?<a href="(?P<url>[^ >]+)">(?P<title>[^<[(]+)<\/a>.*?(?:<strong><span style="[^"]+">(?P<genre>[^<>0-9(]+)\((?P<year>[0-9]{4}).*?</(?:p|div)>(?P<plot>.*?))?</div'
action = 'episodios'
item.contentType = 'tvshow'

View File

@@ -4,41 +4,8 @@
"active": true,
"adult": false,
"language": ["ita"],
"thumbnail": "",
"banner": "",
"thumbnail": "filmpertutti.png",
"banner": "filmpertutti.png",
"categories": ["tvshow","movie"],
"settings": [
{
"id": "include_in_global_search",
"type": "bool",
"label": "Includi in ricerca globale",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_peliculas",
"type": "bool",
"label": "Includi in Novità - Film",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_series",
"type": "bool",
"label": "Incluir en Novedades - Series",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_italiano",
"type": "bool",
"label": "Includi in Novità - Italiano",
"default": true,
"enabled": true,
"visible": true
}
]
"settings": []
}

View File

@@ -4,41 +4,8 @@
"active": true,
"adult": false,
"language": ["ita"],
"thumbnail": "",
"bannermenu": "",
"thumbnail": "guardogratis.png",
"bannermenu": "guardogratis.png",
"categories": ["movie","tvshow"],
"settings": [
{
"id": "include_in_global_search",
"type": "bool",
"label": "Includi ricerca globale",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_peliculas",
"type": "bool",
"label": "Includi in Novità - Film",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_series",
"type": "bool",
"label": "Includi in Novità - Serie TV",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_italiano",
"type": "bool",
"label": "Includi in Novità - Italiano",
"default": true,
"enabled": true,
"visible": true
}
]
"settings": []
}

View File

@@ -4,6 +4,7 @@
"language": ["ita"],
"active": true,
"adult": false,
<<<<<<< HEAD
"thumbnail": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png",
"banner": "https://polpo.tv/build/assets/apple-touch-icon-152x152.png",
"categories": [
@@ -19,4 +20,12 @@
"visible": true
}
]
=======
"thumbnail": "polpotv.png",
"banner": "polpotv.png",
"categories": ["movie"],
"not_active":[],
"default_off":["include_in_newest"],
"settings": []
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
}

View File

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
<<<<<<< HEAD
# kod - XBMC Plugin
# Canale polpotv
# ------------------------------------------------------------
@@ -11,6 +12,16 @@ from platformcode import config
from core import jsontools
import json
import datetime
=======
# KoD - XBMC Plugin
# Canale polpotv
# ------------------------------------------------------------
from core import scrapertools, httptools, support, jsontools
from core.item import Item
from platformcode import config
import json, datetime
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
__channel__ = "polpotv"
host = config.get_channel_url(__channel__)
@@ -22,6 +33,7 @@ list_quality = ['1080p','720p','480p','360p']
@support.menu
def mainlist(item):
<<<<<<< HEAD
film = [
('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']),
('Generi', ['/api/genres', 'search_movie_by_genre', '']),
@@ -31,6 +43,26 @@ def mainlist(item):
def peliculas(item):
logger.info("kod.polpotv peliculas")
=======
menu = [
('Ultimi Film aggiunti', ['/api/movies?order[lastReleaseAt]=desc', 'peliculas', '']),
('Generi', ['/api/genres', 'search_movie_by_genre', '']),
('Anni {film}', ['', 'search_movie_by_year', '']),
('Cerca Film... bold', ['', 'search', ''])
]
return locals()
def newest(categoria):
support.log()
item = Item()
if categoria == 'peliculas':
item.contentType = 'movie'
item.url = host + '/api/movies?order[lastReleaseAt]=desc'
return peliculas(item)
def peliculas(item):
support.log()
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
itemlist = []
data = httptools.downloadpage(item.url, headers=headers).data
json_object = jsontools.load(data)
@@ -39,6 +71,7 @@ def peliculas(item):
itemlist.extend(get_itemlist_movie(movie,item))
try:
<<<<<<< HEAD
if json_object['hydra:view']['hydra:next'] is not None:
itemlist.append(
Item(channel=item.channel,
@@ -54,6 +87,17 @@ def peliculas(item):
def search(item, texto):
logger.info("kod.polpotv " + item.url + " search " + texto)
=======
if support.inspect.stack()[1][3] not in ['newest']:
support.nextPage(itemlist, item, next_page=json_object['hydra:view']['hydra:next'])
except:
pass
return itemlist
def search(item, texto):
support.log(item.url, "search", texto)
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
itemlist=[]
try:
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
@@ -62,6 +106,7 @@ def search(item, texto):
for movie in json_object['hydra:member']:
itemlist.extend(get_itemlist_movie(movie,item))
return itemlist
<<<<<<< HEAD
# Continua la ricerca in caso di errore
except:
import sys
@@ -71,6 +116,17 @@ def search(item, texto):
def search_movie_by_genre(item):
logger.info("kod.polpotv search_movie_by_genre")
=======
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
return []
def search_movie_by_genre(item):
support.log()
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
itemlist = []
data = httptools.downloadpage(item.url, headers=headers).data
json_object = jsontools.load(data)
@@ -78,6 +134,7 @@ def search_movie_by_genre(item):
itemlist.append(
Item(channel=item.channel,
action="peliculas",
<<<<<<< HEAD
title="[COLOR azure]" + genre['name'] + "[/COLOR]",
contentType='movie',
url="%s/api/movies?genres.id=%s" %(host,genre['id']),
@@ -86,6 +143,16 @@ def search_movie_by_genre(item):
def search_movie_by_year(item):
logger.info("kod.polpo.tv search_movie_by_year")
=======
title=support.typo(genre['name'],'bold'),
contentType='movie',
url="%s/api/movies?genres.id=%s" %(host,genre['id']),
extra=item.extra))
return support.thumb(itemlist, True)
def search_movie_by_year(item):
support.log()
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
now = datetime.datetime.now()
year = int(now.year)
itemlist = []
@@ -95,12 +162,21 @@ def search_movie_by_year(item):
url="%s/api/movies?releaseDate=%s" %(host,year_to_search),
plot="1",
type="movie",
<<<<<<< HEAD
title="[COLOR azure]%s[/COLOR]" % year_to_search,
action="peliculas"))
return itemlist
def findvideos(item):
logger.info("kod.polpotv peliculas")
=======
title=support.typo(year_to_search,'bold'),
action="peliculas"))
return itemlist
def findvideos(item):
support.log()
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
itemlist = []
try:
data = httptools.downloadpage(item.url, headers=headers).data
@@ -123,7 +199,11 @@ def findvideos(item):
return support.server(item, itemlist=itemlist)
def get_itemlist_movie(movie,item):
<<<<<<< HEAD
logger.info("kod.polpotv get_itemlist_movie")
=======
support.log()
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
itemlist=[]
try:
if movie['originalLanguage']['id']=='it':
@@ -151,7 +231,11 @@ def get_itemlist_movie(movie,item):
itemlist.append(
Item(channel=item.channel,
action="findvideos",
<<<<<<< HEAD
title="[COLOR azure]"+ scrapedtitle + "[/COLOR]" + " [COLOR yellow]["+movie['lastQuality']+"][/COLOR] ",
=======
title=support.typo(scrapedtitle,'bold') + support.typo(movie['lastQuality'].upper(), '_ [] color kod bold'),
>>>>>>> 6bc4b7199c1eed191a4b9c8f1e066c368126c872
fulltitle=scrapedtitle,
show=scrapedtitle,
plot=scrapedplot,

View File

@@ -1,49 +1,13 @@
{
"id": "toonitalia",
"name": "ToonItalia",
"language": ["ita"],
"language": ["ita", "sub-ita"],
"active": true,
"adult": false,
"thumbnail": "toonitalia.png",
"banner": "toonitalia.png",
"categories": ["tvshow", "movie", "vos", "anime"],
"settings": [
{
"id": "include_in_global_search",
"type": "bool",
"label": "Includi in Ricerca Globale",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "checklinks",
"type": "bool",
"label": "Verifica se i link esistono",
"default": false,
"enabled": true,
"visible": true
},
{
"id": "checklinks_number",
"type": "list",
"label": "Numero di link da verificare",
"default": 1,
"enabled": true,
"visible": "eq(-1,true)",
"lvalues": [ "5", "10", "15", "20" ]
},
{
"id": "filter_languages",
"type": "list",
"label": "Mostra link in lingua...",
"default": 0,
"enabled": true,
"visible": true,
"lvalues": [
"No filtrar",
"Italiano"
]
}
]
"not_active":["include_in_newest_peliculas"],
"default_off":["include_in_newest"],
"settings": []
}

View File

@@ -19,25 +19,58 @@ def mainlist(item):
top = [('Novità',['', 'peliculas', 'new', 'tvshow']),
('Aggiornamenti', ['', 'peliculas', 'last', 'tvshow']),
('Popolari', ['', 'peliculas', 'most_view', 'tvshow'])]
tvshow = '/lista-serie-tv/'
('Popolari', ['', 'peliculas', 'most_view', 'tvshow'])]
tvshow = ['/lista-serie-tv/']
anime =['/lista-anime-2/',
('Sub-Ita',['/lista-anime-sub-ita/', 'peliculas', 'sub']),
('Film Animati',['/lista-film-animazione/','peliculas', '', 'movie'])]
('Film Animati',['/lista-film-animazione/','peliculas', '', 'movie'])]
search = ''
return locals()
def search(item, texto):
support.log(texto)
item.args='search'
item.contentType='tvshow'
item.url = host + '/?s=' + texto
try:
return peliculas(item)
return itemlist
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
support.logger.error("%s" % line)
return []
def newest(categoria):
support.log(categoria)
item = support.Item()
try:
item.contentType = 'tvshow'
item.url= host
item.args= 'new'
return peliculas(item)
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
support.logger.error("{0}".format(line))
return []
@support.scrape
def peliculas(item):
## import web_pdb; web_pdb.set_trace()
pagination = ''
anime = True
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
if item.args == 'search':
patron = r'<h2 class="entry-title"><a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>'
patron = r'<h2 class="entry-title"><a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>.*?<p>(?P<plot>[^<]+)</p>.*?<span class="cat-links">Pubblicato in.*?.*?(?P<type>(?:[Ff]ilm|</artic))[^>]+>'
typeContentDict={'movie':['film']}
typeActionDict={'findvideos':['film']}
patronNext = r'<a href="([^"]+)"\s*>Articoli meno recenti'
elif item.args == 'last':
patronBlock = 'Aggiornamenti</h2>(?P<block>.*)</ul>'
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>'
@@ -46,19 +79,23 @@ def peliculas(item):
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
elif item.args == 'new':
patronBlock = '<main[^>]+>(?P<block>.*)</main>'
patron = r'<a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>[^>]+>[^>]+>[^>]+><img.*?src="(?P<thumb>[^"]+)".*?<p>(?P<plot>[^<]+)</p>'
patronNext = '<a class="next page-numbers" href="([^"]+)">'
patron = r'<a href="(?P<url>[^"]+)" rel="bookmark">(?P<title>[^<]+)</a>[^>]+>[^>]+>[^>]+><img.*?src="(?P<thumb>[^"]+)".*?<p>(?P<plot>[^<]+)</p>.*?<span class="cat-links">Pubblicato in.*?.*?(?P<type>(?:[Ff]ilm|</artic))[^>]+>'
patronNext = '<a class="next page-numbers" href="([^"]+)">'
typeContentDict={'movie':['film']}
typeActionDict={'findvideos':['film']}
else:
patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
patron = r'<li ><a href="(?P<url>[^"]+)" title="[^>]+">(?P<title>[^<|\(]+)?(?:\([^\d]*(?P<year>\d+)\))?[^<]*</a>'
if item.args == 'sub':
def itemHook(item):
def itemHook(item):
support.log(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'è
#solo sub-ita
item.title = item.title.replace('[ITA]','[Sub-ITA]')
item.contentLanguage = 'Sub-ITA'
return item
return item
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
@@ -68,18 +105,21 @@ def peliculas(item):
@support.scrape
def episodios(item):
anime = True
data = support.httptools.downloadpage(item.url, headers=headers).data
data = support.match(item, headers=headers)[1]
if 'https://vcrypt.net' in data:
patron = r'(?:<br /> |<p>)(?P<title>[^<]+)<a href="(?P<url>[^"]+)"'
else:
patron = r'<br /> <a href="(?P<url>[^"]+)" target="_blank" rel="noopener[^>]+>(?P<title>[^<]+)</a>'
patron = r'<br />\s*<a href="(?P<url>[^"]+)" target="_blank" rel="noopener[^>]+>(?P<title>[^<]+)</a>'
def itemHook(item):
item.title = item.title.replace('_',' ').replace('','-')
item.title = support.re.sub(r'\[B\]|\[/B\]', '', item.title)
item.title = item.title.replace('_',' ').replace('','-').replace('&#215;','x').replace('-','-').replace(' ',' ')
item.title = support.re.sub(item.fulltitle + ' - ','',item.title)
item.title = support.typo(item.title.strip(' -'),'bold')
return item
return locals()
def findvideos(item):
return support.server(item, item.url if item.contentType != 'movie' else support.httptools.downloadpage(item.url, headers=headers).data )

View File

@@ -263,20 +263,15 @@ def get_thumb(thumb_name, view="thumb_", auto=False):
thumb_name = unify.set_genre(unify.simplify(thumb_name))
if thumb_name in thumb_dict:
thumbnail = thumb_dict[thumb_name]
return thumbnail
else:
icon_pack_name = config.get_setting('icon_set', default="default")
resource_path = os.path.join(config.get_runtime_path(), "resources", "media", "themes")
media_path = os.path.join(resource_path, icon_pack_name)
media_path = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes/", icon_pack_name)
if os.path.isdir(media_path) == False:
media_path = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes/", icon_pack_name)
elif config.get_setting('enable_custom_theme') and config.get_setting('custom_theme') and os.path.isfile(config.get_setting('custom_theme') + view + thumb_name):
if config.get_setting('enable_custom_theme') and config.get_setting('custom_theme') and os.path.isfile(config.get_setting('custom_theme') + view + thumb_name):
media_path = config.get_setting('custom_theme')
return os.path.join(media_path, view + thumb_name)
@@ -355,39 +350,39 @@ def thumb(itemlist=[], genre=False):
icon_dict = {'channels_movie':['film'],
'channels_tvshow':['serie','tv','episodi','episodio'],
'channels_documentary':['documentari','documentario'],
'channels_documentary':['documentari','documentario', 'documentary'],
'channels_all':['tutti'],
'news':['novità', "novita'", 'aggiornamenti', 'nuovi', 'nuove'],
'now_playing':['cinema', 'in sala'],
'channels_anime':['anime'],
'genres':['genere', 'generi', 'categorie', 'categoria'],
'channels_animation': ['animazione', 'cartoni', 'cartoon'],
'channels_action':['azione', 'arti marziali'],
'channels_adventure': ['avventura'],
'channels_animation': ['animazione', 'cartoni', 'cartoon', 'animation'],
'channels_action':['azione', 'arti marziali', 'action'],
'channels_adventure': ['avventura', 'adventure'],
'channels_biographical':['biografico'],
'channels_comedy':['comico','commedia', 'demenziale'],
'channels_comedy':['comico','commedia', 'demenziale', 'comedy'],
'channels_adult':['erotico', 'hentai'],
'channels_drama':['drammatico', 'drama'],
'channels_syfy':['fantascienza'],
'channels_syfy':['fantascienza', 'science fiction'],
'channels_fantasy':['fantasy'],
'channels_crime':['gangster','poliziesco'],
'channels_crime':['gangster','poliziesco', 'crime'],
'channels_grotesque':['grottesco'],
'channels_war':['guerra'],
'channels_war':['guerra', 'war'],
'channels_children':['bambini', 'kids'],
'horror':['horror'],
'lucky': ['fortunato'],
'channels_musical':['musical', 'musica'],
'channels_mistery':['mistero', 'giallo'],
'channels_musical':['musical', 'musica', 'music'],
'channels_mistery':['mistero', 'giallo', 'mystery'],
'channels_noir':['noir'],
'popular' : ['popolari','popolare', 'più visti'],
'channels_thriller':['thriller'],
'thriller':['thriller'],
'top_rated' : ['fortunato', 'votati'],
'on_the_air' : ['corso', 'onda'],
'channels_western':['western'],
'channels_vos':['sub','sub-ita'],
'channels_romance':['romantico','sentimentale'],
'channels_family':['famiglia','famiglie'],
'channels_historical':['storico'],
'channels_romance':['romantico','sentimentale', 'romance'],
'channels_family':['famiglia','famiglie', 'family'],
'channels_historical':['storico', 'history'],
'autoplay':[config.get_localized_string(60071)]
}

View File

@@ -12,6 +12,8 @@ from platformcode import config, logger
DEFAULT_UPDATE_URL = "/channels/"
dict_channels_parameters = dict()
remote_path = 'https://raw.githubusercontent.com/kodiondemand/media/master/'
def is_adult(channel_name):
logger.info("channel_name=" + channel_name)
@@ -56,14 +58,11 @@ def get_channel_parameters(channel_name):
# Imagenes: se admiten url y archivos locales dentro de "resources/images"
if channel_parameters.get("thumbnail") and "://" not in channel_parameters["thumbnail"]:
channel_parameters["thumbnail"] = os.path.join(config.get_runtime_path(), "resources", "media",
"channels", "thumb", channel_parameters["thumbnail"])
channel_parameters["thumbnail"] = os.path.join(remote_path, 'resources', "thumb", channel_parameters["thumbnail"])
if channel_parameters.get("banner") and "://" not in channel_parameters["banner"]:
channel_parameters["banner"] = os.path.join(config.get_runtime_path(), "resources", "media",
"channels", "banner", channel_parameters["banner"])
channel_parameters["banner"] = os.path.join(remote_path, 'resources', "banner", channel_parameters["banner"])
if channel_parameters.get("fanart") and "://" not in channel_parameters["fanart"]:
channel_parameters["fanart"] = os.path.join(config.get_runtime_path(), "resources", "media",
"channels", "fanart", channel_parameters["fanart"])
channel_parameters["fanart"] = os.path.join(remote_path, 'resources', "fanart", channel_parameters["fanart"])
# Obtenemos si el canal tiene opciones de configuración
channel_parameters["has_settings"] = False
@@ -234,25 +233,25 @@ def get_default_settings(channel_name):
# Apply default configurations if they do not exist
for control in default_controls:
if control['id'] not in str(channel_controls):
if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active:
if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active and control['id'] not in not_active:
label = control['id'].split('_')
label = label[-1]
if label == 'peliculas':
if 'movie' in categories:
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30122)
control['default'] = True if 'include_in_newest' not in default_off else False
control['default'] = False if ('include_in_newest' in default_off) or ('include_in_newest_peliculas' in default_off) else True
channel_controls.append(control)
else: pass
elif label == 'series':
if 'tvshow' in categories:
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30123)
control['default'] = True if 'include_in_newest' not in default_off else False
control['default'] = False if ('include_in_newest' in default_off) or ('include_in_newest_series' in default_off) else True
channel_controls.append(control)
else: pass
elif label == 'anime':
if 'anime' in categories:
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string(30124)
control['default'] = True if 'include_in_newest' not in default_off else False
control['default'] = False if ('include_in_newest' in default_off) or ('include_in_newest_anime' in default_off) else True
channel_controls.append(control)
else: pass

View File

@@ -458,8 +458,7 @@ def get_server_parameters(server):
# Imagenes: se admiten url y archivos locales dentro de "resources/images"
if dict_server.get("thumbnail") and "://" not in dict_server["thumbnail"]:
dict_server["thumbnail"] = os.path.join(config.get_runtime_path(), "resources", "media",
"servers", dict_server["thumbnail"])
dict_server["thumbnail"] = os.path.join("https://raw.githubusercontent.com/kodiondemand/media/master/resources/servers", dict_server["thumbnail"])
for k in ['premium', 'id']:
dict_server[k] = dict_server.get(k, list())

View File

@@ -365,7 +365,6 @@ def scrape(func):
typeActionDict = args['typeActionDict'] if 'typeActionDict' in args else {}
typeContentDict = args['typeContentDict'] if 'typeContentDict' in args else {}
debug = args['debug'] if 'debug' in args else False
log('STACK= ', inspect.stack()[1][3])
if 'pagination' in args and inspect.stack()[1][3] not in ['add_tvshow', 'get_episodes', 'update', 'find_episodes']: pagination = args['pagination'] if args['pagination'] else 20
else: pagination = ''
lang = args['deflang'] if 'deflang' in args else ''
@@ -399,13 +398,11 @@ def scrape(func):
itemlist, matches = scrapeBlock(item, args, data, patron, headers, action, pagination, debug, typeContentDict,
typeActionDict, blacklist, search, pag, function, lang)
checkHost(item, itemlist)
if 'itemlistHook' in args:
itemlist = args['itemlistHook'](itemlist)
if patronNext:
nextPage(itemlist, item, data, patronNext, 2)
if patronNext and inspect.stack()[1][3] != 'newest':
nextPage(itemlist, item, data, patronNext, function)
# next page for pagination
if pagination and len(matches) >= pag * pagination:
@@ -451,21 +448,6 @@ def scrape(func):
return wrapper
def checkHost(item, itemlist):
# nel caso non ci siano risultati puo essere che l'utente abbia cambiato manualmente l'host, pertanto lo riporta
# al valore di default (fixa anche il problema del cambio di host da parte nostra)
if len(itemlist) == 0:
# trovo il valore di default
defHost = None
for s in channeltools.get_channel_json(item.channel)['settings']:
if s['id'] == 'channel_host':
defHost = s['default']
break
# lo confronto con quello attuale
if config.get_setting('channel_host', item.channel) != defHost:
config.set_setting('channel_host', defHost, item.channel)
def dooplay_get_links(item, host):
# get links from websites using dooplay theme and dooplay_player
# return a list of dict containing these values: url, title and server
@@ -496,6 +478,7 @@ def dooplay_get_links(item, host):
@scrape
def dooplay_get_episodes(item):
item.contentType = 'tvshow'
patron = '<li class="mark-[0-9]+">.*?<img.*?(?:data-lazy-)?src="(?P<thumb>[^"]+).*?(?P<episode>[0-9]+ - [0-9]+).*?<a href="(?P<url>[^"]+)">(?P<title>[^<>]+).*?(?P<year>[0-9]{4})'
actLike = 'episodios'
@@ -704,7 +687,7 @@ def typo(string, typography=''):
kod_color = '0xFF65B3DA' #'0xFF0081C2'
string = str(string)
# Check if the typographic attributes are in the string or outside
if typography:
string = string + ' ' + typography
@@ -776,7 +759,6 @@ def match(item, patron='', patronBlock='', headers='', url='', post=''):
if patron:
matches = scrapertoolsV2.find_multiple_matches(block, patron)
if not matches: matches = ['']
log('MATCHES= ',matches)
return matches, block
@@ -877,9 +859,10 @@ def videolibrary(itemlist, item, typography='', function_level=1, function=''):
return itemlist
def nextPage(itemlist, item, data='', patron='', function_level=1, next_page='', resub=[]):
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
action = inspect.stack()[function_or_level][3] if type(function_or_level) == int else function_or_level
if next_page == '':
next_page = scrapertoolsV2.find_single_match(data, patron)
@@ -891,7 +874,7 @@ def nextPage(itemlist, item, data='', patron='', function_level=1, next_page='',
log('NEXT= ', next_page)
itemlist.append(
Item(channel=item.channel,
action = item.action,
action = action,
contentType=item.contentType,
title=typo(config.get_localized_string(30992), 'color kod bold'),
url=next_page,
@@ -1000,7 +983,7 @@ def log(stringa1="", stringa2="", stringa3="", stringa4="", stringa5=""):
frame = inspect.stack()[1]
filename = frame[0].f_code.co_filename
filename = os.path.basename(filename)
logger.info("[" + filename + "] - [" + inspect.stack()[1][3] + "] " + str(stringa1) + str(stringa2) + str(stringa3) + str(stringa4) + str(stringa5))
logger.info("[" + filename + "] - [" + inspect.stack()[1][3] + "] " + str(stringa1) + ( ' ' + str(stringa2) if stringa2 else '') + ( ' ' + str(stringa3) if stringa3 else '') + ( ' ' + str(stringa4) if stringa4 else '') + ( ' ' + str(stringa5) if stringa5 else '') )
def channel_config(item, itemlist):

View File

@@ -833,8 +833,8 @@ def add_tvshow(item, channel=None):
# del item.tmdb_stat #Limpiamos el status para que no se grabe en la Videoteca
# Obtiene el listado de episodios
if item.channel == 'community':
itemlist = getattr(channel, item.action)(item)
#if item.channel == 'community':
itemlist = getattr(channel, item.action)(item)
insertados, sobreescritos, fallidos, path = save_tvshow(item, itemlist)

View File

@@ -32,14 +32,6 @@
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_italiano",
"type": "bool",
"label": "@70727",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "checklinks",
"type": "bool",

View File

@@ -94,31 +94,15 @@ def get_videolibrary_support():
return True
def get_channel_url(name):
def json():
try:
try:
import json
except:
import simplejson as json
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
with open(LOCAL_FILE) as f:
data = json.load(f)
if data[name] is not None:
return data[name]
else:
return get_setting("channel_host", name)
except:
return get_setting("channel_host", name)
if __settings__.getSetting("use_custom_url") == "true":
host = get_setting("channel_host", name)
if host:
return host
else:
return json()
else:
return json()
try:
import json
except:
import simplejson as json
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
with open(LOCAL_FILE) as f:
data = json.load(f)
return data[name]
def get_system_platform():
""" fonction: pour recuperer la platform que xbmc tourne """

View File

@@ -210,8 +210,13 @@ def apply_patch(s,patch,revert=False):
def getSha(path):
f = open(path).read()
return githash.blob_hash(path, len(f)).hexdigest()
try:
f = open(path, 'rb')
except:
return ''
size = len(f.read())
f.seek(0)
return githash.blob_hash(f, size).hexdigest()
def getShaStr(str):
return githash.blob_hash(StringIO(str), len(str)).hexdigest()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More