Merge branch 'master' into master
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
Rev:0.1
|
||||
Update: 18-9-2019
|
||||
Rev:0.2
|
||||
Update: 03-10-2019
|
||||
#####################
|
||||
|
||||
Promemoria da cancellare pena la non visibilità del canale in KOD!!
|
||||
@@ -11,8 +11,7 @@ le voci in settings sono state inserite per l'unico scopo
|
||||
di velocizzare la scrittura del file
|
||||
Vanno lasciate solo quelle voci il cui funzionamento sul
|
||||
canale non vanno attivate.
|
||||
Per esempio se il canale non ha: newest()
|
||||
lasciare le voci dove c'è newest nell'id. Es: include_in_newest_series
|
||||
"not_active": ["include_in_newest"], VA INSERITO nei canali che NON hanno nessuna voce newest.
|
||||
Ovviamente va mantenuto tutto il codice di quell'id tra le {}
|
||||
se vanno cancellati tutti deve rimanere la voce:
|
||||
"settings": []
|
||||
@@ -20,12 +19,13 @@ se vanno cancellati tutti deve rimanere la voce:
|
||||
{
|
||||
"id": "nome del file .json",
|
||||
"name": "Nome del canale visualizzato in KOD",
|
||||
"language": ["ita", "vos"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"adult": false,
|
||||
"thumbnail": "",
|
||||
"banner": "",
|
||||
"categories": ["movie", "tvshow", "anime", "vos", "documentary", "adult"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
|
||||
+79
-46
@@ -1,30 +1,42 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per 'idcanale nel json'
|
||||
# By: pincopallo!
|
||||
# Eventuali crediti se vuoi aggiungerli
|
||||
# ------------------------------------------------------------
|
||||
# Rev: 0.2
|
||||
# Update 18-09-2019
|
||||
# Update 12-10-2019
|
||||
# fix:
|
||||
# 1. aggiunto pagination e sistemate alcune voci
|
||||
# 2. modificato problemi in eccezioni
|
||||
# 3. aggiunta la def select
|
||||
# 4. modifica alla legenda e altre aggiunte
|
||||
|
||||
# Questo vuole solo essere uno scheletro per velocizzare la scrittura di un canale.
|
||||
# La maggior parte dei canali può essere scritta con il decoratore.
|
||||
# I commenti sono più un promemoria... che una vera e propria spiegazione!
|
||||
# Niente di più.
|
||||
# Ulteriori informazioni sono reperibili nel wiki:
|
||||
# https://github.com/kodiondemand/addon/wiki/decoratori
|
||||
|
||||
"""
|
||||
Questi sono commenti per i beta-tester.
|
||||
|
||||
Problemi noti che non superano il test del canale:
|
||||
- indicare i problemi
|
||||
Su questo canale, nella categoria 'Ricerca Globale'
|
||||
non saranno presenti le voci 'Aggiungi alla Videoteca'
|
||||
e 'Scarica Film'/'Scarica Serie', dunque,
|
||||
la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE.
|
||||
|
||||
Novità. Indicare in quale/i sezione/i è presente il canale:
|
||||
- Nessuna, film, serie, anime...
|
||||
|
||||
Avvisi:
|
||||
- Eventuali avvisi per i tester
|
||||
|
||||
Ulteriori info:
|
||||
|
||||
|
||||
"""
|
||||
# CANCELLARE Ciò CHE NON SERVE per il canale, lascia il codice commentato
|
||||
# CANCELLARE Ciò CHE NON SERVE per il canale, lascia il codice commentato ove occorre,
|
||||
# ma fare PULIZIA quando si è finito di testarlo
|
||||
|
||||
# Qui gli import
|
||||
@@ -37,7 +49,7 @@ from platformcode import config
|
||||
|
||||
# in caso di necessità
|
||||
#from core import scrapertoolsV2, httptools, servertools, tmdb
|
||||
#from core.item import Item
|
||||
from core.item import Item # per newest
|
||||
#from lib import unshortenit
|
||||
|
||||
##### fine import
|
||||
@@ -48,7 +60,7 @@ from platformcode import config
|
||||
# da cancellare se non utilizzata
|
||||
__channel__ = "id nel json"
|
||||
# da cancellare se si utilizza findhost()
|
||||
host = config.get_channel_url('id nel json OR '__channel__) # <-- ATTENZIONE
|
||||
host = config.get_channel_url('id nel json' OR __channel__) # <-- ATTENZIONE
|
||||
headers = [['Referer', host]]
|
||||
|
||||
# Inizio findhost() - da cancellare se usato l'altro metodo
|
||||
@@ -62,7 +74,7 @@ def findhost():
|
||||
permUrl = httptools.downloadpage('INSERIRE-URL-QUI', follow_redirects=False).headers
|
||||
host = 'https://www.'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
# cancellare host non utilizzato
|
||||
host = scrapertoolsV2.find_single_match(data, r'<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||
host = scrapertoolsV2.find_single_match(permUrl, r'<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||
headers = [['Referer', host]]
|
||||
|
||||
findhost() # così le imposta una volta per tutte
|
||||
@@ -83,8 +95,7 @@ def mainlist(item):
|
||||
|
||||
# Ordine delle voci
|
||||
# Voce FILM, puoi solo impostare l'url
|
||||
film = ['',
|
||||
#'url', # url per la voce FILM, se possibile la pagina principale con le ultime novità
|
||||
film = ['', # url per la voce FILM, se possibile la pagina principale con le ultime novità
|
||||
#Voce Menu,['url','action','args',contentType]
|
||||
('Al Cinema', ['', 'peliculas', '']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
@@ -97,19 +108,17 @@ def mainlist(item):
|
||||
]
|
||||
|
||||
# Voce SERIE, puoi solo impostare l'url
|
||||
tvshow = ['',
|
||||
#'url', # url per la voce Serie, se possibile la pagina con titoli di serie
|
||||
tvshow = ['', # url per la voce Serie, se possibile la pagina con titoli di serie
|
||||
#Voce Menu,['url','action','args',contentType]
|
||||
('Novità', ['', '', ''])
|
||||
('Novità', ['', '', '']),
|
||||
('Per Lettera', ['', 'genres', 'letters']),
|
||||
('Per Genere', ['', 'genres', 'genres']),
|
||||
('Per anno', ['', 'genres', 'years'])
|
||||
|
||||
]
|
||||
# Voce ANIME, puoi solo impostare l'url
|
||||
anime = ['',
|
||||
#'url', # url per la voce Anime, se possibile la pagina con titoli di anime
|
||||
anime = ['', # url per la voce Anime, se possibile la pagina con titoli di anime
|
||||
#Voce Menu,['url','action','args',contentType]
|
||||
('Novità', ['', '', ''])
|
||||
('Novità', ['', '', '']),
|
||||
('In Corso',['', '', '', '']),
|
||||
('Ultimi Episodi',['', '', '', '']),
|
||||
('Ultime Serie',['', '', '', ''])
|
||||
@@ -133,52 +142,53 @@ def mainlist(item):
|
||||
nome = [( '' ['', '', '', ''])
|
||||
return locals()
|
||||
|
||||
# riepilogo key per il match nei patron
|
||||
# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality',
|
||||
# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
|
||||
# url = link relativo o assoluto
|
||||
# title = titolo Film/Serie/Anime/Altro
|
||||
# title2 = titolo dell'episodio Serie/Anime/Altro
|
||||
# season = stagione in formato numerico
|
||||
# episode = numero episodio, in formato numerico. Se il sito ha stagionexepisodio potete omettere season
|
||||
# thumb = locandina Film/Serie/Anime/Altro
|
||||
# quality = qualità indicata del video
|
||||
# year = anno in formato numerico (4 cifre)
|
||||
# duration = durata del Film/Serie/Anime/Altro
|
||||
# genere = genere del Film/Serie/Anime/Altro. Es: avventura, commedia
|
||||
# rating = punteggio/voto in formato numerico
|
||||
# type = tipo del video. Es. movie per film o tvshow per le serie. Di solito sono discrimanti usati dal sito
|
||||
# lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA. Se non appare 'ITA' è di default
|
||||
# Legenda known_keys per i groups nei patron
|
||||
# known_keys = ['url', 'title', 'title2', 'season', 'episode', 'thumb', 'quality',
|
||||
# 'year', 'plot', 'duration', 'genere', 'rating', 'type', 'lang']
|
||||
# url = link relativo o assoluto alla pagina titolo film/serie
|
||||
# title = titolo Film/Serie/Anime/Altro
|
||||
# title2 = titolo dell'episodio Serie/Anime/Altro
|
||||
# season = stagione in formato numerico
|
||||
# episode = numero episodio, in formato numerico.
|
||||
# thumb = linkrealtivo o assoluto alla locandina Film/Serie/Anime/Altro
|
||||
# quality = qualità indicata del video
|
||||
# year = anno in formato numerico (4 cifre)
|
||||
# duration = durata del Film/Serie/Anime/Altro
|
||||
# genere = genere del Film/Serie/Anime/Altro. Es: avventura, commedia
|
||||
# rating = punteggio/voto in formato numerico
|
||||
# type = tipo del video. Es. movie per film o tvshow per le serie. Di solito sono discrimanti usati dal sito
|
||||
# lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA.
|
||||
# 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)
|
||||
#dbg # decommentare per attivare web_pdb
|
||||
#support.dbg() # decommentare per attivare web_pdb
|
||||
|
||||
action = ''
|
||||
blacklist = ['']
|
||||
patron = r''
|
||||
patronBlock = r''
|
||||
patronNext = ''
|
||||
pagination = 0
|
||||
pagination = ''
|
||||
|
||||
debug = False # True per testare le regex sul sito
|
||||
#debug = True # True per testare le regex sul sito
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log(item)
|
||||
#dbg
|
||||
#support.dbg()
|
||||
|
||||
action = ''
|
||||
blacklist = ['']
|
||||
patron = r''
|
||||
patronBlock = r''
|
||||
patronNext = ''
|
||||
pagination = 0
|
||||
pagination = ''
|
||||
|
||||
debug = False
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
# Questa def è utilizzata per generare i menu del canale
|
||||
@@ -186,28 +196,50 @@ def episodios(item):
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log(item)
|
||||
#dbg
|
||||
#support.dbg()
|
||||
|
||||
action = ''
|
||||
blacklist = ['']
|
||||
patron = r''
|
||||
patronBlock = r''
|
||||
patronNext = ''
|
||||
pagination = 0
|
||||
pagination = ''
|
||||
|
||||
debug = False
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
############## Fine ordine obbligato
|
||||
## Def ulteriori
|
||||
|
||||
# per quei casi dove il sito non differenzia film e/o serie e/o anime
|
||||
# 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.dbg()
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
# pulizia di data, in caso commentare le prossime 2 righe
|
||||
data = re.sub('\n|\t', ' ', data)
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
block = scrapertoolsV2.find_single_match(data, r'')
|
||||
if re.findall('', data, re.IGNORECASE):
|
||||
support.log('select = ### è una serie ###')
|
||||
return episodios(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
args='serie',
|
||||
contentType='tvshow',
|
||||
#data1 = data decommentando portiamo data nella def senza doverla riscaricare
|
||||
))
|
||||
|
||||
############## Fondo Pagina
|
||||
# da adattare al canale
|
||||
def search(item, text):
|
||||
support.log('search', item)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = '/index.php?do=search&story=%s&subaction=search' % (text)
|
||||
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
|
||||
# bisogna inserire item.contentType per la ricerca globale
|
||||
# se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare.
|
||||
item.contentType = item.contentType
|
||||
@@ -240,14 +272,15 @@ def newest(categoria):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log('newest log: ', {0}.format(line))
|
||||
support.log('newest log: ', {0}.format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
# da adattare... ( support.server ha vari parametri )
|
||||
# da adattare...
|
||||
# consultare il wiki sia per support.server che ha vari parametri,
|
||||
# sia per i siti con hdpass
|
||||
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
|
||||
def findvideos(item):
|
||||
support.log('findvideos ->', item)
|
||||
return support.server(item, headers=headers)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "altadefinizione01",
|
||||
"name": "Altadefinizione01",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "https://raw.githubusercontent.com/Zanzibar82/images/master/posters/altadefinizione01.png",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Altadefinizione01 L",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita","vosi"],
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "altadefinizione01_L.png",
|
||||
"banner": "altadefinizione01_L.png",
|
||||
"categories": ["movie","vos"],
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "AltadefinizioneClick",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita","vosi"],
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneclick.png",
|
||||
"bannermenu": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneciclk.png",
|
||||
"categories": ["movie","vos"],
|
||||
|
||||
+21
-24
@@ -24,25 +24,22 @@ headers = [['Referer', host]]
|
||||
def mainlist(item):
|
||||
anime = ['/lista-anime/',
|
||||
('In Corso',['/lista-anime-in-corso/']),
|
||||
('Ultimi Episodi',['','peliculas','update']),
|
||||
('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last'])
|
||||
]
|
||||
return locals()
|
||||
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host
|
||||
item.args = 'update'
|
||||
itemlist = peliculas(item)
|
||||
|
||||
if itemlist[-1].action == "peliculas":
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
item.args = 'newest'
|
||||
itemlist = peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
@@ -56,33 +53,33 @@ def search(item, texto):
|
||||
search = texto
|
||||
item.contentType = 'tvshow'
|
||||
patron = '<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
|
||||
action = 'episodios'
|
||||
action = 'episodios'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
anime = True
|
||||
if item.args == 'update':
|
||||
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):
|
||||
delete = support.scrapertoolsV2.find_single_match(item.fulltitle, r'( Episodio.*)')
|
||||
number = support.scrapertoolsV2.find_single_match(item.title, r'Episodio (\d+)')
|
||||
item.url = support.match(item, '<a href="([^"]+)" class="btn', headers=headers)[0][0]
|
||||
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,'')
|
||||
item.fulltitle = item.show = item.fulltitle.replace(delete,'')
|
||||
item.url = item.url.replace('-episodio-'+ number,'')
|
||||
item.fulltitle = item.show = item.title.replace(delete,'')
|
||||
item.number = number
|
||||
return 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>[^"]+)"'
|
||||
action = 'episodios'
|
||||
|
||||
else:
|
||||
pagination = ''
|
||||
patron = '<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
|
||||
action = 'episodios'
|
||||
patron = r'<strong><a href="(?P<url>[^"]+)">(?P<title>.*?) [Ss][Uu][Bb]'
|
||||
|
||||
return locals()
|
||||
|
||||
@@ -102,16 +99,16 @@ def findvideos(item):
|
||||
support.log(item)
|
||||
|
||||
itemlist = []
|
||||
|
||||
if item.number:
|
||||
item.url = support.match(item, r'<a href="([^"]+)"[^>]*>', patronBlock=r'Episodio %s(.*?)</tr>' % item.number)[0][0]
|
||||
|
||||
|
||||
if item.number:
|
||||
item.url = support.match(item, r'<a href="([^"]+)"[^>]*>', patronBlock=r'Episodio %s(.*?)</tr>' % item.number)[0][0]
|
||||
|
||||
if 'http' not in item.url:
|
||||
if '//' in item.url[:2]:
|
||||
item.url = 'http:' + item.url
|
||||
elif host not in item.url:
|
||||
elif host not in item.url:
|
||||
item.url = host + item.url
|
||||
|
||||
|
||||
if 'adf.ly' in item.url:
|
||||
item.url = adfly.get_long_url(item.url)
|
||||
elif 'bit.ly' in item.url:
|
||||
@@ -129,4 +126,4 @@ def findvideos(item):
|
||||
|
||||
support.server(item, itemlist=itemlist)
|
||||
|
||||
return itemlist
|
||||
return itemlist
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "AnimePerTutti",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animepertutti.png",
|
||||
"bannermenu": "animepertutti.png",
|
||||
"categories": ["anime", "vos"],
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
"name": "AnimeSubIta",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["vosi"],
|
||||
"language": ["sub-ita"],
|
||||
"thumbnail": "animesubita.png",
|
||||
"bannermenu": "animesubita.png",
|
||||
"categories": ["anime", "vosi", "movie"],
|
||||
"categories": ["anime", "vos", "movie"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "AnimeWorld",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animeworld.png",
|
||||
"banner": "animeworld.png",
|
||||
"categories": ["anime", "vos"],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "casacinema",
|
||||
"name": "Casacinema",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "https://raw.githubusercontent.com/Zanzibar82/images/master/posters/casacinema.png",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "casacinemaInfo",
|
||||
"name": "La Casa del Cinema",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "cb01anime",
|
||||
"name": "Cb01anime",
|
||||
"language": ["ita", "vos", "vosi"],
|
||||
"language": ["ita", "vos", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "cb01anime.png",
|
||||
|
||||
+54
-14
@@ -21,7 +21,8 @@ headers = [['Referer', host]]
|
||||
def mainlist(item):
|
||||
anime = [('Genere',['','menu', '2']),
|
||||
('Per Lettera',['','menu', '1']),
|
||||
('Per Anno',['','menu', '3'])]
|
||||
('Per Anno',['','menu', '3']),
|
||||
('Ultimi Anime Aggiornati',['','peliculas', 'newest'])]
|
||||
return locals()
|
||||
|
||||
|
||||
@@ -39,12 +40,34 @@ def search(item, texto):
|
||||
item.url = host + "/?s=" + texto
|
||||
return peliculas(item)
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
item.url = host
|
||||
item.args = 'newest'
|
||||
itemlist = 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 []
|
||||
|
||||
return itemlist
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
blacklist = Blacklist
|
||||
patron = r'<div class="span4">\s*<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+><\/a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> <h1>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\])?</h1></a>.*?-->(?:.*?<br />)?\s*(?P<plot>[^<]+)'
|
||||
patronNext = r'<link rel="next" href="([^"]+)"'
|
||||
item.contentType = 'tvshow'
|
||||
if item.args == 'newest':
|
||||
data = support.match(item)[1]
|
||||
patron = r'<div id="blockvids"><ul><li><a href="(?P<url>[^"]+)"[^>]+><img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^\[]+)\[(?P<lang>[^\]]+)\]'
|
||||
else:
|
||||
patron = r'<div class="span4">\s*<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)"[^>]+><\/a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> <h1>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\])?</h1></a>.*?-->(?:.*?<br />)?\s*(?P<plot>[^<]+)'
|
||||
patronNext = r'<link rel="next" href="([^"]+)"'
|
||||
action = 'check'
|
||||
return locals()
|
||||
|
||||
@@ -65,21 +88,38 @@ def episodios(item):
|
||||
season = 1
|
||||
s = 1
|
||||
e = 0
|
||||
sp = 0
|
||||
for match in item.url:
|
||||
if 'stagione' in match.lower():
|
||||
find_season = support.match(match, r'Stagione\s*(\d+)')[0]
|
||||
season = int(find_season[0]) if find_season else season + 1 if 'prima' not in match.lower() else season
|
||||
else:
|
||||
title = support.match(match,'<a[^>]+>([^<]+)</a>')[0][0]
|
||||
if 'episodio' in title.lower():
|
||||
ep = int(support.match(match, r'Episodio (\d+)')[0][0])
|
||||
if season > s and ep > 1:
|
||||
s += 1
|
||||
e = ep - 1
|
||||
title = str(season) + 'x' + str(ep-e).zfill(2) + ' - ' + title
|
||||
data += title + '|' + match + '\n'
|
||||
|
||||
|
||||
else:
|
||||
try: title = support.match(match,'<a[^>]+>([^<]+)</a>')[0][0]
|
||||
except: title = ''
|
||||
if title:
|
||||
if 'episodio' in title.lower():
|
||||
ep = support.match(match, r'Episodio ((?:\d+.\d|\d+|\D+))')[0][0]
|
||||
check = ep.isdigit()
|
||||
if check or '.' in ep:
|
||||
if '.' in ep:
|
||||
sp += 1
|
||||
title = '0' + 'x' + str(sp).zfill(2) + ' - ' + title
|
||||
else:
|
||||
ep = int(ep)
|
||||
if season > s and ep > 1:
|
||||
s += 1
|
||||
e = ep - 1
|
||||
title = str(season) + 'x' + str(ep-e).zfill(2) + ' - ' + title
|
||||
data += title + '|' + match + '\n'
|
||||
else:
|
||||
title += ' #movie'
|
||||
data += title + '|' + match + '\n'
|
||||
def itemHook(item):
|
||||
if '#movie' in item.title:
|
||||
item.contentType='movie'
|
||||
item.title = item.title.replace(' #movie','')
|
||||
return item
|
||||
|
||||
patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n'
|
||||
action = 'findvideos'
|
||||
return locals()
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "cineblog01",
|
||||
"name": "CB01",
|
||||
"language": ["ita"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "cb01.png",
|
||||
"banner": "cb01.png",
|
||||
"categories": ["tvshow", "movie", "vosi"],
|
||||
"categories": ["tvshow", "movie", "vos"],
|
||||
"settings": []
|
||||
}
|
||||
+11
-5
@@ -18,7 +18,13 @@ headers = ""
|
||||
def findhost():
|
||||
global host, headers
|
||||
permUrl = httptools.downloadpage('https://www.cb01.uno/', follow_redirects=False).headers
|
||||
host = 'https://www.'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
if 'google' in permUrl['location']:
|
||||
if host[:4] != 'http':
|
||||
host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
else:
|
||||
host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
else:
|
||||
host = permUrl['location']
|
||||
headers = [['Referer', host]]
|
||||
|
||||
list_servers = ['verystream', 'openload', 'streamango', 'wstream']
|
||||
@@ -72,7 +78,7 @@ def newest(categoria):
|
||||
else:
|
||||
patronBlock = r'Ultimi 100 film Aggiornati:(?P<block>.*?)<\/td>'
|
||||
item = categoria
|
||||
patron = "<a href=(?P<url>[^>]+)>(?P<title>[^<([]+)(?:\[(?P<lang>Sub-ITA|B/N)\])?\s?(?:\[(?P<quality>HD|SD|HD/3D)\])?\s?\((?P<year>[0-9]{4})\)<\/a>"
|
||||
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
|
||||
|
||||
return locals()
|
||||
@@ -160,13 +166,13 @@ def findvideos(item):
|
||||
QualityStr = scrapertoolsV2.decodeHtmlentities(match.group(1))[6:]
|
||||
|
||||
# Estrae i contenuti - Streaming
|
||||
load_links(itemlist, '<strong>Streaming:</strong>(.*?)<tableclass=cbtable height=30>', "orange", "Streaming", "SD")
|
||||
load_links(itemlist, '<strong>Streaming:</strong>(.*?)cbtable', "orange", "Streaming", "SD")
|
||||
|
||||
# Estrae i contenuti - Streaming HD
|
||||
load_links(itemlist, '<strong>Streaming HD[^<]+</strong>(.*?)<tableclass=cbtable height=30>', "yellow", "Streaming HD", "HD")
|
||||
load_links(itemlist, '<strong>Streaming HD[^<]+</strong>(.*?)cbtable', "yellow", "Streaming HD", "HD")
|
||||
|
||||
# Estrae i contenuti - Streaming 3D
|
||||
load_links(itemlist, '<strong>Streaming 3D[^<]+</strong>(.*?)<tableclass=cbtable height=30>', "pink", "Streaming 3D")
|
||||
load_links(itemlist, '<strong>Streaming 3D[^<]+</strong>(.*?)cbtable', "pink", "Streaming 3D")
|
||||
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
@@ -8,79 +8,13 @@
|
||||
"banner": "https://www.cinemalibero.center/wp-content/themes/Cinemalibero%202.0/images/logo02.png",
|
||||
"categories": ["tvshow", "movie","anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "channel_host",
|
||||
"type": "text",
|
||||
"label": "Host del canale",
|
||||
"default": "https://www.cinemalibero.fun/",
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"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_anime",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Anime",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_italiano",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Italiano",
|
||||
"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 de 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": ["Non filtrare","IT"]
|
||||
}
|
||||
{
|
||||
"id": "include_in_newest_series",
|
||||
"type": "bool",
|
||||
"label": "@70727",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+173
-253
@@ -1,320 +1,240 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per CinemaLibero - First Version
|
||||
# Canale per cinemalibero
|
||||
# ------------------------------------------------------------
|
||||
"""
|
||||
Trasformate le sole def per support.menu e support.scrape
|
||||
da non inviare nel test.
|
||||
Test solo a trasformazione completa
|
||||
|
||||
Il canale non permette di filtrare film, serie e altro nella ricerca.
|
||||
Quindi vengono disabilitate le voci:
|
||||
- "Aggiungi in videoteca"
|
||||
- "Scarica film/serie"
|
||||
per le solo ricerce: nel canale e globale.
|
||||
|
||||
Problemi noti che non superano il test del canale:
|
||||
-
|
||||
|
||||
Avvisi:
|
||||
-
|
||||
|
||||
Ulteriori info:
|
||||
|
||||
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
from core import scrapertools, servertools, httptools, support
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
from lib import unshortenit
|
||||
# per l'uso dei decoratori, per i log, e funzioni per siti particolari
|
||||
from core import support
|
||||
# se non si fa uso di findhost()
|
||||
from platformcode import config
|
||||
from platformcode import logger
|
||||
from specials import autoplay
|
||||
import channelselector
|
||||
|
||||
# Necessario per Autoplay
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_servers = ['akstream', 'wstream', 'openload', 'streamango']
|
||||
list_quality = ['default']
|
||||
|
||||
# Necessario per Verifica Link
|
||||
checklinks = config.get_setting('checklinks', 'cinemalibero')
|
||||
checklinks_number = config.get_setting('checklinks_number', 'cinemalibero')
|
||||
# in caso di necessità
|
||||
from core import scrapertoolsV2, httptools#, servertools
|
||||
from core.item import Item # per newest
|
||||
#from lib import unshortenit
|
||||
|
||||
__channel__ = "cinemalibero"
|
||||
host = config.get_channel_url(__channel__)
|
||||
|
||||
headers = [['Referer', host]]
|
||||
##headers = [
|
||||
## ['Host', host.split("//")[-1].split("/")[0]],
|
||||
## ['User-Agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'],
|
||||
## ['Accept', 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'],
|
||||
## ['Accept-Language', 'en-US,en;q=0.5'],
|
||||
## ['Accept-Encoding', 'gzip, deflate'],
|
||||
## ['Referer', host],
|
||||
## ['DNT', '1'],
|
||||
## ['Connection', 'keep-alive'],
|
||||
## ['Upgrade-Insecure-Requests', '1'],
|
||||
## ['Cache-Control', 'max-age=0']
|
||||
## ]
|
||||
|
||||
list_servers = ['akstream', 'wstream', 'openload', 'streamango']
|
||||
list_quality = ['default']
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.log()
|
||||
film = '/category/film/'
|
||||
filmSub = [
|
||||
('Generi', ['', 'genres']),
|
||||
('Sport', ['/category/sport/', 'peliculas']),
|
||||
]
|
||||
tvshow = '/category/serie-tv/'
|
||||
tvshowSub = [
|
||||
('Anime ', ['/category/anime-giapponesi/', 'video'])
|
||||
]
|
||||
support.log(item)
|
||||
|
||||
film = ['/category/film/',
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
]
|
||||
|
||||
tvshow = ['/category/serie-tv/',
|
||||
## ('Novità', ['/aggiornamenti-serie-tv/', 'peliculas', 'update']),
|
||||
]
|
||||
|
||||
anime = ['/category/anime-giapponesi/',
|
||||
]
|
||||
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log()
|
||||
action='video'
|
||||
patron=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"'
|
||||
## return support.scrape2(item, patronBlock=r'<div id="bordobar" class="dropdown-menu(?P<block>.*)</li>',
|
||||
## patron=r'<a class="dropdown-item" href="([^"]+)" title="([A-z]+)"',
|
||||
## listGroups=['url', 'title'], action='video')
|
||||
def peliculas(item):
|
||||
support.log(item)
|
||||
#support.dbg() # decommentare per attivare web_pdb
|
||||
debug = True
|
||||
blacklist = ['']
|
||||
|
||||
if item.args == 'search':
|
||||
patron = r'href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">.+?class="titolo">(?P<title>[^<]+)<'
|
||||
patronBlock = r'style="color: #2C3549 !important;" class="fon my-3"><small>.+?</small></h1>(?P<block>.*?)<div class="bg-dark ">'
|
||||
action = 'select'
|
||||
else:
|
||||
if item.contentType == 'tvshow':
|
||||
# da sistemare per matchare le ultime serie inserite
|
||||
if item.args == 'update':
|
||||
patron = r'<div class="card-body p-0"> <a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^)]+)\)">[^>]+>(?P<title>.+?)(?:[ ]\((?P<lang>SubITA)\))?(?:[ ](?P<year>\d{4}))?</div> <div class="genere">(?:|Ep.)(?:|.+?)?</div>'
|
||||
action = 'select'
|
||||
else:
|
||||
## #patron = r'href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">[^>]+>[^>]+>[^>]+>(?:[ ](?P<rating>\d+.\d+))?[^>]+>[^>]+>(?P<title>.+?)<[^>]+>[^>]+>(?:.+?) (?:\()?(?P<lang>ITA|iTA|Sub)(?:\))?'
|
||||
## #patron = r'<div class="card-body p-0"> <a href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">[^>]+>[^>]+>[^>]+>(?:[ ](?P<rating>\d+.\d+))?[^>]+>[^>]+>(?P<title>.+?)(?: \(.+?\))?(?: \(\d+\)| \d+)?<[^>]+>(?:<div class="genere">.+?(?:\()?(?P<lang>ITA|iTA|Sub)(?:\))?)?'
|
||||
patron = r'<div class="card-body p-0"> <a href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">[^>]+>[^>]+>[^>]+>(?:[ ](?P<rating>\d+.\d+))?[^>]+>[^>]+>(?P<title>.+?)(?: \(.+?\))?(?: \(\d+\)| \d+)?</div><div class="genere">(?:.?(?P<episode>\d+x\d+-\d+|\d+-\d+|\d+x\d+|\d+)[ ]?(?:\()?(?:(?P<lang>ITA|iTA|Sub ITA|Sub iTA|Sub))?[ ]?(?:(?P<quality>HD))?.+?)</div>'
|
||||
action = 'episodios'
|
||||
if 'anime' in item.url:
|
||||
patron = r'<div class="card-body p-0"> <a href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">[^>]+>[^>]+>[^>]+>(?:[ ](?P<rating>\d+.\d+))?[^>]+>[^>]+>(?P<title>.+?)(?: \(.+?\))?(?: \(\d+\)| \d+)?<[^>]+>(?:<div class="genere">.+?(?:\()?(?P<lang>ITA|iTA|Sub)(?:\))?)?'
|
||||
action = 'select'
|
||||
elif item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
patron = r'href="(?P<url>[^"]+)".+?url\((?P<thumb>.+?)\)">[^>]+>[^>]+>[^>]+>(?:[ ](?P<rating>\d+.\d+))?[^>]+>[^>]+>(?P<title>.+?)(?:\[(?P<lang>Sub-iTA|Sub-ITA|Sub)\])?[ ]\((?P<year>\d+)\)</div>(?:<div class="genere">(?P<quality>[^<]+)<)?'
|
||||
|
||||
patronBlock = r'<h1(?: style="color: #2C3549 !important; text-transform: uppercase;"| style="text-transform: uppercase; color: #2C3549 !important;"| style="color: #2C3549 !important; text-transform: uppercase;" style="text-shadow: 1px 1px 1px #FF8C00; color:#FF8C00;"| style="text-shadow: 1px 1px 1px #0f0f0f;" class="darkorange"| style="color:#2C3549 !important;")>.+?</h1>(?P<block>.*?)<div class=(?:"container"|"bg-dark ")>'
|
||||
|
||||
patronNext = '<a class="next page-numbers".*?href="([^"]+)">'
|
||||
|
||||
return locals()
|
||||
|
||||
def peliculas(item):
|
||||
logger.info('[cinemalibero.py] video')
|
||||
itemlist = []
|
||||
|
||||
if host not in item.url:
|
||||
item.url = host + item.url
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log(item)
|
||||
|
||||
# Carica la pagina
|
||||
data = httptools.downloadpage(item.url).data.replace('\n','').replace('\t','')
|
||||
block = scrapertools.find_single_match(data, '<div class="container">.*?class="col-md-12[^"]*?">(.*?)<div class=(?:"container"|"bg-dark ")>')
|
||||
#dbg
|
||||
## if item.args == '':
|
||||
## patron = r'<a target=.+?href="(?P<url>[^"]+)"[^>]+>(?P<title>Epis.+?(\d+)?)(?:\((?P<lang>Sub ITA)\))?</a><br />'
|
||||
## patronBlock = r'(?:class="txt_dow">Streaming:(?P<block>.*?)at-below-post)'
|
||||
if item.data1 and 'stagione' not in item.data1.lower():
|
||||
# è un movie
|
||||
item.contentType = 'tvshow'
|
||||
#patron = r'(?:href="[ ]?(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<|(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?(?:(\4[^<]+)(\2.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br />|</a></p>))'
|
||||
patron = r'<a target=.+?href="(?P<url>[^"]+)"[^>]+>(?P<title>Epis.+?(?P<episode>\d+)?)(?:\((?P<lang>Sub ITA)\))?</a>(?:<br />)?'
|
||||
patronBlock = r'(?:class="txt_dow">Streaming:(?P<block>.*?)at-below-post)'
|
||||
else:
|
||||
patron = r'(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?[ ]?(?:(?P<title>[^<]+)(?P<url>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br />|</a></p>)'
|
||||
## patron = r'<a target=.+?href="(?P<url>[^"]+)"[^>]+>(?P<title>Epis.+?(\d+)?)(?:\((?P<lang>Sub ITA)\))?</a><br />'
|
||||
patronBlock = r'<p><strong>(?P<block>(?:.+?[Ss]tagione.+?(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?(?:|.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
|
||||
item.contentType = 'tvshow'
|
||||
|
||||
# Estrae i contenuti
|
||||
matches = re.compile(r'<div class="col-lg-3">(.*?)<\/a><\/div>', re.DOTALL).findall(block)
|
||||
action = 'findvideos'
|
||||
blacklist = ['']
|
||||
|
||||
for match in matches:
|
||||
url = scrapertools.find_single_match(match, r'href="([^"]+)"')
|
||||
long_title = scrapertools.find_single_match(match, r'<div class="titolo">([^<]+)<\/div>')
|
||||
thumb = scrapertools.find_single_match(match, r'url=\((.*?)\)')
|
||||
quality = scrapertools.find_single_match(match, r'<div class="voto">([^<]+)<\/div>')
|
||||
genere = scrapertools.find_single_match(match, r'<div class="genere">([^<]+)<\/div>')
|
||||
## pagination = ''
|
||||
|
||||
year = scrapertools.find_single_match(long_title, r'\(([0-9)]+)') or scrapertools.find_single_match(long_title, r'\) ([0-9)]+)')
|
||||
lang = scrapertools.find_single_match(long_title, r'\(([a-zA-Z)]+)')
|
||||
|
||||
title = re.sub(r'\(.*','',long_title)
|
||||
title = re.sub(r'(?:\(|\))','',title)
|
||||
if genere:
|
||||
genere = ' - [' + genere + ']'
|
||||
if year:
|
||||
long_title = title + ' - ('+ year + ')' + genere
|
||||
if lang:
|
||||
long_title = '[B]' + title + '[/B]' + ' - ('+ lang + ')' + genere
|
||||
else:
|
||||
long_title = '[B]' + title + '[/B]'
|
||||
|
||||
# Seleziona fra Serie TV e Film
|
||||
if item.contentType == 'movie':
|
||||
tipologia = 'movie'
|
||||
action = 'findvideos'
|
||||
elif item.contentType == 'episode':
|
||||
tipologia = 'tv'
|
||||
action = 'episodios'
|
||||
else:
|
||||
tipologia = 'movie'
|
||||
action = 'select'
|
||||
## debug = True
|
||||
return locals()
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action=action,
|
||||
contentType=item.contentType,
|
||||
title=long_title,
|
||||
fulltitle=title,
|
||||
quality=quality,
|
||||
url=url,
|
||||
thumbnail=thumb,
|
||||
infoLabels={'year': year},
|
||||
show=title))
|
||||
|
||||
# Next page
|
||||
next_page = scrapertools.find_single_match(data, '<a class="next page-numbers".*?href="([^"]+)">')
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.log(item)
|
||||
#dbg
|
||||
|
||||
if next_page != '':
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action='video',
|
||||
title='[B]' + config.get_localized_string(30992) + ' »[/B]',
|
||||
url=next_page,
|
||||
contentType=item.contentType,
|
||||
thumbnail='http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png'))
|
||||
action = 'peliculas'
|
||||
blacklist = ['']
|
||||
patron = r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"'
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
|
||||
def select(item):
|
||||
support.log('select --->', item)
|
||||
#support.dbg()
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
block = scrapertools.find_single_match(data, r'<div class="col-md-8 bg-white rounded-left p-5"><div>(.*?)<\/div>')
|
||||
block = scrapertoolsV2.find_single_match(data, r'<div class="col-md-8 bg-white rounded-left p-5"><div>(.*?)<div style="margin-left: 0.5%; color: #FFF;">')
|
||||
if re.findall('rel="category tag">serie', data, re.IGNORECASE):
|
||||
logger.info('select = ### è una serie ###')
|
||||
support.log('select = ### è una serie ###')
|
||||
return episodios(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
extra='serie',
|
||||
contentType='episode'))
|
||||
args='serie',
|
||||
contentType='tvshow',
|
||||
data1 = data
|
||||
))
|
||||
elif re.findall('rel="category tag">anime', data, re.IGNORECASE):
|
||||
if re.findall('episodio', block, re.IGNORECASE):
|
||||
logger.info('select = ### è un anime ###')
|
||||
if re.findall('episodio', block, re.IGNORECASE) or re.findall('stagione', data, re.IGNORECASE):
|
||||
support.log('select = ### è un anime ###')
|
||||
return episodios(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
extra='anime',
|
||||
contentType='episode'))
|
||||
args='anime',
|
||||
contentType='tvshow',
|
||||
data1 = data
|
||||
))
|
||||
else:
|
||||
logger.info('select = ### è un film ###')
|
||||
support.log('select = ### è un film ###')
|
||||
return findvideos(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
contentType='movie'))
|
||||
args = '',
|
||||
contentType='movie',
|
||||
#data = data
|
||||
))
|
||||
else:
|
||||
logger.info('select = ### è un film ###')
|
||||
support.log('select = ### è un film ###')
|
||||
return findvideos(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
contentType='movie'))
|
||||
contentType='movie',
|
||||
#data = data
|
||||
))
|
||||
|
||||
def search(item, texto):
|
||||
support.log("[cinemalibero.py] " + item.url + " search " + texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
item.args = 'search'
|
||||
item.contentType = 'episode' # non fa uscire le voci nel context menu
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
return []
|
||||
|
||||
def findvideos(item): # Questa def. deve sempre essere nominata findvideos
|
||||
logger.info('[cinemalibero.py] findvideos')
|
||||
def newest(categoria):
|
||||
support.log('newest ->', categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == 'peliculas':
|
||||
item.args = 'update'
|
||||
item.url = host+'/aggiornamenti-serie-tv/'
|
||||
item.contentType = 'tvshow'
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
|
||||
if item.args == 'direct':
|
||||
return servertools.find_video_items(item)
|
||||
if itemlist[-1].action == 'peliculas':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
log('newest log: ', {0}.format(line))
|
||||
return []
|
||||
|
||||
if item.contentType == 'episode':
|
||||
data = item.url.lower()
|
||||
block = scrapertools.find_single_match(data,r'>streaming.*?<\/strong>*?<\/h2>(.*?)<\/div>')
|
||||
urls = re.findall('<a.*?href="([^"]+)"', block, re.DOTALL)
|
||||
else:
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
data = re.sub(r'\n|\t','',data).lower()
|
||||
block = scrapertools.find_single_match(data,r'>streaming.*?<\/strong>(.*?)<strong>')
|
||||
urls = re.findall('<a href="([^"]+)".*?class="external"', block, re.DOTALL)
|
||||
|
||||
logger.info('URLS'+ str(urls))
|
||||
if urls:
|
||||
data =''
|
||||
for url in urls:
|
||||
url, c = unshortenit.unshorten(url)
|
||||
data += url + '\n'
|
||||
|
||||
logger.info('DATA'+ data)
|
||||
itemlist = servertools.find_video_items(data=data)
|
||||
|
||||
for videoitem in itemlist:
|
||||
videoitem.title = item.fulltitle + ' - [COLOR limegreen][[/COLOR]'+videoitem.title+' [COLOR limegreen]][/COLOR]'
|
||||
videoitem.fulltitle = item.fulltitle
|
||||
videoitem.thumbnail = item.thumbnail
|
||||
videoitem.show = item.show
|
||||
videoitem.plot = item.plot
|
||||
videoitem.channel = item.channel
|
||||
videoitem.contentType = item.contentType
|
||||
|
||||
# Link Aggiungi alla Libreria
|
||||
if item.contentType != 'episode':
|
||||
if config.get_videolibrary_support() and len(itemlist) > 0 and item.extra != 'findservers':
|
||||
itemlist.append(
|
||||
Item(channel=item.channel, title='[COLOR lightblue][B]Aggiungi alla videoteca[/B][/COLOR]', url=item.url,
|
||||
action='add_pelicula_to_library', extra='findservers', contentTitle=item.contentTitle))
|
||||
|
||||
# Necessario per filtrare i Link
|
||||
if checklinks:
|
||||
itemlist = servertools.check_list_links(itemlist, checklinks_number)
|
||||
|
||||
# Necessario per FilterTools
|
||||
# itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||
|
||||
# Necessario per AutoPlay
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def episodios(item): # Questa def. deve sempre essere nominata episodios
|
||||
logger.info('[cinemalibero.py] episodios')
|
||||
itemlist = []
|
||||
extra = ''
|
||||
|
||||
# Carica la pagina
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
block = scrapertools.find_single_match(data, r'<div class="col-md-8 bg-white rounded-left p-5"><div>(.*?)at-below-post')
|
||||
if re.findall('rel="category tag">serie', data, re.IGNORECASE):
|
||||
# logger.info('select = ### è una serie ###')
|
||||
extra='serie'
|
||||
elif re.findall('rel="category tag">anime', data, re.IGNORECASE):
|
||||
if re.findall('episodi', block, re.IGNORECASE):
|
||||
# logger.info('select = ### è un anime ###')
|
||||
extra='anime'
|
||||
|
||||
block = re.sub(r'<h2>.*?<\/h2>','',block)
|
||||
block = block.replace('<p>','').replace('<p style="text-align: left;">','').replace('–<','<').replace('-<','<').replace('–<','<').replace('– <','<').replace('<strong>','<stop><start><strong>')+'<stop>'
|
||||
block = re.sub(r'stagione completa.*?<\/p>','',block,flags=re.IGNORECASE)
|
||||
|
||||
|
||||
if extra == 'serie':
|
||||
block = block.replace('<br /> <a','<a')
|
||||
matches = re.compile(r'<start>.*?(?:stagione|Stagione)(.*?)<\/(?:strong|span)><\/p>(.*?)<stop>', re.DOTALL).findall(block)
|
||||
|
||||
if not matches:
|
||||
matches = scrapertools.find_multiple_matches(block, r'<a href="([^"]+)"[^>]+>(Episodio [0-9]+)</a>')
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
scrapedtitle = re.sub(r'Episodio ([0-9]+)', r'Episodio 1x\1', scrapedtitle)
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
contentType='episode',
|
||||
title=scrapedtitle,
|
||||
fulltitle=scrapedtitle,
|
||||
show=item.fulltitle,
|
||||
url=scrapedurl,
|
||||
args='direct'))
|
||||
else:
|
||||
for lang, html in matches:
|
||||
lang = re.sub('<.*?>','',lang)
|
||||
html = html.replace('<br />','\n').replace('</p>', '\n')
|
||||
|
||||
matches = re.compile(r'([^<]+)([^\n]+)\n', re.DOTALL).findall(html)
|
||||
for scrapedtitle, html in matches:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
contentType='episode',
|
||||
title=scrapedtitle + ' - (' + lang + ')',
|
||||
fulltitle=scrapedtitle,
|
||||
show=item.fulltitle,
|
||||
url=html))
|
||||
|
||||
elif extra == 'anime':
|
||||
block = re.sub(r'<start.*?(?:download:|Download:).*?<stop>','',block)
|
||||
block = re.sub(r'(?:mirror|Mirror)[^<]+<','',block)
|
||||
block = block.replace('<br />','\n').replace('/a></p>','\n')
|
||||
block = re.sub(r'<start.*?(?:download|Download).*?\n','',block)
|
||||
matches = re.compile('<a(.*?)\n', re.DOTALL).findall(block)
|
||||
for html in matches:
|
||||
scrapedtitle = scrapertools.find_single_match(html, r'>(.*?)<\/a>')
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
contentType='episode',
|
||||
title=scrapedtitle,
|
||||
fulltitle=scrapedtitle,
|
||||
show=item.fulltitle,
|
||||
url=html))
|
||||
|
||||
def findvideos(item):
|
||||
support.log(item)
|
||||
if item.contentType == 'movie':
|
||||
return support.server(item)
|
||||
else:
|
||||
logger.info('select = ### è un film ###')
|
||||
return findvideos(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
show=item.fulltitle,
|
||||
contentType='movie'))
|
||||
|
||||
if config.get_videolibrary_support() and len(itemlist) != 0:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
title="[COLOR lightblue]%s[/COLOR]" % config.get_localized_string(30161),
|
||||
url=item.url,
|
||||
action="add_serie_to_library",
|
||||
extra="episodios",
|
||||
show=item.show))
|
||||
|
||||
return itemlist
|
||||
return support.server(item, data= item.url)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "dreamsub",
|
||||
"name": "DreamSub",
|
||||
"language": ["ita", "vosi"],
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "dreamsub.png",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "fastsubita",
|
||||
"name": "Fastsubita",
|
||||
"language": ["vosi"],
|
||||
"language": ["sub-ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "fastsubita.png",
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Italia Serie",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita","vosi"],
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/italiaserie.png",
|
||||
"bannermenu": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/italiaserie.png",
|
||||
"categories": ["tvshow"],
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"adult": false,
|
||||
"thumbnail": "mondolunatico2.png",
|
||||
"banner": "mondolunatico2.png",
|
||||
"categories": ["tvshow", "movie", "vosi", "anime"],
|
||||
"categories": ["tvshow", "movie", "vos", "anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
|
||||
@@ -7,6 +7,5 @@
|
||||
"thumbnail": "seriehd.png",
|
||||
"banner": "seriehd.png",
|
||||
"categories": ["tvshow"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
+20
-8
@@ -7,9 +7,6 @@
|
||||
from core import scrapertoolsV2, httptools, support
|
||||
from core.item import Item
|
||||
|
||||
##__channel__ = 'seriehd'
|
||||
# host = support.config.get_channel_url(__channel__)
|
||||
|
||||
# impostati dinamicamente da findhost()
|
||||
host = ''
|
||||
headers = ''
|
||||
@@ -26,9 +23,6 @@ findhost()
|
||||
list_servers = ['verystream', 'openload', 'streamango', 'thevideome']
|
||||
list_quality = ['1080p', '720p', '480p', '360']
|
||||
|
||||
##checklinks = support.config.get_setting('checklinks', __channel__)
|
||||
##checklinks_number = support.config.get_setting('checklinks_number', __channel__)
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
@@ -82,13 +76,31 @@ def episodios(item):
|
||||
episodes = support.match(item, r'<a href="([^"]+)">(\d+)<', '<h3>EPISODIO</h3><ul>(.*?)</ul>', headers, season_url)[0]
|
||||
for episode_url, episode in episodes:
|
||||
episode_url = support.urlparse.urljoin(url, episode_url)
|
||||
title = season + "x" + episode.zfill(2)
|
||||
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
||||
data += title + '|' + episode_url + '\n'
|
||||
support.log('DaTa= ',data)
|
||||
patron = r'(?P<title>[^\|]+)\|(?P<url>[^\n]+)\n'
|
||||
action = 'findvideos'
|
||||
return locals()
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "series":
|
||||
item.url = host
|
||||
item.contentType = 'tvshow'
|
||||
itemlist = peliculas(item)
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
|
||||
@@ -1,19 +1,11 @@
|
||||
{
|
||||
"id": "streamingaltadefinizione",
|
||||
"name": "Streaming Altadefinizione",
|
||||
"name": "Popcorn Stream",
|
||||
"language": ["ita"],
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"thumbnail": "https://www.streamingaltadefinizione.world/wp-content/uploads/2018/09/StreamingAltadefinizioneLogo.png",
|
||||
"thumbnail": "https://www.popcornstream.best/wp-content/uploads/2019/09/PopLogo40.png",
|
||||
"banner": "https://www.popcornstream.info/media/PopcornStream820x428.png",
|
||||
"categories": ["movie","tvshow","anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
"type": "bool",
|
||||
"label": "Includi in Ricerca Globale",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -1,33 +1,38 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Streaming Altadefinizione
|
||||
# Canale per Popcorn Stream
|
||||
# ------------------------------------------------------------
|
||||
"""
|
||||
Trasformate le sole def per support.menu e support.scrape
|
||||
da non inviare nel test.
|
||||
Test solo a trasformazione completa
|
||||
|
||||
"""
|
||||
|
||||
from core import support
|
||||
from core import support, httptools
|
||||
from core.item import Item
|
||||
from specials import autoplay
|
||||
from platformcode import config
|
||||
|
||||
__channel__ = "streamingaltadefinizione"
|
||||
host = config.get_channel_url(__channel__)
|
||||
# __channel__ = "streamingaltadefinizione"
|
||||
# host = config.get_channel_url(__channel__)
|
||||
|
||||
host = headers = ''
|
||||
list_servers = ['verystream', 'openload', 'wstream']
|
||||
list_quality = ['1080p', 'HD', 'DVDRIP', 'SD', 'CAM']
|
||||
|
||||
def findhost():
|
||||
global host, headers
|
||||
permUrl = httptools.downloadpage('https://www.popcornstream.info', follow_redirects=False).headers
|
||||
if 'google' in permUrl['location']:
|
||||
if host[:4] != 'http':
|
||||
host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
else:
|
||||
host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
else:
|
||||
host = permUrl['location']
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
findhost()
|
||||
film = ["/film/"]
|
||||
anime = ["/genere/anime/",
|
||||
('Film Anime', ["/genere/anime/", 'peliculas']),
|
||||
('Film Anime per genere', ["/genere/anime/", 'generos'])
|
||||
]
|
||||
anime = ["/genere/anime/"]
|
||||
tvshow = ["/serietv/"]
|
||||
top = [('Generi',['', 'generos'])]
|
||||
|
||||
return locals()
|
||||
|
||||
@@ -49,30 +54,29 @@ def generos(item):
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
return support.dooplay_films(item)
|
||||
findhost()
|
||||
return support.dooplay_peliculas(item, True if "/genere/" in item.url else False)
|
||||
|
||||
|
||||
def episodios(item):
|
||||
findhost()
|
||||
return support.dooplay_get_episodes(item)
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
findhost()
|
||||
itemlist = []
|
||||
for link in support.dooplay_get_links(item, host):
|
||||
server = link['server'][:link['server'].find(".")]
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="play",
|
||||
title=server + " [COLOR blue][" + link['title'] + "][/COLOR]",
|
||||
url=link['url'],
|
||||
server=server,
|
||||
fulltitle=item.fulltitle,
|
||||
thumbnail=item.thumbnail,
|
||||
show=item.show,
|
||||
quality=link['title'],
|
||||
contentType=item.contentType,
|
||||
folder=False))
|
||||
if link['title'] != 'Guarda il trailer':
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="play",
|
||||
url=link['url'],
|
||||
fulltitle=item.fulltitle,
|
||||
thumbnail=item.thumbnail,
|
||||
show=item.show,
|
||||
quality=link['title'],
|
||||
contentType=item.contentType,
|
||||
folder=False))
|
||||
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"adult": false,
|
||||
"thumbnail": "toonitalia.png",
|
||||
"banner": "toonitalia.png",
|
||||
"categories": ["tvshow", "movie", "vosi", "anime"],
|
||||
"categories": ["tvshow", "movie", "vos", "anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ def search(item, text):
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
return support.dooplay_films(item, blacklist)
|
||||
return support.dooplay_peliculas(item, False, blacklist)
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
|
||||
Reference in New Issue
Block a user