Compare commits
105 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e1787e9e9 | ||
|
|
5257183fb7 | ||
|
|
48996688a6 | ||
|
|
123bf489ac | ||
|
|
55dbf957c0 | ||
|
|
526bbdd4d1 | ||
|
|
a578a095ff | ||
|
|
ca29ea7216 | ||
|
|
3c60b5c710 | ||
|
|
f2177d7ffd | ||
|
|
003f3905f0 | ||
|
|
5348eebe19 | ||
|
|
52c74d3852 | ||
|
|
6639b5aaca | ||
|
|
fee7a27758 | ||
|
|
4046014220 | ||
|
|
3838a22089 | ||
|
|
32d88dc77c | ||
|
|
69a6a98a56 | ||
|
|
7196425322 | ||
|
|
b80e6295ff | ||
|
|
938b8e6355 | ||
|
|
10ee3d0425 | ||
|
|
dd309c307e | ||
|
|
b84f682461 | ||
|
|
2a5a83c767 | ||
|
|
905e1ad6ee | ||
|
|
dc93170fd5 | ||
|
|
60ec158008 | ||
|
|
8975f950c5 | ||
|
|
27562cad4d | ||
|
|
dfeec60fe3 | ||
|
|
2764c48805 | ||
|
|
b3eff4bb07 | ||
|
|
ed6c7caa91 | ||
|
|
132301b06d | ||
|
|
841c68fb86 | ||
|
|
17edb2d69f | ||
|
|
f9223c7a48 | ||
|
|
bbc79ec2bb | ||
|
|
66def5c3a1 | ||
|
|
9041d4c1b7 | ||
|
|
4db8d3a388 | ||
|
|
3103864308 | ||
|
|
2662277a71 | ||
|
|
f9a4d0dbbb | ||
|
|
c86cdab9da | ||
|
|
1e2f88c47a | ||
|
|
fc0822f93a | ||
|
|
fc1ca5435f | ||
|
|
60bf2d670a | ||
|
|
acaed1c036 | ||
|
|
7965daf524 | ||
|
|
8b1e6acc6e | ||
|
|
0367ea31a7 | ||
|
|
658666bd6b | ||
|
|
b32b500b07 | ||
|
|
ea5f4de258 | ||
|
|
002d4bd32a | ||
|
|
e6c09ab8bb | ||
|
|
3d61f5dc54 | ||
|
|
0cceffea0c | ||
|
|
3fd09dbb11 | ||
|
|
4b1cb8f9a8 | ||
|
|
a04aa7cb73 | ||
|
|
3c05a3cd0c | ||
|
|
eb0aa3cafe | ||
|
|
34c438d01b | ||
|
|
b845810d7e | ||
|
|
89c8de9522 | ||
|
|
46b8eb945a | ||
|
|
ec850dc045 | ||
|
|
5f16ff4121 | ||
|
|
dbc2ecd57e | ||
|
|
1868420425 | ||
|
|
ab8136e326 | ||
|
|
608b6e6a15 | ||
|
|
e6b28189dd | ||
|
|
ef8f78ea07 | ||
|
|
f7fd28e9d1 | ||
|
|
01059eb373 | ||
|
|
dc2140f2ca | ||
|
|
753f915e5a | ||
|
|
228c7bbd79 | ||
|
|
ba98922a9c | ||
|
|
a4e2278122 | ||
|
|
529e24e4c1 | ||
|
|
6b8305f7ae | ||
|
|
b0d3dd2fa7 | ||
|
|
f1d8873fa4 | ||
|
|
b773164dad | ||
|
|
b6dcb8f716 | ||
|
|
8eb5881559 | ||
|
|
057f94027a | ||
|
|
5403e65895 | ||
|
|
ae06db005b | ||
|
|
57814f6e7c | ||
|
|
f52ce7f9d3 | ||
|
|
551e89e0f5 | ||
|
|
273fff7c48 | ||
|
|
b37cf50261 | ||
|
|
d925f26c8d | ||
|
|
5e3fd956b9 | ||
|
|
4e980e426c | ||
|
|
c942f9b4ec |
2
.github/ISSUE_TEMPLATE/test-canale.md
vendored
2
.github/ISSUE_TEMPLATE/test-canale.md
vendored
@@ -67,7 +67,7 @@ Controlla sia presente qualcosa, tra le " " di thumbnail e banner, e che le imma
|
|||||||
|
|
||||||
Riepilogo voci:
|
Riepilogo voci:
|
||||||
|
|
||||||
movie, tvshow, anime, documentary, vos, adult
|
movie, tvshow, anime, documentary, sub, adult
|
||||||
|
|
||||||
(se il sito contiene film e serie, devono esserci sia movie che tvshow, se contiene solo film, solo movie)
|
(se il sito contiene film e serie, devono esserci sia movie che tvshow, se contiene solo film, solo movie)
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<addon id="plugin.video.kod" name="Kodi on Demand BETA" version="1.7" provider-name="KoD Team">
|
<addon id="plugin.video.kod" name="Kodi on Demand ALPHA" version="2.0" provider-name="KoD Team">
|
||||||
<requires>
|
<requires>
|
||||||
<!-- <import addon="script.module.libtorrent" optional="true"/> -->
|
|
||||||
<import addon="metadata.themoviedb.org"/>
|
|
||||||
<import addon="metadata.tvshows.themoviedb.org"/>
|
|
||||||
<!-- <import addon="metadata.tvdb.com"/> -->
|
|
||||||
<import addon="script.module.web-pdb" />
|
<import addon="script.module.web-pdb" />
|
||||||
</requires>
|
</requires>
|
||||||
<extension point="xbmc.python.pluginsource" library="default.py">
|
<extension point="xbmc.python.pluginsource" library="default.py">
|
||||||
@@ -23,7 +19,7 @@
|
|||||||
<summary lang="it">Kodi on Demand è un addon di Kodi per cercare e guardare contenuti sul web.</summary>
|
<summary lang="it">Kodi on Demand è un addon di Kodi per cercare e guardare contenuti sul web.</summary>
|
||||||
<assets>
|
<assets>
|
||||||
<icon>resources/media/logo.png</icon>
|
<icon>resources/media/logo.png</icon>
|
||||||
<fanart>resources/media/fanart.jpg</fanart>
|
<fanart>resources/media/dark_background.jpg</fanart>
|
||||||
<screenshot>resources/media/screenshot-1.png</screenshot>
|
<screenshot>resources/media/screenshot-1.png</screenshot>
|
||||||
<screenshot>resources/media/screenshot-2.png</screenshot>
|
<screenshot>resources/media/screenshot-2.png</screenshot>
|
||||||
<screenshot>resources/media/screenshot-3.png</screenshot>
|
<screenshot>resources/media/screenshot-3.png</screenshot>
|
||||||
|
|||||||
@@ -6,28 +6,28 @@
|
|||||||
"animeforce": "https://www.animeforce.it",
|
"animeforce": "https://www.animeforce.it",
|
||||||
"animeleggendari": "https://animezeus.com",
|
"animeleggendari": "https://animezeus.com",
|
||||||
"animesaturn": "https://www.animesaturn.it",
|
"animesaturn": "https://www.animesaturn.it",
|
||||||
"animeunity": "https://www.animeunity.it",
|
"animeunity": "https://www.animeunity.tv",
|
||||||
"animeuniverse": "https://www.animeuniverse.it",
|
"animeuniverse": "https://www.animeuniverse.it",
|
||||||
"animeworld": "https://www.animeworld.tv",
|
"animeworld": "https://www.animeworld.tv",
|
||||||
"aniplay": "https://aniplay.it",
|
"aniplay": "https://aniplay.it",
|
||||||
"casacinema": "https://www.casacinema.page",
|
"casacinema": "https://www.casacinema.page",
|
||||||
"cb01anime": "https://www.cineblog01.red",
|
"cb01anime": "https://www.cineblog01.red",
|
||||||
"cineblog01": "https://cb01.uno",
|
"cineblog01": "https://cb01.uno",
|
||||||
"cinemalibero": "https://cinemalibero.bar",
|
"cinemalibero": "https://cinemalibero.surf",
|
||||||
"cinetecadibologna": "http://cinestore.cinetecadibologna.it",
|
"cinetecadibologna": "http://cinestore.cinetecadibologna.it",
|
||||||
"discoveryplus": "https://www.discoveryplus.com",
|
"discoveryplus": "https://www.discoveryplus.com",
|
||||||
"dreamsub": "https://dreamsub.stream",
|
"dreamsub": "https://dreamsub.stream",
|
||||||
"dsda": "https://www.dsda.press",
|
"dsda": "https://www.dsda.press",
|
||||||
"eurostreaming": "https://eurostreaming.bar",
|
"eurostreaming": "https://eurostreaming.world",
|
||||||
"filmigratis": "https://filmigratis.org",
|
"filmigratis": "https://filmigratis.org",
|
||||||
"guardaseriecam": "https://guardaserie.cam",
|
"guardaseriecam": "https://guardaserie.cam",
|
||||||
"guardaserieclick": "https://www.guardaserie.builders",
|
"guardaserieclick": "https://www.guardaserie.builders",
|
||||||
"guardaserieicu": "https://guardaserie.cfd",
|
"guardaserieicu": "https://guardaserie.center",
|
||||||
"hd4me": "https://hd4me.net",
|
"hd4me": "https://hd4me.net",
|
||||||
"ilcorsaronero": "https://ilcorsaronero.link",
|
"ilcorsaronero": "https://ilcorsaronero.link",
|
||||||
"ilgeniodellostreaming": "https://ilgeniodellostreaming.wtf",
|
"ilgeniodellostreaming": "https://ilgeniodellostreaming.bet",
|
||||||
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city",
|
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city",
|
||||||
"italiaserie": "https://italiaserie.date",
|
"italiaserie": "https://italiaserie.men",
|
||||||
"mediasetplay": "https://www.mediasetplay.mediaset.it",
|
"mediasetplay": "https://www.mediasetplay.mediaset.it",
|
||||||
"mondoserietv": "https://mondoserietv.club",
|
"mondoserietv": "https://mondoserietv.club",
|
||||||
"paramount": "https://www.paramountnetwork.it",
|
"paramount": "https://www.paramountnetwork.it",
|
||||||
@@ -38,17 +38,16 @@
|
|||||||
"serietvonline": "https://serietvonline.art",
|
"serietvonline": "https://serietvonline.art",
|
||||||
"serietvsubita": "http://serietvsubita.xyz",
|
"serietvsubita": "http://serietvsubita.xyz",
|
||||||
"serietvu": "https://www.serietvu.live",
|
"serietvu": "https://www.serietvu.live",
|
||||||
"streamingcommunity": "https://streamingcommunity.vip",
|
|
||||||
"streamtime": "https://t.me/s/StreamTime",
|
"streamtime": "https://t.me/s/StreamTime",
|
||||||
"tantifilm": "https://www.tantifilm.stream",
|
"tantifilm": "https://www.tantifilm.cfd",
|
||||||
"tapmovie": "https://it.tapmovie.net",
|
"tapmovie": "https://it.tapmovie.net",
|
||||||
"toonitalia": "https://toonitalia.co",
|
"toonitalia": "https://toonitalia.co",
|
||||||
"vvvvid": "https://www.vvvvid.it"
|
"vvvvid": "https://www.vvvvid.it"
|
||||||
},
|
},
|
||||||
"findhost": {
|
"findhost": {
|
||||||
"altadefinizioneclick": "https://altadefinizione-nuovo.click",
|
"altadefinizionecommunity": "https://altaregistrazione.net",
|
||||||
"altadefinizionecommunity": "https://altaregistrazione.com",
|
|
||||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||||
"filmpertutti": "https://filmpertuttiii.nuovo.live"
|
"filmpertutti": "https://filmpertuttiii.nuovo.live",
|
||||||
|
"streamingcommunity": "https://t.me/s/StreamingCommunity_nuovo_link"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ se vanno cancellati tutti deve rimanere la voce:
|
|||||||
"active": false,
|
"active": false,
|
||||||
"thumbnail": "",
|
"thumbnail": "",
|
||||||
"banner": "",
|
"banner": "",
|
||||||
"categories": ["movie", "tvshow", "anime", "vos", "documentary"],
|
"categories": ["movie", "tvshow", "anime", "sub, "documentary"],
|
||||||
"not_active": ["include_in_newest"],
|
"not_active": ["include_in_newest"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
@@ -35,7 +35,7 @@ se vanno cancellati tutti deve rimanere la voce:
|
|||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "include_in_newest_peliculas",
|
"id": "include_in_newest_movie",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "@70727",
|
"label": "@70727",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
@@ -75,20 +75,19 @@ headers = [['Referer', host]]
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.info(item)
|
|
||||||
|
|
||||||
# Ordine delle voci
|
# Ordine delle voci
|
||||||
# Voce FILM, puoi solo impostare l'url
|
# Voce FILM, puoi solo impostare l'url
|
||||||
film = ['', # 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]
|
#Voce Menu,['url','action','args',contentType]
|
||||||
('Al Cinema', ['', 'peliculas', '']),
|
('Al Cinema', ['', 'movies', '']),
|
||||||
('Generi', ['', 'genres', 'genres']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('Per Lettera', ['', 'genres', 'letters']),
|
('Per Lettera', ['', 'genres', 'letters']),
|
||||||
('Anni', ['', 'genres', 'years']),
|
('Anni', ['', 'genres', 'years']),
|
||||||
('Qualità', ['', 'genres', 'quality']),
|
('Qualità', ['', 'genres', 'quality']),
|
||||||
('Mi sento fortunato', ['', 'genres', 'lucky']),
|
('Mi sento fortunato', ['', 'genres', 'lucky']),
|
||||||
('Popolari', ['', 'peliculas', '']),
|
('Popolari', ['', 'movies', '']),
|
||||||
('Sub-ITA', ['', 'peliculas', ''])
|
('Sub-ITA', ['', 'movies', ''])
|
||||||
]
|
]
|
||||||
|
|
||||||
# Voce SERIE, puoi solo impostare l'url
|
# Voce SERIE, puoi solo impostare l'url
|
||||||
@@ -145,31 +144,29 @@ def mainlist(item):
|
|||||||
# lang = lingua del video. Es: ITA, Sub-ITA, Sub, SUB ITA.
|
# 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.!!!!
|
# AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!!
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info(item)
|
#logger.dbg() # decommentare per attivare web_pdb
|
||||||
#support.dbg() # decommentare per attivare web_pdb
|
|
||||||
|
|
||||||
action = ''
|
action = ''
|
||||||
blacklist = ['']
|
blacklist = ['']
|
||||||
patron = r''
|
patron = r''
|
||||||
patronBlock = r''
|
patronBlock = r''
|
||||||
patronNext = ''
|
patronNext = ''
|
||||||
pagination = ''
|
pagination = True
|
||||||
|
|
||||||
#debug = True # True per testare le regex sul sito
|
#debug = True # True per testare le regex sul sito
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info(item)
|
#logger.dbg()
|
||||||
#support.dbg()
|
|
||||||
|
|
||||||
action = ''
|
action = ''
|
||||||
blacklist = ['']
|
blacklist = ['']
|
||||||
patron = r''
|
patron = r''
|
||||||
patronBlock = r''
|
patronBlock = r''
|
||||||
patronNext = ''
|
patronNext = ''
|
||||||
pagination = ''
|
pagination = True
|
||||||
|
|
||||||
#debug = True
|
#debug = True
|
||||||
return locals()
|
return locals()
|
||||||
@@ -178,15 +175,14 @@ def episodios(item):
|
|||||||
# per genere, per anno, per lettera, per qualità ecc ecc
|
# per genere, per anno, per lettera, per qualità ecc ecc
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.info(item)
|
#logger.dbg()
|
||||||
#support.dbg()
|
|
||||||
|
|
||||||
action = ''
|
action = ''
|
||||||
blacklist = ['']
|
blacklist = ['']
|
||||||
patron = r''
|
patron = r''
|
||||||
patronBlock = r''
|
patronBlock = r''
|
||||||
patronNext = ''
|
patronNext = ''
|
||||||
pagination = ''
|
pagination = True
|
||||||
|
|
||||||
#debug = True
|
#debug = True
|
||||||
return locals()
|
return locals()
|
||||||
@@ -196,18 +192,18 @@ def genres(item):
|
|||||||
|
|
||||||
# per quei casi dove il sito non differenzia film e/o serie e/o anime
|
# 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
|
# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro
|
||||||
# andranno modificate anche le def peliculas e episodios ove occorre
|
# andranno modificate anche le def movies e episodes ove occorre
|
||||||
def select(item):
|
def select(item):
|
||||||
support.info('select --->', item)
|
logger.debug()
|
||||||
#support.dbg()
|
#logger.dbg()
|
||||||
data = httptools.downloadpage(item.url, headers=headers).data
|
data = httptools.downloadpage(item.url, headers=headers).data
|
||||||
# pulizia di data, in caso commentare le prossime 2 righe
|
# pulizia di data, in caso commentare le prossime 2 righe
|
||||||
data = re.sub('\n|\t', ' ', data)
|
data = re.sub('\n|\t', ' ', data)
|
||||||
data = re.sub(r'>\s+<', '> <', data)
|
data = re.sub(r'>\s+<', '> <', data)
|
||||||
block = scrapertools.find_single_match(data, r'')
|
block = scrapertools.find_single_match(data, r'')
|
||||||
if re.findall('', data, re.IGNORECASE):
|
if re.findall('', data, re.IGNORECASE):
|
||||||
support.info('select = ### è una serie ###')
|
logger.debug('select = ### è una serie ###')
|
||||||
return episodios(Item(channel=item.channel,
|
return episodes(Item(channel=item.channel,
|
||||||
title=item.title,
|
title=item.title,
|
||||||
fulltitle=item.fulltitle,
|
fulltitle=item.fulltitle,
|
||||||
url=item.url,
|
url=item.url,
|
||||||
@@ -219,7 +215,7 @@ def select(item):
|
|||||||
############## Fondo Pagina
|
############## Fondo Pagina
|
||||||
# da adattare al canale
|
# da adattare al canale
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', item)
|
logger.debug(text)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
|
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
|
||||||
@@ -227,35 +223,35 @@ def search(item, text):
|
|||||||
# se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare.
|
# se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare.
|
||||||
item.contentType = item.contentType
|
item.contentType = item.contentType
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
# da adattare al canale
|
# da adattare al canale
|
||||||
# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte
|
# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte
|
||||||
# altrimenti NON inserirlo
|
# altrimenti NON inserirlo
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info('newest ->', categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.url = host
|
item.url = host
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('newest log: ', {0}.format(line))
|
logger.debug('newest log: ', {0}.format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -265,5 +261,5 @@ def newest(categoria):
|
|||||||
# sia per i siti con hdpass
|
# sia per i siti con hdpass
|
||||||
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
|
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos ->', item)
|
logger.debug()
|
||||||
return support.server(item, headers=headers)
|
return support.server(item, headers=headers)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
|
||||||
# Appends the main plugin dir to the PYTHONPATH if an internal package cannot be imported.
|
# Appends the main plugin dir to the PYTHONPATH if an internal package cannot be imported.
|
||||||
# Examples: In Plex Media Server all modules are under "Code.*" package, and in Enigma2 under "Plugins.Extensions.*"
|
# Examples: In Plex Media Server all modules are under "Code.*" package, and in Enigma2 under "Plugins.Extensions.*"
|
||||||
try:
|
try:
|
||||||
@@ -10,3 +11,4 @@ try:
|
|||||||
import core
|
import core
|
||||||
except:
|
except:
|
||||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import random
|
import random
|
||||||
from core import httptools, support
|
from core import httptools, support, config
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
|
||||||
host = 'https://www.accuradio.com'
|
host = 'https://www.accuradio.com'
|
||||||
@@ -12,29 +12,27 @@ api_url = host + '/c/m/json/{}/'
|
|||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
itemlist = []
|
|
||||||
item.action = 'peliculas'
|
|
||||||
js = httptools.downloadpage(api_url.format('brands')).json
|
js = httptools.downloadpage(api_url.format('brands')).json
|
||||||
for it in js.get('features',[]):
|
itemlist = []
|
||||||
|
item.action = 'movies'
|
||||||
|
js = httptools.downloadpage(api_url.format('brands')).json
|
||||||
|
for it in js.get('features',[]) + js.get('brands',[]):
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
||||||
title=support.typo(it['name'],'italic') + support.typo(it.get('channels',''),'_ [] color kod')
|
extraInfo = it.get('channels',''),
|
||||||
))
|
title=it['name'],
|
||||||
for it in js.get('brands',[]):
|
thumbnail = support.thumb('music')
|
||||||
itemlist.append(
|
|
||||||
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
|
||||||
title=support.typo(it['name'],'bullet bold') + support.typo(it.get('channels',''),'_ [] color kod')
|
|
||||||
))
|
))
|
||||||
|
|
||||||
itemlist.append(item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search')))
|
itemlist.append(item.clone(title=support.typo(config.getLocalizedString(70741) % 'Musica… ', 'bold'), action='search', thumbnail=support.thumb('music_search')))
|
||||||
support.channel_config(item, itemlist)
|
support.channel_config(item, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
|
tmdbEnabled = False
|
||||||
action = 'playradio'
|
action = 'playradio'
|
||||||
patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)'
|
patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)'
|
||||||
return locals()
|
return locals()
|
||||||
@@ -68,7 +66,7 @@ def playradio(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
item.url = host + '/search/' + text
|
item.url = host + '/search/' + text
|
||||||
itemlist = []
|
itemlist = []
|
||||||
try:
|
try:
|
||||||
@@ -76,9 +74,9 @@ def search(item, text):
|
|||||||
artists = support.match(data, patronBlock=r'artistResults(.*?)</ul', patron=r'href="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)').matches
|
artists = support.match(data, patronBlock=r'artistResults(.*?)</ul', patron=r'href="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)').matches
|
||||||
if artists:
|
if artists:
|
||||||
for url, artist in artists:
|
for url, artist in artists:
|
||||||
itemlist.append(item.clone(title=support.typo(artist,'bullet bold'), thumbnail=support.thumb('music'), url=host+url, action='peliculas'))
|
itemlist.append(item.clone(title=support.typo(artist,'bullet bold'), thumbnail=support.thumb('music'), url=host+url, action='movies'))
|
||||||
item.data = data
|
item.data = data
|
||||||
itemlist += peliculas(item)
|
itemlist += movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "altadefinizione01.png",
|
"thumbnail": "altadefinizione01.png",
|
||||||
"banner": "altadefinizione01.png",
|
"banner": "altadefinizione01.png",
|
||||||
"categories": ["movie", "vos"],
|
"categories": ["movie", "sub"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,11 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per altadefinizione01
|
# Canale per altadefinizione01
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
"""
|
|
||||||
|
|
||||||
Eccezioni note che non superano il test del canale:
|
|
||||||
|
|
||||||
Avvisi:
|
|
||||||
- L'url si prende da questo file.
|
|
||||||
- è presente nelle novità-> Film.
|
|
||||||
|
|
||||||
Ulteriori info:
|
|
||||||
|
|
||||||
"""
|
|
||||||
from core import scrapertools, httptools, support
|
from core import scrapertools, httptools, support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
|
|
||||||
# def findhost(url):
|
# def findhost(url):
|
||||||
# data = httptools.downloadpage(url).data
|
# data = httptools.downloadpage(url).data
|
||||||
# host = scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
# host = scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||||
@@ -32,22 +21,20 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
film = [
|
film = [
|
||||||
('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']),
|
('Al Cinema', ['/cinema/', 'movies', 'pellicola']),
|
||||||
('Ultimi Aggiornati-Aggiunti', ['','peliculas', 'update']),
|
('Ultimi Aggiornati-Aggiunti', ['','movies', 'update']),
|
||||||
('Generi', ['', 'genres', 'genres']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('Lettera', ['/catalog/a/', 'genres', 'orderalf']),
|
('Lettera', ['/catalog/a/', 'genres', 'az']),
|
||||||
('Anni', ['', 'genres', 'years']),
|
('Anni', ['', 'genres', 'years']),
|
||||||
('Sub-ITA', ['/sub-ita/', 'peliculas', 'pellicola'])
|
('Sub-ITA', ['/sub-ita/', 'movies', 'pellicola'])
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info('peliculas', item)
|
|
||||||
|
|
||||||
## deflang = 'ITA'
|
|
||||||
action="findvideos"
|
action="findvideos"
|
||||||
|
|
||||||
patron = r'<div class="cover boxcaption"> +<h2>\s*<a href="(?P<url>[^"]+)">(?P<title>[^<]+).*?src="(?P<thumb>[^"]+).*?<div class="trdublaj">(?P<quality>[^<]+).*?<span class="ml-label">(?P<year>[0-9]+).*?<span class="ml-label">(?P<duration>[^<]+).*?<p>(?P<plot>[^<]+)'
|
patron = r'<div class="cover boxcaption"> +<h2>\s*<a href="(?P<url>[^"]+)">(?P<title>[^<]+).*?src="(?P<thumb>[^"]+).*?<div class="trdublaj">(?P<quality>[^<]+).*?<span class="ml-label">(?P<year>[0-9]+).*?<span class="ml-label">(?P<duration>[^<]+).*?<p>(?P<plot>[^<]+)'
|
||||||
@@ -58,52 +45,49 @@ def peliculas(item):
|
|||||||
elif item.args == 'update':
|
elif item.args == 'update':
|
||||||
patronBlock = r'<div class="widget-title">Ultimi Film Aggiunti/Aggiornati</div>(?P<block>.*?)<div id="alt_menu">'
|
patronBlock = r'<div class="widget-title">Ultimi Film Aggiunti/Aggiornati</div>(?P<block>.*?)<div id="alt_menu">'
|
||||||
patron = r'style="background-image:url\((?P<thumb>[^\)]+).+?<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> [^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+|N/A).+?>.*?(?:>Film (?P<lang>Sub ITA)</a></p> )?<p>(?P<plot>[^<]+)<.*?href="(?P<url>[^"]+)'
|
patron = r'style="background-image:url\((?P<thumb>[^\)]+).+?<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> [^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+|N/A).+?>.*?(?:>Film (?P<lang>Sub ITA)</a></p> )?<p>(?P<plot>[^<]+)<.*?href="(?P<url>[^"]+)'
|
||||||
elif item.args == 'orderalf':
|
elif item.args == 'az':
|
||||||
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"' \
|
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"' \
|
||||||
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<' \
|
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<' \
|
||||||
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
|
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
|
||||||
else:
|
else:
|
||||||
patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">'
|
patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">'
|
||||||
|
|
||||||
patronNext = '<span>\d</span> <a href="([^"]+)">'
|
patronNext = r'<a href="([^"]+)">»'
|
||||||
# debug = True
|
patronTotalPages = r'>(\d+)(?:[^>]+>){3}»'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.info('genres',item)
|
action = "movies"
|
||||||
action = "peliculas"
|
|
||||||
|
|
||||||
blacklist = ['Altadefinizione01']
|
blacklist = ['Altadefinizione01']
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<ul class="kategori_list">(?P<block>.*?)<div class="tab-pane fade" id="wtab2">'
|
patronBlock = r'<ul class="kategori_list">(?P<block>.*?)<div class="tab-pane fade" id="wtab2">'
|
||||||
patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
|
patronGenreMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
|
||||||
elif item.args == 'years':
|
elif item.args == 'years':
|
||||||
patronBlock = r'<ul class="anno_list">(?P<block>.*?)</li> </ul> </div>'
|
patronBlock = r'<ul class="anno_list">(?P<block>.*?)</li> </ul> </div>'
|
||||||
patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
|
patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
|
||||||
elif item.args == 'orderalf':
|
elif item.args == 'az':
|
||||||
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
|
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
|
||||||
patronMenu = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
|
patronMenu = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
|
||||||
|
|
||||||
#debug = True
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def orderalf(item):
|
def az(item):
|
||||||
support.info('orderalf',item)
|
|
||||||
|
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
|
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
|
||||||
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<'\
|
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<'\
|
||||||
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
|
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
|
||||||
patronNext = r'<span>[^<]+</span>[^<]+<a href="(.*?)">'
|
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(item, text)
|
logger.debug(text)
|
||||||
|
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -111,7 +95,7 @@ def search(item, text):
|
|||||||
item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text)
|
item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text)
|
||||||
item.args = "search"
|
item.args = "search"
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -119,18 +103,18 @@ def search(item, text):
|
|||||||
logger.error("search except: %s" % line)
|
logger.error("search except: %s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "peliculas":
|
if category == "movie":
|
||||||
item.url = host
|
item.url = host
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
if itemlist[-1].action == "peliculas":
|
if itemlist[-1].action == "movies":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
@@ -142,7 +126,7 @@ def newest(categoria):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos', item)
|
logger.debug()
|
||||||
data = httptools.downloadpage(item.url).data
|
data = httptools.downloadpage(item.url).data
|
||||||
iframe = support.match(data, patron='player-container[^>]+>\s*<iframe[^>]+src="([^"]+)').match
|
iframe = support.match(data, patron='player-container[^>]+>\s*<iframe[^>]+src="([^"]+)').match
|
||||||
if iframe:
|
if iframe:
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"language": ["ita","sub-ita"],
|
"language": ["ita","sub-ita"],
|
||||||
"thumbnail": "altadefinizione01_L.png",
|
"thumbnail": "altadefinizione01_L.png",
|
||||||
"banner": "altadefinizione01_L.png",
|
"banner": "altadefinizione01_L.png",
|
||||||
"categories": ["movie","vos"],
|
"categories": ["movie","sub"],
|
||||||
"settings" :[]
|
"settings" :[]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,37 +15,30 @@ headers = [['Referer', host]]
|
|||||||
# =========== home menu ===================
|
# =========== home menu ===================
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.info('mainlist',item)
|
|
||||||
|
|
||||||
film = [
|
film = [
|
||||||
('Al Cinema', ['/film-del-cinema', 'peliculas', '']),
|
('Al Cinema', ['/film-del-cinema', 'movies', '']),
|
||||||
('Generi', ['', 'genres', 'genres']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('Anni', ['', 'genres', 'years']),
|
('Anni', ['', 'genres', 'years']),
|
||||||
('Qualità', ['/piu-visti.html', 'genres', 'quality']),
|
('Qualità', ['/piu-visti.html', 'genres', 'quality']),
|
||||||
('Mi sento fortunato', ['/piu-visti.html', 'genres', 'lucky']),
|
('Mi sento fortunato', ['/piu-visti.html', 'genres', 'lucky']),
|
||||||
('Popolari', ['/piu-visti.html', 'peliculas', '']),
|
('Popolari', ['/piu-visti.html', 'movies', '']),
|
||||||
('Sub-ITA', ['/film-sub-ita/', 'peliculas', ''])
|
('Sub-ITA', ['/film-sub-ita/', 'movies', ''])
|
||||||
]
|
]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
# ======== def in ordine di action dal menu ===========================
|
# ======== def in ordine di action dal menu ===========================
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
|
||||||
support.info('peliculas',item)
|
|
||||||
|
|
||||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)(?:[^>]+>){5}\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)(?:[^>]+>){6}\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+))?(?:[^>]+>){0,2}\s+(?P<quality>[a-zA-Z]+)\s+(?:[^>]+>){2}\s*(?P<lang>[^>]+)\s+[^>]+>'
|
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)(?:[^>]+>){5}\s*<div class="[^"]+" style="background-image:url\((?P<thumb>[^\)]+)(?:[^>]+>){6}\s*(?P<year>\d{4})[^>]+>[^>]+>(?:\s*(?P<duration>\d+))?(?:[^>]+>){0,2}\s+(?P<quality>[a-zA-Z]+)\s+(?:[^>]+>){2}\s*(?P<lang>[^>]+)\s+[^>]+>'
|
||||||
patronNext = r'<span>\d</span> <a href="([^"]+)">'
|
patronNext = r'<span>\d</span> <a href="([^"]+)">'
|
||||||
# debug = True
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
# =========== def pagina categorie ======================================
|
# =========== def pagina categorie ======================================
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.info('genres',item)
|
|
||||||
|
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
||||||
elif item.args == 'years':
|
elif item.args == 'years':
|
||||||
@@ -56,19 +49,17 @@ def genres(item):
|
|||||||
patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>'
|
patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
|
||||||
#debug = True
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
# =========== def per cercare film/serietv =============
|
# =========== def per cercare film/serietv =============
|
||||||
#host+/index.php?do=search&story=avatar&subaction=search
|
#host+/index.php?do=search&story=avatar&subaction=search
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', item)
|
logger.debug(text)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
text = text.replace(" ", "+")
|
text = text.replace(" ", "+")
|
||||||
item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text)
|
item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text)
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -78,18 +69,18 @@ def search(item, text):
|
|||||||
|
|
||||||
# =========== def per le novità nel menu principale =============
|
# =========== def per le novità nel menu principale =============
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info('newest', categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "peliculas":
|
if category == "movie":
|
||||||
item.url = host
|
item.url = host
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
item.contentType='movie'
|
item.contentType='movie'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == "peliculas":
|
if itemlist[-1].action == "movies":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
@@ -101,5 +92,5 @@ def newest(categoria):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos', item)
|
logger.debug('findvideos', item)
|
||||||
return support.server(item, support.match(item, patron='<ul class="playernav">.*?</ul>', headers=headers).match)
|
return support.server(item, support.match(item, patron='<ul class="playernav">.*?</ul>', headers=headers).match)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita","sub-ita"],
|
"language": ["ita","sub-ita"],
|
||||||
"thumbnail": "altadefinizioneclick.png",
|
"thumbnail": "altadefinizioneclick.png",
|
||||||
"bannermenu": "altadefinizioneciclk.png",
|
"bannermenu": "altadefinizioneciclk.png",
|
||||||
"categories": ["tvshow","movie","vos"],
|
"categories": ["tvshow","movie","sub"],
|
||||||
"not_active":["include_in_newest_series"],
|
"not_active":["include_in_newest_tvshow"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,22 +2,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per altadefinizioneclick
|
# Canale per altadefinizioneclick
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
"""
|
from platformcode import logger
|
||||||
|
|
||||||
Eccezioni che non superano il test del canale:
|
|
||||||
- indicare le eccezioni
|
|
||||||
|
|
||||||
Novità. Indicare in quale/i sezione/i è presente il canale:
|
|
||||||
- film
|
|
||||||
|
|
||||||
Avvisi:
|
|
||||||
- Eventuali avvisi per i tester
|
|
||||||
|
|
||||||
Ulteriori info:
|
|
||||||
|
|
||||||
|
|
||||||
"""
|
|
||||||
from platformcode.logger import debug
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config
|
||||||
@@ -34,14 +19,14 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
film = ['',
|
film = ['',
|
||||||
('Novità', ['/nuove-uscite/', 'peliculas', 'news']),
|
('Novità', ['/nuove-uscite/', 'movies', 'news']),
|
||||||
('Al Cinema', ['/al-cinema/', 'peliculas', 'cinema']),
|
('Al Cinema', ['/al-cinema/', 'movies', 'cinema']),
|
||||||
('A-Z',['/lista-film/', 'genres', 'az']),
|
('A-Z',['/lista-film/', 'genres', 'az']),
|
||||||
('Generi', ['', 'genres', 'genres']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('Anni', ['', 'genres', 'years']),
|
('Anni', ['', 'genres', 'years']),
|
||||||
('Qualità', ['', 'genres', 'quality']),
|
('Qualità', ['', 'genres', 'quality']),
|
||||||
('Mi sento Fortunato',[ '', 'genres', 'lucky']),
|
('Mi sento Fortunato',[ '', 'genres', 'lucky']),
|
||||||
('Sub-ITA', ['/sub-ita/', 'peliculas', 'sub'])
|
('Sub-ITA', ['/sub-ita/', 'movies', 'sub'])
|
||||||
]
|
]
|
||||||
|
|
||||||
tvshow = ['/serie-tv/']
|
tvshow = ['/serie-tv/']
|
||||||
@@ -50,7 +35,7 @@ def mainlist(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
action = 'check'
|
action = 'check'
|
||||||
|
|
||||||
patron = r'<div class="wrapperImage">\s*(?:<span class="year">(?P<year>[^<]+)[^>]+>)?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</div>)'
|
patron = r'<div class="wrapperImage">\s*(?:<span class="year">(?P<year>[^<]+)[^>]+>)?(?:<span class="hd">(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?</a>.*?(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</div>)'
|
||||||
@@ -67,16 +52,16 @@ def peliculas(item):
|
|||||||
if not item.args:
|
if not item.args:
|
||||||
# patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section'
|
# patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section'
|
||||||
patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV')
|
patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV')
|
||||||
|
# debugBlock = True
|
||||||
# nella pagina "CERCA", la voce "SUCCESSIVO" apre la maschera di inserimento dati
|
|
||||||
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
||||||
|
patronTotalPages = r'>(\d+)(?:[^>]+>){3}<a class="next'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patronGenreMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
||||||
@@ -97,33 +82,33 @@ def genres(item):
|
|||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info("search ", texto)
|
logger.debug(text)
|
||||||
|
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
item.url = host + "?s=" + texto
|
item.url = host + "?s=" + text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "peliculas":
|
if category == "movie":
|
||||||
item.args = 'news'
|
item.args = 'news'
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + "/nuove-uscite/"
|
item.url = host + "/nuove-uscite/"
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == "peliculas":
|
if itemlist[-1].action == "movies":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
@@ -143,8 +128,6 @@ def check(item):
|
|||||||
data = ''
|
data = ''
|
||||||
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
||||||
for episode_url, episode in episodes:
|
for episode_url, episode in episodes:
|
||||||
# episode_url = support.urlparse.urljoin(item.url, episode_url)
|
|
||||||
# if '-' in episode: episode = episode.split('-')[0].zfill(2) + 'x' + episode.split('-')[1].zfill(2)
|
|
||||||
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
||||||
data += title + '|' + episode_url + '\n'
|
data += title + '|' + episode_url + '\n'
|
||||||
return data
|
return data
|
||||||
@@ -153,10 +136,11 @@ def check(item):
|
|||||||
patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>'
|
patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>'
|
||||||
patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>'
|
patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>'
|
||||||
|
|
||||||
url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
|
url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen')
|
||||||
seasons = support.match(url, patronBlock=patron_season, patron=patron_option)
|
seasons = support.match(url.match, patronBlock=patron_season, patron=patron_option)
|
||||||
if not seasons.match:
|
if not seasons.match:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'tvshow'
|
||||||
|
item.data = url.data
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
|
|
||||||
data = ''
|
data = ''
|
||||||
@@ -172,10 +156,10 @@ def check(item):
|
|||||||
if res.result():
|
if res.result():
|
||||||
data += res.result()
|
data += res.result()
|
||||||
item.data = data
|
item.data = data
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
data = item.data
|
data = item.data
|
||||||
|
|
||||||
patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)'
|
patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)'
|
||||||
@@ -188,10 +172,7 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos', item)
|
logger.debug()
|
||||||
return support.hdpass_get_servers(item)
|
return support.hdpass_get_servers(item, item.data)
|
||||||
|
|
||||||
|
|
||||||
# def play(item):
|
|
||||||
# if 'hdpass' in item.url:
|
|
||||||
# return support.hdpass_get_url(item)
|
|
||||||
# return [item]
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "altadefinizionecommunity.png",
|
"thumbnail": "altadefinizionecommunity.png",
|
||||||
"banner": "",
|
"banner": "",
|
||||||
"categories": ["movie", "tvshow", "vos"],
|
"categories": ["movie", "tvshow", "sub"],
|
||||||
"not_active": ["include_in_newest"],
|
"not_active": ["include_in_newest"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,163 +13,44 @@ def findhost(url):
|
|||||||
|
|
||||||
|
|
||||||
host = config.get_channel_url(findhost)
|
host = config.get_channel_url(findhost)
|
||||||
register_url = 'https://altaregistrazione.com'
|
register_url = 'https://altaregistrazione.net'
|
||||||
headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'}
|
|
||||||
|
if 'altadefinizionecommunity' not in host:
|
||||||
|
config.get_channel_url(findhost, forceFindhost=True)
|
||||||
|
|
||||||
|
if host.endswith('/'):
|
||||||
|
host = host[:-1]
|
||||||
|
|
||||||
|
headers = {'Referer': host}
|
||||||
|
order = ['', 'i_piu_visti', 'i_piu_votati', 'i_piu_votati_dellultimo_mese', 'titolo_az', 'voto_imdb_piu_alto'][config.getSetting('order', 'altadefinizionecommunity')]
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.debug(item)
|
logger.debug(item)
|
||||||
|
|
||||||
film = ['/load-more-film?anno=&order=&support_webp=1&type=movie&page=1',
|
film = ['/type/movie',
|
||||||
# Voce Menu,['url','action','args',contentType]
|
('Generi', ['/type/movie', 'genres', 'genres']),
|
||||||
('Generi Film', ['', 'genres', 'genres']),
|
('Anni', ['/type/movie', 'genres', 'year']),]
|
||||||
]
|
|
||||||
|
|
||||||
tvshow = ['/load-more-film?type=tvshow&anno=&order=&support_webp=1&page=1',
|
tvshow = ['/serie-tv/tvshow',
|
||||||
# Voce Menu,['url','action','args',contentType]
|
('Generi', ['/serie-tv/tvshow', 'genres', 'genres']),
|
||||||
('Generi Serie TV', ['', 'genres', 'genres']),
|
('Anni', ['/serie-tv/tvshow', 'genres', 'year'])]
|
||||||
]
|
|
||||||
|
|
||||||
altri = [
|
|
||||||
# ('A-Z', ['/lista-film', 'genres', 'letters']),
|
|
||||||
('Qualità', ['', 'genres', 'quality']),
|
|
||||||
('Anni', ['/anno', 'genres', 'years'])
|
|
||||||
]
|
|
||||||
search = ''
|
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def login():
|
def search(item, text):
|
||||||
r = support.httptools.downloadpage(host, cloudscraper=True)
|
logger.debug("search ", text)
|
||||||
Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)', cloudscraper=True).match
|
# per evitare fastidi da ricerca globale
|
||||||
if 'id="logged"' in r.text:
|
if not item.globalsearch:
|
||||||
logger.info('Già loggato')
|
registerOrLogin()
|
||||||
else:
|
|
||||||
logger.info('Login in corso')
|
|
||||||
post = {'_token': '',
|
|
||||||
'form_action':'login',
|
|
||||||
'email': config.get_setting('username', channel='altadefinizionecommunity'),
|
|
||||||
'password':config.get_setting('password', channel='altadefinizionecommunity')}
|
|
||||||
|
|
||||||
r = support.httptools.downloadpage(host + '/login', post=post, headers={'referer': host}, cloudscraper=True)
|
|
||||||
if not r.status_code in [200, 302] or 'Email o Password non validi' in r.text:
|
|
||||||
platformtools.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi')
|
|
||||||
return False
|
|
||||||
|
|
||||||
return 'id="logged"' in r.text
|
|
||||||
|
|
||||||
|
|
||||||
def registerOrLogin():
|
|
||||||
if config.get_setting('username', channel='altadefinizionecommunity') and config.get_setting('password', channel='altadefinizionecommunity'):
|
|
||||||
if login():
|
|
||||||
return True
|
|
||||||
|
|
||||||
action = platformtools.dialog_yesno('AltadefinizioneCommunity',
|
|
||||||
'Questo server necessita di un account, ne hai già uno oppure vuoi tentare una registrazione automatica?',
|
|
||||||
yeslabel='Accedi', nolabel='Tenta registrazione', customlabel='Annulla')
|
|
||||||
if action == 1: # accedi
|
|
||||||
from specials import setting
|
|
||||||
from core.item import Item
|
|
||||||
user_pre = config.get_setting('username', channel='altadefinizionecommunity')
|
|
||||||
password_pre = config.get_setting('password', channel='altadefinizionecommunity')
|
|
||||||
setting.channel_config(Item(config='altadefinizionecommunity'))
|
|
||||||
user_post = config.get_setting('username', channel='altadefinizionecommunity')
|
|
||||||
password_post = config.get_setting('password', channel='altadefinizionecommunity')
|
|
||||||
|
|
||||||
if user_pre != user_post or password_pre != password_post:
|
|
||||||
return registerOrLogin()
|
|
||||||
else:
|
|
||||||
return []
|
|
||||||
elif action == 0: # tenta registrazione
|
|
||||||
import random
|
|
||||||
import string
|
|
||||||
logger.debug('Registrazione automatica in corso')
|
|
||||||
mailbox = Gmailnator()
|
|
||||||
randPsw = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(10))
|
|
||||||
logger.debug('email: ' + mailbox.address)
|
|
||||||
logger.debug('pass: ' + randPsw)
|
|
||||||
reg = platformtools.dialog_register(register_url, email=True, password=True, email_default=mailbox.address, password_default=randPsw)
|
|
||||||
if not reg:
|
|
||||||
return False
|
|
||||||
regPost = httptools.downloadpage(register_url, post={'email': reg['email'], 'password': reg['password']}, cloudscraper=True)
|
|
||||||
|
|
||||||
if regPost.url == register_url:
|
|
||||||
error = scrapertools.htmlclean(scrapertools.find_single_match(regPost.data, 'Impossibile proseguire.*?</div>'))
|
|
||||||
error = scrapertools.unescape(scrapertools.re.sub('\n\s+', ' ', error))
|
|
||||||
platformtools.dialog_ok('AltadefinizioneCommunity', error)
|
|
||||||
return False
|
|
||||||
if reg['email'] == mailbox.address:
|
|
||||||
if "L'indirizzo email risulta già registrato" in regPost.data:
|
|
||||||
# httptools.downloadpage(baseUrl + '/forgotPassword', post={'email': reg['email']})
|
|
||||||
platformtools.dialog_ok('AltadefinizioneCommunity', 'Indirizzo mail già utilizzato')
|
|
||||||
return False
|
|
||||||
mail = mailbox.waitForMail()
|
|
||||||
if mail:
|
|
||||||
checkUrl = scrapertools.find_single_match(mail.body, '<a href="([^"]+)[^>]+>Verifica').replace(r'\/', '/')
|
|
||||||
logger.debug('CheckURL: ' + checkUrl)
|
|
||||||
httptools.downloadpage(checkUrl, cloudscraper=True)
|
|
||||||
config.set_setting('username', mailbox.address, channel='altadefinizionecommunity')
|
|
||||||
config.set_setting('password', randPsw, channel='altadefinizionecommunity')
|
|
||||||
platformtools.dialog_ok('AltadefinizioneCommunity',
|
|
||||||
'Registrato automaticamente con queste credenziali:\nemail:' + mailbox.address + '\npass: ' + randPsw)
|
|
||||||
else:
|
|
||||||
platformtools.dialog_ok('AltadefinizioneCommunity', 'Impossibile registrarsi automaticamente')
|
|
||||||
return False
|
|
||||||
else:
|
|
||||||
platformtools.dialog_ok('AltadefinizioneCommunity', 'Hai modificato la mail quindi KoD non sarà in grado di effettuare la verifica in autonomia, apri la casella ' + reg['email']
|
|
||||||
+ ' e clicca sul link. Premi ok quando fatto')
|
|
||||||
logger.debug('Registrazione completata')
|
|
||||||
else:
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
def peliculas(item):
|
|
||||||
json = {}
|
|
||||||
|
|
||||||
if item.contentType == 'undefined':
|
|
||||||
disabletmdb = True
|
|
||||||
action = 'check'
|
|
||||||
elif item.contentType == 'movie':
|
|
||||||
action = 'findvideos'
|
|
||||||
else:
|
|
||||||
action = 'episodios'
|
|
||||||
|
|
||||||
if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto
|
|
||||||
import ast
|
|
||||||
ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match
|
|
||||||
item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1'
|
|
||||||
if not '/search' in item.url:
|
|
||||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
|
||||||
data = "\n".join(json['data'])
|
|
||||||
else:
|
|
||||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
|
||||||
data = "\n".join(json['data'])
|
|
||||||
patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
|
|
||||||
|
|
||||||
# paginazione
|
|
||||||
if json.get('have_next'):
|
|
||||||
def fullItemlistHook(itemlist):
|
|
||||||
spl = item.url.split('=')
|
|
||||||
url = '='.join(spl[:-1])
|
|
||||||
page = str(int(spl[-1])+1)
|
|
||||||
support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas')
|
|
||||||
return itemlist
|
|
||||||
|
|
||||||
return locals()
|
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
|
||||||
logger.debug("search ", texto)
|
|
||||||
|
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
item.url = host + "/search?s={}&page=1".format(texto)
|
item.url = host + "/search?s={}&f={}".format(text.replace(' ', '+'), item.contentType)
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -180,27 +61,89 @@ def search(item, texto):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
|
registerOrLogin()
|
||||||
logger.debug(item)
|
logger.debug(item)
|
||||||
data = support.httptools.downloadpage(item.url, cloudscraper=True).data
|
data = support.httptools.downloadpage(item.url).data
|
||||||
|
blacklist= ['Film', 'Serie TV']
|
||||||
|
|
||||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)'
|
if item.args == 'genres':
|
||||||
if item.args == 'quality':
|
categories ={}
|
||||||
item.contentType = 'undefined'
|
res = support.match(host + '/cerca', patron=r'for="cat-(\d+)[^>]+>([^<]+)').matches
|
||||||
|
for _id, name in res:
|
||||||
|
categories[name] = _id
|
||||||
|
|
||||||
|
patronBlock = r'{}<span></span>(?P<block>.*?)</ul>\s*</li'.format('Film' if item.contentType == 'movie' else 'Serie TV')
|
||||||
|
patronMenu = r'<a href="[^"]+">(?P<title>[^<]+)'
|
||||||
|
|
||||||
|
def itemHook(it):
|
||||||
|
it.cat_id = categories[it.fulltitle]
|
||||||
|
return it
|
||||||
|
|
||||||
|
if item.args == 'year':
|
||||||
|
patronMenu = r'value="(?P<year_id>[^"]+)"[^>]*>(?P<title>\d+)'
|
||||||
|
patronBlock = r'Anno</option>(?P<block>.*?</select>)'
|
||||||
|
|
||||||
|
elif item.args == 'quality':
|
||||||
|
patronMenu = r'quality/(?P<quality_id>[^"]+)">(?P<title>[^<]+)'
|
||||||
patronBlock = r'Risoluzione(?P<block>.*?)</ul>'
|
patronBlock = r'Risoluzione(?P<block>.*?)</ul>'
|
||||||
elif item.args == 'years':
|
|
||||||
item.contentType = 'undefined'
|
action = 'movies'
|
||||||
patronBlock = r'ANNO(?P<block>.*?</section>)'
|
|
||||||
else:
|
|
||||||
patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu'
|
|
||||||
action = 'peliculas'
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def movies(item):
|
||||||
|
item.quality = 'HD'
|
||||||
|
json = {}
|
||||||
|
if not item.page: item.page = 1
|
||||||
|
params ={'type':item.contentType, 'anno':item.year_id, 'quality':item.quality_id, 'cat':item.cat_id, 'order':order, 'page':item.page}
|
||||||
|
# debug = True
|
||||||
|
|
||||||
|
action = 'findvideos' if item.contentType == 'movie' else 'episodes'
|
||||||
|
|
||||||
|
try:
|
||||||
|
# support.dbg()
|
||||||
|
if item.args in ['search']:
|
||||||
|
page = support.httptools.downloadpage(item.url, headers=headers)
|
||||||
|
if page.json:
|
||||||
|
data = "\n".join(page.json['data'])
|
||||||
|
else:
|
||||||
|
data = page.data
|
||||||
|
else:
|
||||||
|
params['page'] = item.page
|
||||||
|
|
||||||
|
url = '{}/load-more-film?{}'.format(host, support.urlencode(params))
|
||||||
|
json = support.httptools.downloadpage(url, headers=headers).json
|
||||||
|
data = "\n".join(json['data'])
|
||||||
|
except:
|
||||||
|
data = ' '
|
||||||
|
|
||||||
|
patron = r'wrapFilm"[^>]*>\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){2,6}\s+<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA -]+))?'
|
||||||
|
# patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){3}(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
|
||||||
|
|
||||||
|
def itemHook(item):
|
||||||
|
item.quality = item.quality.replace('2K', 'HD').replace('4K', 'HD')
|
||||||
|
item.title = item.title.replace('2K', 'HD').replace('4K', 'HD')
|
||||||
|
return item
|
||||||
|
|
||||||
|
# paginazione
|
||||||
|
if json.get('have_next') or support.match(data, patron=r'have_next_film\s*=\s*true').match:
|
||||||
|
def fullItemlistHook(itemlist):
|
||||||
|
cat_id = support.match(data, patron=r''''cat':"(\d+)"''').match
|
||||||
|
if cat_id: item.cat_id = cat_id
|
||||||
|
item.page += 1
|
||||||
|
support.nextPage(itemlist, item, function_or_level='movies')
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
@support.scrape
|
||||||
|
def episodes(item):
|
||||||
logger.debug(item)
|
logger.debug(item)
|
||||||
|
# debug = True
|
||||||
data = item.data
|
data = item.data
|
||||||
patron = r'class="playtvshow " data-href="(?P<url>[^"]+)'
|
patron = r'class="playtvshow "\s+data-href="(?P<url>[^"]+)'
|
||||||
|
|
||||||
def itemHook(it):
|
def itemHook(it):
|
||||||
spl = it.url.split('/')[-2:]
|
spl = it.url.split('/')[-2:]
|
||||||
@@ -213,16 +156,6 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def check(item):
|
|
||||||
resolve_url(item)
|
|
||||||
if '/tvshow' in item.url:
|
|
||||||
item.contentType = 'tvshow'
|
|
||||||
return episodios(item)
|
|
||||||
else:
|
|
||||||
item.contentType = 'movie'
|
|
||||||
return findvideos(item)
|
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
resolve_url(item)
|
resolve_url(item)
|
||||||
@@ -234,19 +167,106 @@ def findvideos(item):
|
|||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
if host in item.url: # intercetto il server proprietario
|
if host in item.url: # intercetto il server proprietario
|
||||||
if registerOrLogin():
|
# if registerOrLogin():
|
||||||
return support.get_jwplayer_mediaurl(support.httptools.downloadpage(item.url, cloudscraper=True).data, 'Diretto')
|
return support.get_jwplayer_mediaUrl(support.httptools.downloadpage(item.url, cloudscraper=True).data, 'Diretto')
|
||||||
else:
|
# else:
|
||||||
platformtools.play_canceled = True
|
# platformtools.playCanceled = True
|
||||||
return []
|
# return []
|
||||||
else:
|
else:
|
||||||
return [item]
|
return [item]
|
||||||
|
|
||||||
|
|
||||||
def resolve_url(item):
|
def resolve_url(item):
|
||||||
|
registerOrLogin()
|
||||||
if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url:
|
if '/watch-unsubscribed' not in item.url and '/watch-external' not in item.url:
|
||||||
playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)')
|
playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)')
|
||||||
video_url = playWindow.match
|
videoUrl = playWindow.match
|
||||||
item.data = playWindow.data
|
item.data = playWindow.data
|
||||||
item.url = video_url.replace('/watch-unsubscribed', '/watch-external')
|
item.url = videoUrl.replace('/watch-unsubscribed', '/watch-external')
|
||||||
return item
|
return item
|
||||||
|
|
||||||
|
|
||||||
|
def login():
|
||||||
|
r = support.httptools.downloadpage(host, cloudscraper=True)
|
||||||
|
Token = support.match(r.data, patron=r'name=\s*"_token"\s*value=\s*"([^"]+)', cloudscraper=True).match
|
||||||
|
if 'id="logged"' in r.data:
|
||||||
|
logger.info('Già loggato')
|
||||||
|
else:
|
||||||
|
logger.info('Login in corso')
|
||||||
|
post = {'_token': '',
|
||||||
|
'form_action':'login',
|
||||||
|
'email': config.getSetting('username', channel='altadefinizionecommunity'),
|
||||||
|
'password':config.getSetting('password', channel='altadefinizionecommunity')}
|
||||||
|
|
||||||
|
r = support.httptools.downloadpage(host + '/login', post=post, headers={'referer': host}, cloudscraper=True)
|
||||||
|
if r.code not in [200, 302] or 'Email o Password non validi' in r.data:
|
||||||
|
platformtools.dialogOk('AltadefinizioneCommunity', 'Username/password non validi')
|
||||||
|
return False
|
||||||
|
|
||||||
|
return 'id="logged"' in r.data
|
||||||
|
|
||||||
|
|
||||||
|
def registerOrLogin():
|
||||||
|
if config.getSetting('username', channel='altadefinizionecommunity') and config.getSetting('password', channel='altadefinizionecommunity'):
|
||||||
|
if login():
|
||||||
|
return True
|
||||||
|
|
||||||
|
action = platformtools.dialogYesNo('AltadefinizioneCommunity',
|
||||||
|
'Questo server necessita di un account, ne hai già uno oppure vuoi tentare una registrazione automatica?',
|
||||||
|
yeslabel='Accedi', nolabel='Tenta registrazione', customlabel='Annulla')
|
||||||
|
if action == 1: # accedi
|
||||||
|
from specials import setting
|
||||||
|
from core.item import Item
|
||||||
|
user_pre = config.getSetting('username', channel='altadefinizionecommunity')
|
||||||
|
password_pre = config.getSetting('password', channel='altadefinizionecommunity')
|
||||||
|
setting.channel_config(Item(config='altadefinizionecommunity'))
|
||||||
|
user_post = config.getSetting('username', channel='altadefinizionecommunity')
|
||||||
|
password_post = config.getSetting('password', channel='altadefinizionecommunity')
|
||||||
|
|
||||||
|
if user_pre != user_post or password_pre != password_post:
|
||||||
|
return registerOrLogin()
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
elif action == 0: # tenta registrazione
|
||||||
|
import random
|
||||||
|
import string
|
||||||
|
logger.debug('Registrazione automatica in corso')
|
||||||
|
mailbox = Gmailnator()
|
||||||
|
randPsw = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(10))
|
||||||
|
logger.debug('email: ' + mailbox.address)
|
||||||
|
logger.debug('pass: ' + randPsw)
|
||||||
|
reg = platformtools.dialogRegister(register_url, email=True, password=True, email_default=mailbox.address, password_default=randPsw)
|
||||||
|
if not reg:
|
||||||
|
return False
|
||||||
|
regPost = httptools.downloadpage(register_url, post={'email': reg['email'], 'password': reg['password']}, cloudscraper=True)
|
||||||
|
|
||||||
|
if regPost.url == register_url:
|
||||||
|
error = scrapertools.htmlclean(scrapertools.find_single_match(regPost.data, 'Impossibile proseguire.*?</div>'))
|
||||||
|
error = scrapertools.unescape(scrapertools.re.sub('\n\s+', ' ', error))
|
||||||
|
platformtools.dialogOk('AltadefinizioneCommunity', error)
|
||||||
|
return False
|
||||||
|
if reg['email'] == mailbox.address:
|
||||||
|
if "L'indirizzo email risulta già registrato" in regPost.data:
|
||||||
|
# httptools.downloadpage(baseUrl + '/forgotPassword', post={'email': reg['email']})
|
||||||
|
platformtools.dialogOk('AltadefinizioneCommunity', 'Indirizzo mail già utilizzato')
|
||||||
|
return False
|
||||||
|
mail = mailbox.waitForMail()
|
||||||
|
if mail:
|
||||||
|
checkUrl = scrapertools.find_single_match(mail.body, '<a href="([^"]+)[^>]+>Verifica').replace(r'\/', '/')
|
||||||
|
logger.debug('CheckURL: ' + checkUrl)
|
||||||
|
httptools.downloadpage(checkUrl, cloudscraper=True)
|
||||||
|
config.setSetting('username', mailbox.address, channel='altadefinizionecommunity')
|
||||||
|
config.setSetting('password', randPsw, channel='altadefinizionecommunity')
|
||||||
|
platformtools.dialogOk('AltadefinizioneCommunity',
|
||||||
|
'Registrato automaticamente con queste credenziali:\nemail:' + mailbox.address + '\npass: ' + randPsw)
|
||||||
|
else:
|
||||||
|
platformtools.dialogOk('AltadefinizioneCommunity', 'Impossibile registrarsi automaticamente')
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
platformtools.dialogOk('AltadefinizioneCommunity', 'Hai modificato la mail quindi KoD non sarà in grado di effettuare la verifica in autonomia, apri la casella ' + reg['email']
|
||||||
|
+ ' e clicca sul link. Premi ok quando fatto')
|
||||||
|
logger.debug('Registrazione completata')
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"id": "animealtadefinizione",
|
"id": "animealtadefinizione",
|
||||||
"name": "AnimealtAdefinizione",
|
"name": "AnimealtaDefinizione",
|
||||||
"active": true,
|
"active": true,
|
||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "animealtadefinizione.png",
|
"thumbnail": "animealtadefinizione.png",
|
||||||
"banner": "animealtadefinizione.png",
|
"banner": "animealtadefinizione.png",
|
||||||
"categories": ["anime", "sub-ita"],
|
"categories": ["anime", "sub"],
|
||||||
"default_off": ["include_in_newest"],
|
"default_off": ["include_in_newest"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,13 +3,15 @@
|
|||||||
# Canale per animealtadefinizione
|
# Canale per animealtadefinizione
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
|
from platformcode import platformtools
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
perpage_list = ['20','30','40','50','60','70','80','90','100']
|
perpage_list = ['20','30','40','50','60','70','80','90','100']
|
||||||
perpage = perpage_list[support.config.get_setting('perpage' , 'animealtadefinizione')]
|
perpage = perpage_list[support.config.getSetting('perpage' , 'animealtadefinizione')]
|
||||||
epPatron = r'<td>\s*(?P<title>[^<]+)[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
epPatron = r'<td>\s*(?P<title>[^<]+)[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
||||||
|
|
||||||
|
|
||||||
@@ -19,49 +21,51 @@ def mainlist(item):
|
|||||||
('Tipo',['', 'menu', 'Anime']),
|
('Tipo',['', 'menu', 'Anime']),
|
||||||
('Anno',['', 'menu', 'Anno']),
|
('Anno',['', 'menu', 'Anno']),
|
||||||
('Genere', ['', 'menu','Genere']),
|
('Genere', ['', 'menu','Genere']),
|
||||||
('Ultimi Episodi',['', 'peliculas', 'last'])]
|
('Ultimi Episodi',['', 'movies', 'last'])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock= r'<a href="' + host + r'/category/' + item.args.lower() + r'/">' + item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>'
|
patronBlock= r'<a href="' + host + r'/category/' + item.args.lower() + r'/">' + item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>'
|
||||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
if 'genere' in item.args.lower():
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info(texto)
|
logger.debug(text)
|
||||||
item.search = texto
|
item.search = text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host
|
item.url = host
|
||||||
item.args = "last"
|
item.args = "last"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
if '/movie/' in item.url:
|
if '/movie/' in item.url:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
action='findvideos'
|
action='findvideos'
|
||||||
@@ -70,17 +74,22 @@ def peliculas(item):
|
|||||||
action='findvideos'
|
action='findvideos'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
action='episodios'
|
action='episodes'
|
||||||
if item.search:
|
if item.search:
|
||||||
query = 's'
|
query = 's'
|
||||||
searchtext = item.search
|
searchtext = item.search
|
||||||
else:
|
else:
|
||||||
query='category_name'
|
query='category_name'
|
||||||
searchtext = item.url.split('/')[-2]
|
searchtext = item.url.split('/')[-2]
|
||||||
if not item.pag: item.pag = 1
|
|
||||||
# debug = True
|
page = 1 if not item.page else item.page
|
||||||
anime = True
|
|
||||||
data = support.match(host + '/wp-admin/admin-ajax.php', post='action=itajax-sort&loop=main+loop&location=&thumbnail=1&rating=1sorter=recent&columns=4&numarticles='+perpage+'&paginated='+str(item.pag)+'¤tquery%5B'+query+'%5D='+searchtext).data.replace('\\','')
|
numerationEnabled = True
|
||||||
|
post = 'action=itajax-sort&loop=main+loop&location=&thumbnail=1&rating=1sorter=recent&columns=4&numarticles={}&paginated={}¤tquery%5B{}%5D={}'.format(perpage, page, query, searchtext)
|
||||||
|
res = support.match(host + '/wp-admin/admin-ajax.php', post=post, patron=r'"pages":(\d+)')
|
||||||
|
data= res.data.replace('\\','')
|
||||||
|
# item.total_pages = int(res.match)
|
||||||
|
|
||||||
patron = r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>[^"]+?)\s+(?P<type>Movie)?\s*(?P<lang>Sub Ita|Ita)?\s*[sS]treaming'
|
patron = r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>[^"]+?)\s+(?P<type>Movie)?\s*(?P<lang>Sub Ita|Ita)?\s*[sS]treaming'
|
||||||
typeContentDict = {'movie':['movie']}
|
typeContentDict = {'movie':['movie']}
|
||||||
typeActionDict = {'findvideos':['movie']}
|
typeActionDict = {'findvideos':['movie']}
|
||||||
@@ -89,16 +98,15 @@ def peliculas(item):
|
|||||||
if item.search:
|
if item.search:
|
||||||
itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ]
|
itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ]
|
||||||
if len(itemlist) == int(perpage):
|
if len(itemlist) == int(perpage):
|
||||||
item.pag += 1
|
support.nextPage(itemlist, item, 'movies', page=page + 1, total_pages=int(res.match))
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas'))
|
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
pagination = int(perpage)
|
pagination = True
|
||||||
patron = epPatron
|
patron = epPatron
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -108,10 +116,9 @@ def findvideos(item):
|
|||||||
if item.contentType == 'movie':
|
if item.contentType == 'movie':
|
||||||
matches = support.match(item, patron=epPatron).matches
|
matches = support.match(item, patron=epPatron).matches
|
||||||
for title, url in matches:
|
for title, url in matches:
|
||||||
# support.dbg()
|
|
||||||
get_video_list(item, url, title, itemlist)
|
get_video_list(item, url, title, itemlist)
|
||||||
else:
|
else:
|
||||||
get_video_list(item, item.url, support.config.get_localized_string(30137), itemlist)
|
get_video_list(item, item.url, support.config.getLocalizedString(30137), itemlist)
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# Canale per AnimeForce
|
# Canale per AnimeForce
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import scrapertools, support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -12,74 +13,76 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
anime = ['/lista-anime/',
|
anime = ['/lista-anime/',
|
||||||
('In Corso',['/anime/anime-status/in-corso/', 'peliculas', 'status']),
|
('In Corso',['/anime/anime-status/in-corso/', 'movies', 'status']),
|
||||||
('Completi',['/anime/anime-status/completo/', 'peliculas', 'status']),
|
('Completi',['/anime/anime-status/completo/', 'movies', 'status']),
|
||||||
('Genere',['/anime', 'submenu', 'genre']),
|
('Genere',['/anime', 'submenu', 'genre']),
|
||||||
('Anno',['/anime', 'submenu', 'anime-year']),
|
('Anno',['/anime', 'submenu', 'anime-year']),
|
||||||
('Tipologia',['/anime', 'submenu', 'anime-type']),
|
('Tipologia',['/anime', 'submenu', 'anime-type']),
|
||||||
('Stagione',['/anime', 'submenu', 'anime-season']),
|
('Stagione',['/anime', 'submenu', 'anime-season']),
|
||||||
('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last'])
|
('Ultime Serie',['/category/anime/articoli-principali/','movies','last'])
|
||||||
]
|
]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def submenu(item):
|
def submenu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select'
|
patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select'
|
||||||
patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<t>[^(]+)[^\(]+\((?P<num>\d+)'
|
patronMenu = r'<option class="level-\d+ (?P<u>[^"]+)"[^>]+>(?P<title>[^(]+)[^\(]+\((?P<num>\d+)'
|
||||||
|
if 'genre' in item.args:
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.url += host + '/anime/' + item.args + '/' + item.u
|
item.url += host + '/anime/' + item.args + '/' + item.u
|
||||||
item.title = support.typo(item.t, 'bold')
|
# item.title = support.typo(item.t, 'bold')
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host
|
item.url = host
|
||||||
item.args = 'newest'
|
item.args = 'newest'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search',text)
|
logger.debug(text)
|
||||||
item.search = text
|
item.search = text
|
||||||
item.url = host + '/lista-anime/'
|
item.url = host + '/lista-anime/'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
search = item.search
|
search = item.search
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
if 'movie' in item.url:
|
if 'movie' in item.url:
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
action = 'check'
|
action = 'check'
|
||||||
|
|
||||||
if not item.args:
|
if not item.args:
|
||||||
pagination = ''
|
pagination = True
|
||||||
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
|
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
|
||||||
else:
|
else:
|
||||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
||||||
@@ -88,7 +91,6 @@ def peliculas(item):
|
|||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if 'sub-ita' in item.url:
|
if 'sub-ita' in item.url:
|
||||||
if item.args != 'newest': item.title = item.title + support.typo('Sub-ITA','_ [] color kod')
|
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
return item
|
return item
|
||||||
|
|
||||||
@@ -102,29 +104,45 @@ def check(item):
|
|||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
else:
|
else:
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
|
def episodes(item):
|
||||||
|
@support.scrape
|
||||||
|
def _episodes(item):
|
||||||
|
actLike = 'episodes'
|
||||||
|
disableAll = True
|
||||||
|
data = item.data
|
||||||
|
|
||||||
|
if '<h6>Streaming</h6>' in data:
|
||||||
|
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<episode>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
|
||||||
|
else:
|
||||||
|
patron = r'<a\s*href="(?P<url>[^"]+)"[^>]+>(?P<episode>\d+)[<-](?P<episode2>\d+)?'
|
||||||
|
|
||||||
|
def itemHook(item):
|
||||||
|
if item.url.startswith('//'): item.url= 'https:' + item.url
|
||||||
|
elif item.url.startswith('/'): item.url= 'https:/' + item.url
|
||||||
|
return item
|
||||||
|
action = 'findvideos'
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
itemlist = support.itemlistdb() if item.itemlist else []
|
||||||
|
groups = support.match(item.data, patron=[r'"tabpanel">.*?</div', r'Special-tab">.*?</div']).matches
|
||||||
|
for group in groups:
|
||||||
|
item.data = group
|
||||||
|
if 'Special' in group:
|
||||||
|
item.contentSeason = 0
|
||||||
|
itemlist.extend(_episodes(item))
|
||||||
|
|
||||||
|
from platformcode.autorenumber import start
|
||||||
|
start(itemlist, item)
|
||||||
|
itemlist = support.season_pagination(itemlist, item, function_level='episodes')
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
def episodios(item):
|
|
||||||
anime = True
|
|
||||||
data = item.data
|
|
||||||
|
|
||||||
if '<h6>Streaming</h6>' in data:
|
|
||||||
patron = r'<td style[^>]+>\s*.*?(?:<span[^>]+)?<strong>(?P<title>[^<]+)<\/strong>.*?<td style[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>'
|
|
||||||
else:
|
|
||||||
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">'
|
|
||||||
def itemHook(item):
|
|
||||||
support.info(item)
|
|
||||||
if item.url.startswith('//'): item.url= 'https:' + item.url
|
|
||||||
elif item.url.startswith('/'): item.url= 'https:/' + item.url
|
|
||||||
return item
|
|
||||||
action = 'findvideos'
|
|
||||||
return locals()
|
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info(item)
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
if 'adf.ly' in item.url:
|
if 'adf.ly' in item.url:
|
||||||
@@ -150,6 +168,6 @@ def findvideos(item):
|
|||||||
if url.startswith('//'): url = 'https:' + url
|
if url.startswith('//'): url = 'https:' + url
|
||||||
elif url.startswith('/'): url = 'https:/' + url
|
elif url.startswith('/'): url = 'https:/' + url
|
||||||
if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
|
if 'vvvvid' in url: itemlist.append(item.clone(action="play", title='VVVVID', url=url, server='vvvvid'))
|
||||||
else: itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), url=url, server='directo'))
|
else: itemlist.append(item.clone(action="play", title=support.config.getLocalizedString(30137), url=url, server='directo'))
|
||||||
|
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "animepertutti.png",
|
"thumbnail": "animepertutti.png",
|
||||||
"bannermenu": "animepertutti.png",
|
"bannermenu": "animepertutti.png",
|
||||||
"categories": ["anime", "vos"],
|
"categories": ["anime", "sub"],
|
||||||
"not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime"],
|
"not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
from lib.js2py.host import jsfunctions
|
from lib.js2py.host import jsfunctions
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
@@ -19,29 +20,29 @@ headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
anime = [
|
anime = [
|
||||||
# ('Leggendari', ['/category/anime-leggendari/', 'peliculas']),
|
# ('Leggendari', ['/category/anime-leggendari/', 'movies']),
|
||||||
('ITA', ['/category/anime-ita/', 'peliculas']),
|
('ITA', ['/category/anime-ita/', 'movies']),
|
||||||
('SUB-ITA', ['/category/anime-sub-ita/', 'peliculas']),
|
('SUB-ITA', ['/category/anime-sub-ita/', 'movies']),
|
||||||
('Conclusi', ['/category/serie-anime-concluse/', 'peliculas']),
|
('Conclusi', ['/category/serie-anime-concluse/', 'movies']),
|
||||||
('in Corso', ['/category/serie-anime-in-corso/', 'peliculas']),
|
('in Corso', ['/category/serie-anime-in-corso/', 'movies']),
|
||||||
('Genere', ['', 'genres'])
|
('Genere', ['', 'genres'])
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info(texto)
|
logger.debug(text)
|
||||||
|
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@@ -50,20 +51,20 @@ def genres(item):
|
|||||||
blacklist = ['Contattaci','Privacy Policy', 'DMCA']
|
blacklist = ['Contattaci','Privacy Policy', 'DMCA']
|
||||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
patronBlock = r'Generi</a>\s*<ul[^>]+>(?P<block>.*?)<\/ul>'
|
patronBlock = r'Generi</a>\s*<ul[^>]+>(?P<block>.*?)<\/ul>'
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
blacklist = ['top 10 anime da vedere']
|
blacklist = ['top 10 anime da vedere']
|
||||||
if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside'
|
if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside'
|
||||||
patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)">\s*<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+'
|
patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)">\s*<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if 'movie' in item.title.lower():
|
if 'movie' in item.title.lower():
|
||||||
item.title = support.re.sub(' - [Mm][Oo][Vv][Ii][Ee]|[Mm][Oo][Vv][Ii][Ee]','',item.title)
|
item.title = support.re.sub(' - [Mm][Oo][Vv][Ii][Ee]|[Mm][Oo][Vv][Ii][Ee]','',item.title)
|
||||||
item.title += support.typo('Movie','_ () bold')
|
# item.title += support.typo('Movie','_ () bold')
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.action = 'findvideos'
|
item.action = 'findvideos'
|
||||||
return item
|
return item
|
||||||
@@ -75,15 +76,15 @@ def peliculas(item):
|
|||||||
return itlist
|
return itlist
|
||||||
|
|
||||||
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
data = support.match(item, headers=headers, patronBlock=r'entry-content clearfix">(.*?)class="mh-widget mh-posts-2 widget_text').block
|
data = support.match(item, headers=headers, patronBlock=r'entry-content clearfix">(.*?)class="mh-widget mh-posts-2 widget_text').block
|
||||||
if not 'pagination clearfix' in data:
|
if not 'pagination clearfix' in data:
|
||||||
support.info('NOT IN DATA')
|
logger.debug('NOT IN DATA')
|
||||||
patron = r'<iframe.*?src="(?P<url>[^"]+)"'
|
patron = r'<iframe.*?src="(?P<url>[^"]+)"'
|
||||||
title = item.title
|
title = item.title
|
||||||
def fullItemlistHook(itemlist):
|
def fullItemlistHook(itemlist):
|
||||||
@@ -100,17 +101,17 @@ def episodios(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
else:
|
else:
|
||||||
url = item.url
|
url = item.url
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
patronBlock = r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(?P<block>.*?)</span></a></div>'
|
patronBlock = r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(?P<block>.*?)</span></a></div>'
|
||||||
patron = r'(?:<a href="(?P<url>[^"]+)"[^>]+>)?<span class="pagelink">(?P<episode>\d+)'
|
patron = r'(?:<a href="(?P<url>[^"]+)"[^>]+>)?<span class="pagelink">(?P<episode>\d+)'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if not item.url:
|
if not item.url:
|
||||||
item.url = url
|
item.url = url
|
||||||
if 'Movie Parte' in data:
|
if 'Movie Parte' in data:
|
||||||
item.title = support.typo(item.fulltitle + ' - Part ','bold') + item.title
|
item.title = item.fulltitle + ' - Part ' + item.title
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
else:
|
else:
|
||||||
item.title = support.typo('Episodio ', 'bold') + item.title
|
item.title = 'Episodio ' + item.title
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -124,7 +125,7 @@ def check(item):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
if item.data:
|
if item.data:
|
||||||
data = item.data
|
data = item.data
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -3,26 +3,23 @@
|
|||||||
# Canale per AnimeSaturn
|
# Canale per AnimeSaturn
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
from lib import js2py
|
|
||||||
from core import support
|
from core import support
|
||||||
from platformcode import config
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
__channel__ = 'animesaturn'
|
__channel__ = 'animesaturn'
|
||||||
cookie = support.config.get_setting('cookie', __channel__)
|
cookie = support.config.getSetting('cookie', __channel__)
|
||||||
headers = {'X-Requested-With': 'XMLHttpRequest', 'Cookie': cookie}
|
headers = {'X-Requested-With': 'XMLHttpRequest', 'Cookie': cookie}
|
||||||
|
|
||||||
|
|
||||||
def get_cookie(data):
|
def get_cookie(data):
|
||||||
global cookie, headers
|
global cookie, headers
|
||||||
cookie = support.match(data, patron=r'document.cookie="([^\s]+)').match
|
cookie = support.match(data, patron=r'document.cookie="([^\s]+)').match
|
||||||
support.config.set_setting('cookie', cookie, __channel__)
|
support.config.setSetting('cookie', cookie, __channel__)
|
||||||
headers = [['Cookie', cookie]]
|
headers = [['Cookie', cookie]]
|
||||||
|
|
||||||
|
|
||||||
def get_data(item):
|
def get_data(item):
|
||||||
# support.dbg()
|
|
||||||
# url = support.match(item.url, headers=headers, follow_redirects=True, only_headers=True).url
|
|
||||||
data = support.match(item.url, headers=headers, follow_redirects=True).data
|
data = support.match(item.url, headers=headers, follow_redirects=True).data
|
||||||
if 'ASCookie' in data:
|
if 'ASCookie' in data:
|
||||||
get_cookie(data)
|
get_cookie(data)
|
||||||
@@ -37,40 +34,40 @@ def mainlist(item):
|
|||||||
('ITA',['', 'submenu', '/filter?language%5B0%5D=1']),
|
('ITA',['', 'submenu', '/filter?language%5B0%5D=1']),
|
||||||
('SUB-ITA',['', 'submenu', '/filter?language%5B0%5D=0']),
|
('SUB-ITA',['', 'submenu', '/filter?language%5B0%5D=0']),
|
||||||
('Più Votati',['/toplist','menu', 'top']),
|
('Più Votati',['/toplist','menu', 'top']),
|
||||||
('In Corso',['/animeincorso','peliculas','incorso']),
|
('In Corso',['/animeincorso','movies','incorso']),
|
||||||
('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','peliculas','updated'])]
|
('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','movies','updated'])]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info(texto)
|
logger.debug(text)
|
||||||
item.url = host + '/animelist?search=' + texto
|
item.url = host + '/animelist?search=' + text
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info()
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host + '/fetch_pages.php?request=episodes&d=1'
|
item.url = host + '/fetch_pages.php?request=episodes&d=1'
|
||||||
item.args = "updated"
|
item.args = "updated"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -82,7 +79,7 @@ def submenu(item):
|
|||||||
action = 'filter'
|
action = 'filter'
|
||||||
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<data>.*?)</select>'
|
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<data>.*?)</select>'
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='peliculas'))
|
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='movies'))
|
||||||
return itemlist[:-1]
|
return itemlist[:-1]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -91,15 +88,15 @@ def filter(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
matches = support.match(item.data if item.data else item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches
|
matches = support.match(item.data if item.data else item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches
|
||||||
for value, title in matches:
|
for value, title in matches:
|
||||||
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter'))
|
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='movies', args='filter'))
|
||||||
support.thumb(itemlist, genre=True)
|
support.thumb(itemlist, mode='genre')
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<other>.*?)(?:"lista-top"|"clearfix")'
|
patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<other>.*?)(?:"lista-top"|"clearfix")'
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
item.args = 'top'
|
item.args = 'top'
|
||||||
def itemHook(item2):
|
def itemHook(item2):
|
||||||
item2.url = item.url
|
item2.url = item.url
|
||||||
@@ -109,8 +106,8 @@ def menu(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
|
|
||||||
deflang= 'Sub-ITA'
|
deflang= 'Sub-ITA'
|
||||||
action = 'check'
|
action = 'check'
|
||||||
@@ -132,7 +129,7 @@ def peliculas(item):
|
|||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
if page:
|
if page:
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),page= page, thumbnail=support.thumb()))
|
itemlist.append(item.clone(title=support.typo(support.config.getLocalizedString(30992), 'color kod bold'),page= page, thumbnail=support.thumb()))
|
||||||
return itemlist
|
return itemlist
|
||||||
elif 'filter' in item.args:
|
elif 'filter' in item.args:
|
||||||
page = support.match(data, patron=r'totalPages:\s*(\d+)').match
|
page = support.match(data, patron=r'totalPages:\s*(\d+)').match
|
||||||
@@ -141,11 +138,11 @@ def peliculas(item):
|
|||||||
if item.nextpage: item.nextpage += 1
|
if item.nextpage: item.nextpage += 1
|
||||||
else: item.nextpage = 2
|
else: item.nextpage = 2
|
||||||
if page and item.nextpage < int(page):
|
if page and item.nextpage < int(page):
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), url= '{}&page={}'.format(item.url, item.nextpage), infoLabels={}, thumbnail=support.thumb()))
|
itemlist.append(item.clone(title=support.typo(support.config.getLocalizedString(30992), 'color kod bold'), url= '{}&page={}'.format(item.url, item.nextpage), infoLabels={}, thumbnail=support.thumb()))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
else:
|
else:
|
||||||
pagination = ''
|
pagination = True
|
||||||
if item.args == 'incorso':
|
if item.args == 'incorso':
|
||||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-za-z-]+)\))?</a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<(]+)(?:\s*\((?P<year>\d+)\))?(?:\s*\((?P<lang>[A-za-z-]+)\))?</a>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<'
|
||||||
else:
|
else:
|
||||||
@@ -158,72 +155,41 @@ def peliculas(item):
|
|||||||
def check(item):
|
def check(item):
|
||||||
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie')
|
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie')
|
||||||
if movie.match:
|
if movie.match:
|
||||||
episodes = episodios(item)
|
episodes = episodes(item)
|
||||||
if len(episodes) > 0:
|
if len(episodes) > 0:
|
||||||
it = episodes[0].clone(contentType = 'movie', contentTitle=item.fulltitle, contentSerieName='')
|
it = episodes[0].clone(contentType = 'movie', contentTitle=item.fulltitle, contentSerieName='')
|
||||||
return findvideos(it)
|
return findvideos(it)
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
if item.contentType != 'movie': anime = True
|
if item.contentType != 'movie': numerationEnabled = True
|
||||||
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
|
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
links = []
|
links = []
|
||||||
# page_data = ''
|
|
||||||
# titles =['Primario', 'Secondario', 'Alternativo Primario', 'Alternativo Secondario']
|
|
||||||
# pre_data = support.match(item, headers=headers).data
|
|
||||||
# url = support.match(pre_data , patron=r'<a href="([^"]+)">[^>]+>[^>]+>G').match
|
|
||||||
# urls = [url, url+'&extra=1', url+'&s=alt', url+'&s=alt&extra=1']
|
|
||||||
# links = []
|
|
||||||
# support.dbg()
|
|
||||||
# for i, url in enumerate(urls):
|
|
||||||
# data = support.match(url, headers=headers).data
|
|
||||||
# if not '&s' in url:
|
|
||||||
# link = support.match(data, patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers).match
|
|
||||||
# else:
|
|
||||||
# link = support.match(data, headers=headers, patron=r'file:\s*"([^"]+)"').match
|
|
||||||
# if not link:
|
|
||||||
# page_data += data
|
|
||||||
# if link and link not in links:
|
|
||||||
# links.append(link)
|
|
||||||
# # link += '|Referer=' + item.url
|
|
||||||
# itemlist.append(item.clone(action="play", title=titles[i], url=link, server='directo'))
|
|
||||||
|
|
||||||
# return support.server(item, data=data, itemlist=itemlist)
|
|
||||||
main_url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G').match
|
main_url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G').match
|
||||||
# internal = support.match(data, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G').match
|
|
||||||
urls = support.match(support.match(main_url, headers=headers).data, patron=r'<a class="dropdown-item"\s*href="([^"]+)', headers=headers).matches
|
urls = support.match(support.match(main_url, headers=headers).data, patron=r'<a class="dropdown-item"\s*href="([^"]+)', headers=headers).matches
|
||||||
itemlist.append(item.clone(action="play", title='Primario', url=main_url, server='directo'))
|
itemlist.append(item.clone(action="play", title='Primario', url=main_url, server='directo'))
|
||||||
itemlist.append(item.clone(action="play", title='Secondario', url=main_url + '&s=alt', server='directo'))
|
itemlist.append(item.clone(action="play", title='Secondario', url=main_url + '&s=alt', server='directo'))
|
||||||
# support.dbg()
|
|
||||||
# for i, url in enumerate(internal_urls):
|
|
||||||
# internal_data = support.match(url, headers=headers).data
|
|
||||||
# if not '&s' in url:
|
|
||||||
# link = support.match(internal_data, patron=r'(?:<source type="[^"]+"\s*src=|file:\s*)"([^"]+)"', headers=headers).match
|
|
||||||
# else:
|
|
||||||
# link = support.match(internal_data, headers=headers, patron=r'file:\s*"([^"]+)"').match
|
|
||||||
# if not link:
|
|
||||||
# links.append(internal_data)
|
|
||||||
# if link and link not in links:
|
|
||||||
# links.append(link)
|
|
||||||
# itemlist.append(item.clone(action="play", title=internal_titles[i], url=link, server='directo'))
|
|
||||||
# link = support.match(external[0], patron=r'href="([^"]+)', headers=headers, debug=True).match
|
|
||||||
# support.dbg()
|
|
||||||
for url in urls:
|
for url in urls:
|
||||||
link = support.match(url, patron=r'<a href="([^"]+)"[^>]+><button', headers=headers).match
|
link = support.match(url, patron=r'<a href="([^"]+)"[^>]+><button', headers=headers).match
|
||||||
if link:
|
if link:
|
||||||
links.append(link)
|
links.append(link)
|
||||||
return support.server(item, data=links, itemlist=itemlist)
|
return support.server(item, data=links, itemlist=itemlist)
|
||||||
|
|
||||||
|
def play(item):
|
||||||
|
if item.server == 'directo':
|
||||||
|
item.url = support.match(item.url, patron=r'(?:source type="[^"]+"\s*src=|file:[^"]+)"([^"]+)').match
|
||||||
|
return[item]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,9 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import cloudscraper, json, copy, inspect
|
import cloudscraper, json, copy, inspect
|
||||||
from core import jsontools, support, httptools, filetools
|
from core import jsontools, support, config
|
||||||
|
from core.httptools import downloadpage
|
||||||
from platformcode import autorenumber, logger
|
from platformcode import autorenumber, logger
|
||||||
import re
|
|
||||||
import xbmc
|
|
||||||
|
|
||||||
|
|
||||||
session = cloudscraper.create_scraper()
|
session = cloudscraper.create_scraper()
|
||||||
|
|
||||||
@@ -16,10 +14,10 @@ host = support.config.get_channel_url()
|
|||||||
response = session.get(host + '/archivio')
|
response = session.get(host + '/archivio')
|
||||||
csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match
|
csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match
|
||||||
headers = {'content-type': 'application/json;charset=UTF-8',
|
headers = {'content-type': 'application/json;charset=UTF-8',
|
||||||
|
'Referer': host,
|
||||||
'x-csrf-token': csrf_token,
|
'x-csrf-token': csrf_token,
|
||||||
'Cookie' : '; '.join([x.name + '=' + x.value for x in response.cookies])}
|
'Cookie' : '; '.join([x.name + '=' + x.value for x in response.cookies])}
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
top = [('Ultimi Episodi', ['', 'news'])]
|
top = [('Ultimi Episodi', ['', 'news'])]
|
||||||
@@ -33,8 +31,9 @@ def mainlist(item):
|
|||||||
search =''
|
search =''
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def menu(item):
|
def menu(item):
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
ITA = copy.copy(item.args)
|
ITA = copy.copy(item.args)
|
||||||
ITA['title'] = '(ita)'
|
ITA['title'] = '(ita)'
|
||||||
InCorso = copy.copy(item.args)
|
InCorso = copy.copy(item.args)
|
||||||
@@ -42,30 +41,29 @@ def menu(item):
|
|||||||
Terminato = copy.copy(item.args)
|
Terminato = copy.copy(item.args)
|
||||||
Terminato['status'] = 'Terminato'
|
Terminato['status'] = 'Terminato'
|
||||||
itemlist = [item.clone(title=support.typo('Tutti','bold')),
|
itemlist = [item.clone(title=support.typo('Tutti','bold')),
|
||||||
item.clone(title=support.typo('ITA','bold'), args=ITA),
|
item.clone(title='ITA', args=ITA),
|
||||||
item.clone(title=support.typo('Genere','bold'), action='genres'),
|
item.clone(title='Genere', action='genres'),
|
||||||
item.clone(title=support.typo('Anno','bold'), action='years')]
|
item.clone(title='Anno', action='years')]
|
||||||
if item.contentType == 'tvshow':
|
if item.contentType == 'tvshow':
|
||||||
itemlist += [item.clone(title=support.typo('In Corso','bold'), args=InCorso),
|
itemlist += [item.clone(title='In Corso', args=InCorso),
|
||||||
item.clone(title=support.typo('Terminato','bold'), args=Terminato)]
|
item.clone(title='Terminato', args=Terminato)]
|
||||||
itemlist +=[item.clone(title=support.typo('Cerca...','bold'), action='search', thumbnail=support.thumb('search'))]
|
itemlist +=[item.clone(title=support.typo(config.getLocalizedString(70741).replace(' %s', '…'),'bold'), action='search', thumbnail=support.thumb('search'))]
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
# support.dbg()
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
genres = json.loads(support.match(response.text, patron='genres="([^"]+)').match.replace('"','"'))
|
genres = json.loads(support.match(response.text, patron='genres="([^"]+)').match.replace('"','"'))
|
||||||
|
|
||||||
for genre in genres:
|
for genre in genres:
|
||||||
item.args['genres'] = [genre]
|
item.args['genres'] = [genre]
|
||||||
itemlist.append(item.clone(title=support.typo(genre['name'],'bold'), action='peliculas'))
|
itemlist.append(item.clone(title=genre['name'], action='movies'))
|
||||||
return support.thumb(itemlist)
|
return support.thumb(itemlist)
|
||||||
|
|
||||||
def years(item):
|
def years(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -74,12 +72,12 @@ def years(item):
|
|||||||
|
|
||||||
for year in list(reversed(range(oldest_year, current_year + 1))):
|
for year in list(reversed(range(oldest_year, current_year + 1))):
|
||||||
item.args['year']=year
|
item.args['year']=year
|
||||||
itemlist.append(item.clone(title=support.typo(year,'bold'), action='peliculas'))
|
itemlist.append(item.clone(title=year, action='movies'))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', item)
|
logger.debug(text)
|
||||||
if not item.args:
|
if not item.args:
|
||||||
item.args = {'title':text}
|
item.args = {'title':text}
|
||||||
else:
|
else:
|
||||||
@@ -87,17 +85,17 @@ def search(item, text):
|
|||||||
item.search = text
|
item.search = text
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.debug('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
item.url = host
|
item.url = host
|
||||||
@@ -111,50 +109,55 @@ def newest(categoria):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info(line)
|
logger.debug(line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def news(item):
|
def news(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
item.contentType = 'episode'
|
item.contentType = 'episode'
|
||||||
itemlist = []
|
itemlist = []
|
||||||
import cloudscraper
|
import cloudscraper
|
||||||
session = cloudscraper.create_scraper()
|
session = cloudscraper.create_scraper()
|
||||||
|
|
||||||
fullJs = json.loads(support.match(session.get(item.url).text, headers=headers, patron=r'items-json="([^"]+)"').match.replace('"','"'))
|
fullJs = json.loads(support.match(session.get(item.url).text, headers=headers, patron=r'items-json="([^"]+)"').match.replace('"','"'))
|
||||||
|
# logger.debug(jsontools.dump(fullJs))
|
||||||
js = fullJs['data']
|
js = fullJs['data']
|
||||||
|
|
||||||
for it in js:
|
for it in js:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title= support.typo(it['anime']['title'] + ' - EP. ' + it['number'], 'bold'),
|
item.clone(title=it['anime']['title'],
|
||||||
|
contentTitle = it['anime']['title'],
|
||||||
|
contentEpisodeNumber = int(it['number']),
|
||||||
fulltitle=it['anime']['title'],
|
fulltitle=it['anime']['title'],
|
||||||
thumbnail=it['anime']['imageurl'],
|
thumbnail=it['anime']['imageurl'],
|
||||||
forcethumb = True,
|
forcethumb = True,
|
||||||
video_url=it['scws_id'],
|
videoUrl=it['scws_id'],
|
||||||
plot=it['anime']['plot'],
|
plot=it['anime']['plot'],
|
||||||
action='findvideos')
|
action='findvideos')
|
||||||
)
|
)
|
||||||
if 'next_page_url' in fullJs:
|
if fullJs.get('next_page_url'):
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),thumbnail=support.thumb(), url=fullJs['next_page_url']))
|
support.nextPage(itemlist, item, 'news', next_page=fullJs['next_page_url'], total_pages=int(fullJs['last_page_url'].split('=')[-1]))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
page = item.page if item.page else 0
|
page = item.page if item.page else 0
|
||||||
item.args['offset'] = page * 30
|
item.args['offset'] = page * 30
|
||||||
|
|
||||||
order = support.config.get_setting('order', item.channel)
|
order = support.config.getSetting('order', item.channel)
|
||||||
if order:
|
if order:
|
||||||
order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ]
|
order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ]
|
||||||
item.args['order'] = order_list[order]
|
item.args['order'] = order_list[order]
|
||||||
|
|
||||||
payload = json.dumps(item.args)
|
payload = json.dumps(item.args)
|
||||||
records = session.post(host + '/archivio/get-animes', headers=headers, data=payload).json()['records']
|
js = session.post(host + '/archivio/get-animes', headers=headers, data=payload).json()
|
||||||
|
records = js['records']
|
||||||
|
total_pages = int(js['tot'] / 30)
|
||||||
|
|
||||||
for it in records:
|
for it in records:
|
||||||
logger.debug(jsontools.dump(it))
|
logger.debug(jsontools.dump(it))
|
||||||
@@ -164,53 +167,59 @@ def peliculas(item):
|
|||||||
if 'ita' in lang.lower(): language = 'ITA'
|
if 'ita' in lang.lower(): language = 'ITA'
|
||||||
else: language = 'Sub-ITA'
|
else: language = 'Sub-ITA'
|
||||||
|
|
||||||
itm = item.clone(title=support.typo(title,'bold') + support.typo(language,'_ [] color kod') + (support.typo(it['title_eng'],'_ ()') if it['title_eng'] else ''))
|
itm = item.clone(title=title,
|
||||||
itm.contentLanguage = language
|
contentLanguage = language,
|
||||||
itm.type = it['type']
|
type = it['type'],
|
||||||
itm.thumbnail = it['imageurl']
|
thumbnail = it['imageurl'],
|
||||||
itm.plot = it['plot']
|
plot = it['plot'],
|
||||||
itm.url = item.url
|
url = '{}/{}-{}'.format(item.url, it['id'], it['slug'])
|
||||||
|
)
|
||||||
|
# itm.contentLanguage = language
|
||||||
|
# itm.type = it['type']
|
||||||
|
# itm.thumbnail = it['imageurl']
|
||||||
|
# itm.plot = it['plot']
|
||||||
|
# itm.url = item.url
|
||||||
|
|
||||||
if it['episodes_count'] == 1:
|
if it['episodes_count'] == 1:
|
||||||
itm.contentType = 'movie'
|
itm.contentType = 'movie'
|
||||||
itm.fulltitle = itm.show = itm.contentTitle = title
|
itm.fulltitle = itm.show = itm.contentTitle = title
|
||||||
itm.contentSerieName = ''
|
itm.contentSerieName = ''
|
||||||
itm.action = 'findvideos'
|
itm.action = 'play'
|
||||||
itm.video_url = it['episodes'][0]['scws_id']
|
item.forcethumb=True
|
||||||
|
itm.videoUrl = it['episodes'][0]['scws_id']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
itm.contentType = 'tvshow'
|
itm.contentType = 'tvshow'
|
||||||
itm.contentTitle = ''
|
itm.contentTitle = ''
|
||||||
itm.fulltitle = itm.show = itm.contentSerieName = title
|
itm.fulltitle = itm.show = itm.contentSerieName = title
|
||||||
itm.action = 'episodios'
|
itm.action = 'episodes'
|
||||||
itm.episodes = it['episodes'] if 'episodes' in it else it['scws_id']
|
itm.episodes = it['episodes'] if 'episodes' in it else it['scws_id']
|
||||||
itm.video_url = item.url
|
# itm.videoUrl = item.url
|
||||||
|
|
||||||
itemlist.append(itm)
|
itemlist.append(itm)
|
||||||
|
|
||||||
autorenumber.start(itemlist)
|
autorenumber.start(itemlist)
|
||||||
if len(itemlist) >= 30:
|
if len(itemlist) == 30:
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page + 1))
|
support.nextPage(itemlist, item, 'movies', page=page + 1, total_pages=total_pages)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
|
# title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
|
||||||
for it in item.episodes:
|
for it in item.episodes:
|
||||||
|
|
||||||
|
episode2 = it['number'].split('.')[-1]
|
||||||
|
episode = it['number'].split('.')[0]
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=support.typo(title + it['number'], 'bold'),
|
item.clone(episodes = [],
|
||||||
episode = it['number'],
|
contentEpisodeNumber=int(float(it['number'])),
|
||||||
fulltitle=item.title,
|
episodeExtra = '.' + it['number'].split('.')[-1] if '.' in it['number'] else '',
|
||||||
show=item.title,
|
action='play',
|
||||||
contentTitle='',
|
|
||||||
contentSerieName=item.contentSerieName,
|
|
||||||
thumbnail=item.thumbnail,
|
|
||||||
plot=item.plot,
|
|
||||||
action='findvideos',
|
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
video_url=it['scws_id']))
|
forcethumb=True,
|
||||||
|
videoUrl=it['scws_id']))
|
||||||
|
|
||||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||||
autorenumber.start(itemlist, item)
|
autorenumber.start(itemlist, item)
|
||||||
@@ -219,68 +228,17 @@ def episodios(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def play(item):
|
||||||
# def calculateToken():
|
from time import time
|
||||||
# from time import time
|
from base64 import b64encode
|
||||||
# from base64 import b64encode as b64
|
from hashlib import md5
|
||||||
# import hashlib
|
|
||||||
# o = 48
|
|
||||||
# n = support.match('https://au-1.scws-content.net/get-ip').data
|
|
||||||
# i = 'Yc8U6r8KjAKAepEA'
|
|
||||||
# t = int(time() + (3600 * o))
|
|
||||||
# l = '{}{} {}'.format(t, n, i)
|
|
||||||
# md5 = hashlib.md5(l.encode())
|
|
||||||
# s = '?token={}&expires={}'.format(b64(md5.digest()).decode().replace('=', '').replace('+', "-").replace('\\', "_"), t)
|
|
||||||
# return s
|
|
||||||
# token = calculateToken()
|
|
||||||
|
|
||||||
# url = 'https://streamingcommunityws.com/master/{}{}'.format(item.video_url, token)
|
|
||||||
|
|
||||||
# # support.dbg()
|
|
||||||
|
|
||||||
# m3u8_original = httptools.downloadpage(url, CF=False).data
|
|
||||||
|
|
||||||
# m_video = re.search(r'\.\/video\/(\d+p)\/playlist.m3u8', m3u8_original)
|
|
||||||
# video_res = m_video.group(1)
|
|
||||||
# m_audio = re.search(r'\.\/audio\/(\d+k)\/playlist.m3u8', m3u8_original)
|
|
||||||
# audio_res = m_audio.group(1)
|
|
||||||
|
|
||||||
# # https://streamingcommunityws.com/master/5957?type=video&rendition=480p&token=wQLowWskEnbLfOfXXWWPGA&expires=1623437317
|
|
||||||
# video_url = 'https://streamingcommunityws.com/master/{}{}&type=video&rendition={}'.format(item.video_url, token, video_res)
|
|
||||||
# audio_url = 'https://streamingcommunityws.com/master/{}{}&type=audio&rendition={}'.format(item.video_url, token, audio_res)
|
|
||||||
|
|
||||||
# m3u8_original = m3u8_original.replace( m_video.group(0), video_url )
|
|
||||||
# m3u8_original = m3u8_original.replace( m_audio.group(0), audio_url )
|
|
||||||
|
|
||||||
# file_path = 'special://temp/animeunity.m3u8'
|
|
||||||
|
|
||||||
# filetools.write(xbmc.translatePath(file_path), m3u8_original, 'w')
|
|
||||||
|
|
||||||
# return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=file_path, manifest = 'hls', server='directo', action='play')])
|
|
||||||
# item.url=item.video_url
|
|
||||||
|
|
||||||
directLink = False
|
|
||||||
if item.video_url == None:
|
|
||||||
if item.extra == "tvshow":
|
|
||||||
epnum = item.episode
|
|
||||||
logger.info('it is a episode', epnum)
|
|
||||||
episode = None
|
|
||||||
for ep in item.episodes:
|
|
||||||
if ep["number"] == epnum:
|
|
||||||
episode = ep
|
|
||||||
break
|
|
||||||
if episode == None:
|
|
||||||
logger.warn('cannot found episode')
|
|
||||||
else:
|
|
||||||
item.url = episode["link"]
|
|
||||||
directLink = True
|
|
||||||
|
|
||||||
if directLink:
|
|
||||||
logger.info('try direct link')
|
|
||||||
return support.server(item, itemlist=[item.clone(title=support.config.get_localized_string(30137), url=item.url, server='directo', action='play')])
|
|
||||||
else:
|
|
||||||
return support.server(item, itemlist=[item.clone(title="StreamingCommunityWS", url=str(item.video_url), manifest = 'hls', server='streamingcommunityws', action='play')])
|
|
||||||
|
|
||||||
|
# Calculate Token
|
||||||
|
client_ip = support.httptools.downloadpage('https://scws.xyz/videos/{}'.format(item.videoUrl), headers=headers).json.get('client_ip')
|
||||||
|
expires = int(time() + 172800)
|
||||||
|
token = b64encode(md5('{}{} Yc8U6r8KjAKAepEA'.format(expires, client_ip).encode('utf-8')).digest()).decode('utf-8').replace('=', '').replace('+', '-').replace('/', '_')
|
||||||
|
|
||||||
|
url = 'https://scws.xyz/master/{}?token={}&expires={}&n=1'.format(item.videoUrl, token, expires)
|
||||||
|
|
||||||
|
return [item.clone(server='directo', url=url, manifest='hls')]
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "animeuniverse.png",
|
"thumbnail": "animeuniverse.png",
|
||||||
"banner": "animeuniverse.png",
|
"banner": "animeuniverse.png",
|
||||||
"categories": ["anime", "sub-ita"],
|
"categories": ["anime", "sub"],
|
||||||
"default_off": ["include_in_newest"],
|
"default_off": ["include_in_newest"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,13 +4,14 @@
|
|||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
perpage_list = ['20','30','40','50','60','70','80','90','100']
|
perpage_list = ['20','30','40','50','60','70','80','90','100']
|
||||||
perpage = perpage_list[support.config.get_setting('perpage' , 'animeuniverse')]
|
perpage = perpage_list[support.config.getSetting('perpage' , 'animeuniverse')]
|
||||||
epPatron = r'<td>\s*(?P<title>[^<]+)[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
epPatron = r'<td>\s*(?P<title>[^ <]+)\s*(?P<episode>\d+)?[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
@@ -19,50 +20,52 @@ def mainlist(item):
|
|||||||
('Tipo',['', 'menu', 'Anime']),
|
('Tipo',['', 'menu', 'Anime']),
|
||||||
('Anno',['', 'menu', 'Anno']),
|
('Anno',['', 'menu', 'Anno']),
|
||||||
('Genere', ['', 'menu','Genere']),
|
('Genere', ['', 'menu','Genere']),
|
||||||
('Ultimi Episodi',['/2/', 'peliculas', 'last']),
|
('Ultimi Episodi',['/2/', 'movies', 'last']),
|
||||||
('Hentai', ['/hentai/', 'peliculas'])]
|
('Hentai', ['/hentai/', 'movies'])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>'
|
patronBlock = item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>'
|
||||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
if 'genere' in item.args.lower():
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info(texto)
|
logger.debug(text)
|
||||||
item.search = texto
|
item.search = text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host
|
item.url = host
|
||||||
item.args = "last"
|
item.args = "last"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
query = ''
|
query = ''
|
||||||
if '/mos/' in item.url:
|
if '/mos/' in item.url:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
@@ -74,7 +77,7 @@ def peliculas(item):
|
|||||||
action='findvideos'
|
action='findvideos'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
action='episodios'
|
action='episodes'
|
||||||
if item.search:
|
if item.search:
|
||||||
query = 's'
|
query = 's'
|
||||||
searchtext = item.search
|
searchtext = item.search
|
||||||
@@ -83,7 +86,7 @@ def peliculas(item):
|
|||||||
searchtext = item.url.split('/')[-2] if item.url != host else ''
|
searchtext = item.url.split('/')[-2] if item.url != host else ''
|
||||||
if not item.pag: item.pag = 1
|
if not item.pag: item.pag = 1
|
||||||
|
|
||||||
anime=True
|
numerationEnabled = False
|
||||||
# blacklist=['Altri Hentai']
|
# blacklist=['Altri Hentai']
|
||||||
data = support.match(host + '/wp-content/themes/animeuniverse/functions/ajax.php', post='sorter=recent&location=&loop=main+loop&action=sort&numarticles='+perpage+'&paginated='+str(item.pag)+'¤tquery%5B'+query+'%5D='+searchtext+'&thumbnail=1').data.replace('\\','')
|
data = support.match(host + '/wp-content/themes/animeuniverse/functions/ajax.php', post='sorter=recent&location=&loop=main+loop&action=sort&numarticles='+perpage+'&paginated='+str(item.pag)+'¤tquery%5B'+query+'%5D='+searchtext+'&thumbnail=1').data.replace('\\','')
|
||||||
patron=r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>.*?)\s*(?P<lang>Sub ITA|ITA)?(?:"| \[)'
|
patron=r'<a href="(?P<url>[^"]+)"><img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)" class="[^"]+" alt="" title="(?P<title>.*?)\s*(?P<lang>Sub ITA|ITA)?(?:"| \[)'
|
||||||
@@ -91,7 +94,7 @@ def peliculas(item):
|
|||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
if len(itemlist) == int(perpage):
|
if len(itemlist) == int(perpage):
|
||||||
item.pag += 1
|
item.pag += 1
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas'))
|
itemlist.append(item.clone(title=support.typo(support.config.getLocalizedString(30992), 'color kod bold'), action='movies'))
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -99,9 +102,9 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
pagination = int(perpage)
|
pagination = True
|
||||||
patron = epPatron
|
patron = epPatron
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -113,7 +116,7 @@ def findvideos(item):
|
|||||||
for title, url in matches:
|
for title, url in matches:
|
||||||
get_video_list(url, title, itemlist)
|
get_video_list(url, title, itemlist)
|
||||||
else:
|
else:
|
||||||
get_video_list(item.url, support.config.get_localized_string(30137), itemlist)
|
get_video_list(item.url, support.config.getLocalizedString(30137), itemlist)
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "animeworld.png",
|
"thumbnail": "animeworld.png",
|
||||||
"banner": "animeworld.png",
|
"banner": "animeworld.png",
|
||||||
"categories": ["anime", "vos"],
|
"categories": ["anime", "sub"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"id": "order",
|
"id": "order",
|
||||||
|
|||||||
@@ -5,33 +5,35 @@
|
|||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
from core import httptools, support, jsontools
|
from core import httptools, support, jsontools
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
__channel__ = 'animeworld'
|
__channel__ = 'animeworld'
|
||||||
cookie = support.config.get_setting('cookie', __channel__)
|
cookie = support.config.getSetting('cookie', __channel__)
|
||||||
headers = [['Cookie', cookie]]
|
headers = [['Cookie', cookie]]
|
||||||
|
|
||||||
|
|
||||||
def get_cookie(data):
|
def get_cookie(data):
|
||||||
global cookie, headers
|
global cookie, headers
|
||||||
cookie = support.match(data, patron=r'document.cookie="([^\s]+)').match
|
cookie = support.match(data, patron=r'document.cookie="([^\s]+)').match
|
||||||
support.config.set_setting('cookie', cookie, __channel__)
|
support.config.setSetting('cookie', cookie, __channel__)
|
||||||
headers = [['Cookie', cookie]]
|
headers = [['Cookie', cookie]]
|
||||||
|
|
||||||
|
|
||||||
def get_data(item):
|
def get_data(item):
|
||||||
# support.dbg()
|
data = ''
|
||||||
url = httptools.downloadpage(item.url, headers=headers, follow_redirects=True, only_headers=True).url
|
if item.url:
|
||||||
data = support.match(url, headers=headers, follow_redirects=True).data
|
url = httptools.downloadpage(item.url, headers=headers, follow_redirects=True, only_headers=True).url
|
||||||
if 'AWCookieVerify' in data:
|
data = support.match(url, headers=headers, follow_redirects=True).data
|
||||||
get_cookie(data)
|
if 'AWCookieVerify' in data:
|
||||||
data = get_data(item)
|
get_cookie(data)
|
||||||
|
data = get_data(item)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
def order():
|
def order():
|
||||||
# Seleziona l'ordinamento dei risultati
|
# Seleziona l'ordinamento dei risultati
|
||||||
return str(support.config.get_setting("order", __channel__))
|
return str(support.config.getSetting("order", __channel__))
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
@@ -39,19 +41,19 @@ def mainlist(item):
|
|||||||
anime=['/filter?sort=',
|
anime=['/filter?sort=',
|
||||||
('ITA',['/filter?dub=1&sort=', 'menu', '1']),
|
('ITA',['/filter?dub=1&sort=', 'menu', '1']),
|
||||||
('SUB-ITA',['/filter?dub=0&sort=', 'menu', '0']),
|
('SUB-ITA',['/filter?dub=0&sort=', 'menu', '0']),
|
||||||
('In Corso', ['/ongoing', 'peliculas','noorder']),
|
('In Corso', ['/ongoing', 'movies','noorder']),
|
||||||
('Ultimi Episodi', ['/updated', 'peliculas', 'updated']),
|
('Ultimi Episodi', ['/updated', 'movies', 'updated']),
|
||||||
('Nuove Aggiunte',['/newest', 'peliculas','noorder' ]),
|
('Nuove Aggiunte',['/newest', 'movies','noorder' ]),
|
||||||
('Generi',['/?d=1','genres',])]
|
('Generi',['/?d=1','genres',])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
data = get_data(item)
|
data = get_data(item)
|
||||||
patronBlock = r'dropdown[^>]*>\s*Generi\s*<span.[^>]+>(?P<block>.*?)</ul>'
|
patronBlock = r'dropdown[^>]*>\s*Generi\s*<span.[^>]+>(?P<block>.*?)</ul>'
|
||||||
patronMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)</label>'
|
patronGenreMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)</label>'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.url = host + '/filter?' + item.name + '=' + item.value + '&sort='
|
item.url = host + '/filter?' + item.name + '=' + item.value + '&sort='
|
||||||
@@ -63,17 +65,20 @@ def genres(item):
|
|||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'submenu'
|
action = 'submenu'
|
||||||
data = get_data(item)
|
data = get_data(item)
|
||||||
patronMenu=r'<button[^>]+>\s*(?P<title>[A-Za-z0-9]+)\s*<span.[^>]+>(?P<other>.*?)</ul>'
|
patronMenu = r'<button[^>]+>\s*(?P<title>[A-Za-z0-9]+)\s*<span.[^>]+>(?P<other>.*?)</ul>'
|
||||||
|
genre = False
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), action='peliculas'))
|
for item in itemlist:
|
||||||
itemlist.append(item.clone(title=support.typo('Cerca...','bold'), action='search', search=True, thumbnail=support.thumb('search.png')))
|
item.title += ' {anime}'
|
||||||
|
itemlist.insert(0, item.clone(title=support.typo('Tutti {anime}','bold'), action='movies'))
|
||||||
|
itemlist.append(item.clone(title=support.typo('Cerca... {anime}','bold'), action='search', search=True, thumbnail=support.thumb('search.png')))
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def submenu(item):
|
def submenu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
data = item.other
|
data = item.other
|
||||||
patronMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)<\/label>'
|
patronMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)<\/label>'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
@@ -82,24 +87,24 @@ def submenu(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host + '/updated'
|
item.url = host + '/updated'
|
||||||
item.args = "updated"
|
item.args = "updated"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(texto)
|
logger.debug(texto)
|
||||||
if item.search:
|
if item.search:
|
||||||
item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort='
|
item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort='
|
||||||
else:
|
else:
|
||||||
@@ -107,64 +112,64 @@ def search(item, texto):
|
|||||||
item.url = host + '/search?keyword=' + texto
|
item.url = host + '/search?keyword=' + texto
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
# debug = True
|
# debug = True
|
||||||
if item.args not in ['noorder', 'updated'] and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale
|
if item.args not in ['noorder', 'updated'] and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale
|
||||||
data = get_data(item)
|
data = get_data(item)
|
||||||
|
|
||||||
if item.args == 'updated':
|
if item.args == 'updated':
|
||||||
item.contentType='episode'
|
item.contentType='episode'
|
||||||
patron=r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<lang>[^\)]+)\))?"[^>]+>[^>]+>\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?[^>]+>[^>]+>\s*<div class="ep">[^\d]+(?P<episode>\d+)[^<]*</div>'
|
patron=r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<lang>[^\)]+)\))?"[^>]+>[^>]+>\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?(?:[^>]+>){2,4}\s*<div class="ep">[^\d]+(?P<episode>\d+)[^<]*</div>'
|
||||||
action='findvideos'
|
action='findvideos'
|
||||||
else:
|
else:
|
||||||
patron= r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<year>\d+)\) )?(?:\((?P<lang>[^\)]+)\))?(?P<title2>[^"]+)?[^>]+>[^>]+>(?:\s*<div class="(?P<l>[^"]+)">[^>]+>)?\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?'
|
patron= r'<div class="inner">\s*<a href="(?P<url>[^"]+)" class[^>]+>\s*<img.*?src="(?P<thumb>[^"]+)" alt?="(?P<title>[^\("]+)(?:\((?P<year>\d+)\) )?(?:\((?P<lang>[^\)]+)\))?(?P<title2>[^"]+)?[^>]+>[^>]+>(?:\s*<div class="(?P<l>[^"]+)">[^>]+>)?\s*(?:<div class="[^"]+">(?P<type>[^<]+)</div>)?'
|
||||||
action='episodios'
|
action='episodes'
|
||||||
|
|
||||||
# Controlla la lingua se assente
|
# Controlla la lingua se assente
|
||||||
patronNext=r'<a href="([^"]+)" class="[^"]+" id="go-next'
|
patronNext=r'<a href="([^"]+)" class="[^"]+" id="go-next'
|
||||||
|
patronTotalPages=r'<span class="total">(\d+)</span>'
|
||||||
typeContentDict={'movie':['movie', 'special']}
|
typeContentDict={'movie':['movie', 'special']}
|
||||||
typeActionDict={'findvideos':['movie', 'special']}
|
typeActionDict={'findvideos':['movie', 'special']}
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if not item.contentLanguage:
|
if not item.contentLanguage:
|
||||||
if 'dub=1' in item.url or item.l == 'dub':
|
if 'dub=1' in item.url or item.l == 'dub':
|
||||||
item.contentLanguage = 'ITA'
|
item.contentLanguage = 'ITA'
|
||||||
item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
# item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||||
else:
|
else:
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
# item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
data = get_data(item)
|
data = get_data(item)
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
pagination = 50
|
# pagination = True
|
||||||
patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)(?:<div class="server|<link)'
|
patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)(?:<div class="server|<link)'
|
||||||
patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^-<]+)(?:-(?P<episode2>[^<]+))?'
|
patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^-<]+)(?:-(?P<episode2>[^<]+))?'
|
||||||
def itemHook(item):
|
# def itemHook(item):
|
||||||
item.number = support.re.sub(r'\[[^\]]+\]', '', item.title)
|
# item.title = item.fulltitle
|
||||||
item.title += support.typo(item.fulltitle,'-- bold')
|
# return item
|
||||||
return item
|
|
||||||
action='findvideos'
|
action='findvideos'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
import time
|
import time
|
||||||
support.info(item)
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
urls = []
|
urls = []
|
||||||
# resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<')
|
# resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<')
|
||||||
@@ -172,8 +177,9 @@ def findvideos(item):
|
|||||||
data = resp.data
|
data = resp.data
|
||||||
|
|
||||||
for ID, name in resp.matches:
|
for ID, name in resp.matches:
|
||||||
if not item.number: item.number = support.match(item.title, patron=r'(\d+) -').match
|
# if not item.number: item.number = support.match(item.title, patron=r'(\d+) -').match
|
||||||
match = support.match(data, patronBlock=r'data-name="' + ID + r'"[^>]+>(.*?)(?:<div class="(?:server|download)|link)', patron=r'data-id="([^"]+)" data-episode-num="' + (item.number if item.number else '1') + '"' + r'.*?href="([^"]+)"').match
|
match = support.match(data, patronBlock=r'data-name="{}"[^>]+>(.*?)(?:<div class="(?:server|download)|link)'.format(ID), patron=r'data-id="([^"]+)" data-episode-num="{}".*?href="([^"]+)"'.format(item.contentEpisodeNumber if item.contentEpisodeNumber else 1)).match
|
||||||
|
|
||||||
if match:
|
if match:
|
||||||
epID, epurl = match
|
epID, epurl = match
|
||||||
# if 'vvvvid' in name.lower():
|
# if 'vvvvid' in name.lower():
|
||||||
@@ -183,8 +189,7 @@ def findvideos(item):
|
|||||||
title = support.match(url, patron=r'http[s]?://(?:www.)?([^.]+)', string=True).match
|
title = support.match(url, patron=r'http[s]?://(?:www.)?([^.]+)', string=True).match
|
||||||
itemlist.append(item.clone(action="play", title=title, url=url, server='directo'))
|
itemlist.append(item.clone(action="play", title=title, url=url, server='directo'))
|
||||||
else:
|
else:
|
||||||
dataJson = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).data
|
json = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).response.json
|
||||||
json = jsontools.load(dataJson)
|
|
||||||
title = support.match(json['grabber'], patron=r'server\d+.([^.]+)', string=True).match
|
title = support.match(json['grabber'], patron=r'server\d+.([^.]+)', string=True).match
|
||||||
if title: itemlist.append(item.clone(action="play", title=title, url=json['grabber'].split('=')[-1], server='directo'))
|
if title: itemlist.append(item.clone(action="play", title=title, url=json['grabber'].split('=')[-1], server='directo'))
|
||||||
else: urls.append(json['grabber'])
|
else: urls.append(json['grabber'])
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "aniplay.png",
|
"thumbnail": "aniplay.png",
|
||||||
"banner": "aniplay.png",
|
"banner": "aniplay.png",
|
||||||
"categories": ["anime", "vos"],
|
"categories": ["anime", "sub"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"id": "sort",
|
"id": "sort",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
from platformcode import config, logger, autorenumber
|
from platformcode import config, logger, autorenumber
|
||||||
from core import httptools, scrapertools, support, tmdb
|
from core import httptools, jsontools, scrapertools, support, tmdb
|
||||||
from inspect import stack
|
from inspect import stack
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
@@ -9,9 +9,9 @@ else:
|
|||||||
from concurrent_py2 import futures
|
from concurrent_py2 import futures
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
sort = ['views', 'title', 'episodeNumber', 'startDate', 'endDate', 'createdDate'][config.get_setting('sort', 'aniplay')]
|
sort = ['views', 'title', 'episodeNumber', 'startDate', 'endDate', 'createdDate'][config.getSetting('sort', 'aniplay')]
|
||||||
order = 'asc' if config.get_setting('order', 'aniplay') else 'desc'
|
order = 'asc' if config.getSetting('order', 'aniplay') else 'desc'
|
||||||
perpage = [10, 20, 30 ,40, 50, 60, 70, 80, 90][config.get_setting('perpage', 'aniplay')]
|
perpage = [10, 20, 30 ,40, 50, 60, 70, 80, 90][config.getSetting('perpage', 'aniplay')]
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
@@ -27,9 +27,9 @@ def mainlist(item):
|
|||||||
def submenu_az(item):
|
def submenu_az(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
for letter in ['0-9'] + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
|
for letter in ['0-9'] + list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
|
||||||
itemlist.append(item.clone(title = support.typo(letter, 'bold'),
|
itemlist.append(item.clone(title = letter,
|
||||||
url= host + '/api/anime/find-by-char',
|
url= host + '/api/anime/find-by-char',
|
||||||
action= 'peliculas',
|
action= 'movies',
|
||||||
variable= '&character=' + letter,
|
variable= '&character=' + letter,
|
||||||
thumbnail=support.thumb('az')))
|
thumbnail=support.thumb('az')))
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -40,7 +40,7 @@ def submenu_year(item):
|
|||||||
current = date.today().year
|
current = date.today().year
|
||||||
first = int(httptools.downloadpage('{}/api/anime/advanced-search?page=0&size=1&sort=startDate,asc&sort=id'.format(host)).json[0]['startDate'].split('-')[0]) -1
|
first = int(httptools.downloadpage('{}/api/anime/advanced-search?page=0&size=1&sort=startDate,asc&sort=id'.format(host)).json[0]['startDate'].split('-')[0]) -1
|
||||||
for year in range(current, first, -1):
|
for year in range(current, first, -1):
|
||||||
itemlist.append(item.clone(title = support.typo(year, 'bold'),
|
itemlist.append(item.clone(title = year,
|
||||||
action= 'submenu_season',
|
action= 'submenu_season',
|
||||||
variable= year,
|
variable= year,
|
||||||
thumbnail=support.thumb('year')))
|
thumbnail=support.thumb('year')))
|
||||||
@@ -51,7 +51,7 @@ def submenu_top(item):
|
|||||||
links = {'Top del giorno':'daily-top', 'Top della settimana':'weekly-top', 'Top del mese':'monthly-top'}
|
links = {'Top del giorno':'daily-top', 'Top della settimana':'weekly-top', 'Top del mese':'monthly-top'}
|
||||||
for label in links:
|
for label in links:
|
||||||
link = links[label]
|
link = links[label]
|
||||||
itemlist.append(item.clone(title = support.typo(label, 'bold'),
|
itemlist.append(item.clone(title = label,
|
||||||
action= 'submenu_top_of',
|
action= 'submenu_top_of',
|
||||||
variable= link))
|
variable= link))
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -67,7 +67,7 @@ def submenu_season(item):
|
|||||||
itemlist.append(item.clone(title=title,
|
itemlist.append(item.clone(title=title,
|
||||||
url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable),
|
url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable),
|
||||||
thumbnail = support.thumb(s),
|
thumbnail = support.thumb(s),
|
||||||
action = 'peliculas',
|
action = 'movies',
|
||||||
variable=''))
|
variable=''))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -80,61 +80,62 @@ def submenu_top_of(item):
|
|||||||
title = fulltitle.split('(')[0].strip()
|
title = fulltitle.split('(')[0].strip()
|
||||||
scrapedlang = scrapertools.find_single_match(fulltitle, r'\(([^\)]+)')
|
scrapedlang = scrapertools.find_single_match(fulltitle, r'\(([^\)]+)')
|
||||||
lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA'
|
lang = scrapedlang.upper() if scrapedlang else 'Sub-ITA'
|
||||||
long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod')
|
# long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod')
|
||||||
|
|
||||||
itemlist.append(item.clone(title=long_title,
|
itemlist.append(item.clone(title=title,
|
||||||
id=anime['animeId'],
|
id=anime['animeId'],
|
||||||
url = '{}/api/anime/{}'.format(host, anime['animeId']),
|
url = '{}/api/anime/{}'.format(host, anime['animeId']),
|
||||||
thumbnail = get_thumbnail(anime, 'animeHorizontalImages'),
|
thumbnail = get_thumbnail(anime, 'animeHorizontalImages'),
|
||||||
action = 'episodios',
|
action = 'episodes',
|
||||||
variable=anime['animeId']))
|
variable=anime['animeId']))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(texto)
|
logger.debug(texto)
|
||||||
item.url = host + '/api/anime/advanced-search'
|
item.url = host + '/api/anime/advanced-search'
|
||||||
item.variable = '&query=' + texto
|
item.variable = '&query=' + texto
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
return latest_added(item)
|
return latest_added(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def latest_added(item):
|
def latest_added(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
page = item.page if item.page else 0
|
page = item.page if item.page else 0
|
||||||
url= '{}/api/home/latest-episodes?page={}'.format(host, page)
|
url= '{}/api/home/latest-episodes?page={}'.format(host, page)
|
||||||
js = httptools.downloadpage(url).json
|
js = httptools.downloadpage(url).json
|
||||||
|
|
||||||
for episode in js:
|
for episode in js:
|
||||||
title = episode['title']
|
logger.debug(jsontools.dump(episode))
|
||||||
|
title = episode['title'] if episode['title'] else episode['animeTitle']
|
||||||
animeTitle, lang = get_lang(episode['animeTitle'])
|
animeTitle, lang = get_lang(episode['animeTitle'])
|
||||||
quality = 'Full HD' if episode['fullHd'] else 'HD'
|
quality = 'Full HD' if episode['fullHd'] else 'HD'
|
||||||
long_title = support.typo('{}. {}{}'.format(int(float(episode['episodeNumber'])), title + ' - ' if title else '', animeTitle), 'bold') + support.typo(lang, '_ [] color kod') + support.typo(quality, '_ [] color kod')
|
|
||||||
image = get_thumbnail(episode, 'episodeImages')
|
image = get_thumbnail(episode, 'episodeImages')
|
||||||
|
|
||||||
itemlist.append(item.clone(title=long_title,
|
itemlist.append(item.clone(title=title,
|
||||||
fulltitle=title,
|
fulltitle=title,
|
||||||
animeId = episode['animeId'],
|
animeId = episode['animeId'],
|
||||||
id=episode['id'],
|
id=episode['id'],
|
||||||
@@ -155,7 +156,7 @@ def latest_added(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -165,16 +166,14 @@ def peliculas(item):
|
|||||||
for it in js:
|
for it in js:
|
||||||
title, lang = get_lang(it['title'])
|
title, lang = get_lang(it['title'])
|
||||||
|
|
||||||
long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod')
|
itemlist.append(item.clone(title = title,
|
||||||
|
|
||||||
itemlist.append(item.clone(title = long_title,
|
|
||||||
fulltitle = title,
|
fulltitle = title,
|
||||||
show = title,
|
show = title,
|
||||||
contentLanguage = lang,
|
contentLanguage = lang,
|
||||||
contentType = 'movie' if it['type'] == 'Movie' else 'tvshow',
|
contentType = 'movie' if it['type'] == 'Movie' else 'tvshow',
|
||||||
contentTitle = title,
|
contentTitle = title,
|
||||||
contentSerieName = title if it['type'] == 'Serie' else '',
|
contentSerieName = title if it['type'] == 'Serie' else '',
|
||||||
action ='findvideos' if it['type'] == 'Movie' else 'episodios',# '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodios',
|
action ='findvideos' if it['type'] == 'Movie' else 'episodes',# '' if not active else 'findvideos' if it['type'] == 'Movie' else 'episodes',
|
||||||
plot = it['storyline'],
|
plot = it['storyline'],
|
||||||
year = it['startDate'].split('-')[0],
|
year = it['startDate'].split('-')[0],
|
||||||
url = '{}/api/anime/{}'.format(host, it['id']),
|
url = '{}/api/anime/{}'.format(host, it['id']),
|
||||||
@@ -189,7 +188,7 @@ def peliculas(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
@@ -208,6 +207,7 @@ def episodios(item):
|
|||||||
title = it['name']
|
title = it['name']
|
||||||
|
|
||||||
itemlist.append(item.clone(title = title,
|
itemlist.append(item.clone(title = title,
|
||||||
|
contentTitle = title,
|
||||||
id= '{}/season/{}'.format(it['animeId'], it['id']),
|
id= '{}/season/{}'.format(it['animeId'], it['id']),
|
||||||
contentType = 'season',
|
contentType = 'season',
|
||||||
action = 'list_episodes',
|
action = 'list_episodes',
|
||||||
@@ -259,10 +259,11 @@ def list_episodes(item, json=None):
|
|||||||
else:
|
else:
|
||||||
episode = '{:02d}'.format(int(it['episodeNumber'].split('.')[0]))
|
episode = '{:02d}'.format(int(it['episodeNumber'].split('.')[0]))
|
||||||
|
|
||||||
title = support.typo('{}. {}'.format(episode, it['title']), 'bold')
|
# title = support.typo('{}. {}'.format(episode, it['title']), 'bold')
|
||||||
image = get_thumbnail(it, 'episodeImages')
|
image = get_thumbnail(it, 'episodeImages')
|
||||||
|
|
||||||
itemlist.append(item.clone(title = title,
|
itemlist.append(item.clone(title = it['title'],
|
||||||
|
contentTitle = it['title'],
|
||||||
id= it['id'],
|
id= it['id'],
|
||||||
url= 'api/episode/{}'.format(it['id']),
|
url= 'api/episode/{}'.format(it['id']),
|
||||||
contentType = 'episode',
|
contentType = 'episode',
|
||||||
@@ -283,7 +284,7 @@ def list_episodes(item, json=None):
|
|||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
url = '{}/api/{}/{}'.format(host, 'episode' if item.contentType == 'episode' else 'anime', item.id)
|
url = '{}/api/{}/{}'.format(host, 'episode' if item.contentType != 'movie' else 'anime', item.id)
|
||||||
|
|
||||||
json = httptools.downloadpage(url, CF=False ).json
|
json = httptools.downloadpage(url, CF=False ).json
|
||||||
|
|
||||||
@@ -292,7 +293,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
videourl = json['episodeVideo']
|
videourl = json['episodeVideo']
|
||||||
|
|
||||||
itemlist = [item.clone(title=config.get_localized_string(30137),
|
itemlist = [item.clone(title=config.getLocalizedString(30137),
|
||||||
url=videourl,
|
url=videourl,
|
||||||
server='directo')]
|
server='directo')]
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "casacinema.png",
|
"thumbnail": "casacinema.png",
|
||||||
"banner": "casacinema.png",
|
"banner": "casacinema.png",
|
||||||
"categories": ["tvshow", "movie","vos"],
|
"categories": ["tvshow", "movie","sub"],
|
||||||
"settings": [
|
"settings": [
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -14,11 +15,11 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
film = ['/category/film',
|
film = ['/category/film',
|
||||||
('Generi', ['', 'genres', 'genres']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('Sub-ITA', ['/category/sub-ita/', 'peliculas', 'sub'])
|
('Sub-ITA', ['/category/sub-ita/', 'movies', 'sub'])
|
||||||
]
|
]
|
||||||
|
|
||||||
tvshow = ['/category/serie-tv',
|
tvshow = ['/category/serie-tv',
|
||||||
('Novità', ['/aggiornamenti-serie-tv', 'peliculas', '']),
|
('Novità', ['/aggiornamenti-serie-tv', 'movies', '']),
|
||||||
]
|
]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
@@ -28,9 +29,9 @@ def mainlist(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
blacklist = ['PRIME VISIONI', 'ULTIME SERIE TV', 'ULTIMI FILM']
|
blacklist = ['PRIME VISIONI', 'ULTIME SERIE TV', 'ULTIMI FILM']
|
||||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></li>'
|
patronGenreMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></li>'
|
||||||
patronBlock = r'<div class="container home-cats">(?P<block>.*?)<div class="clear">'
|
patronBlock = r'<div class="container home-cats">(?P<block>.*?)<div class="clear">'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -38,37 +39,37 @@ def genres(item):
|
|||||||
def select(item):
|
def select(item):
|
||||||
item.data = support.match(item).data
|
item.data = support.match(item).data
|
||||||
if 'continua con il video' in item.data.lower():
|
if 'continua con il video' in item.data.lower():
|
||||||
support.info('select = ### è un film ###')
|
logger.debug('select = ### è un film ###')
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
else:
|
else:
|
||||||
support.info('select = ### è una serie ###')
|
logger.debug('select = ### è una serie ###')
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/?s=' + text
|
item.url = host + '/?s=' + text
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error(line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
item.args = 'newest'
|
item.args = 'newest'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if categoria == 'series':
|
if category == 'tvshow':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host+'/aggiornamenti-serie-tv'
|
item.url = host+'/aggiornamenti-serie-tv'
|
||||||
|
|
||||||
@@ -76,30 +77,30 @@ def newest(categoria):
|
|||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host+'/category/film'
|
item.url = host+'/category/film'
|
||||||
|
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("%s" % line)
|
logger.error(line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
if item.contentType == 'movie':
|
if item.contentType == 'movie':
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
elif item.contentType == 'tvshow':
|
elif item.contentType == 'tvshow':
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
pagination = ''
|
pagination = True
|
||||||
else:
|
else:
|
||||||
action = 'select'
|
action = 'select'
|
||||||
|
|
||||||
@@ -110,17 +111,17 @@ def peliculas(item):
|
|||||||
patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?(?:\(\D{2}\s\d{4}\))?<'
|
patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?(?:\(\D{2}\s\d{4}\))?<'
|
||||||
|
|
||||||
patronNext = r'<a href="([^"]+)"\s*>Pagina'
|
patronNext = r'<a href="([^"]+)"\s*>Pagina'
|
||||||
# debug = True
|
patronTotalPages = r'>(\d+)(?:[^>]+>){4}Pagina'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if item.quality1:
|
if item.quality1:
|
||||||
item.quality = item.quality1
|
item.quality = item.quality1
|
||||||
item.title += support.typo(item.quality, '_ [] color kod')
|
# item.title += support.typo(item.quality, '_ [] color kod')
|
||||||
if item.lang2:
|
if item.lang2:
|
||||||
item.contentLanguage = item.lang2
|
item.contentLanguage = item.lang2
|
||||||
item.title += support.typo(item.lang2, '_ [] color kod')
|
# item.title += support.typo(item.lang2, '_ [] color kod')
|
||||||
if item.args == 'novita':
|
# if item.args == 'novita':
|
||||||
item.title = item.title
|
# item.title = item.title
|
||||||
# if 'wp-content' in item.thumbnail and not item.infoLabels['year']:
|
# if 'wp-content' in item.thumbnail and not item.infoLabels['year']:
|
||||||
# item.infoLabels['year'] = item.thumbnail.split('/')[5]
|
# item.infoLabels['year'] = item.thumbnail.split('/')[5]
|
||||||
return item
|
return item
|
||||||
@@ -128,7 +129,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
if item.data:
|
if item.data:
|
||||||
data = item.data
|
data = item.data
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
@@ -148,7 +149,7 @@ def findvideos(item):
|
|||||||
data = ''
|
data = ''
|
||||||
from lib.unshortenit import unshorten_only
|
from lib.unshortenit import unshorten_only
|
||||||
for link in links:
|
for link in links:
|
||||||
support.info('URL=',link)
|
logger.debug('URL=',link)
|
||||||
url, c = unshorten_only(link.replace('#', 'speedvideo.net'))
|
url, c = unshorten_only(link.replace('#', 'speedvideo.net'))
|
||||||
data += url + '\n'
|
data += url + '\n'
|
||||||
return support.server(item, data)
|
return support.server(item, data)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "cb01anime",
|
"id": "cb01anime",
|
||||||
"name": "Cb01anime",
|
"name": "Cb01anime",
|
||||||
"language": ["ita", "vos", "sub-ita"],
|
"language": ["ita", "sub, "sub-ita"],
|
||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "cb01anime.png",
|
"thumbnail": "cb01anime.png",
|
||||||
"banner": "cb01anime.png",
|
"banner": "cb01anime.png",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url() + '/cb01-anime-cartoon'
|
host = support.config.get_channel_url() + '/cb01-anime-cartoon'
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ def mainlist(item):
|
|||||||
anime = [('Genere',['','menu', '2']),
|
anime = [('Genere',['','menu', '2']),
|
||||||
('Per Lettera',['','menu', '1']),
|
('Per Lettera',['','menu', '1']),
|
||||||
('Per Anno',['','menu', '3']),
|
('Per Anno',['','menu', '3']),
|
||||||
('Ultimi Anime Aggiornati',['','peliculas', 'newest'])]
|
('Ultimi Anime Aggiornati',['','movies', 'newest'])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@@ -27,7 +28,9 @@ def menu(item):
|
|||||||
blacklist = ['Anime per Genere', 'Anime per Anno', 'Anime per Lettera']
|
blacklist = ['Anime per Genere', 'Anime per Anno', 'Anime per Lettera']
|
||||||
patronBlock = r'<select name="select%s"(?P<block>.*?)</select>' % item.args
|
patronBlock = r'<select name="select%s"(?P<block>.*?)</select>' % item.args
|
||||||
patronMenu = r'<option value="(?P<url>[^"]+)">(?P<title>[^<]+)</option>'
|
patronMenu = r'<option value="(?P<url>[^"]+)">(?P<title>[^<]+)</option>'
|
||||||
action = 'peliculas'
|
if '2' in item.args:
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
|
action = 'movies'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.url = item.url.replace('cb01-anime/','cb01-anime-cartoon/')
|
item.url = item.url.replace('cb01-anime/','cb01-anime-cartoon/')
|
||||||
return item
|
return item
|
||||||
@@ -35,37 +38,37 @@ def menu(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(texto)
|
logger.debug(texto)
|
||||||
item.url = host + "/search/" + texto
|
item.url = host + "/search/" + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error(line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host
|
item.url = host
|
||||||
item.args = 'newest'
|
item.args = 'newest'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug=True
|
# debug=True
|
||||||
blacklist = Blacklist
|
blacklist = Blacklist
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
@@ -78,20 +81,19 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
# support.dbg()
|
|
||||||
item.url = support.match(item, patron=r'(?:<p>|/>)(.*?)(?:<br|</td>|</p>)', patronBlock=r'Streaming:(.*?)</tr>').matches
|
item.url = support.match(item, patron=r'(?:<p>|/>)(.*?)(?:<br|</td>|</p>)', patronBlock=r'Streaming:(.*?)</tr>').matches
|
||||||
if 'Episodio' in str(item.url):
|
if 'Episodio' in str(item.url):
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.action ='episodios'
|
item.action ='episodes'
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
else:
|
else:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.action = 'findvideos'
|
item.action = 'findvideos'
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info('EPISODIOS ', item.data)
|
logger.debug('EPISODIOS ', item.data)
|
||||||
data = ''
|
data = ''
|
||||||
matches = item.data
|
matches = item.data
|
||||||
season = 1
|
season = 1
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "cb01.png",
|
"thumbnail": "cb01.png",
|
||||||
"banner": "cb01.png",
|
"banner": "cb01.png",
|
||||||
"categories": ["tvshow", "movie", "vos", "documentary"],
|
"categories": ["tvshow", "movie", "sub", "documentary"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per cineblog01
|
# Canale per cineblog01
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
import datetime
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from core import scrapertools, httptools, servertools, support
|
from core import scrapertools, httptools, servertools, support
|
||||||
@@ -27,17 +27,17 @@ def mainlist(item):
|
|||||||
('Generi', ['', 'menu', 'Film per Genere']),
|
('Generi', ['', 'menu', 'Film per Genere']),
|
||||||
('Anni', ['', 'menu', 'Film per Anno']),
|
('Anni', ['', 'menu', 'Film per Anno']),
|
||||||
('Paese', ['', 'menu', 'Film per Paese']),
|
('Paese', ['', 'menu', 'Film per Paese']),
|
||||||
('Ultimi Aggiornati', ['/ultimi-100-film-aggiornati/', 'peliculas', 'newest']),
|
('Ultimi Aggiornati', ['/ultimi-100-film-aggiornati/', 'movies', 'newest']),
|
||||||
('Ultimi Aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'peliculas', 'newest'])
|
('Ultimi Aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'movies', 'newest'])
|
||||||
]
|
]
|
||||||
tvshow = ['/serietv/',
|
tvshow = ['/serietv/',
|
||||||
('Per Lettera', ['/serietv/', 'menu', 'Serie-Tv per Lettera']),
|
('Per Lettera', ['/serietv/', 'menu', 'Serie-Tv per Lettera']),
|
||||||
('Per Genere', ['/serietv/', 'menu', 'Serie-Tv per Genere']),
|
('Per Genere', ['/serietv/', 'menu', 'Serie-Tv per Genere']),
|
||||||
('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']),
|
('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']),
|
||||||
('Ultime Aggiornate', ['/serietv/ultime-100-serie-tv-aggiornate/', 'peliculas', 'newest'])
|
('Ultime Aggiornate', ['/serietv/ultime-100-serie-tv-aggiornate/', 'movies', 'newest'])
|
||||||
]
|
]
|
||||||
docu = [('Documentari {bullet bold}', ['/category/documentario/', 'peliculas']),
|
docu = [('Documentari {bullet bold}', ['/category/documentario/', 'movies']),
|
||||||
('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'peliculas'])
|
('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'movies'])
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
@@ -47,24 +47,26 @@ def mainlist(item):
|
|||||||
def menu(item):
|
def menu(item):
|
||||||
patronBlock = item.args + r'<span.*?><\/span>.*?<ul.*?>(?P<block>.*?)<\/ul>'
|
patronBlock = item.args + r'<span.*?><\/span>.*?<ul.*?>(?P<block>.*?)<\/ul>'
|
||||||
patronMenu = r'href="?(?P<url>[^">]+)"?>(?P<title>.*?)<\/a>'
|
patronMenu = r'href="?(?P<url>[^">]+)"?>(?P<title>.*?)<\/a>'
|
||||||
action = 'peliculas'
|
if 'genere' in item.args.lower():
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
|
action = 'movies'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
|
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host + '/serietv/' # aggiornamento-quotidiano-serie-tv/'
|
item.url = host + '/serietv/' # aggiornamento-quotidiano-serie-tv/'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + '/lista-film-ultimi-100-film-aggiunti/'
|
item.url = host + '/lista-film-ultimi-100-film-aggiunti/'
|
||||||
item.args = "newest"
|
item.args = "newest"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -74,12 +76,13 @@ def newest(categoria):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
logger.info("search", text)
|
|
||||||
|
logger.info("search", item, text)
|
||||||
if item.contentType == 'tvshow': item.url = host + '/serietv'
|
if item.contentType == 'tvshow': item.url = host + '/serietv'
|
||||||
else: item.url = host
|
else: item.url = host
|
||||||
try:
|
try:
|
||||||
item.url = item.url + "/search/" + text.replace(' ', '+')
|
item.url = item.url + "/search/" + text.replace(' ', '+')
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
@@ -90,7 +93,7 @@ def search(item, text):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
# esclusione degli articoli 'di servizio'
|
# esclusione degli articoli 'di servizio'
|
||||||
# curYear = datetime.date.today().year
|
# curYear = datetime.date.today().year
|
||||||
@@ -101,14 +104,14 @@ def peliculas(item):
|
|||||||
# 'Auguri di Buon Natale e Felice Anno Nuovo! – ' + str(curYear) + '!']
|
# 'Auguri di Buon Natale e Felice Anno Nuovo! – ' + str(curYear) + '!']
|
||||||
|
|
||||||
if 'newest' in item.args:
|
if 'newest' in item.args:
|
||||||
pagination = ''
|
pagination = True
|
||||||
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
|
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
|
||||||
if '/serietv/' not in item.url:
|
if '/serietv/' not in item.url:
|
||||||
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)?\((?P<year>\d{4})[^\)]*\)[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>\w+) [^ ]+ DURATA (?P<duration>[0-9]+)[^ ]+ [^ ]+ [A-Z ]+ (?P<plot>[^<]+)<'
|
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)?\((?P<year>\d{4})[^\)]*\)[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>\w+) [^ ]+ DURATA (?P<duration>[0-9]+)[^ ]+ [^ ]+ [A-Z ]+ (?P<plot>[^<]+)<'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")? alt=(?:")?(?P<title>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")? alt=(?:")?(?P<title>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
|
|
||||||
elif '/serietv/' not in item.url:
|
elif '/serietv/' not in item.url:
|
||||||
patron = r'(?<!sticky )hentry.*?<div class="card-image">\s*<a[^>]+>\s*<img src="(?P<thumb>[^" ]+)" alt[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)? (?:\((?P<year>[0-9]{4})\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<genre>[^<>&âÃÂÖ]+)(?:[^ ]+\s*DURATA\s*(?P<duration>[0-9]+)[^>]+>[^>]+>[^>]+>(?P<plot>[^<>]+))?'
|
patron = r'(?<!sticky )hentry.*?<div class="card-image">\s*<a[^>]+>\s*<img src="(?P<thumb>[^" ]+)" alt[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="?(?P<url>[^" >]+)(?:\/|"|\s+)>(?P<title>[^<[(]+)(?:\[(?P<quality>[a-zA-Z/]+)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z/]+)\]\s*)? (?:\((?P<year>[0-9]{4})\))?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<genre>[^<>&âÃÂÖ]+)(?:[^ ]+\s*DURATA\s*(?P<duration>[0-9]+)[^>]+>[^>]+>[^>]+>(?P<plot>[^<>]+))?'
|
||||||
@@ -116,10 +119,11 @@ def peliculas(item):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
patron = r'(?<!sticky )hentry.*?card-image[^>]*>\s*<a href=(?:")?(?P<url>[^" >]+)(?:")?\s*>\s*<img src=(?:")?(?P<thumb>[^" ]+)(?:")? alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>(?P<genre>[^\(]+)\((?P<year>\d{4})[^>]*>[^>]+>[^>]+>[^>]+>(?:<p>)?(?P<plot>[^<]+)'
|
patron = r'(?<!sticky )hentry.*?card-image[^>]*>\s*<a href=(?:")?(?P<url>[^" >]+)(?:")?\s*>\s*<img src=(?:")?(?P<thumb>[^" ]+)(?:")? alt="(?P<title>.*?)(?: – \d+×\d+)?(?:"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>[^>]+>[^>]+>[^>]*>(?P<genre>[^\(]+)\((?P<year>\d{4})[^>]*>[^>]+>[^>]+>[^>]+>(?:<p>)?(?P<plot>[^<]+)'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
|
|
||||||
patronNext = '<a class="?page-link"? href="?([^>"]+)"?><i class="fa fa-angle-right">'
|
patronNext = '<a class="?page-link"? href="?([^>"]+)"?><i class="fa fa-angle-right">'
|
||||||
|
patronTotalPages = '(\d+[\.]?\d+)</option>\s*</sele'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if item.quality2:
|
if item.quality2:
|
||||||
@@ -130,113 +134,117 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def folder(item, data):
|
def listed(item, data):
|
||||||
"""
|
actLike = 'episodes'
|
||||||
Quando c'è un link ad una cartella contenente più stagioni
|
disableAll = True
|
||||||
"""
|
|
||||||
actLike = 'episodios'
|
|
||||||
addVideolibrary = False
|
|
||||||
downloadEnabled = False
|
|
||||||
|
|
||||||
folderUrl = scrapertools.find_single_match(data, r'TUTTA L[EA] \w+\s+(?:–|-)\s+<a href="?([^" ]+)')
|
patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>'
|
||||||
data = httptools.downloadpage(folderUrl, disable_directIP=True).data
|
patron = r'(?:/>|<p>|<strong>)(?P<data>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
||||||
patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<url>[^"]+)[^>]+>'
|
|
||||||
sceneTitle = True
|
|
||||||
# debug = True
|
|
||||||
|
|
||||||
def itemHook(item):
|
|
||||||
item.serieFolder = True
|
|
||||||
return item
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
# debugBlock=True
|
@support.scrape
|
||||||
|
def folder(item, data):
|
||||||
|
# Quando c'è un link ad una cartella contenente più stagioni
|
||||||
|
|
||||||
|
actLike = 'episodes'
|
||||||
|
disableAll = True
|
||||||
|
sceneTitle = True
|
||||||
|
|
||||||
|
folderUrl = scrapertools.find_single_match(data, r'TUTT[EA] L[EA] \w+\s+(?:–|-)\s+<a href="?([^" ]+)')
|
||||||
|
data = httptools.downloadpage(folderUrl, disable_directIP=True).data
|
||||||
|
patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<folderdata>[^"]+)[^>]+>'
|
||||||
|
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
folderItemlist = folder(item, data) if '<p>TUTTA L' in data else []
|
|
||||||
|
|
||||||
patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>'
|
itemlist = listed(item, data)
|
||||||
patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
itemlist.extend(folder(item, data) if 'TUTTE LE' in data or 'TUTTA LA' in data else [])
|
||||||
def itemlistHook(itemlist):
|
|
||||||
title_dict = {}
|
|
||||||
itlist = []
|
|
||||||
for i in itemlist:
|
|
||||||
i.url = item.url
|
|
||||||
i.title = re.sub(r'\.(\D)',' \\1', i.title)
|
|
||||||
match = support.match(i.title, patron=r'(\d+.\d+)').match.replace('x','')
|
|
||||||
i.order = match
|
|
||||||
if match not in title_dict:
|
|
||||||
title_dict[match] = i
|
|
||||||
elif match in title_dict and i.contentLanguage == title_dict[match].contentLanguage \
|
|
||||||
or i.contentLanguage == 'ITA' and not title_dict[match].contentLanguage \
|
|
||||||
or title_dict[match].contentLanguage == 'ITA' and not i.contentLanguage:
|
|
||||||
title_dict[match].url = i.url
|
|
||||||
else:
|
|
||||||
title_dict[match + '1'] = i
|
|
||||||
|
|
||||||
for key, value in title_dict.items():
|
itemDict = {'ITA':{}, 'Sub-ITA':{}}
|
||||||
itlist.append(value)
|
seasons = []
|
||||||
|
|
||||||
itlist = sorted(itlist, key=lambda it: (it.contentLanguage, int(it.order)))
|
for it in itemlist:
|
||||||
|
it.contentType = 'episode'
|
||||||
itlist.extend(folderItemlist)
|
if it.contentSeason and it.contentSeason not in seasons:
|
||||||
|
seasons.append(it.contentSeason)
|
||||||
return itlist
|
itemDict['ITA'][it.contentSeason] = []
|
||||||
return locals()
|
itemDict['Sub-ITA'][it.contentSeason] = []
|
||||||
|
if it.contentSeason:
|
||||||
|
if not it.contentLanguage: it.contentLanguage = 'ITA'
|
||||||
|
itemDict[it.contentLanguage][it.contentSeason].append(it)
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
itlist = []
|
||||||
if item.serieFolder:
|
for season in sorted(seasons):
|
||||||
return support.server(item, data=item.url)
|
itlist.extend(sorted(itemDict['ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
|
||||||
if item.contentType == "episode":
|
itlist.extend(sorted(itemDict['Sub-ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
|
||||||
return findvid_serie(item)
|
itemlist = itlist
|
||||||
|
|
||||||
def load_links(itemlist, re_txt, desc_txt, quality=""):
|
if not support.stackCheck(['add_tvshow', 'get_episodes', 'update', 'find_episodes']):
|
||||||
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
|
if len(seasons) > 1:
|
||||||
logger.debug('STREAMING', streaming)
|
itemlist = support.season_pagination(itemlist, item, [], 'episodes')
|
||||||
logger.debug('STREAMING=', streaming)
|
else:
|
||||||
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
|
itemlist = support.pagination(itemlist, item, 'episodes')
|
||||||
for scrapedurl, scrapedtitle in matches:
|
if config.getSetting('episode_info'):
|
||||||
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
|
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, server=scrapedtitle, quality=quality))
|
support.videolibrary(itemlist, item)
|
||||||
|
support.download(itemlist, item)
|
||||||
logger.debug()
|
|
||||||
|
|
||||||
itemlist = []
|
|
||||||
|
|
||||||
# Carica la pagina
|
|
||||||
data = httptools.downloadpage(item.url).data
|
|
||||||
data = re.sub('\n|\t', '', data)
|
|
||||||
|
|
||||||
# Estrae i contenuti - Streaming
|
|
||||||
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
|
|
||||||
|
|
||||||
# Estrae i contenuti - Streaming HD
|
|
||||||
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD")
|
|
||||||
|
|
||||||
# Estrae i contenuti - Streaming 3D
|
|
||||||
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D")
|
|
||||||
|
|
||||||
itemlist = support.server(item, itemlist=itemlist)
|
|
||||||
# Extract the quality format
|
|
||||||
patronvideos = r'([\w.]+)</strong></div></td>'
|
|
||||||
support.addQualityTag(item, itemlist, data, patronvideos)
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
# Estrae i contenuti - Download
|
|
||||||
# load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download")
|
|
||||||
|
|
||||||
# Estrae i contenuti - Download HD
|
def findvideos(item):
|
||||||
# load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<tableclass=cbtable width=100% height=20>', "azure", "Download HD")
|
|
||||||
|
|
||||||
|
|
||||||
def findvid_serie(item):
|
|
||||||
logger.debug()
|
logger.debug()
|
||||||
data = re.sub(r'((?:<p>|<strong>)?[^\d]*\d*(?:×|Ã)[0-9]+[^<]+)', '', item.other)
|
if item.folderdata:
|
||||||
|
return support.server(item, data=item.folderdata)
|
||||||
|
elif item.data:
|
||||||
|
return support.server(item, data=re.sub(r'((?:<p>|<strong>)?[^\d]*\d*(?:×|Ã)[0-9]+[^<]+)', '', item.data))
|
||||||
|
else:
|
||||||
|
|
||||||
return support.server(item, data=data)
|
def load_links(itemlist, re_txt, desc_txt, quality=""):
|
||||||
|
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
|
||||||
|
logger.debug('STREAMING', streaming)
|
||||||
|
logger.debug('STREAMING=', streaming)
|
||||||
|
matches = support.match(streaming, patron = r'<td><a.*?href=([^ ]+) [^>]+>([^<]+)<').matches
|
||||||
|
for scrapedurl, scrapedtitle in matches:
|
||||||
|
logger.debug("##### findvideos %s ## %s ## %s ##" % (desc_txt, scrapedurl, scrapedtitle))
|
||||||
|
itemlist.append(item.clone(action="play", title=scrapedtitle, url=scrapedurl, server=scrapedtitle, quality=quality))
|
||||||
|
|
||||||
|
logger.debug()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
# Carica la pagina
|
||||||
|
data = httptools.downloadpage(item.url).data
|
||||||
|
data = re.sub('\n|\t', '', data)
|
||||||
|
|
||||||
|
# Estrae i contenuti - Streaming
|
||||||
|
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
|
||||||
|
|
||||||
|
# Estrae i contenuti - Streaming HD
|
||||||
|
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD")
|
||||||
|
|
||||||
|
# Estrae i contenuti - Streaming 3D
|
||||||
|
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D")
|
||||||
|
|
||||||
|
itemlist = support.server(item, itemlist=itemlist)
|
||||||
|
# Extract the quality format
|
||||||
|
patronvideos = r'([\w.]+)</strong></div></td>'
|
||||||
|
support.addQualityTag(item, itemlist, data, patronvideos)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
# Estrae i contenuti - Download
|
||||||
|
# load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download")
|
||||||
|
|
||||||
|
# Estrae i contenuti - Download HD
|
||||||
|
# load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<tableclass=cbtable width=100% height=20>', "azure", "Download HD")
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
"thumbnail": "cinemalibero.png",
|
"thumbnail": "cinemalibero.png",
|
||||||
"banner": "cinemalibero.png",
|
"banner": "cinemalibero.png",
|
||||||
"categories": ["movie","tvshow","anime"],
|
"categories": ["movie","tvshow","anime"],
|
||||||
"not_active": ["include_in_newest_anime", "include_in_newest_peliculas"],
|
"not_active": ["include_in_newest_anime", "include_in_newest_movie"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import re
|
|||||||
|
|
||||||
from core import httptools, support, scrapertools
|
from core import httptools, support, scrapertools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
|
|
||||||
|
|
||||||
# rimanda a .today che contiene tutti link a .plus
|
# rimanda a .today che contiene tutti link a .plus
|
||||||
@@ -29,15 +29,15 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
film = ['/category/film/',
|
film = ['/category/film/',
|
||||||
('Novità', ['', 'peliculas', 'update']),
|
('Novità', ['', 'movies', 'update']),
|
||||||
('Generi', ['', 'genres'])]
|
('Generi', ['', 'genres'])]
|
||||||
|
|
||||||
tvshow = ['/category/serie-tv/']
|
tvshow = ['/category/serie-tv/']
|
||||||
|
|
||||||
anime = ['/category/anime-giapponesi/']
|
anime = ['/category/anime-giapponesi/']
|
||||||
|
|
||||||
## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'peliculas', 'sport', 'tvshow'])]
|
## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'movies', 'sport', 'tvshow'])]
|
||||||
news = [('Ultimi episodi Serie/Anime', ['/aggiornamenti-serie-tv/', 'peliculas', 'update', 'tvshow'])]
|
news = [('Ultimi episodi Serie/Anime', ['/aggiornamenti-serie-tv/', 'movies', 'update', 'tvshow'])]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
|
|
||||||
@@ -45,13 +45,13 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
action = 'check'
|
action = 'check'
|
||||||
patronBlock = r'<div class="container">.*?class="col-md-12[^"]*?">(?P<block>.*?)<div class=(?:"container"|"bg-dark ")>'
|
patronBlock = r'<div class="container">.*?class="col-md-12[^"]*?">(?P<block>.*?)<div class=(?:"container"|"bg-dark ")>'
|
||||||
if item.args == 'newest':
|
if item.args == 'newest':
|
||||||
patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?'
|
patron = r'<div class="col-lg-3">[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)".+?url\((?P<thumb>[^\)]+)\)">[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>(?:[^>]+>)?\s?(?P<rating>[\d\.]+)?[^>]+>.+?(?:[ ]\((?P<year>\d{4})\))?<[^>]+>[^>]+>(.?[\d\-x]+\s\(?(?P<lang>[sSuUbBiItTaA\-]+)?\)?\s?(?P<quality>[\w]+)?[|]?\s?(?:[fFiInNeE]+)?\s?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?)?'
|
||||||
pagination = 25
|
pagination = True
|
||||||
elif item.contentType == 'movie':
|
elif item.contentType == 'movie':
|
||||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>.+?)(?:[ ]\[(?P<lang>[sSuUbB\-iItTaA]+)\])?(?:[ ]\((?P<year>\d{4})\))?"\s*alt="[^"]+"\s*class="[^"]+"(?: style="background-image: url\((?P<thumb>.+?)\)">)?\s*<div class="voto">[^>]+>[^>]+>.(?P<rating>[\d\.a-zA-Z\/]+)?[^>]+>[^>]+>[^>]+>(?:<div class="genere">(?P<quality>[^<]+)</div>)?'
|
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>.+?)(?:[ ]\[(?P<lang>[sSuUbB\-iItTaA]+)\])?(?:[ ]\((?P<year>\d{4})\))?"\s*alt="[^"]+"\s*class="[^"]+"(?: style="background-image: url\((?P<thumb>.+?)\)">)?\s*<div class="voto">[^>]+>[^>]+>.(?P<rating>[\d\.a-zA-Z\/]+)?[^>]+>[^>]+>[^>]+>(?:<div class="genere">(?P<quality>[^<]+)</div>)?'
|
||||||
if item.args == 'update':
|
if item.args == 'update':
|
||||||
@@ -60,7 +60,7 @@ def peliculas(item):
|
|||||||
elif item.contentType == 'tvshow':
|
elif item.contentType == 'tvshow':
|
||||||
if item.args == 'update':
|
if item.args == 'update':
|
||||||
patron = r'<a href="(?P<url>[^"]+)"[^<]+?url\((?P<thumb>.+?)\)">\s*?<div class="titolo">(?P<title>.+?)(?: – Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>\s*?(?:<div class="genere">)?(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)'
|
patron = r'<a href="(?P<url>[^"]+)"[^<]+?url\((?P<thumb>.+?)\)">\s*?<div class="titolo">(?P<title>.+?)(?: – Serie TV)?(?:\([sSuUbBiItTaA\-]+\))?[ ]?(?P<year>\d{4})?</div>\s*?(?:<div class="genere">)?(?:[\w]+?\.?\s?[\s|S]?[\dx\-S]+?\s\(?(?P<lang>[iItTaA]+|[sSuUbBiItTaA\-]+)\)?\s?(?P<quality>[HD]+)?|.+?\(?(?P<lang2>[sSuUbBiItTaA\-]+)?\)?</div>)'
|
||||||
pagination = 25
|
pagination = True
|
||||||
else:
|
else:
|
||||||
patron = r'<a href="(?P<url>[^"]+)"\s*title="(?P<title>[^"\(]+)(?:"|\()(?:(?P<year>\d+)[^"]+)?.*?url\((?P<thumb>[^\)]+)\)(?:.*?<div class="voto">[^>]+>[^>]+>\s*(?P<rating>[^<]+))?.*?<div class="titolo">[^>]+>(?:<div class="genere">[^ ]*(?:\s\d+)?\s*(?:\()?(?P<lang>[^\)< ]+))?'
|
patron = r'<a href="(?P<url>[^"]+)"\s*title="(?P<title>[^"\(]+)(?:"|\()(?:(?P<year>\d+)[^"]+)?.*?url\((?P<thumb>[^\)]+)\)(?:.*?<div class="voto">[^>]+>[^>]+>\s*(?P<rating>[^<]+))?.*?<div class="titolo">[^>]+>(?:<div class="genere">[^ ]*(?:\s\d+)?\s*(?:\()?(?P<lang>[^\)< ]+))?'
|
||||||
else:
|
else:
|
||||||
@@ -77,8 +77,8 @@ def peliculas(item):
|
|||||||
item.title += support.typo(item.lang2, '_ [] color kod')
|
item.title += support.typo(item.lang2, '_ [] color kod')
|
||||||
if item.args == 'update':
|
if item.args == 'update':
|
||||||
item.title = item.title.replace('-', ' ')
|
item.title = item.title.replace('-', ' ')
|
||||||
# if item.args == 'search':
|
if item.args == 'search':
|
||||||
# item.contentType = 'tvshow' if 'serie-' in item.url else 'movie'
|
item.contentType = 'undefined'
|
||||||
|
|
||||||
return item
|
return item
|
||||||
|
|
||||||
@@ -86,20 +86,20 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
data=item.data
|
data=item.data
|
||||||
# debug=True
|
# debug=True
|
||||||
if item.args == 'anime':
|
if item.args == 'anime':
|
||||||
support.info("Anime :", item)
|
logger.debug("Anime :", item)
|
||||||
# blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo']
|
# blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo']
|
||||||
patron = r'<a target=(?P<url>[^>]+>(?P<title>Episodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))'
|
patron = r'<a target=(?P<url>[^>]+>(?P<title>Episodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))'
|
||||||
patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)'
|
patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)'
|
||||||
item.contentType = 'tvshow'
|
# item.contentType = 'tvshow'
|
||||||
elif item.args == 'serie':
|
elif item.args == 'serie':
|
||||||
support.info("Serie :", item)
|
logger.debug("Serie :", item)
|
||||||
patron = r'(?:>| )(?P<episode>\d+(?:x|×|×)\d+)[;]?[ ]?(?:(?P<title>[^<–-]+)(?P<data>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br /|</a></p|$)'
|
patron = r'(?:>| )(?P<episode>\d+(?:x|×|×)\d+)[;]?[ ]?(?:(?P<title>[^<–-]+)(?P<data>.*?)|(\2[ ])(?:<(\3.*?)))(?:</a><br /|</a></p|$)'
|
||||||
patronBlock = r'>(?:[^<]+[Ss]tagione\s|[Ss]tagione [Uu]nica)(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:<strong|<div class="at-below)'
|
patronBlock = r'>(?:[^<]+[Ss]tagione\s|[Ss]tagione [Uu]nica)(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:<strong|<div class="at-below)'
|
||||||
item.contentType = 'tvshow'
|
# item.contentType = 'tvshow'
|
||||||
else:
|
else:
|
||||||
patron = r'(?P<title>\s*[0-9]{2}/[0-9]{2}/[0-9]{4})(?P<data>.*?)(?:<br|</p)'
|
patron = r'(?P<title>\s*[0-9]{2}/[0-9]{2}/[0-9]{4})(?P<data>.*?)(?:<br|</p)'
|
||||||
|
|
||||||
@@ -114,51 +114,52 @@ def episodios(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
|
|
||||||
action='peliculas'
|
action='movies'
|
||||||
patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>'
|
patron_block=r'<div id="bordobar" class="dropdown-menu(?P<block>.*?)</li>'
|
||||||
patronMenu=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"'
|
patronGenreMenu=r'<a class="dropdown-item" href="(?P<url>[^"]+)" title="(?P<title>[A-z]+)"'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(item.url,texto)
|
logger.debug(item.url,texto)
|
||||||
|
item.contentType = 'undefined'
|
||||||
texto = texto.replace(' ', '+')
|
texto = texto.replace(' ', '+')
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
# item.contentType = 'tv'
|
# item.contentType = 'tv'
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info('newest ->', categoria)
|
logger.debug('newest ->', category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
item.args = 'newest'
|
item.args = 'newest'
|
||||||
try:
|
try:
|
||||||
if categoria == 'series' or categoria == 'anime':
|
if category == 'tvshow' or category == 'anime':
|
||||||
item.args = 'update'
|
item.args = 'update'
|
||||||
item.url = host+'/aggiornamenti-serie-tv/'
|
item.url = host+'/aggiornamenti-serie-tv/'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('newest log: ', (line))
|
logger.error('newest log: ', (line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def check(item):
|
def check(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
if data:
|
if data:
|
||||||
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
|
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
|
||||||
@@ -167,13 +168,13 @@ def check(item):
|
|||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.args = 'serie'
|
item.args = 'serie'
|
||||||
item.data = data
|
item.data = data
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
elif ck == 'anime':
|
elif ck == 'anime':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.args = 'anime'
|
item.args = 'anime'
|
||||||
item.data = data
|
item.data = data
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
elif ck == 'film':
|
elif ck == 'film':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
@@ -183,7 +184,7 @@ def check(item):
|
|||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.data = data
|
item.data = data
|
||||||
itemlist = episodios(item)
|
itemlist = episodes(item)
|
||||||
if not itemlist:
|
if not itemlist:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.data = data
|
item.data = data
|
||||||
@@ -192,6 +193,6 @@ def check(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
item.data = item.data.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca
|
item.data = item.data.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca
|
||||||
return support.server(item, data=item.data)
|
return support.server(item, data=item.data)
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
"thumbnail": "cinetecadibologna.png",
|
"thumbnail": "cinetecadibologna.png",
|
||||||
"banner": "cinetecadibologna.png",
|
"banner": "cinetecadibologna.png",
|
||||||
"categories": ["documentary"],
|
"categories": ["documentary"],
|
||||||
"not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime"],
|
"not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per cinetecadibologna
|
# Canale per cinetecadibologna
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
from core.item import Item
|
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
if 'epoche' in item.url:
|
if 'epoche' in item.url:
|
||||||
patronMenu =r'<li>\s*<a href="(?P<url>[^"]+)">(?P<title>[^>]+)<'
|
patronMenu =r'<li>\s*<a href="(?P<url>[^"]+)">(?P<title>[^>]+)<'
|
||||||
elif 'percorsi' in item.url:
|
elif 'percorsi' in item.url:
|
||||||
@@ -34,23 +34,23 @@ def menu(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
item.args = 'noorder'
|
item.args = 'noorder'
|
||||||
item.url = host + '/ricerca/type_ALL/ricerca_' + text
|
item.url = host + '/ricerca/type_ALL/ricerca_' + text
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
if 'alfabetico' in item.url:
|
if 'alfabetico' in item.url:
|
||||||
patron = r'<img src="(?P<thumb>[^"]+)"[^>]+>\s*[^>]+>\s*<div[^>]+>\s*<div[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?:\[)?(?P<title>[^\]<]+)(?:\]|<)'
|
patron = r'<img src="(?P<thumb>[^"]+)"[^>]+>\s*[^>]+>\s*<div[^>]+>\s*<div[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?:\[)?(?P<title>[^\]<]+)(?:\]|<)'
|
||||||
else:
|
else:
|
||||||
@@ -62,13 +62,13 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
matches = support.match(item, patron=r'filename: "(.*?)"').matches
|
matches = support.match(item, patron=r'filename: "(.*?)"').matches
|
||||||
|
|
||||||
for url in matches:
|
for url in matches:
|
||||||
itemlist.append(item.clone(action="play", title=support.config.get_localized_string(30137), server='directo', url=host + url))
|
itemlist.append(item.clone(action="play", title=support.config.getLocalizedString(30137), server='directo', url=host + url))
|
||||||
|
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,8 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
from core import support, jsontools
|
from core import support
|
||||||
from platformcode import logger, config
|
from platformcode import logger
|
||||||
typo = support.typo
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
@@ -24,8 +23,8 @@ def Dict(item):
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
top = [('Dirette {bold}', ['', 'live']),
|
top = [('Dirette {bullet bold}', ['', 'live']),
|
||||||
('Programmi {bullet bold tv}', ['', 'peliculas', 'programmi']),
|
('Programmi {bullet bold tv}', ['', 'movies', 'programmi']),
|
||||||
('Generi {bullet bold tv}', ['', 'genres'])]
|
('Generi {bullet bold tv}', ['', 'genres'])]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
@@ -33,30 +32,16 @@ def mainlist(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def liveDict():
|
|
||||||
livedict = {}
|
|
||||||
|
|
||||||
for key in session.get(api + '/cms/routes/canali?decorators=viewingHistory&include=default', headers=headers).json()['included']:
|
|
||||||
|
|
||||||
if key['type'] == 'channel' and key.get('attributes',{}).get('hasLiveStream', '') and 'Free' in key.get('attributes',{}).get('packages', []):
|
|
||||||
title = key['attributes']['name']
|
|
||||||
livedict[title] = {}
|
|
||||||
livedict[title]['plot'] = key['attributes']['description']
|
|
||||||
livedict[title]['url'] = '{}/canali/{}'.format(host, key['attributes']['alternateId'])
|
|
||||||
livedict[title]['id'] = key['id']
|
|
||||||
return livedict
|
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
item.text = text
|
item.text = text
|
||||||
try:
|
try:
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -64,13 +49,19 @@ def search(item, text):
|
|||||||
def live(item):
|
def live(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist =[]
|
itemlist =[]
|
||||||
for name, values in liveDict().items():
|
for key in session.get(api + '/cms/routes/canali?decorators=viewingHistory&include=default', headers=headers).json()['included']:
|
||||||
itemlist.append(item.clone(title=typo(name,'bold'), fulltitle=name, plot=values['plot'], url=values['url'], id=values['id'], action='play', forcethumb=True, no_return=True))
|
if key['type'] == 'channel' and key.get('attributes',{}).get('hasLiveStream', '') and 'Free' in key.get('attributes',{}).get('packages', []):
|
||||||
return support.thumb(itemlist, live=True)
|
title = key['attributes']['name']
|
||||||
|
plot = key['attributes']['description']
|
||||||
|
url = '{}/canali/{}'.format(host, key['attributes']['alternateId'])
|
||||||
|
_id = key['id']
|
||||||
|
|
||||||
|
itemlist.append(item.clone(title=title, fulltitle=title, plot=plot, url=url, id=_id, action='findvideos', forcethumb=True))
|
||||||
|
return support.thumb(itemlist, mode='live')
|
||||||
|
|
||||||
|
|
||||||
def genres(item):
|
def genres(item):
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = [
|
itemlist = [
|
||||||
item.clone(title='Attualità e inchiesta', args='genere/attualita-e-inchiesta'),
|
item.clone(title='Attualità e inchiesta', args='genere/attualita-e-inchiesta'),
|
||||||
item.clone(title='Beauty and style', args='genere/beauty-and-style'),
|
item.clone(title='Beauty and style', args='genere/beauty-and-style'),
|
||||||
@@ -96,7 +87,7 @@ def genres(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist =[]
|
itemlist =[]
|
||||||
if 'search' in item.args:
|
if 'search' in item.args:
|
||||||
@@ -116,14 +107,14 @@ def peliculas(item):
|
|||||||
fanarts = [image['attributes']['src'] for image in images if len(key['relationships']['images']['data']) > 1 and image['id'] == key['relationships']['images']['data'][1]['id']]
|
fanarts = [image['attributes']['src'] for image in images if len(key['relationships']['images']['data']) > 1 and image['id'] == key['relationships']['images']['data'][1]['id']]
|
||||||
fanart = fanarts[0] if fanarts else item.fanart
|
fanart = fanarts[0] if fanarts else item.fanart
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=typo(title,'bold'),
|
item.clone(title=title,
|
||||||
fulltitle=title,
|
fulltitle=title,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
url=url,
|
url=url,
|
||||||
programid=key['attributes']['alternateId'],
|
programid=key['attributes']['alternateId'],
|
||||||
id=key['id'],
|
id=key['id'],
|
||||||
seasons=seasons,
|
seasons=seasons,
|
||||||
action='episodios',
|
action='episodes',
|
||||||
thumbnail=thumb,
|
thumbnail=thumb,
|
||||||
fanart=fanart,
|
fanart=fanart,
|
||||||
contentType='tvshow'))
|
contentType='tvshow'))
|
||||||
@@ -131,7 +122,7 @@ def peliculas(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist =[]
|
itemlist =[]
|
||||||
pdict = session.get(api + '/cms/routes/programmi/{}?decorators=viewingHistory&include=default'.format(item.programid), headers=headers).json()['included']
|
pdict = session.get(api + '/cms/routes/programmi/{}?decorators=viewingHistory&include=default'.format(item.programid), headers=headers).json()['included']
|
||||||
@@ -163,11 +154,11 @@ def episodios(item):
|
|||||||
title = '{}x{:02d} - {}'.format(option['id'], episode['attributes']['episodeNumber'], episode['attributes']['name'])
|
title = '{}x{:02d} - {}'.format(option['id'], episode['attributes']['episodeNumber'], episode['attributes']['name'])
|
||||||
plot = episode['attributes']['description']
|
plot = episode['attributes']['description']
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=typo(title,'bold'),
|
item.clone(title=title,
|
||||||
fulltitle=title,
|
fulltitle=title,
|
||||||
plot=plot,
|
plot=plot,
|
||||||
id=episode['id'],
|
id=episode['id'],
|
||||||
action='play',
|
action='findvideos',
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
season=option['id'],
|
season=option['id'],
|
||||||
episode=episode['attributes']['episodeNumber'],
|
episode=episode['attributes']['episodeNumber'],
|
||||||
@@ -177,6 +168,9 @@ def episodios(item):
|
|||||||
if itemlist: itemlist.sort(key=lambda it: (int(it.season), int(it.episode)))
|
if itemlist: itemlist.sort(key=lambda it: (int(it.season), int(it.episode)))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.debug()
|
||||||
|
return support.server(item, itemlist=[item.clone(server='directo', action='play')])
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
if item.livefilter:
|
if item.livefilter:
|
||||||
@@ -184,7 +178,7 @@ def play(item):
|
|||||||
item.fulltitle = item.livefilter
|
item.fulltitle = item.livefilter
|
||||||
item.forcethumb = True
|
item.forcethumb = True
|
||||||
item.no_return = True
|
item.no_return = True
|
||||||
support.thumb(item, live=True)
|
support.thumb(item, mode='live')
|
||||||
if item.contentType == 'episode': data = session.get('{}/playback/v2/videoPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
if item.contentType == 'episode': data = session.get('{}/playback/v2/videoPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
||||||
else: data = session.get('{}/playback/v2/channelPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
else: data = session.get('{}/playback/v2/channelPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
||||||
if data.get('protection', {}).get('drm_enabled',True):
|
if data.get('protection', {}).get('drm_enabled',True):
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "dreamsub.png",
|
"thumbnail": "dreamsub.png",
|
||||||
"banner": "dreamsub.png",
|
"banner": "dreamsub.png",
|
||||||
"categories": ["anime", "vos"],
|
"categories": ["anime", "sub"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,22 +4,21 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.info(item)
|
|
||||||
|
|
||||||
anime = ['/search?typeY=tv',
|
anime = ['/search?typeY=tv',
|
||||||
('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']),
|
('Movie', ['/search?typeY=movie', 'movies', '', 'movie']),
|
||||||
('OAV', ['/search?typeY=oav', 'peliculas', '', 'tvshow']),
|
('OAV', ['/search?typeY=oav', 'movies', '', 'tvshow']),
|
||||||
('Spinoff', ['/search?typeY=spinoff', 'peliculas', '', 'tvshow']),
|
('Spinoff', ['/search?typeY=spinoff', 'movies', '', 'tvshow']),
|
||||||
('Generi', ['','menu','Generi']),
|
('Generi', ['','menu','Generi']),
|
||||||
('Stato', ['','menu','Stato']),
|
('Stato', ['','menu','Stato']),
|
||||||
('Ultimi Episodi', ['', 'peliculas', ['last', 'episodiRecenti']]),
|
('Ultimi Episodi', ['', 'movies', ['last', 'episodiRecenti']]),
|
||||||
('Ultimi Aggiornamenti', ['', 'peliculas', ['last', 'episodiNuovi']])
|
('Ultimi Aggiornamenti', ['', 'movies', ['last', 'episodiNuovi']])
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
@@ -28,14 +27,15 @@ def mainlist(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
item.contentType = ''
|
item.contentType = ''
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
|
|
||||||
|
|
||||||
patronBlock = r'<div class="filter-header"><b>%s</b>(?P<block>.*?)<div class="filter-box">' % item.args
|
patronBlock = r'<div class="filter-header"><b>%s</b>(?P<block>.*?)<div class="filter-box">' % item.args
|
||||||
patronMenu = r'<a class="[^"]+" data-state="[^"]+" (?P<other>[^>]+)>[^>]+></i>[^>]+></i>[^>]+></i>(?P<title>[^>]+)</a>'
|
patronMenu = r'<a class="[^"]+" data-state="[^"]+" (?P<other>[^>]+)>[^>]+></i>[^>]+></i>[^>]+></i>(?P<title>[^>]+)</a>'
|
||||||
|
|
||||||
|
if 'generi' in item.args.lower():
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
support.info(item.type)
|
|
||||||
for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches:
|
for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches:
|
||||||
item.url = host + '/search?' + Type + 'Y=' + ID
|
item.url = host + '/search?' + Type + 'Y=' + ID
|
||||||
return item
|
return item
|
||||||
@@ -43,48 +43,48 @@ def menu(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
|
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/search/' + text
|
item.url = host + '/search/' + text
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host
|
item.url = host
|
||||||
item.args = ['last', 'episodiNuovi']
|
item.args = ['last', 'episodiNuovi']
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
if 'movie' in item.url:
|
if 'movie' in item.url:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
|
|
||||||
if len(item.args) > 1 and item.args[0] == 'last':
|
if len(item.args) > 1 and item.args[0] == 'last':
|
||||||
patronBlock = r'<div id="%s"[^>]+>(?P<block>.*?)<div class="vistaDettagliata"' % item.args[1]
|
patronBlock = r'<div id="%s"[^>]+>(?P<block>.*?)<div class="vistaDettagliata"' % item.args[1]
|
||||||
@@ -102,9 +102,9 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
pagination = 100
|
pagination = True
|
||||||
|
|
||||||
if item.data:
|
if item.data:
|
||||||
data = item.data
|
data = item.data
|
||||||
@@ -116,20 +116,19 @@ def episodios(item):
|
|||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
support.info()
|
logger.debug()
|
||||||
# support.dbg()
|
|
||||||
|
|
||||||
matches = support.match(item, patron=r'href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"')
|
matches = support.match(item, patron=r'href="([^"]+)"', patronBlock=r'<div style="white-space: (.*?)<div id="main-content"')
|
||||||
|
|
||||||
if not matches.matches and item.contentType != 'episode':
|
if not matches.matches and item.contentType != 'episode':
|
||||||
item.data = matches.data
|
item.data = matches.data
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
|
|
||||||
if 'vvvvid' in matches.data:
|
if 'vvvvid' in matches.data:
|
||||||
itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid'))
|
itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid'))
|
||||||
else:
|
else:
|
||||||
support.info('VIDEO')
|
logger.debug('VIDEO')
|
||||||
for url in matches.matches:
|
for url in matches.matches:
|
||||||
lang = url.split('/')[-2]
|
lang = url.split('/')[-2]
|
||||||
if 'ita' in lang.lower():
|
if 'ita' in lang.lower():
|
||||||
|
|||||||
@@ -11,15 +11,15 @@ host = config.get_channel_url()
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
docu = [('Documentari {bullet bold}',('/elenco-documentari','peliculas')),
|
docu = [('Documentari {bullet bold}',('/elenco-documentari','movies')),
|
||||||
('Categorie {submenu}',('','menu')),
|
('Categorie {submenu documentary}',('','menu')),
|
||||||
('Cerca... {bullet bold}',('','search')),]
|
('Cerca... {bullet bold documentary}',('','search')),]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronMenu = r'<li class="menu-item menu-item-type-taxonomy[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<'
|
patronMenu = r'<li class="menu-item menu-item-type-taxonomy[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<'
|
||||||
def fullItemlistHook(itemlist):
|
def fullItemlistHook(itemlist):
|
||||||
item_list = []
|
item_list = []
|
||||||
@@ -32,28 +32,28 @@ def menu(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info()
|
logger.debug()
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "documentales":
|
if category == "documentales":
|
||||||
item.url = host + "/elenco-documentari"
|
item.url = host + "/elenco-documentari"
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(texto)
|
logger.debug(texto)
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -63,7 +63,7 @@ def search(item, texto):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
blacklist = ['GUIDA PRINCIPIANTI Vedere film e documentari streaming gratis', 'Guida Dsda']
|
blacklist = ['GUIDA PRINCIPIANTI Vedere film e documentari streaming gratis', 'Guida Dsda']
|
||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
# debug =True
|
# debug =True
|
||||||
@@ -83,14 +83,14 @@ def peliculas(item):
|
|||||||
title = support.re.sub(r'(?:[Ss]erie\s*|[Ss]treaming(?:\s*[Dd][Aa])?\s*|[Cc]ollezione\s*|[Rr]accolta\s*|[Dd]ocumentari(?:o)?\s*)?','',item.fulltitle).strip()
|
title = support.re.sub(r'(?:[Ss]erie\s*|[Ss]treaming(?:\s*[Dd][Aa])?\s*|[Cc]ollezione\s*|[Rr]accolta\s*|[Dd]ocumentari(?:o)?\s*)?','',item.fulltitle).strip()
|
||||||
if 'serie' in item.fulltitle.lower():
|
if 'serie' in item.fulltitle.lower():
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.action = 'episodios'
|
item.action = 'episodes'
|
||||||
item.contentSerieName = title
|
item.contentSerieName = title
|
||||||
item.contentTitle = ''
|
item.contentTitle = ''
|
||||||
elif 'collezion' in item.fulltitle.lower() or \
|
elif 'collezion' in item.fulltitle.lower() or \
|
||||||
'raccolt' in item.fulltitle.lower() or \
|
'raccolt' in item.fulltitle.lower() or \
|
||||||
'filmografia' in item.fulltitle.lower():
|
'filmografia' in item.fulltitle.lower():
|
||||||
item.args = 'collection'
|
item.args = 'collection'
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
item.contentTitle = title
|
item.contentTitle = title
|
||||||
item.contentSerieName = ''
|
item.contentSerieName = ''
|
||||||
else:
|
else:
|
||||||
@@ -113,7 +113,7 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
html = support.match(item, patron=r'class="title-episodio">(\d+x\d+)')
|
html = support.match(item, patron=r'class="title-episodio">(\d+x\d+)')
|
||||||
data = html.data
|
data = html.data
|
||||||
if html.match:
|
if html.match:
|
||||||
@@ -133,7 +133,7 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
if item.args == 'raccolta' or item.contentType == 'episode':
|
if item.args == 'raccolta' or item.contentType == 'episode':
|
||||||
return support.server(item, item.url)
|
return support.server(item, item.url)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"language": ["ita","sub-ita"],
|
"language": ["ita","sub-ita"],
|
||||||
"thumbnail": "eurostreaming.png",
|
"thumbnail": "eurostreaming.png",
|
||||||
"banner": "eurostreaming.png",
|
"banner": "eurostreaming.png",
|
||||||
"categories": ["tvshow","anime","vos"],
|
"categories": ["tvshow","anime","sub"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,9 @@
|
|||||||
# by Greko
|
# by Greko
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import httptools, support
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
# def findhost(url):
|
# def findhost(url):
|
||||||
# permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
|
# permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
|
||||||
@@ -17,25 +18,24 @@ headers = [['Referer', host]]
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.info()
|
|
||||||
tvshow = []
|
tvshow = []
|
||||||
anime = ['/category/anime-cartoni-animati/']
|
anime = ['/category/anime-cartoni-animati/']
|
||||||
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest']),
|
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'movies', 'newest']),
|
||||||
('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'peliculas'])]
|
('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'movies'])]
|
||||||
search = ''
|
search = ''
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
|
|
||||||
if item.args == 'newest':
|
if item.args == 'newest':
|
||||||
item.contentType = 'episode'
|
item.contentType = 'episode'
|
||||||
patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>[^<]+) –\s*<a href="(?P<url>[^"]+)"[^>]*>\s+?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>'
|
patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>[^<]+) –\s*<a href="(?P<url>[^"]+)"[^>]*>\s+?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>'
|
||||||
pagination = ''
|
pagination = True
|
||||||
else:
|
else:
|
||||||
patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>'
|
patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>'
|
||||||
patronNext=r'a class="next page-numbers" href="?([^>"]+)">Avanti »</a>'
|
patronNext=r'a class="next page-numbers" href="?([^>"]+)">Avanti »</a>'
|
||||||
@@ -43,13 +43,13 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
data = support.match(item, headers=headers).data
|
data = support.match(item, headers=headers).data
|
||||||
if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data
|
if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data
|
||||||
elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data
|
elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data
|
||||||
patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>'
|
patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>'
|
||||||
patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.*?)(?:â|-.+?-|âÂÂ.+?âÂÂ|âÂÂ|em|.)?(?:/em.*?)?(?:<a (?P<other>.*?))?<br />'
|
patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.*?)(?:â|-.+?-|âÂÂ.+?âÂÂ|âÂÂ|em|.)?(?:/em.*?)?(?:<a (?P<data>.*?))<br />'
|
||||||
|
|
||||||
def itemHook(i):
|
def itemHook(i):
|
||||||
i.url = item.url
|
i.url = item.url
|
||||||
@@ -58,25 +58,25 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info()
|
logger.debug(text)
|
||||||
|
|
||||||
item.url = "%s/?s=%s" % (host, texto)
|
item.url = "%s/?s=%s" % (host, text)
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info(line)
|
logger.error(line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info()
|
logger.debug()
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
@@ -84,18 +84,18 @@ def newest(categoria):
|
|||||||
item.args = 'newest'
|
item.args = 'newest'
|
||||||
try:
|
try:
|
||||||
item.url = "%s/aggiornamento-episodi/" % host
|
item.url = "%s/aggiornamento-episodi/" % host
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
return support.server(item, item.other)
|
return support.server(item, item.data)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"active": false,
|
"active": false,
|
||||||
"thumbnail": "fastsubita.png",
|
"thumbnail": "fastsubita.png",
|
||||||
"banner": "fastsubita.png",
|
"banner": "fastsubita.png",
|
||||||
"categories": ["tvshow", "vos"],
|
"categories": ["tvshow", "sub"],
|
||||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime"],
|
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Su questo canale, nella categoria 'Ricerca Globale'
|
Su questo canale, nella category 'Ricerca Globale'
|
||||||
non saranno presenti le voci 'Aggiungi alla Videoteca'
|
non saranno presenti le voci 'Aggiungi alla Videoteca'
|
||||||
e 'Scarica Film'/'Scarica Serie', dunque,
|
e 'Scarica Film'/'Scarica Serie', dunque,
|
||||||
la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE.
|
la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE.
|
||||||
@@ -16,10 +16,9 @@
|
|||||||
- SOLO SUB-ITA
|
- SOLO SUB-ITA
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from core import support, httptools, scrapertools
|
from core import support, httptools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core.support import info
|
from platformcode import config, logger
|
||||||
from platformcode import config
|
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -29,7 +28,7 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
Tvshow = [
|
Tvshow = [
|
||||||
('Aggiornamenti', ['', 'peliculas', 'update']),
|
('Aggiornamenti', ['', 'movies', 'update']),
|
||||||
('Cerca... {bold}{TV}', ['', 'search'])
|
('Cerca... {bold}{TV}', ['', 'search'])
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -39,27 +38,25 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info(item)
|
|
||||||
# support.dbg()
|
|
||||||
deflang = 'Sub-ITA'
|
deflang = 'Sub-ITA'
|
||||||
|
|
||||||
# è una singola pagina con tutti gli episodi
|
# è una singola pagina con tutti gli episodi
|
||||||
if item.grouped and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
if item.grouped and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
||||||
item.grouped = False
|
item.grouped = False
|
||||||
return episodios_args(item)
|
return episodes_args(item)
|
||||||
|
|
||||||
# ogni puntata è un articolo a se
|
# ogni puntata è un articolo a se
|
||||||
if item.fulltitle:
|
if item.fulltitle:
|
||||||
item.url = host + '?s=' + item.fulltitle
|
item.url = host + '?s=' + item.fulltitle
|
||||||
actLike = 'episodios'
|
actLike = 'episodes'
|
||||||
|
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
blacklist = ['']
|
blacklist = ['']
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<h4 id="mctm1-.">'+item.fulltitle+'</h4>(?P<block>.+?)</div>'
|
patronBlock = r'<h4 id="mctm1-.">'+item.fulltitle+'</h4>(?P<block>.+?)</div>'
|
||||||
patron = r'[^>]+>[^>]+>.+?href="(?P<url>[^"]+)[^>]>(?P<title>[^<]+)\s<'
|
patron = r'[^>]+>[^>]+>.+?href="(?P<url>[^"]+)[^>]>(?P<title>[^<]+)\s<'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
elif item.args == 'search':
|
elif item.args == 'search':
|
||||||
group = True
|
group = True
|
||||||
patronBlock = r'</header>(?P<block>.*?)</main>'
|
patronBlock = r'</header>(?P<block>.*?)</main>'
|
||||||
@@ -67,7 +64,7 @@ def peliculas(item):
|
|||||||
else:
|
else:
|
||||||
# è una singola pagina con tutti gli episodi
|
# è una singola pagina con tutti gli episodi
|
||||||
if item.args != 'update' and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
if item.args != 'update' and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
||||||
return episodios_args(item)
|
return episodes_args(item)
|
||||||
patron = r'<div class="featured-thumb"> +<a href="(?P<url>[^"]+)" title="(?P<title>[^[]+)\[(?P<episode>\d+×\d+)?'
|
patron = r'<div class="featured-thumb"> +<a href="(?P<url>[^"]+)" title="(?P<title>[^[]+)\[(?P<episode>\d+×\d+)?'
|
||||||
patronBlock = r'<main id="main"[^>]+>(?P<block>.*?)<div id="secondary'
|
patronBlock = r'<main id="main"[^>]+>(?P<block>.*?)<div id="secondary'
|
||||||
|
|
||||||
@@ -81,9 +78,8 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def episodios_args(item):
|
def episodes_args(item):
|
||||||
actLike = 'episodios'
|
actLike = 'episodes'
|
||||||
# support.dbg()
|
|
||||||
|
|
||||||
deflang = 'Sub-ITA'
|
deflang = 'Sub-ITA'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
@@ -96,17 +92,15 @@ def episodios_args(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info(item)
|
return episodes_args(item)
|
||||||
return episodios_args(item)
|
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
#support.dbg()
|
|
||||||
|
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = r'<div id="mcTagMapNav">(?P<block>.+?)</div>'
|
patronBlock = r'<div id="mcTagMapNav">(?P<block>.+?)</div>'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>.+?)</a>'
|
patron = r'<a href="(?P<url>[^"]+)">(?P<title>.+?)</a>'
|
||||||
|
|
||||||
@@ -120,47 +114,47 @@ def genres(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', item)
|
logger.debug('search', text)
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '?s=' + text
|
item.url = host + '?s=' + text
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info('newest ->', categoria)
|
logger.debug('newest ->', category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
if categoria == 'series':
|
if category == 'tvshow':
|
||||||
try:
|
try:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.args = 'newest'
|
item.args = 'newest'
|
||||||
item.url = host
|
item.url = host
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('newest log: ', line)
|
logger.error('newest log: ', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos ->', item)
|
logger.debug('findvideos ->', item)
|
||||||
patron = r'<a href="([^"]+)">'
|
patron = r'<a href="([^"]+)">'
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -176,14 +170,14 @@ def findvideos(item):
|
|||||||
resp = httptools.downloadpage(scrapedurl, follow_redirects=False)
|
resp = httptools.downloadpage(scrapedurl, follow_redirects=False)
|
||||||
data += resp.headers.get("location", "") + '\n'
|
data += resp.headers.get("location", "") + '\n'
|
||||||
elif not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
elif not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
else:
|
else:
|
||||||
patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">'
|
patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">'
|
||||||
html = support.match(item, patron=patron, patronBlock=patronBlock, headers=headers)
|
html = support.match(item, patron=patron, patronBlock=patronBlock, headers=headers)
|
||||||
matches = html.matches
|
matches = html.matches
|
||||||
data= html.data
|
data= html.data
|
||||||
|
|
||||||
if item.args != 'episodios':
|
if item.args != 'episodes':
|
||||||
item.infoLabels['mediatype'] = 'episode'
|
item.infoLabels['mediatype'] = 'episode'
|
||||||
for scrapedurl in matches:
|
for scrapedurl in matches:
|
||||||
if 'is.gd' in scrapedurl:
|
if 'is.gd' in scrapedurl:
|
||||||
@@ -206,7 +200,7 @@ def findvideos(item):
|
|||||||
# contentType='tvshow',
|
# contentType='tvshow',
|
||||||
# contentSerieName=series,
|
# contentSerieName=series,
|
||||||
# url=host+"/serietv/"+series,
|
# url=host+"/serietv/"+series,
|
||||||
# action='episodios',
|
# action='episodes',
|
||||||
# contentTitle=titles,
|
# contentTitle=titles,
|
||||||
# plot = "Vai alla Serie " + titles + " con tutte le puntate",
|
# plot = "Vai alla Serie " + titles + " con tutte le puntate",
|
||||||
# ))
|
# ))
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
"thumbnail": "film4k.png",
|
"thumbnail": "film4k.png",
|
||||||
"banner": "film4k.png",
|
"banner": "film4k.png",
|
||||||
"categories": ["tvshow", "movie", "anime"],
|
"categories": ["tvshow", "movie", "anime"],
|
||||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime", "include_in_newest_series"],
|
"not_active": ["include_in_newest_movie", "include_in_newest_anime", "include_in_newest_tvshow"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ def mainlist(item):
|
|||||||
('Qualità', ['', 'menu', 'quality']),
|
('Qualità', ['', 'menu', 'quality']),
|
||||||
('Generi', ['movies', 'menu', 'genres']),
|
('Generi', ['movies', 'menu', 'genres']),
|
||||||
('Anno', ['movies', 'menu', 'releases']),
|
('Anno', ['movies', 'menu', 'releases']),
|
||||||
('Più popolari', ['trending/?get=movies', 'peliculas']),
|
('Più popolari', ['trending/?get=movies', 'movies']),
|
||||||
('Più votati', ['ratings/?get=movies', 'peliculas'])]
|
('Più votati', ['ratings/?get=movies', 'movies'])]
|
||||||
tvshow = ['/tvshows',
|
tvshow = ['/tvshows',
|
||||||
('Più popolari', ['trending/?get=tv', 'peliculas']),
|
('Più popolari', ['trending/?get=tv', 'movies']),
|
||||||
('Più votati', ['ratings/?get=tv', 'peliculas'])]
|
('Più votati', ['ratings/?get=tv', 'movies'])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@@ -41,14 +41,14 @@ def search(item, text):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
if 'anime' in item.url:
|
if 'anime' in item.url:
|
||||||
return support.dooplay_peliculas(item, True)
|
return support.dooplay_movies(item, True)
|
||||||
else:
|
else:
|
||||||
return support.dooplay_peliculas(item, False)
|
return support.dooplay_movies(item, False)
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
itemlist = support.dooplay_get_episodes(item)
|
itemlist = support.dooplay_get_episodes(item)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
if item.args in ['genres','releases']:
|
if item.args in ['genres','releases']:
|
||||||
patronBlock = r'<nav class="' + item.args + r'">(?P<block>.*?)</nav'
|
patronBlock = r'<nav class="' + item.args + r'">(?P<block>.*?)</nav'
|
||||||
patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<'
|
patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<'
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
"categories": ["movie","tvshow"],
|
"categories": ["movie","tvshow"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"id": "include_in_newest_peliculas",
|
"id": "include_in_newest_movie",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "@70727",
|
"label": "@70727",
|
||||||
"default": false,
|
"default": false,
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"visible": false
|
"visible": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "include_in_newest_series",
|
"id": "include_in_newest_tvshow",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "@70727",
|
"label": "@70727",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import re
|
|||||||
|
|
||||||
from core import httptools, support
|
from core import httptools, support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
film = [
|
film = [
|
||||||
('Al Cinema ', ['', 'peliculas', 'cinema']),
|
('Al Cinema ', ['', 'movies', 'cinema']),
|
||||||
('Categorie', ['', 'genres', 'genres']),
|
('Categorie', ['', 'genres', 'genres']),
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -40,8 +40,7 @@ def mainlist(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info()
|
|
||||||
|
|
||||||
if item.args == 'search':
|
if item.args == 'search':
|
||||||
action = ''
|
action = ''
|
||||||
@@ -62,11 +61,11 @@ def peliculas(item):
|
|||||||
data = re.sub('\n|\t', ' ', data)
|
data = re.sub('\n|\t', ' ', data)
|
||||||
patron = r'<div class="cnt">\s.*?src="([^"]+)".+?title="((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)"\s*[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s+<a href="(?P<url>[^"]+)"'
|
patron = r'<div class="cnt">\s.*?src="([^"]+)".+?title="((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)"\s*[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s+<a href="(?P<url>[^"]+)"'
|
||||||
patronBlock = r'<div class="container">(?P<block>.*?)</main>'
|
patronBlock = r'<div class="container">(?P<block>.*?)</main>'
|
||||||
pagination = ''
|
pagination = True
|
||||||
|
|
||||||
patronNext = '<a class="page-link" href="([^"]+)">>>'
|
patronNext = '<a class="page-link" href="([^"]+)">>>'
|
||||||
else:
|
else:
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
patron = r'<div class="cnt">\s.*?src="([^"]+)".+?title="((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)"\s*[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s+<a href="(?P<url>[^"]+)"'
|
patron = r'<div class="cnt">\s.*?src="([^"]+)".+?title="((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)"\s*[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s+<a href="(?P<url>[^"]+)"'
|
||||||
## if item.args == 'search':
|
## if item.args == 'search':
|
||||||
## patron = r'<div class="cnt">.*?src="([^"]+)".+?[^>]+>[^>]+>[^>]+>\s+((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)\s+<[^>]+>[^>]+>[^>]+>[ ]<a href="(?P<url>[^"]+)"'
|
## patron = r'<div class="cnt">.*?src="([^"]+)".+?[^>]+>[^>]+>[^>]+>\s+((?P<title>.+?)(?:[ ]\[(?P<lang>Sub-ITA|SUB-ITA)\])?(?:[ ]\[(?P<quality>.*?)\])?(?:[ ]\((?P<year>\d+)\))?)\s+<[^>]+>[^>]+>[^>]+>[ ]<a href="(?P<url>[^"]+)"'
|
||||||
@@ -75,7 +74,7 @@ def peliculas(item):
|
|||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if item.args == 'search':
|
if item.args == 'search':
|
||||||
if 'series' in item.url:
|
if 'series' in item.url:
|
||||||
item.action = 'episodios'
|
item.action = 'episodes'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
else:
|
else:
|
||||||
item.action = 'findvideos'
|
item.action = 'findvideos'
|
||||||
@@ -87,9 +86,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info()
|
|
||||||
|
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">'
|
patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">'
|
||||||
patron = r'href="(?P<url>.*?)">(?:.+?)?\s+S(?P<season>\d+)\s\-\sEP\s(?P<episode>\d+)[^<]+<'
|
patron = r'href="(?P<url>.*?)">(?:.+?)?\s+S(?P<season>\d+)\s\-\sEP\s(?P<episode>\d+)[^<]+<'
|
||||||
@@ -98,15 +95,13 @@ def episodios(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
support.info()
|
|
||||||
|
|
||||||
if item.contentType == 'movie':
|
if item.contentType == 'movie':
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
|
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
|
||||||
patronBlock = r'CATEGORIES.*?<ul>(?P<block>.*?)</ul>'
|
patronBlock = r'CATEGORIES.*?<ul>(?P<block>.*?)</ul>'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
blacklist = ['Al-Cinema']
|
blacklist = ['Al-Cinema']
|
||||||
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
|
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
|
||||||
patronBlock = r'class="material-button submenu-toggle"> SERIE TV.*?<ul>.*?</li>(?P<block>.*?)</ul>'
|
patronBlock = r'class="material-button submenu-toggle"> SERIE TV.*?<ul>.*?</li>(?P<block>.*?)</ul>'
|
||||||
@@ -115,42 +110,42 @@ def genres(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', item)
|
logger.debug('search', text)
|
||||||
|
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/search/?s=' + text
|
item.url = host + '/search/?s=' + text
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info('newest ->', categoria)
|
logger.debug('newest ->', category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.url = host
|
item.url = host
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info({0}.format(line))
|
logger.error({0}.format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
return support.server(item)
|
return support.server(item)
|
||||||
|
|||||||
@@ -3,14 +3,12 @@
|
|||||||
# Canale per filmpertutti.py
|
# Canale per filmpertutti.py
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import httptools, support
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
|
|
||||||
def findhost(url):
|
def findhost(url):
|
||||||
page = httptools.downloadpage(url).data
|
return support.match(url, patron=r'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)').match
|
||||||
url = support.scrapertools.find_single_match(page, 'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)')
|
|
||||||
return url
|
|
||||||
|
|
||||||
host = config.get_channel_url(findhost)
|
host = config.get_channel_url(findhost)
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -24,7 +22,7 @@ def mainlist(item):
|
|||||||
]
|
]
|
||||||
|
|
||||||
tvshow = ['/category/serie-tv/',
|
tvshow = ['/category/serie-tv/',
|
||||||
('Aggiornamenti', ['/aggiornamenti-serie-tv/', 'peliculas', 'newest']),
|
('Aggiornamenti', ['/aggiornamenti-serie-tv/', 'movies', 'newest']),
|
||||||
('Per Lettera', ['/category/serie-tv/', 'genres', 'lettersS'])
|
('Per Lettera', ['/category/serie-tv/', 'genres', 'lettersS'])
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -33,11 +31,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info()
|
|
||||||
# debug = True
|
|
||||||
#debugBlock = True
|
|
||||||
# support.dbg()
|
|
||||||
|
|
||||||
if item.args != 'newest':
|
if item.args != 'newest':
|
||||||
patronBlock = r'<ul class="posts">(?P<block>.*)<\/ul>'
|
patronBlock = r'<ul class="posts">(?P<block>.*)<\/ul>'
|
||||||
@@ -48,13 +42,13 @@ def peliculas(item):
|
|||||||
patron = r'<li>\s?<a href="(?P<url>[^"]+)" data-thumbnail="(?P<thumb>[^"]+)">.*?<div class="title[^"]*">(?P<title>.+?)(?:\s\[(?P<quality>HD)\])?<\/div>\s*<div class="episode[^"]*"[^>]+>(?P<episode>[^<(]+)(?:\((?P<lang>[a-zA-Z\-]+)\))?'
|
patron = r'<li>\s?<a href="(?P<url>[^"]+)" data-thumbnail="(?P<thumb>[^"]+)">.*?<div class="title[^"]*">(?P<title>.+?)(?:\s\[(?P<quality>HD)\])?<\/div>\s*<div class="episode[^"]*"[^>]+>(?P<episode>[^<(]+)(?:\((?P<lang>[a-zA-Z\-]+)\))?'
|
||||||
|
|
||||||
if item.args == 'search':
|
if item.args == 'search':
|
||||||
action = 'select'
|
action = 'check'
|
||||||
elif item.contentType == 'tvshow':
|
elif item.contentType == 'tvshow':
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
elif item.contentType == 'movie':
|
elif item.contentType == 'movie':
|
||||||
action ='findvideos'
|
action ='findvideos'
|
||||||
else:
|
else:
|
||||||
action = 'select'
|
action = 'check'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.title = item.title.replace(' - La Serie', '')
|
item.title = item.title.replace(' - La Serie', '')
|
||||||
@@ -63,12 +57,12 @@ def peliculas(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
# debug = True
|
# debug=True
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
if 'accordion-item' in data:
|
if 'accordion-item' in data:
|
||||||
patronBlock = r'<span class="season[^>]*>\d+[^>]+>[^>]+>[^>]+>[^>]+>\D*(?:STAGIONE|Stagione)[ -]+(?P<lang>[a-zA-Z\- ]+)[^<]*</span>(?P<block>.*?)<div id="(?:season|disqus)'
|
patronBlock = r'<span class="season[^>]*>\d+[^>]+>[^>]+>[^>]+>[^>]+>\D*(?:STAGIONE|Stagione)[ -]+(?P<lang>[a-zA-Z\- ]+)[^<]*</span>(?P<block>.*?)<div id="(?:season|disqus)'
|
||||||
patron = r'<img src="(?P<thumb>[^"]+)">.*?<li class="season-no">(?P<season>\d+)(?:×|×|x)(?P<episode>\d+)[^<0-9]*<\/li>(?P<data>.*?javascript:;">(?P<title>[^<]+).*?</tbody>)'
|
patron = r'data-src="(?P<thumb>[^"]+)"[^>]*>.*?<li class="season-no">(?P<season>\d+)(?:×|×|x)(?P<episode>\d+)[^<0-9]*<\/li>(?P<data>.*?javascript:;">(?P<title>[^<]+).*?</tbody>)'
|
||||||
else:
|
else:
|
||||||
patronBlock = r'(?:STAGIONE|Stagione)(?:<[^>]+>)?\s*(?:(?P<lang>[A-Za-z- ]+))?(?P<block>.*?)(?: |<strong>|<div class="addtoany)'
|
patronBlock = r'(?:STAGIONE|Stagione)(?:<[^>]+>)?\s*(?:(?P<lang>[A-Za-z- ]+))?(?P<block>.*?)(?: |<strong>|<div class="addtoany)'
|
||||||
patron = r'(?:/>|p>)\s*(?P<season>\d+)(?:×|×|x)(?P<episode>\d+)[^<]+(?P<data>.*?)(?:<br|</p)'
|
patron = r'(?:/>|p>)\s*(?P<season>\d+)(?:×|×|x)(?P<episode>\d+)[^<]+(?P<data>.*?)(?:<br|</p)'
|
||||||
@@ -90,64 +84,64 @@ def genres(item):
|
|||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
|
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = r'<select class="cats">(?P<block>.*?)<\/select>'
|
patronBlock = r'<select class="cats">(?P<block>.*?)<\/select>'
|
||||||
patronMenu = r'<option data-src="(?P<url>[^"]+)">(?P<title>[^<]+)<\/option>'
|
patronGenreMenu = r'<option data-src="(?P<url>[^"]+)">(?P<title>[^<]+)<\/option>'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def select(item):
|
def check(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
patron=r'class="taxonomy category"\s*><span property="name">([^>]+)</span></a><meta property="position" content="2">'
|
patron=r'class="taxonomy category"\s*><span property="name">([^>]+)</span></a><meta property="position" content="2">'
|
||||||
block = support.match(item.url, patron=patron,headers=headers).match
|
block = support.match(item.url, patron=patron,headers=headers).match
|
||||||
if block.lower() != 'film':
|
if block.lower() != 'film':
|
||||||
support.info('select = ### è una serie ###')
|
logger.debug('### è una Serie ###')
|
||||||
item.contentType='tvshow'
|
item.contentType='tvshow'
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
else:
|
else:
|
||||||
support.info('select = ### è un movie ###')
|
logger.debug(' ### è un Film ###')
|
||||||
item.contentType='movie'
|
item.contentType='movie'
|
||||||
return findvideos(item)
|
return findvideos(item)
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info()
|
logger.debug()
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "peliculas":
|
if category == "movie":
|
||||||
item.url = host + "/category/film/"
|
item.url = host + "/category/film/"
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
item.extra = "movie"
|
item.extra = "movie"
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
else:
|
else:
|
||||||
item.url = host + "/aggiornamenti-serie-tv/"
|
item.url = host + "/aggiornamenti-serie-tv/"
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
item.args = "newest"
|
item.args = "newest"
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
# possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità
|
# possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.support import info
|
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
@@ -29,20 +28,20 @@ def mainlist(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def list(item):
|
def list(item):
|
||||||
patronMenu = r'<a title="(?P<title>[^"]+)" href="(?P<url>[^"]+)'
|
patronMenu = r'<a title="(?P<title>[^"]+)" href="(?P<url>[^"]+)'
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
patron = r'<div class="mlnh-thumb"><a href="(?P<url>[^"]+).*?title="(?P<title>[^"]+).*?src="(?P<thumb>[^"]+).*?hdn">(?P<year>[0-9]{4})'
|
patron = r'<div class="mlnh-thumb"><a href="(?P<url>[^"]+).*?title="(?P<title>[^"]+).*?src="(?P<thumb>[^"]+).*?hdn">(?P<year>[0-9]{4})'
|
||||||
patronNext = 'pagenavi.*?<span>.</span>.*?<a href="([^"]+)'
|
patronNext = 'pagenavi.*?<span>.</span>.*?<a href="([^"]+)'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
patronBlock = r'<div class="tab-pane fade" id="season-(?P<season>.)"(?P<block>.*?)</div>'
|
patronBlock = r'<div class="tab-pane fade" id="season-(?P<season>.)"(?P<block>.*?)</div>'
|
||||||
patron = r'<a href="#" allowfullscreen data-link="(?P<url>[^"]+).*?title="(?P<title>[^"]+)(?P<lang>[sS][uU][bB]-?[iI][tT][aA])?\s*">(?P<episode>[^<]+)'
|
patron = r'<a href="#" allowfullscreen data-link="(?P<url>[^"]+).*?title="(?P<title>[^"]+)(?P<lang>[sS][uU][bB]-?[iI][tT][aA])?\s*">(?P<episode>[^<]+)'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
@@ -51,17 +50,17 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', text)
|
logger.debug('search', text)
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
itemlist = []
|
itemlist = []
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/index.php?story=%s&do=search&subaction=search' % (text)
|
item.url = host + '/index.php?story=%s&do=search&subaction=search' % (text)
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
"id": "guardaserieclick",
|
"id": "guardaserieclick",
|
||||||
"name": "GuardaSerie.click",
|
"name": "GuardaSerie.click",
|
||||||
"active": true,
|
"active": true,
|
||||||
"language": ["ita", "vos"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "guardaserieclick.png",
|
"thumbnail": "guardaserieclick.png",
|
||||||
"bannermenu": "guardaserieclick.png",
|
"bannermenu": "guardaserieclick.png",
|
||||||
"categories": ["tvshow", "anime"],
|
"categories": ["tvshow", "anime"],
|
||||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime"],
|
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||||
"settings": [
|
"settings": [
|
||||||
{
|
{
|
||||||
"id": "include_in_newest_peliculas",
|
"id": "include_in_newest_movie",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "@70727",
|
"label": "@70727",
|
||||||
"default": false,
|
"default": false,
|
||||||
|
|||||||
@@ -16,8 +16,7 @@
|
|||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
from core.support import info
|
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -26,28 +25,28 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
tvshow = ['',
|
tvshow = ['',
|
||||||
('Aggiornamenti', ['', 'peliculas', 'update']),
|
('Aggiornamenti', ['', 'movies', 'update']),
|
||||||
('Generi', ['', 'genres', 'genres']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('News Sub-ITA', ['', 'peliculas', 'ined']),
|
('News Sub-ITA', ['', 'movies', 'ined']),
|
||||||
('Anime/Cartoni', ["/category/animazione/", 'peliculas', 'genres'])
|
('Anime/Cartoni', ["/category/animazione/", 'movies', 'genres'])
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
##@support.scrape
|
##@support.scrape
|
||||||
##def peliculas(item):
|
##def movies(item):
|
||||||
#### import web_pdb; web_pdb.set_trace()
|
#### import web_pdb; web_pdb.set_trace()
|
||||||
## info('peliculas ->\n', item)
|
## logger.debug('movies ->\n', item)
|
||||||
##
|
##
|
||||||
## action = 'episodios'
|
## action = 'episodes'
|
||||||
## block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
|
## block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
|
||||||
##
|
##
|
||||||
## if item.args == 'ined':
|
## if item.args == 'ined':
|
||||||
## deflang = 'SUB-ITA'
|
## deflang = 'SUB-ITA'
|
||||||
## patronBlock = r'<span\s+class="label label-default label-title-typology">'+block
|
## patronBlock = r'<span\s+class="label label-default label-title-typology">'+block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
## elif item.args == 'update':
|
## elif item.args == 'update':
|
||||||
## patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">'+block
|
## patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">'+block
|
||||||
## patron = r'<a(?: rel="[^"]+")? href="(?P<url>[^"]+)"(?: class="[^"]+")?>[ ]<img class="[^"]+"[ ]title="[^"]+"[ ]alt="[^"]+"[ ]src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<episode>\d+.\d+)[ ]\((?P<lang>[a-zA-Z\-]+)[^<]+<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<'
|
## patron = r'<a(?: rel="[^"]+")? href="(?P<url>[^"]+)"(?: class="[^"]+")?>[ ]<img class="[^"]+"[ ]title="[^"]+"[ ]alt="[^"]+"[ ]src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<episode>\d+.\d+)[ ]\((?P<lang>[a-zA-Z\-]+)[^<]+<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<'
|
||||||
@@ -59,25 +58,25 @@ def mainlist(item):
|
|||||||
## elif item.args == 'nolost':
|
## elif item.args == 'nolost':
|
||||||
## patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">'+block
|
## patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">'+block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
## elif item.args == 'classic':
|
## elif item.args == 'classic':
|
||||||
## patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">'+block
|
## patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">'+block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
## else:
|
## else:
|
||||||
## patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">'+block
|
## patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">'+block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
##
|
##
|
||||||
## debug = True
|
## debug = True
|
||||||
## return locals()
|
## return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
## import web_pdb; web_pdb.set_trace()
|
## import web_pdb; web_pdb.set_trace()
|
||||||
info('peliculas ->\n', item)
|
logger.debug('movies ->\n', item)
|
||||||
|
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
blacklist = ['DMCA']
|
blacklist = ['DMCA']
|
||||||
|
|
||||||
if item.args == 'genres' or item.args == 'search':
|
if item.args == 'genres' or item.args == 'search':
|
||||||
@@ -91,36 +90,36 @@ def peliculas(item):
|
|||||||
else:
|
else:
|
||||||
end_block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
|
end_block = r'(?P<block>.*?)<div\s+class="btn btn-lg btn-default btn-load-other-series">'
|
||||||
patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
pagination = 25
|
pagination = True
|
||||||
if item.args == 'ined':
|
if item.args == 'ined':
|
||||||
deflang = 'SUB-ITA'
|
deflang = 'SUB-ITA'
|
||||||
patronBlock = r'<span\s+class="label label-default label-title-typology">' + end_block
|
patronBlock = r'<span\s+class="label label-default label-title-typology">' + end_block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
elif item.args == 'update':
|
elif item.args == 'update':
|
||||||
patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">' + end_block
|
patronBlock = r'<div\s+class="container-fluid greybg title-serie-lastep title-last-ep fixed-title-wrapper containerBottomBarTitle">' + end_block
|
||||||
patron = r'href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>.+?class="strongText">(?P<title>.+?)<'
|
patron = r'href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>.+?class="strongText">(?P<title>.+?)<'
|
||||||
# elif item.args == 'nolost':
|
# elif item.args == 'nolost':
|
||||||
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">' + end_block
|
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">' + end_block
|
||||||
# pagination = 25
|
# pagination = True
|
||||||
# elif item.args == 'classic':
|
# elif item.args == 'classic':
|
||||||
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">' + end_block
|
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-classiche">' + end_block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
## elif item.args == 'anime':
|
## elif item.args == 'anime':
|
||||||
##
|
##
|
||||||
else:
|
else:
|
||||||
patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">' + end_block
|
patronBlock = r'<div\s+class="container container-title-serie-new container-scheda" meta-slug="new">' + end_block
|
||||||
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
## patron = r'<a href="(?P<url>[^"]+)".*?>\s<img\s.*?src="(?P<thumb>[^"]+)"\s/>[^>]+>[^>]+>\s[^>]+>\s(?P<year>\d{4})?\s.+?class="strongText">(?P<title>.+?)<'
|
||||||
## pagination = 25
|
## pagination = True
|
||||||
# support.regexDbg(item, patronBlock, headers)
|
# support.regexDbg(item, patronBlock, headers)
|
||||||
# debug = True
|
# debug = True
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
info()
|
logger.debug()
|
||||||
|
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'<div class="number-episodes-on-img">\s?\d+.\d+\s?(?:\((?P<lang>[a-zA-Z\-]+)\))?</div>.+?(?:<span class="pull-left bottom-year">(?P<title2>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<[^>]+>[^>]+>[^>]+>\s?)?<span(?: meta-nextep="[^"]+")? class="[^"]+" meta-serie="(?P<title>[^"]+)" meta-stag="(?P<season>\d+)" meta-ep="(?P<episode>\d+)" meta-embed="(?P<url>[^>]+)">'
|
patron = r'<div class="number-episodes-on-img">\s?\d+.\d+\s?(?:\((?P<lang>[a-zA-Z\-]+)\))?</div>.+?(?:<span class="pull-left bottom-year">(?P<title2>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<[^>]+>[^>]+>[^>]+>\s?)?<span(?: meta-nextep="[^"]+")? class="[^"]+" meta-serie="(?P<title>[^"]+)" meta-stag="(?P<season>\d+)" meta-ep="(?P<episode>\d+)" meta-embed="(?P<url>[^>]+)">'
|
||||||
@@ -136,9 +135,9 @@ def episodios(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
info()
|
logger.debug()
|
||||||
|
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>'
|
patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>'
|
||||||
patron_block = r'<ul\sclass="dropdown-menu category">(?P<block>.*?)</ul>'
|
patron_block = r'<ul\sclass="dropdown-menu category">(?P<block>.*?)</ul>'
|
||||||
# debug = True
|
# debug = True
|
||||||
@@ -146,42 +145,42 @@ def genres(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
info(text)
|
logger.debug(text)
|
||||||
item.url = host + "/?s=" + text
|
item.url = host + "/search/" + text
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.args = 'update'
|
item.args = 'update'
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.url = host
|
item.url = host
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
info('--->', item)
|
logger.debug('--->', item)
|
||||||
return support.server(item, item.url)
|
return support.server(item, item.url)
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
|
|
||||||
# possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito)
|
# possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito)
|
||||||
|
|
||||||
from core.support import info
|
|
||||||
from core import support
|
from core import support
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -26,34 +26,34 @@ def mainlist(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
patronBlock = r'movies-list movies-list-full(?P<block>.*?)footer>'
|
patronBlock = r'movies-list movies-list-full(?P<block>.*?)footer>'
|
||||||
patron = r'<div data-movie-id[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>[^>]+><img src="(?P<thumbnail>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+).*?jt-info[^>]+>[^:]+:\s*(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d*)[^>]+>[^>]+>[^>]+>(?P<duration>\d*)'
|
patron = r'<div data-movie-id[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>[^>]+><img src="(?P<thumbnail>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+).*?jt-info[^>]+>[^:]+:\s*(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d*)[^>]+>[^>]+>[^>]+>(?P<duration>\d*)'
|
||||||
patronNext = '<li class=.active.>.*?href=.(.*?).>'
|
patronNext = '<li class=.active.>.*?href=.(.*?).>'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
patronBlock = r'<strong>Stagione (?P<season>[0-9]+)(?P<block>.*?)</div></div>'
|
patronBlock = r'<strong>Stagione (?P<season>[0-9]+)(?P<block>.*?)</div></div>'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*Episodio\s*(?P<episode>[0-9]+)'
|
patron = r'<a href="(?P<url>[^"]+)">\s*Episodio\s*(?P<episode>[0-9]+)'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
info(text)
|
logger.debug(text)
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host + "/?s=" + text
|
item.url = host + "/?s=" + text
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("%s" % line)
|
logger.error("%s" % line)
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info('findvideos', item)
|
logger.debug('findvideos', item)
|
||||||
data = support.match(item, headers=headers, patron=r'div class="movieplay">([^>]+)').matches
|
data = support.match(item, headers=headers, patron=r'div class="movieplay">([^>]+)').matches
|
||||||
return support.server(item, data=data )
|
return support.server(item, data=data )
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "hd4me.png",
|
"thumbnail": "hd4me.png",
|
||||||
"banner": "hd4me.png",
|
"banner": "hd4me.png",
|
||||||
"categories": ["movie", "vos"],
|
"categories": ["movie", "sub"],
|
||||||
"not_active": ["include_in_newest"],
|
"not_active": ["include_in_newest"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
@@ -19,10 +20,10 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
if item.args == 'alternative':
|
if item.args == 'alternative':
|
||||||
pagination = ''
|
pagination = True
|
||||||
patron = r'<a title="(?P<title>[^\(]+)\(\s*(?P<year>\d+)\)\s\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?[^"]+"\s*href="(?P<url>[^"]+)'
|
patron = r'<a title="(?P<title>[^\(]+)\(\s*(?P<year>\d+)\)\s\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?[^"]+"\s*href="(?P<url>[^"]+)'
|
||||||
else:
|
else:
|
||||||
patron = r'<a href="(?P<url>[^"]+)" (?:rel="?[0-9]+"?)? title="(?P<title>[^\(]+)(?!\()\s*\((?P<year>\d+)\)\s(?:[^\]]+\])?\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?<img id="?cov"?.*?src="(?P<thumb>[^"]+)'
|
patron = r'<a href="(?P<url>[^"]+)" (?:rel="?[0-9]+"?)? title="(?P<title>[^\(]+)(?!\()\s*\((?P<year>\d+)\)\s(?:[^\]]+\])?\D+(?P<quality>\d+p).{3}(?P<lang>[^ ]+).*?<img id="?cov"?.*?src="(?P<thumb>[^"]+)'
|
||||||
@@ -32,9 +33,9 @@ def peliculas(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genre(item):
|
def genre(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
blacklist =['prova ']
|
blacklist =['prova ']
|
||||||
patronMenu = r'<a href="(?P<url>[^"]+)" class="menu-link\s*sub-menu-link">(?P<title>[^<]+)<'
|
patronGenreMenu = r'<a href="(?P<url>[^"]+)" class="menu-link\s*sub-menu-link">(?P<title>[^<]+)<'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if item.fulltitle in ['Classici Disney', 'Studio Ghibli', 'Pixar']:
|
if item.fulltitle in ['Classici Disney', 'Studio Ghibli', 'Pixar']:
|
||||||
item.args = 'alternative'
|
item.args = 'alternative'
|
||||||
@@ -43,15 +44,15 @@ def genre(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
item.url = host + '/?s=' + text
|
item.url = host + '/?s=' + text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("search except: %s" % line)
|
logger.error("search except: %s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
# def findhost(url):
|
# def findhost(url):
|
||||||
# data = support.httptools.downloadpage(url).data
|
# data = support.httptools.downloadpage(url).data
|
||||||
@@ -11,7 +12,7 @@ from core import support
|
|||||||
# return url[:-1] if url.endswith('/') else url
|
# return url[:-1] if url.endswith('/') else url
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
support.info('HOST',host)
|
logger.debug('HOST',host)
|
||||||
# host = 'https://ilcorsaronero.xyz'
|
# host = 'https://ilcorsaronero.xyz'
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
@@ -20,22 +21,22 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
menu = [
|
menu = [
|
||||||
('BDRiP {film}', ['/categoria.php?active=0&category=1&order=data&by=DESC&page=', 'peliculas', [0, 'movie', True], 'undefined']),
|
('BDRiP {film}', ['/categoria.php?active=0&category=1&order=data&by=DESC&page=', 'movies', [0, 'movie', True], 'undefined']),
|
||||||
('Cerca BDRiP... {submenu} {film}', ['/torrent-ita/1/', 'search', ['search', 'movie', True], 'movie']),
|
('Cerca BDRiP... {submenu} {film}', ['/torrent-ita/1/', 'search', ['search', 'movie', True], 'movie']),
|
||||||
('DVD {film}', ['/categoria.php?active=0&category=20&order=data&by=DESC&page=', 'peliculas', [0, 'movie', True], 'undefined']),
|
('DVD {film}', ['/categoria.php?active=0&category=20&order=data&by=DESC&page=', 'movies', [0, 'movie', True], 'undefined']),
|
||||||
('Cerca DVD... {submenu} {film}', ['/torrent-ita/20/', 'search', ['search', 'movie', True], 'movie']),
|
('Cerca DVD... {submenu} {film}', ['/torrent-ita/20/', 'search', ['search', 'movie', True], 'movie']),
|
||||||
('Screener {film}', ['/categoria.php?active=0&category=19&order=data&by=DESC&page=', 'peliculas', [0, 'movie', True], 'undefined']),
|
('Screener {film}', ['/categoria.php?active=0&category=19&order=data&by=DESC&page=', 'movies', [0, 'movie', True], 'undefined']),
|
||||||
('Cerca Screener.. {submenu} {film}', ['/torrent-ita/19/', 'search', ['search', 'movie', True], 'movie']),
|
('Cerca Screener.. {submenu} {film}', ['/torrent-ita/19/', 'search', ['search', 'movie', True], 'movie']),
|
||||||
('Serie TV', ['/categoria.php?active=0&category=15&order=data&by=DES&page=', 'peliculas', [0 , 'tvshow', True], 'tvshow']),
|
('Serie TV', ['/categoria.php?active=0&category=15&order=data&by=DES&page=', 'movies', [0 , 'tvshow', True], 'tvshow']),
|
||||||
('Cerca Serie TV.. {submenu}', ['/torrent-ita/15/', 'search', ['search', 'tvshow',True], 'tvshow']),
|
('Cerca Serie TV.. {submenu}', ['/torrent-ita/15/', 'search', ['search', 'tvshow',True], 'tvshow']),
|
||||||
('Anime', ['/categoria.php?active=0&category=5&order=data&by=DESC&page=', 'peliculas', [0, 'anime', True], 'tvshow']),
|
('Anime', ['/categoria.php?active=0&category=5&order=data&by=DESC&page=', 'movies', [0, 'anime', True], 'tvshow']),
|
||||||
('Cerca Anime.. {submenu}', ['/torrent-ita/5/', 'search', ['search', 'anime', True], 'tvshow']),
|
('Cerca Anime.. {submenu}', ['/torrent-ita/5/', 'search', ['search', 'anime', True], 'tvshow']),
|
||||||
('Musica', ['/categoria.php?active=0&category=2&order=data&by=DESC&page=', 'peliculas', [0, 'music', False], 'music']),
|
('Musica', ['/categoria.php?active=0&category=2&order=data&by=DESC&page=', 'movies', [0, 'music', False], 'music']),
|
||||||
('Cerca Musica.. {submenu}', ['/torrent-ita/2/', 'search', ['search', 'music', False], 'music']),
|
('Cerca Musica.. {submenu}', ['/torrent-ita/2/', 'search', ['search', 'music', False], 'music']),
|
||||||
('Audiolibri {musica}', ['/categoria.php?active=0&category=18&order=data&by=DESC&page=', 'peliculas', [0, 'music', False], 'music']),
|
('Audiolibri {musica}', ['/categoria.php?active=0&category=18&order=data&by=DESC&page=', 'movies', [0, 'music', False], 'music']),
|
||||||
('Cerca Audiolibri.. {submenu}', ['/torrent-ita/18/', 'search', ['search', 'music', False], 'music']),
|
('Cerca Audiolibri.. {submenu}', ['/torrent-ita/18/', 'search', ['search', 'music', False], 'music']),
|
||||||
# mostrerebbe anche risultati non "multimediali" e allungherebbero inutilmente la ricerca globale
|
# mostrerebbe anche risultati non "multimediali" e allungherebbero inutilmente la ricerca globale
|
||||||
# ('Altro {film}', ['/categoria.php?active=0&category=4&order=data&by=DESC&page=', 'peliculas', [0, 'other', False]]),
|
# ('Altro {film}', ['/categoria.php?active=0&category=4&order=data&by=DESC&page=', 'movies', [0, 'other', False]]),
|
||||||
# ('Cerca altro.. {submenu}', ['/torrent-ita/4/', 'search', ['search', 'other', False]]),
|
# ('Cerca altro.. {submenu}', ['/torrent-ita/4/', 'search', ['search', 'other', False]]),
|
||||||
# ('Cerca Tutto... {color kod bold}', ['/argh.php?search=', 'search', ['search', 'all', False]])
|
# ('Cerca Tutto... {color kod bold}', ['/argh.php?search=', 'search', ['search', 'all', False]])
|
||||||
]
|
]
|
||||||
@@ -44,39 +45,38 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
sceneTitle = item.args[2]
|
sceneTitle = item.args[2]
|
||||||
if item.args[1] in ['tvshow', 'anime', 'music', 'other']:
|
if item.args[1] in ['tvshow', 'anime', 'music', 'other']:
|
||||||
patron = r'>[^"<]+'
|
patron = r'>[^"<]+'
|
||||||
else:
|
else:
|
||||||
patron = r'>(?P<quality>[^"<]+)'
|
patron = r'>(?P<quality>[^"<]+)'
|
||||||
patron += '</td> <TD[^>]+><A class="tab" HREF="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<size>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<seed>[^<]+)'
|
patron += r'</td> <TD[^>]+><A class="tab" HREF="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<size>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<seed>[^<]+)'
|
||||||
|
|
||||||
if 'search' not in item.args:
|
if 'search' not in item.args:
|
||||||
item.url += str(item.args[0])
|
item.url += str(item.args[0])
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
args = item.args
|
args = item.args
|
||||||
args[0] += 1
|
args[0] += 1
|
||||||
support.nextPage(itemlist, item, next_page=item.url, function_or_level="peliculas")
|
support.nextPage(itemlist, item, 'movies', next_page=item.url, total_pages=15)
|
||||||
# itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), args=args, thumbnail=support.thumb()))
|
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(item, text)
|
logger.debug( text)
|
||||||
if 'all' in item.args:
|
if 'all' in item.args:
|
||||||
item.url += text
|
item.url += text
|
||||||
else:
|
else:
|
||||||
item.url += text + '.html'
|
item.url += text + '.html'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
# Cattura l' eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("search except: %s" % line)
|
logger.error("search except: %s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,6 @@
|
|||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "ilgeniodellostreaming.png",
|
"thumbnail": "ilgeniodellostreaming.png",
|
||||||
"banner": "ilgeniodellostreaming.png",
|
"banner": "ilgeniodellostreaming.png",
|
||||||
"categories": ["movie", "tvshow", "anime", "vos"],
|
"categories": ["movie", "tvshow", "anime", "sub"],
|
||||||
"settings": ["include_in_newest_anime"]
|
"settings": ["include_in_newest_anime"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,29 +6,27 @@
|
|||||||
|
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.support import info
|
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.info(item)
|
|
||||||
|
|
||||||
film = ['/film/',
|
film = ['/film/',
|
||||||
('Generi',['', 'genres', 'genres']),
|
('Generi',['', 'genres', 'genres']),
|
||||||
('Per Lettera',['/film-a-z/', 'genres', 'letter']),
|
('Per Lettera',['/film-a-z/', 'genres', 'letter']),
|
||||||
('Anni',['', 'genres', 'year']),
|
('Anni',['', 'genres', 'year']),
|
||||||
('Popolari',['/trending/?get=movies', 'peliculas', 'populared']),
|
('Popolari',['/trending/?get=movies', 'movies', 'populared']),
|
||||||
('Più Votati', ['/ratings/?get=movies', 'peliculas', 'populared'])
|
('Più Votati', ['/ratings/?get=movies', 'movies', 'populared'])
|
||||||
]
|
]
|
||||||
|
|
||||||
tvshow = ['/serie/',
|
tvshow = ['/serie/',
|
||||||
('Aggiornamenti', ['/aggiornamenti-serie/', 'peliculas', 'update']),
|
('Aggiornamenti', ['/aggiornamenti-serie/', 'movies', 'update']),
|
||||||
('Popolari',['/trending/?get=tv', 'peliculas', 'populared']),
|
('Popolari',['/trending/?get=tv', 'movies', 'populared']),
|
||||||
('Più Votati', ['/ratings/?get=tv', 'peliculas', 'populared'])
|
('Più Votati', ['/ratings/?get=tv', 'movies', 'populared'])
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -36,7 +34,7 @@ def mainlist(item):
|
|||||||
]
|
]
|
||||||
|
|
||||||
Tvshow = [
|
Tvshow = [
|
||||||
('Show TV {bullet bold}', ['/tv-show/', 'peliculas', '', 'tvshow'])
|
('Show TV {bullet bold}', ['/tv-show/', 'movies', '', 'tvshow'])
|
||||||
]
|
]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
@@ -45,8 +43,8 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
info()
|
logger.debug()
|
||||||
# debugBlock = True
|
# debugBlock = True
|
||||||
# debug=True
|
# debug=True
|
||||||
|
|
||||||
@@ -55,7 +53,7 @@ def peliculas(item):
|
|||||||
patron = r'<img src="(?P<thumb>[^"]+)" alt="[^"]+" ?/?>[^>]+>(?P<type>[^<]+)</span>.*?<a href="(?P<url>[^"]+)">(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?</a>[^>]+>[^>]+>(?:<span class="rating">IMDb\s*(?P<rating>[^>]+)</span>)?.?(?:<span class="year">(?P<year>[0-9]+)</span>)?.*?<p>(?P<plot>.*?)</p>'
|
patron = r'<img src="(?P<thumb>[^"]+)" alt="[^"]+" ?/?>[^>]+>(?P<type>[^<]+)</span>.*?<a href="(?P<url>[^"]+)">(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?</a>[^>]+>[^>]+>(?:<span class="rating">IMDb\s*(?P<rating>[^>]+)</span>)?.?(?:<span class="year">(?P<year>[0-9]+)</span>)?.*?<p>(?P<plot>.*?)</p>'
|
||||||
|
|
||||||
typeContentDict={'movie': ['film'], 'tvshow': ['tv']}
|
typeContentDict={'movie': ['film'], 'tvshow': ['tv']}
|
||||||
typeActionDict={'findvideos': ['film'], 'episodios': ['tv']}
|
typeActionDict={'findvideos': ['film'], 'episodes': ['tv']}
|
||||||
else:
|
else:
|
||||||
|
|
||||||
if item.contentType == 'movie':
|
if item.contentType == 'movie':
|
||||||
@@ -77,11 +75,11 @@ def peliculas(item):
|
|||||||
patron = r'<div class="poster">\s?<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)" alt="[^"]+"><\/a>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[0-9.]+)<\/div>(?:<span class="quality">(?:SUB-ITA|)?(?P<quality>|[^<]+)?<\/span>)?[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?<\/a>[^>]+>[^>]+>(?P<year>[^<]+)<\/span>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<div'
|
patron = r'<div class="poster">\s?<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)" alt="[^"]+"><\/a>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[0-9.]+)<\/div>(?:<span class="quality">(?:SUB-ITA|)?(?P<quality>|[^<]+)?<\/span>)?[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>.+?)[ ]?(?:\[(?P<lang>Sub-ITA)\])?<\/a>[^>]+>[^>]+>(?P<year>[^<]+)<\/span>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<div'
|
||||||
else:
|
else:
|
||||||
# TVSHOW
|
# TVSHOW
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
if item.args == 'update':
|
if item.args == 'update':
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'<div class="poster"><img src="(?P<thumb>[^"]+)"(?:[^>]+>){2}<a href="(?P<url>[^"]+)">[^>]+>(?P<episode>[\d\-x]+)(?:[^>]+>){4}(?P<title>.+?)(?:\[(?P<lang>[SsuUbBiItTaA-]{7})\])?<(?:[^>]+>){4}(?P<quality>[HDWEBRIP-]+)?(?:.+?)?/span><p class="serie"'
|
patron = r'<div class="poster"><img src="(?P<thumb>[^"]+)"(?:[^>]+>){2}<a href="(?P<url>[^"]+)">[^>]+>(?P<episode>[\d\-x]+)(?:[^>]+>){4}(?P<title>.+?)(?:\[(?P<lang>[SsuUbBiItTaA-]{7})\])?<(?:[^>]+>){4}(?P<quality>[HDWEBRIP-]+)?(?:.+?)?/span><p class="serie"'
|
||||||
pagination = 25
|
pagination = True
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.contentType = 'episode'
|
item.contentType = 'episode'
|
||||||
return item
|
return item
|
||||||
@@ -95,10 +93,10 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
info()
|
logger.debug()
|
||||||
|
|
||||||
patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" style="display:block">\s*<ul class="episodios">(?P<block>.*?)</ul>\s*</div>\s*</div>\s*</div>\s*</div>\s*</div>'
|
patronBlock = r'<h1>.*?[ ]?(?:\[(?P<lang>.+?\]))?</h1>.+?<div class="se-a" style="display:block">\s*<ul class="episodes">(?P<block>.*?)</ul>\s*</div>\s*</div>\s*</div>\s*</div>\s*</div>'
|
||||||
patron = r'<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)">.*?'\
|
patron = r'<a href="(?P<url>[^"]+)"><img src="(?P<thumb>[^"]+)">.*?'\
|
||||||
'<div class="numerando">(?P<episode>[^<]+).*?<div class="episodiotitle">'\
|
'<div class="numerando">(?P<episode>[^<]+).*?<div class="episodiotitle">'\
|
||||||
'[^>]+>(?P<title>[^<]+)<\/a>'
|
'[^>]+>(?P<title>[^<]+)<\/a>'
|
||||||
@@ -108,9 +106,9 @@ def episodios(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
info(item)
|
logger.debug(item)
|
||||||
|
|
||||||
action='peliculas'
|
action='movies'
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<div class="sidemenu"><h2>Genere</h2>(?P<block>.*?)/li></ul></div>'
|
patronBlock = r'<div class="sidemenu"><h2>Genere</h2>(?P<block>.*?)/li></ul></div>'
|
||||||
elif item.args == 'year':
|
elif item.args == 'year':
|
||||||
@@ -126,50 +124,50 @@ def genres(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
info(text)
|
logger.debug(text)
|
||||||
import uuid
|
import uuid
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text
|
item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("%s" % line)
|
logger.error("%s" % line)
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
|
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + '/film/'
|
item.url = host + '/film/'
|
||||||
elif categoria == 'series':
|
elif category == 'tvshow':
|
||||||
item.args = 'update'
|
item.args = 'update'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host + '/aggiornamenti-serie/'
|
item.url = host + '/aggiornamenti-serie/'
|
||||||
## elif categoria == 'anime':
|
## elif category == 'anime':
|
||||||
## item.contentType = 'tvshow'
|
## item.contentType = 'tvshow'
|
||||||
## item.url = host + '/anime/'
|
## item.url = host + '/anime/'
|
||||||
try:
|
try:
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
info()
|
logger.debug()
|
||||||
matches = support.match(item, patron=[r'var ilinks\s?=\s?([^;]+)',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
matches = support.match(item, patron=[r'var ilinks\s?=\s?([^;]+)',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
||||||
itemlist = []
|
itemlist = []
|
||||||
list_url = []
|
list_url = []
|
||||||
@@ -193,7 +191,7 @@ def findvideos(item):
|
|||||||
for i, url in enumerate(list_url):
|
for i, url in enumerate(list_url):
|
||||||
itemlist.append(support.Item(
|
itemlist.append(support.Item(
|
||||||
channel=item.channel,
|
channel=item.channel,
|
||||||
title=list_servers[i],
|
# title=list_servers[i],
|
||||||
url=url,
|
url=url,
|
||||||
action='play',
|
action='play',
|
||||||
quality=list_quality[i],
|
quality=list_quality[i],
|
||||||
|
|||||||
@@ -5,9 +5,8 @@
|
|||||||
|
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.support import info
|
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -15,7 +14,7 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
film = ['/film/',
|
film = ['/film/',
|
||||||
('In Sala', ['', 'peliculas', 'sala']),
|
('In Sala', ['', 'movies', 'sala']),
|
||||||
('Generi',['', 'genres', 'genres']),
|
('Generi',['', 'genres', 'genres']),
|
||||||
('Per Lettera',['/catalog/all', 'genres', 'az']),
|
('Per Lettera',['/catalog/all', 'genres', 'az']),
|
||||||
('Anni',['', 'genres', 'year'])]
|
('Anni',['', 'genres', 'year'])]
|
||||||
@@ -24,7 +23,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
if item.args == 'sala':
|
if item.args == 'sala':
|
||||||
patronBlock = r'insala(?P<block>.*?)<header>'
|
patronBlock = r'insala(?P<block>.*?)<header>'
|
||||||
patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[^<]+)[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d{4})'
|
patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[^<]+)[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d{4})'
|
||||||
@@ -40,55 +39,55 @@ def peliculas(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
action='peliculas'
|
action='movies'
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<div class="sidemenu">\s*<h2>Genere</h2>(?P<block>.*?)</ul'
|
patronBlock = r'<div class="sidemenu">\s*<h2>Genere</h2>(?P<block>.*?)</ul'
|
||||||
elif item.args == 'year':
|
elif item.args == 'year':
|
||||||
item.args = 'genres'
|
|
||||||
patronBlock = r'<div class="sidemenu">\s*<h2>Anno di uscita</h2>(?P<block>.*?)</ul'
|
patronBlock = r'<div class="sidemenu">\s*<h2>Anno di uscita</h2>(?P<block>.*?)</ul'
|
||||||
elif item.args == 'az':
|
elif item.args == 'az':
|
||||||
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
|
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
|
||||||
|
|
||||||
patronMenu = r'<a(?:.+?)?href="(?P<url>.*?)"[ ]?>(?P<title>.*?)<\/a>'
|
patronMenu = r'<a(?:.+?)?href="(?P<url>.*?)"[ ]?>(?P<title>.*?)<\/a>'
|
||||||
|
if 'genres' in item.args:
|
||||||
|
patronGenreMenu = patronMenu
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
info(text)
|
logger.debug(text)
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + "/search/" + text
|
item.url = host + "/search/" + text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("%s" % line)
|
logger.error("%s" % line)
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
|
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + '/film/'
|
item.url = host + '/film/'
|
||||||
try:
|
try:
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
info()
|
logger.debug()
|
||||||
urls = []
|
urls = []
|
||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
urls += support.match(data, patron=r'id="urlEmbed" value="([^"]+)').matches
|
urls += support.match(data, patron=r'id="urlEmbed" value="([^"]+)').matches
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita","sub-ita"],
|
"language": ["ita","sub-ita"],
|
||||||
"thumbnail": "italiaserie.png",
|
"thumbnail": "italiaserie.png",
|
||||||
"bannermenu": "italiaserie.png",
|
"bannermenu": "italiaserie.png",
|
||||||
"categories": ["tvshow", "vos"],
|
"categories": ["tvshow", "sub"],
|
||||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime"],
|
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,30 +15,30 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
tvshow = ['',
|
tvshow = ['',
|
||||||
('Aggiornamenti', ['/aggiornamento-episodi/', 'peliculas', 'update']),
|
('Aggiornamenti', ['/aggiornamento-episodi/', 'movies', 'update']),
|
||||||
('Top 10', ['/top-10', 'peliculas', 'top']),
|
('Top 10', ['/top-10', 'movies', 'top']),
|
||||||
('Netflix {tv submenu}', ['/genere/netflix', 'peliculas'])
|
('Netflix {tv submenu}', ['/genere/netflix', 'movies'])
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug=True
|
# debug=True
|
||||||
blacklist = ['Aggiornamento Episodi']
|
blacklist = ['Aggiornamento Episodi']
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"\[]+)[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>'
|
patron = r'<div class="post-thumb">\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"\[]+)[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>'
|
||||||
|
|
||||||
if item.args == 'update':
|
if item.args == 'update':
|
||||||
pagination = ''
|
pagination = True
|
||||||
#patron = r'br />(?:[^>]+>)?(?P<title>[^–]+)[^<]+<a href="(?P<url>[^"]+)">(?P<episode>[^ ]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?'
|
#patron = r'br />(?:[^>]+>)?(?P<title>[^–]+)[^<]+<a href="(?P<url>[^"]+)">(?P<episode>[^ ]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?'
|
||||||
patron = r'br[\s/]*>(?:\s*<[^>]+>)*(?P<title>[^–<]+)[^<]+<a href="(?P<url>[^"]+)"[^>]*>(?:[^,]{0,80}[, ]{2})*(?P<episode>[\S]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?'
|
patron = r'br[\s/]*>(?:\s*<[^>]+>)*(?P<title>[^–<]+)[^<]+<a href="(?P<url>[^"]+)"[^>]*>(?:[^,]{0,80}[, ]{2})*(?P<episode>[\S]+)\s*(?P<title2>[^\(<]+)(?:\((?P<lang>[^\)]+))?'
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
if item.args == 'top':
|
if item.args == 'top':
|
||||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>(?:[^>]+>){3}<img.*?src="(?P<thumb>[^"]+)"[^>]+>(?:[^>]+>){5}:\s*(?P<rating>[^/]+)'
|
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>(?:[^>]+>){3}<img.*?src="(?P<thumb>[^"]+)"[^>]+>(?:[^>]+>){5}:\s*(?P<rating>[^/]+)'
|
||||||
if item.args =='a-z':
|
if item.args =='a-z':
|
||||||
pagination = ''
|
pagination = True
|
||||||
patron = r'<li ><a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
patron = r'<li ><a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
||||||
patronNext = r'<a class="next page-numbers" href="(.*?)">'
|
patronNext = r'<a class="next page-numbers" href="(.*?)">'
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
res = support.match(item, patron=r'<a href="([^"]+)">>')
|
res = support.match(item, patron=r'<a href="([^"]+)">>')
|
||||||
if res.match: data = support.match(res.match).data
|
if res.match: data = support.match(res.match).data
|
||||||
else: data = res.data
|
else: data = res.data
|
||||||
@@ -66,38 +66,38 @@ def episodios(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def category(item):
|
def category(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patron = r'<li class="cat-item.*?href="(?P<url>[^"]+)".*?>(?P<title>.*?)</a>'
|
patron = r'<li class="cat-item.*?href="(?P<url>[^"]+)".*?>(?P<title>.*?)</a>'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, text):
|
||||||
support.info("s=", texto)
|
logger.debug(text)
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + text
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info("newest", categoria)
|
logger.debug("newest", category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.url = host + "/aggiornamento-episodi/"
|
item.url = host + "/aggiornamento-episodi/"
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
item.args = "update"
|
item.args = "update"
|
||||||
item.contentType = "episode"
|
item.contentType = "episode"
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == "peliculas":
|
if itemlist[-1].action == "movies":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
DRM = 'com.widevine.alpha'
|
DRM = 'com.widevine.alpha'
|
||||||
key_widevine = "https://la7.prod.conax.cloud/widevine/license"
|
key_widevine = "https://la7.prod.conax.cloud/widevine/license"
|
||||||
@@ -23,26 +24,26 @@ headers = {
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
top = [('Dirette {bold}', ['', 'live']),
|
top = [('Dirette {bullet bold}', ['', 'live']),
|
||||||
('Replay {bold}', ['', 'replay_channels'])]
|
('Replay {bullet bold}', ['', 'replay_channels'])]
|
||||||
|
|
||||||
menu = [('Programmi TV {bullet bold}', ['/tutti-i-programmi', 'peliculas', '', 'tvshow']),
|
menu = [('Programmi TV {bullet bold}', ['/tutti-i-programmi', 'movies', '', 'tvshow']),
|
||||||
('Teche La7 {bullet bold}', ['/i-protagonisti', 'peliculas', '', 'tvshow'])]
|
('Teche La7 {bullet bold}', ['/i-protagonisti', 'movies', '', 'tvshow'])]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def live(item):
|
def live(item):
|
||||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='play', forcethumb = True, no_return=True),
|
itemlist = [item.clone(title='La7', fulltitle='La7', url= host + '/dirette-tv', action='findvideos', forcethumb = True),
|
||||||
item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='play', forcethumb = True, no_return=True)]
|
item.clone(title='La7d', fulltitle='La7d', url= host + '/live-la7d', action='findvideos', forcethumb = True)]
|
||||||
return support.thumb(itemlist, live=True)
|
return support.thumb(itemlist, mode='live')
|
||||||
|
|
||||||
|
|
||||||
def replay_channels(item):
|
def replay_channels(item):
|
||||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/rivedila7/0/la7', action='replay_menu', forcethumb = True),
|
itemlist = [item.clone(title='La7', fulltitle='La7', url= host + '/rivedila7/0/la7', action='replay_menu', forcethumb = True),
|
||||||
item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/rivedila7/0/la7d', action='replay_menu', forcethumb = True)]
|
item.clone(title='La7d', fulltitle='La7d', url= host + '/rivedila7/0/la7d', action='replay_menu', forcethumb = True)]
|
||||||
return support.thumb(itemlist, live=True)
|
return support.thumb(itemlist, mode='live')
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
@@ -50,17 +51,17 @@ def replay_menu(item):
|
|||||||
action = 'replay'
|
action = 'replay'
|
||||||
patron = r'href="(?P<url>[^"]+)"><div class="giorno-text">\s*(?P<day>[^>]+)</div><[^>]+>\s*(?P<num>[^<]+)</div><[^>]+>\s*(?P<month>[^<]+)<'
|
patron = r'href="(?P<url>[^"]+)"><div class="giorno-text">\s*(?P<day>[^>]+)</div><[^>]+>\s*(?P<num>[^<]+)</div><[^>]+>\s*(?P<month>[^<]+)<'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.title = support.typo(item.day + ' ' + item.num + ' ' + item.month,'bold')
|
item.title = '{} {} {}'.format(item.day, item.num, item.month)
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def replay(item):
|
def replay(item):
|
||||||
action = 'play'
|
action = 'findvideos'
|
||||||
patron = r'guida-tv"><[^>]+><[^>]+>(?P<hour>[^<]+)<[^>]+><[^>]+><[^>]+>\s*<a href="(?P<url>[^"]+)"><[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"><[^>]+><[^>]+><[^>]+><[^>]+>\s*(?P<name>[^<]+)<[^>]+><[^>]+><[^>]+>(?P<plot>[^<]+)<'
|
patron = r'guida-tv"><[^>]+><[^>]+>(?P<hour>[^<]+)<[^>]+><[^>]+><[^>]+>\s*<a href="(?P<url>[^"]+)"><[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"><[^>]+><[^>]+><[^>]+><[^>]+>\s*(?P<name>[^<]+)<[^>]+><[^>]+><[^>]+>(?P<plot>[^<]+)<'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.title = support.typo(item.hour + ' - ' + item.name,'bold')
|
item.title = '{} - {}'.format(item.hour, item.name)
|
||||||
item.contentTitle = item.fulltitle = item.show = item.name
|
item.contentTitle = item.fulltitle = item.show = item.name
|
||||||
item.thumbnail = 'http:' + item.t
|
item.thumbnail = 'http:' + item.t
|
||||||
item.fanart = item.thumbnail
|
item.fanart = item.thumbnail
|
||||||
@@ -69,37 +70,42 @@ def replay(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
|
logger.debug(text)
|
||||||
item.url = host + '/tutti-i-programmi'
|
item.url = host + '/tutti-i-programmi'
|
||||||
item.search = text
|
item.search = text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
search = item.search
|
search = item.search
|
||||||
disabletmdb = True
|
disableAll = True
|
||||||
addVideolibrary = False
|
action = 'episodes'
|
||||||
downloadEnabled = False
|
|
||||||
action = 'episodios'
|
|
||||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
|
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
item.thumbnail = 'http:' + item.t if item.t.startswith('//') else item.t if item.t else item.thumbnail
|
prepose = ''
|
||||||
|
if item.t.startswith('//'):
|
||||||
|
prepose = 'http:'
|
||||||
|
elif item.t.startswith('/'):
|
||||||
|
prepose = host
|
||||||
|
elif not item.t.startswith('http'):
|
||||||
|
prepose = host + '/'
|
||||||
|
item.thumbnail = prepose + item.t
|
||||||
item.fanart = item.thumb
|
item.fanart = item.thumb
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
# debug = True
|
action = 'findvideos'
|
||||||
action = 'play'
|
|
||||||
if '>puntate<' in data:
|
if '>puntate<' in data:
|
||||||
patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain'
|
patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain'
|
||||||
url = support.match(data, patron=r'>puntate<[^>]+>[^>]+>[^>]+><a href="([^"]+)"').match
|
url = support.match(data, patron=r'>puntate<[^>]+>[^>]+>[^>]+><a href="([^"]+)"').match
|
||||||
@@ -110,16 +116,16 @@ def episodios(item):
|
|||||||
|
|
||||||
patron = r'(?:<a href="(?P<url>[^"]+)">[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]*)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?(?:[^>]+>){6}?)\s*(?P<title>[^<]+)<(?:[^>]+>[^>]+>[^>]+><div class="data">(?P<date>[^<]+))?|class="heading">[^>]+>(?P<Title>[^<]+).*?window.shareUrl = "(?P<Url>[^"]+)".*?poster:\s*"(?P<Thumb>[^"]+)", title: "(?P<desc>[^"]+)"'
|
patron = r'(?:<a href="(?P<url>[^"]+)">[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]*)">[^>]+>[^>]+>[^>]+>(?:[^>]+>)?(?:[^>]+>){6}?)\s*(?P<title>[^<]+)<(?:[^>]+>[^>]+>[^>]+><div class="data">(?P<date>[^<]+))?|class="heading">[^>]+>(?P<Title>[^<]+).*?window.shareUrl = "(?P<Url>[^"]+)".*?poster:\s*"(?P<Thumb>[^"]+)", title: "(?P<desc>[^"]+)"'
|
||||||
patronNext = r'<a href="([^"]+)">›'
|
patronNext = r'<a href="([^"]+)">›'
|
||||||
addVideolibrary = False
|
videlibraryEnabled = False
|
||||||
downloadEnabled = False
|
downloadEnabled = False
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if item.Thumb: item.t = item.Thumb
|
if item.Thumb: item.t = item.Thumb
|
||||||
item.thumbnail = 'http:' + item.t if item.t.startswith('//') else item.t if item.t else item.thumbnail
|
item.thumbnail = 'http:' + item.t if item.t.startswith('//') else item.t if item.t else item.thumbnail
|
||||||
if item.Title: item.title = support.typo(item.Title, 'bold')
|
if item.Title: item.title = item.Title
|
||||||
if item.date:
|
if item.date:
|
||||||
item.title = support.re.sub(r'[Pp]untata (?:del )?\d+/\d+/\d+', '', item.title)
|
item.title = support.re.sub(r'[Pp]untata (?:del )?\d+/\d+/\d+', '', item.title)
|
||||||
item.title += support.typo(item.date, '_ [] bold')
|
item.title = '{} [{}]'.format(item.title, item.date)
|
||||||
if item.desc: item.plot = item.desc
|
if item.desc: item.plot = item.desc
|
||||||
item.forcethumb = True
|
item.forcethumb = True
|
||||||
item.fanart = item.thumbnail
|
item.fanart = item.thumbnail
|
||||||
@@ -127,21 +133,16 @@ def episodios(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.debug()
|
||||||
|
return support.server(item, itemlist=[item.clone(server='directo', action='play')])
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
if item.livefilter:
|
|
||||||
for it in live(item):
|
|
||||||
if it.fulltitle == item.livefilter:
|
|
||||||
item = it
|
|
||||||
break
|
|
||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
url = support.match(data, patron=r'''["]?dash["]?\s*:\s*["']([^"']+)["']''').match
|
||||||
if match:
|
if url:
|
||||||
url = 'https://awsvodpkg.iltrovatore.it/local/hls/,/content/entry/data/' + support.match(item, patron='/content/entry/data/(.*?).mp4').match + '.mp4.urlset/master.m3u8'
|
|
||||||
item = item.clone(title='Direct', url=url, server='directo', action='play')
|
|
||||||
else:
|
|
||||||
preurl = support.match(data, patron=r'preTokenUrl = "(.+?)"').match
|
preurl = support.match(data, patron=r'preTokenUrl = "(.+?)"').match
|
||||||
url = support.match(data, patron=r'''["]?dash["]?\s*:\s*["']([^"']+)["']''').match
|
|
||||||
tokenHeader = {
|
tokenHeader = {
|
||||||
'host': headers['host_token'],
|
'host': headers['host_token'],
|
||||||
'user-agent': headers['user-agent'],
|
'user-agent': headers['user-agent'],
|
||||||
@@ -168,4 +169,9 @@ def play(item):
|
|||||||
lic_url='%s|%s|R{SSM}|'%(license_url, preLic)
|
lic_url='%s|%s|R{SSM}|'%(license_url, preLic)
|
||||||
item.drm = DRM
|
item.drm = DRM
|
||||||
item.license = lic_url
|
item.license = lic_url
|
||||||
|
else:
|
||||||
|
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
||||||
|
if match:
|
||||||
|
url = 'https://awsvodpkg.iltrovatore.it/local/hls/,/content/entry/data/' + support.match(item, patron='/content/entry/data/(.*?).mp4').match + '.mp4.urlset/master.m3u8'
|
||||||
|
item = item.clone(url=url, server='directo', action='play')
|
||||||
return support.servertools.find_video_items(item, data=url)
|
return support.servertools.find_video_items(item, data=url)
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per Mediaset Play
|
# Canale per Mediaset Play
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
import functools
|
||||||
|
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
import uuid, datetime, xbmc
|
import uuid, datetime, xbmc
|
||||||
|
|
||||||
import requests, sys
|
import requests, sys
|
||||||
from core import support
|
from core import jsontools, support, httptools
|
||||||
|
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
from urllib.parse import urlencode, quote
|
from urllib.parse import urlencode, quote
|
||||||
else:
|
else:
|
||||||
@@ -23,6 +25,7 @@ loginData = {"client_id": clientid, "platform": "pc", "appName": "web//mediasetp
|
|||||||
sessionUrl = "https://api.one.accedo.tv/session?appKey=59ad346f1de1c4000dfd09c5&uuid={uuid}&gid=default"
|
sessionUrl = "https://api.one.accedo.tv/session?appKey=59ad346f1de1c4000dfd09c5&uuid={uuid}&gid=default"
|
||||||
|
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
|
session.request = functools.partial(session.request, timeout=httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT)
|
||||||
session.headers.update({'Content-Type': 'application/json', 'User-Agent': support.httptools.get_user_agent(), 'Referer': host})
|
session.headers.update({'Content-Type': 'application/json', 'User-Agent': support.httptools.get_user_agent(), 'Referer': host})
|
||||||
|
|
||||||
entry = 'https://api.one.accedo.tv/content/entry/{id}?locale=it'
|
entry = 'https://api.one.accedo.tv/content/entry/{id}?locale=it'
|
||||||
@@ -38,14 +41,14 @@ session.headers.update({'authorization': 'Bearer ' + Token})
|
|||||||
sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['sessionKey']
|
sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['sessionKey']
|
||||||
session.headers.update({'x-session': sessionKey})
|
session.headers.update({'x-session': sessionKey})
|
||||||
|
|
||||||
pagination = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100][config.get_setting('pagination', 'mediasetplay')]
|
pagination = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100][config.getSetting('pagination', 'mediasetplay')]
|
||||||
|
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
top = [('Dirette {bold}', ['', 'live'])]
|
top = [('Dirette {bold}', ['', 'live'])]
|
||||||
|
|
||||||
menu = [('Film {bullet bold}', ['/cinema', 'peliculas', {'uxReference':'filmUltimiArrivi'}, 'movie']),
|
menu = [('Film {bullet bold}', ['/cinema', 'movies', {'uxReference':'filmUltimiArrivi'}, 'movie']),
|
||||||
('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', '5acfcb3c23eec6000d64a6a4', 'tvshow']),
|
('Fiction / Serie TV {bullet bold}', ['/fiction', 'menu', '5acfcb3c23eec6000d64a6a4', 'tvshow']),
|
||||||
('Programmi TV{ bullet bold}', ['/programmitv', 'menu', '5acfc8011de1c4000b6ec953', 'tvshow']),
|
('Programmi TV{ bullet bold}', ['/programmitv', 'menu', '5acfc8011de1c4000b6ec953', 'tvshow']),
|
||||||
('Documentari {bullet bold}', ['/documentari', 'menu', '5bfd17c423eec6001aec49f9', 'undefined']),
|
('Documentari {bullet bold}', ['/documentari', 'menu', '5bfd17c423eec6001aec49f9', 'undefined']),
|
||||||
@@ -63,7 +66,7 @@ def menu(item):
|
|||||||
itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'),
|
itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'),
|
||||||
url= it['landingUrl'],
|
url= it['landingUrl'],
|
||||||
args={'uxReference':it.get('uxReferenceV2', ''), 'params':it.get('uxReferenceV2Params', ''), 'feed':it.get('feedurlV2','')},
|
args={'uxReference':it.get('uxReferenceV2', ''), 'params':it.get('uxReferenceV2Params', ''), 'feed':it.get('feedurlV2','')},
|
||||||
action='peliculas'))
|
action='movies'))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -75,22 +78,29 @@ def live(item):
|
|||||||
stations = res['stations']
|
stations = res['stations']
|
||||||
|
|
||||||
for it in stations.values():
|
for it in stations.values():
|
||||||
|
logger.debug(jsontools.dump(it))
|
||||||
plot = ''
|
plot = ''
|
||||||
title = it['title']
|
title = it['title']
|
||||||
url = 'https:' + it['mediasetstation$pageUrl']
|
url = 'https:' + it['mediasetstation$pageUrl']
|
||||||
if 'plus' in title.lower() or 'premium' in title.lower(): continue
|
if 'SVOD' in it['mediasetstation$channelsRights']: continue
|
||||||
|
thumb = it.get('thumbnails',{}).get('channel_logo-100x100',{}).get('url','')
|
||||||
if it['callSign'] in allguide:
|
if it['callSign'] in allguide:
|
||||||
|
|
||||||
guide = allguide[it['callSign']]
|
guide = allguide[it['callSign']]
|
||||||
plot = '[B]{}[/B]\n{}\n\nA Seguire:\n[B]{}[/B]\n{}'.format(guide['currentListing']['mediasetlisting$epgTitle'],
|
plot = '[B]{}[/B]\n{}'.format(guide.get('currentListing', {}).get('mediasetlisting$epgTitle', ''),guide.get('currentListing', {}).get('description', ''))
|
||||||
guide['currentListing']['description'],
|
if 'nextListing' in guide.keys():
|
||||||
guide['nextListing']['mediasetlisting$epgTitle'],
|
plot += '\n\nA Seguire:\n[B]{}[/B]\n{}'.format(guide.get('nextListing', {}).get('mediasetlisting$epgTitle', ''),guide.get('nextListing', {}).get('description', ''))
|
||||||
guide['nextListing']['description'],)
|
itemlist.append(item.clone(title=title,
|
||||||
|
fulltitle=title, callSign=it['callSign'],
|
||||||
itemlist.append(item.clone(title=support.typo(title, 'bold'), fulltitle=title, callSign=it['callSign'], urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'], plot=plot, url=url, action='play', forcethumb=True))
|
urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'],
|
||||||
|
plot=plot,
|
||||||
|
url=url,
|
||||||
|
action='findvideos',
|
||||||
|
thumbnail=thumb,
|
||||||
|
forcethumb=True))
|
||||||
|
|
||||||
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||||
support.thumb(itemlist, live=True)
|
support.thumb(itemlist, mode='live')
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -98,7 +108,7 @@ def search(item, text):
|
|||||||
item.args = {'uxReference':'main', 'params':'channel≈', 'query':text}
|
item.args = {'uxReference':'main', 'params':'channel≈', 'query':text}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -107,7 +117,7 @@ def search(item, text):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
res = get_programs(item)
|
res = get_programs(item)
|
||||||
video_id= ''
|
video_id= ''
|
||||||
@@ -131,7 +141,7 @@ def peliculas(item):
|
|||||||
else:
|
else:
|
||||||
contentType = 'movie'
|
contentType = 'movie'
|
||||||
video_id = it['guid']
|
video_id = it['guid']
|
||||||
action = 'play'
|
action = 'findvideos'
|
||||||
for k, v in it['thumbnails'].items():
|
for k, v in it['thumbnails'].items():
|
||||||
if 'image_vertical' in k and not thumb:
|
if 'image_vertical' in k and not thumb:
|
||||||
thumb = v['url'].replace('.jpg', '@3.jpg')
|
thumb = v['url'].replace('.jpg', '@3.jpg')
|
||||||
@@ -140,7 +150,7 @@ def peliculas(item):
|
|||||||
if thumb and fanart:
|
if thumb and fanart:
|
||||||
break
|
break
|
||||||
|
|
||||||
itemlist.append(item.clone(title=support.typo(title, 'bold'),
|
itemlist.append(item.clone(title=title,
|
||||||
fulltitle=title,
|
fulltitle=title,
|
||||||
contentTitle=title,
|
contentTitle=title,
|
||||||
contentSerieName=contentSerieName,
|
contentSerieName=contentSerieName,
|
||||||
@@ -172,22 +182,22 @@ def epmenu(item):
|
|||||||
for s in item.seriesid:
|
for s in item.seriesid:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(seriesid = s['id'],
|
item.clone(seriesid = s['id'],
|
||||||
title=support.typo(s['title'], 'bold')))
|
title=s['title']))
|
||||||
if len(itemlist) == 1: return epmenu(itemlist[0])
|
if len(itemlist) == 1: return epmenu(itemlist[0])
|
||||||
else:
|
else:
|
||||||
res = requests.get(epUrl.format(item.seriesid)).json()['entries']
|
res = requests.get(epUrl.format(item.seriesid)).json()['entries']
|
||||||
for it in res:
|
for it in res:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(seriesid = '',
|
item.clone(seriesid = '',
|
||||||
title=support.typo(it['description'], 'bold'),
|
title=it['description'],
|
||||||
subbrand=it['mediasetprogram$subBrandId'],
|
subbrand=it['mediasetprogram$subBrandId'],
|
||||||
action='episodios'))
|
action='episodes'))
|
||||||
itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True)
|
itemlist = sorted(itemlist, key=lambda it: it.title, reverse=True)
|
||||||
if len(itemlist) == 1: return episodios(itemlist[0])
|
if len(itemlist) == 1: return episodes(itemlist[0])
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
# create month list
|
# create month list
|
||||||
months = []
|
months = []
|
||||||
try:
|
try:
|
||||||
@@ -195,15 +205,18 @@ def episodios(item):
|
|||||||
except: # per i test, xbmc.getLocalizedString non è supportato
|
except: # per i test, xbmc.getLocalizedString non è supportato
|
||||||
for month in range(21, 33): months.append('dummy')
|
for month in range(21, 33): months.append('dummy')
|
||||||
|
|
||||||
|
# i programmi tv vanno ordinati per data decrescente, gli episodi delle serie per data crescente
|
||||||
|
order = 'desc' if '/programmi-tv/' in item.url else 'asc'
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
res = requests.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs-v2?byCustomValue={subBrandId}{' + item.subbrand +'}&sort=:publishInfo_lastPublished|asc,tvSeasonEpisodeNumber').json()['entries']
|
res = requests.get('https://feed.entertainment.tv.theplatform.eu/f/PR1GhC/mediaset-prod-all-programs-v2?byCustomValue={subBrandId}{' + item.subbrand +'}&sort=:publishInfo_lastPublished|' + order + ',tvSeasonEpisodeNumber').json()['entries']
|
||||||
|
|
||||||
for it in res:
|
for it in res:
|
||||||
thumb = ''
|
thumb = ''
|
||||||
titleDate = ''
|
titleDate = ''
|
||||||
if 'mediasetprogram$publishInfo_lastPublished' in it:
|
if 'mediasetprogram$publishInfo_lastPublished' in it:
|
||||||
date = datetime.date.fromtimestamp(it['mediasetprogram$publishInfo_lastPublished'] / 1000)
|
date = datetime.date.fromtimestamp(it['mediasetprogram$publishInfo_lastPublished'] / 1000)
|
||||||
titleDate =' [{} {}]'.format(date.day, months[date.month])
|
titleDate =' [{} {}]'.format(date.day, months[date.month-1])
|
||||||
title = '[B]{}[/B]{}'.format(it['title'], titleDate)
|
title = '[B]{}[/B]{}'.format(it['title'], titleDate)
|
||||||
for k, v in it['thumbnails'].items():
|
for k, v in it['thumbnails'].items():
|
||||||
if 'image_keyframe' in k and not thumb:
|
if 'image_keyframe' in k and not thumb:
|
||||||
@@ -215,16 +228,22 @@ def episodios(item):
|
|||||||
thumbnail=thumb,
|
thumbnail=thumb,
|
||||||
forcethumb=True,
|
forcethumb=True,
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
action='play',
|
action='findvideos',
|
||||||
video_id=it['guid']))
|
video_id=it['guid']))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.debug()
|
||||||
|
return support.server(item, itemlist=[item.clone(server='directo', action='play')])
|
||||||
|
|
||||||
|
|
||||||
def play(item):
|
def play(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
item.no_return=True
|
item.no_return=True
|
||||||
mpd = config.get_setting('mpd', item.channel)
|
# support.dbg()
|
||||||
|
mpd = config.getSetting('mpd', item.channel)
|
||||||
|
|
||||||
|
|
||||||
lic_url = 'https://widevine.entitlement.theplatform.eu/wv/web/ModularDrm/getRawWidevineLicense?releasePid={pid}&account=http://access.auth.theplatform.com/data/Account/2702976343&schema=1.0&token={token}|Accept=*/*&Content-Type=&User-Agent={ua}|R{{SSM}}|'
|
lic_url = 'https://widevine.entitlement.theplatform.eu/wv/web/ModularDrm/getRawWidevineLicense?releasePid={pid}&account=http://access.auth.theplatform.com/data/Account/2702976343&schema=1.0&token={token}|Accept=*/*&Content-Type=&User-Agent={ua}|R{{SSM}}|'
|
||||||
@@ -238,6 +257,8 @@ def play(item):
|
|||||||
if Format in it['format']:
|
if Format in it['format']:
|
||||||
item.url = requests.head(it['publicUrls'][0]).headers['Location']
|
item.url = requests.head(it['publicUrls'][0]).headers['Location']
|
||||||
pid = it['releasePids'][0]
|
pid = it['releasePids'][0]
|
||||||
|
if mpd and 'widevine' in it['assetTypes']:
|
||||||
|
break
|
||||||
|
|
||||||
if mpd:
|
if mpd:
|
||||||
item.manifest = 'mpd'
|
item.manifest = 'mpd'
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ current_session.headers.update({'Content-Type': 'application/json', 'User-Agent'
|
|||||||
|
|
||||||
# login anonimo
|
# login anonimo
|
||||||
res = current_session.post(loginUrl, json=loginData, verify=False)
|
res = current_session.post(loginUrl, json=loginData, verify=False)
|
||||||
support.dbg()
|
logger.dbg()
|
||||||
Token = res.json['response']['beToken']
|
Token = res.json['response']['beToken']
|
||||||
sid = res.json['response']['sid']
|
sid = res.json['response']['sid']
|
||||||
current_session.headers.update({'authorization': 'Bearer' + Token})
|
current_session.headers.update({'authorization': 'Bearer' + Token})
|
||||||
@@ -100,11 +100,11 @@ def search(item, text):
|
|||||||
item.search = text
|
item.search = text
|
||||||
|
|
||||||
try:
|
try:
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ def menu(item):
|
|||||||
for it in json:
|
for it in json:
|
||||||
logger.debug(jsontools.dump(it))
|
logger.debug(jsontools.dump(it))
|
||||||
if 'uxReference' in it: itemlist.append(
|
if 'uxReference' in it: itemlist.append(
|
||||||
item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], feed = it.get('feedurlV2',''), ref=it['uxReference'], args='', action='peliculas'))
|
item.clone(title=support.typo(it['title'], 'bullet bold'), url= it['landingUrl'], feed = it.get('feedurlV2',''), ref=it['uxReference'], args='', action='movies'))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -150,10 +150,10 @@ def live(item):
|
|||||||
plot=value['plot'],
|
plot=value['plot'],
|
||||||
action='play',
|
action='play',
|
||||||
no_return=True))
|
no_return=True))
|
||||||
return support.thumb(itemlist, live=True)
|
return support.thumb(itemlist, mode='live')
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
titlelist = []
|
titlelist = []
|
||||||
@@ -228,16 +228,16 @@ def epmenu(item):
|
|||||||
for entry in entries:
|
for entry in entries:
|
||||||
if 'mediasetprogram$subBrandId' in entry:
|
if 'mediasetprogram$subBrandId' in entry:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action='episodios',
|
item.clone(action='episodes',
|
||||||
title=support.typo(entry['description'], 'bold'),
|
title=support.typo(entry['description'], 'bold'),
|
||||||
url=entry['mediasetprogram$subBrandId'],
|
url=entry['mediasetprogram$subBrandId'],
|
||||||
order=entry.get('mediasetprogram$order',0)))
|
order=entry.get('mediasetprogram$order',0)))
|
||||||
if len(itemlist) == 1: return episodios(itemlist[0])
|
if len(itemlist) == 1: return episodes(itemlist[0])
|
||||||
itemlist = sorted(itemlist, key=lambda it: it.order)
|
itemlist = sorted(itemlist, key=lambda it: it.order)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
if not item.nextIndex: item.nextIndex = 1
|
if not item.nextIndex: item.nextIndex = 1
|
||||||
@@ -318,7 +318,7 @@ def get_from_id(item):
|
|||||||
def get_programs(item, ret=[], args={}):
|
def get_programs(item, ret=[], args={}):
|
||||||
hasMore = False
|
hasMore = False
|
||||||
url = ''
|
url = ''
|
||||||
# support.dbg()
|
# logger.dbg()
|
||||||
|
|
||||||
if 'search' in item.args:
|
if 'search' in item.args:
|
||||||
args['uxReference'] = item.args[2]
|
args['uxReference'] = item.args[2]
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
# Canale per altadefinizione01
|
# Canale per altadefinizione01
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support, config
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = 'https://metalvideo.com'
|
host = 'https://metalvideo.com'
|
||||||
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
||||||
@@ -12,7 +13,7 @@ headers = {'X-Requested-With': 'XMLHttpRequest'}
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
item.url = host
|
item.url = host
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = r'<ul class="dropdown-menu(?P<block>.*?)</ul>\s*</div'
|
patronBlock = r'<ul class="dropdown-menu(?P<block>.*?)</ul>\s*</div'
|
||||||
patron = r'<a href="(?P<url>[^"]+)"(?: class="")?>(?P<title>[^<]+)<'
|
patron = r'<a href="(?P<url>[^"]+)"(?: class="")?>(?P<title>[^<]+)<'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
@@ -24,18 +25,18 @@ def mainlist(item):
|
|||||||
itemlist.append(
|
itemlist.append(
|
||||||
support.Item(
|
support.Item(
|
||||||
channel=item.channel,
|
channel=item.channel,
|
||||||
title=support.typo('Cerca...', 'bold'),
|
title=support.typo(config.getLocalizedString(70741) % 'Musica… ', 'bold'),
|
||||||
contentType='music',
|
contentType='music',
|
||||||
url=item.url,
|
url=item.url,
|
||||||
action='search',
|
action='search',
|
||||||
thumbnail=support.thumb('search')))
|
thumbnail=support.thumb('music_search')))
|
||||||
|
|
||||||
support.channel_config(item, itemlist)
|
support.channel_config(item, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug=True
|
# debug=True
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"(?:[^>]+>){7}<a href="(?P<url>[^"]+)"'
|
patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"(?:[^>]+>){7}<a href="(?P<url>[^"]+)"'
|
||||||
@@ -49,13 +50,13 @@ def findvideos(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
item.url = host + '/search.php?keywords=' + text + '&video-id='
|
item.url = host + '/search.php?keywords=' + text + '&video-id='
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = {'Referer': host}
|
headers = {'Referer': host}
|
||||||
@@ -13,7 +14,7 @@ headers = {'Referer': host}
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
film = ['/lista-film',
|
film = ['/lista-film',
|
||||||
('Ultimi Film Aggiunti', ['/ultimi-film-aggiunti', 'peliculas' , 'last'])]
|
('Ultimi Film Aggiunti', ['/ultimi-film-aggiunti', 'movies' , 'last'])]
|
||||||
|
|
||||||
tvshow = ['/lista-serie-tv',
|
tvshow = ['/lista-serie-tv',
|
||||||
('HD {TV}', ['/lista-serie-tv-in-altadefinizione']),
|
('HD {TV}', ['/lista-serie-tv-in-altadefinizione']),
|
||||||
@@ -22,7 +23,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
anime = ['/lista-cartoni-animati-e-anime']
|
anime = ['/lista-cartoni-animati-e-anime']
|
||||||
|
|
||||||
docu = [('Documentari {bullet bold}',['/lista-documentari', 'peliculas', '', 'tvshow'])]
|
docu = [('Documentari {bullet bold}',['/lista-documentari', 'movies', '', 'tvshow'])]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
|
|
||||||
@@ -30,48 +31,48 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
if item.contentType == 'movie' or item.extra == 'movie':
|
if item.contentType == 'movie' or item.extra == 'movie':
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
item.url = host + "?a=b&s=" + text
|
item.url = host + "?a=b&s=" + text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore .
|
# Continua la ricerca in caso di errore .
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.contentType= 'tvshow'
|
item.contentType= 'tvshow'
|
||||||
item.url = host + '/ultimi-episodi-aggiunti'
|
item.url = host + '/ultimi-episodi-aggiunti'
|
||||||
item.args = "lastep"
|
item.args = "lastep"
|
||||||
if categoria == "peliculas":
|
if category == "movie":
|
||||||
item.contentType= 'movie'
|
item.contentType= 'movie'
|
||||||
item.url = host + '/ultimi-film-aggiunti'
|
item.url = host + '/ultimi-film-aggiunti'
|
||||||
item.args = "last"
|
item.args = "last"
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
pagination = ''
|
pagination = True
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"'
|
patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
# debug=True
|
# debug=True
|
||||||
@@ -82,7 +83,7 @@ def peliculas(item):
|
|||||||
patronBlock = r'<table>(?P<block>.*?)</table>'
|
patronBlock = r'<table>(?P<block>.*?)</table>'
|
||||||
patron = r'<td>\s*<a href="[^>]+>(?P<title>.*?)(?:\s(?P<year>\d{4}))?\s(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<url>.*?)<tr>'
|
patron = r'<td>\s*<a href="[^>]+>(?P<title>.*?)(?:\s(?P<year>\d{4}))?\s(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<url>.*?)<tr>'
|
||||||
elif item.args == 'search':
|
elif item.args == 'search':
|
||||||
patronBlock = r'<div class="peliculas">(?P<block>.*?)<div id="paginador"'
|
patronBlock = r'<div class="movies">(?P<block>.*?)<div id="paginador"'
|
||||||
patron = r'class="item">\s*<a href="(?P<url>[^"]+)">\s*<div class="image">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.+?)(?:"| \d{4}).*?<span class="ttx">(?P<plot>[^<]+)<div class="degradado">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?:<span class="imdbs">(?P<rating>[^<]+))?(?:[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<year>\d+))?'
|
patron = r'class="item">\s*<a href="(?P<url>[^"]+)">\s*<div class="image">\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.+?)(?:"| \d{4}).*?<span class="ttx">(?P<plot>[^<]+)<div class="degradado">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?:<span class="imdbs">(?P<rating>[^<]+))?(?:[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<year>\d+))?'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
if '/film/' in item.url:
|
if '/film/' in item.url:
|
||||||
@@ -90,21 +91,21 @@ def peliculas(item):
|
|||||||
item.action = 'findvideos'
|
item.action = 'findvideos'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.action = 'episodios'
|
item.action = 'episodes'
|
||||||
return item
|
return item
|
||||||
else:
|
else:
|
||||||
patronBlock = r'<div class="entry-content pagess">(?P<block>.*?)</ul>'
|
patronBlock = r'<div class="entry-content pagess">(?P<block>.*?)</ul>'
|
||||||
patron = r'<li\s*><a href="(?P<url>[^"]+)" title="(?P<title>.*?)(?:\s(?P<year>\d{4}))?"[^>]*>'
|
patron = r'<li\s*><a href="(?P<url>[^"]+)" title="(?P<title>.*?)(?:\s(?P<year>\d{4}))?"[^>]*>'
|
||||||
if item.contentType == 'tvshow':
|
if item.contentType == 'tvshow':
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
pagination = 50
|
pagination = True
|
||||||
patronBlock = r'<table>(?P<block>.*?)</table>'
|
patronBlock = r'<table>(?P<block>.*?)</table>'
|
||||||
patron = r'<tr><td><b>(?P<title>(?:\d+)?.*?)\s*(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<data>.*?)<tr>'
|
patron = r'<tr><td><b>(?P<title>(?:\d+)?.*?)\s*(?:(?P<episode>(?:\d+x\d+|\d+)))\s*(?P<title2>[^<]+)(?P<data>.*?)<tr>'
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
"thumbnail": "netfreex.png",
|
"thumbnail": "netfreex.png",
|
||||||
"banner": "netfreex.png",
|
"banner": "netfreex.png",
|
||||||
"categories": ["tvshow", "movie", "anime"],
|
"categories": ["tvshow", "movie", "anime"],
|
||||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime", "include_in_newest_series"],
|
"not_active": ["include_in_newest_movie", "include_in_newest_anime", "include_in_newest_tvshow"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ def search(item, text):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
if 'anime' in item.url:
|
if 'anime' in item.url:
|
||||||
return support.dooplay_peliculas(item, True)
|
return support.dooplay_movies(item, True)
|
||||||
else:
|
else:
|
||||||
return support.dooplay_peliculas(item, False)
|
return support.dooplay_movies(item, False)
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
return support.dooplay_get_episodes(item)
|
return support.dooplay_get_episodes(item)
|
||||||
|
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
data = support.match(item, patron=r'<a href="#">Genere<(.*?)</ul').match
|
data = support.match(item, patron=r'<a href="#">Genere<(.*?)</ul').match
|
||||||
patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<'
|
patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<'
|
||||||
return locals()
|
return locals()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action='peliculas'
|
action='movies'
|
||||||
blacklist=['Tutti']
|
blacklist=['Tutti']
|
||||||
patronMenu = r'<a data-display-name="Link" href="(?P<url>[^"]+)" class="[^"]+">(?P<title>[^<]+)'
|
patronMenu = r'<a data-display-name="Link" href="(?P<url>[^"]+)" class="[^"]+">(?P<title>[^<]+)'
|
||||||
return locals()
|
return locals()
|
||||||
@@ -31,7 +31,7 @@ def search(item, text):
|
|||||||
|
|
||||||
item.text = text
|
item.text = text
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore .
|
# Continua la ricerca in caso di errore .
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -64,11 +64,11 @@ def live(item):
|
|||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
for key, value in liveDict().items():
|
for key, value in liveDict().items():
|
||||||
itemlist.append(item.clone(title=support.typo(key,'bold'), contentTitle=key, fulltitle=key, show=key, url=value['url'], plot=value['plot'], action='play', forcethumb=True, no_return=True))
|
itemlist.append(item.clone(title=key, contentTitle=key, fulltitle=key, show=key, url=value['url'], plot=value['plot'], action='findvideos', forcethumb=True, no_return=True))
|
||||||
return support.thumb(itemlist, live=True)
|
return support.thumb(itemlist, mode='live')
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
def load_more(url):
|
def load_more(url):
|
||||||
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('\\u002F','/').replace('%5C','/')
|
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('\\u002F','/').replace('%5C','/')
|
||||||
@@ -92,7 +92,7 @@ def peliculas(item):
|
|||||||
continue
|
continue
|
||||||
if item.text.lower() in title.lower():
|
if item.text.lower() in title.lower():
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=support.typo(title,'bold'),
|
item.clone(title=title,
|
||||||
fulltitle = title,
|
fulltitle = title,
|
||||||
show = title,
|
show = title,
|
||||||
contentTitle = title if item.contentType == 'movie' else '',
|
contentTitle = title if item.contentType == 'movie' else '',
|
||||||
@@ -101,11 +101,11 @@ def peliculas(item):
|
|||||||
thumbnail = it['media']['image']['url'],
|
thumbnail = it['media']['image']['url'],
|
||||||
fanart = it['media']['image']['url'],
|
fanart = it['media']['image']['url'],
|
||||||
plot = it['meta']['description'],
|
plot = it['meta']['description'],
|
||||||
action = 'findvideos' if item.contentType == 'movie' else 'episodios'))
|
action = 'findvideos' if item.contentType == 'movie' else 'episodes'))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
def load_more(url):
|
def load_more(url):
|
||||||
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('%5C','/')
|
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('%5C','/')
|
||||||
@@ -137,10 +137,10 @@ def episodios(item):
|
|||||||
s = support.match(se, patron=r'S\s*(?P<season>\d+)').match
|
s = support.match(se, patron=r'S\s*(?P<season>\d+)').match
|
||||||
e = support.match(se, patron=r'E\s*(?P<episode>\d+)').match
|
e = support.match(se, patron=r'E\s*(?P<episode>\d+)').match
|
||||||
if not e: e = support.match(it['meta']['subHeader'], patron=r'(\d+)').match
|
if not e: e = support.match(it['meta']['subHeader'], patron=r'(\d+)').match
|
||||||
title = support.typo((s + 'x' if s else 'Episodio ') + e.zfill(2) + ' - ' + it['meta']['subHeader'],'bold')
|
title = (s + 'x' if s else 'Episodio ') + e.zfill(2) + ' - ' + it['meta']['subHeader']
|
||||||
else:
|
else:
|
||||||
s = e = '0'
|
s = e = '0'
|
||||||
title = support.typo(it['meta']['header']['title'],'bold')
|
title = it['meta']['header']['title']
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=title,
|
item.clone(title=title,
|
||||||
season=int(s) if s else '',
|
season=int(s) if s else '',
|
||||||
@@ -170,9 +170,4 @@ def play(item):
|
|||||||
url = 'https://media.mtvnservices.com/pmt/e1/access/index.html?uri=' + mgid + '&configtype=edge&ref=' + item.url
|
url = 'https://media.mtvnservices.com/pmt/e1/access/index.html?uri=' + mgid + '&configtype=edge&ref=' + item.url
|
||||||
ID, rootUrl = support.match(url, patron=[r'"id":"([^"]+)",',r'brightcove_mediagenRootURL":"([^"]+)"']).matches
|
ID, rootUrl = support.match(url, patron=[r'"id":"([^"]+)",',r'brightcove_mediagenRootURL":"([^"]+)"']).matches
|
||||||
item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
||||||
|
|
||||||
if item.livefilter:
|
|
||||||
d = liveDict()[item.livefilter]
|
|
||||||
item = item.clone(title=support.typo(item.livefilter, 'bold'), fulltitle=item.livefilter, url=d['url'], plot=d['plot'], action='play', forcethumb=True, no_return=True)
|
|
||||||
support.thumb(item, live=True)
|
|
||||||
return [item]
|
return [item]
|
||||||
@@ -5,7 +5,8 @@
|
|||||||
|
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
from core.support import config, info
|
from core.support import config
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -23,58 +24,58 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
info(texto)
|
logger.debug(texto)
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/search/" + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "peliculas":
|
if category == "movie":
|
||||||
item.url = host + '/category/films'
|
item.url = host + '/category/films'
|
||||||
item.contentType = 'movies'
|
item.contentType = 'movies'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.url = host + '/category/serie'
|
item.url = host + '/category/serie'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
if categoria == "anime":
|
if category == "anime":
|
||||||
item.url = host + '/category/anime-cartoni-animati'
|
item.url = host + '/category/anime-cartoni-animati'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
patron = r'data-placement="bottom" title="(?P<title>[^"]+)" alt=[^=]+="(?P<url>[^"]+)"> <img class="[^"]+" title="[^"]+(?P<type>film|serie)[^"]+" alt="[^"]+" src="(?P<thumb>[^"]+)"'
|
patron = r'data-placement="bottom" title="(?P<title>[^"]+)" alt=[^=]+="(?P<url>[^"]+)"> <img class="[^"]+" title="[^"]+(?P<type>film|serie)[^"]+" alt="[^"]+" src="(?P<thumb>[^"]+)"'
|
||||||
patronNext = r'<a\s*class="nextpostslink" rel="next" href="([^"]+)">Avanti'
|
patronNext = r'<a\s*class="nextpostslink" rel="next" href="([^"]+)">Avanti'
|
||||||
|
|
||||||
typeActionDict = {'findvideos': ['film'], 'episodios': ['serie']}
|
typeActionDict = {'findvideos': ['film'], 'episodes': ['serie']}
|
||||||
typeContentDict = {'movie': ['film'], 'tvshow': ['serie']}
|
typeContentDict = {'movie': ['film'], 'tvshow': ['serie']}
|
||||||
# debug = True
|
# debug = True
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
if item.data: data = item.data
|
if item.data: data = item.data
|
||||||
# debug= True
|
# debug= True
|
||||||
title = item.fulltitle
|
title = item.fulltitle
|
||||||
@@ -93,5 +94,5 @@ def findvideos(item):
|
|||||||
data = support.match(item).data
|
data = support.match(item).data
|
||||||
if 'link-episode' in data:
|
if 'link-episode' in data:
|
||||||
item.data = data
|
item.data = data
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
return support.server(item, data=data)
|
return support.server(item, data=data)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
from core import support, jsontools
|
from core import support, jsontools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
@@ -17,8 +17,8 @@ headers = [['Accept', 'application/ld+json']]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
# menu = [
|
# menu = [
|
||||||
# ('Ultimi Film aggiunti', ['/api/movies', 'peliculas', '']),
|
# ('Ultimi Film aggiunti', ['/api/movies', 'movies', '']),
|
||||||
# ('Ultime Serie TV aggiunte', ['/api/shows', 'peliculas', '']),
|
# ('Ultime Serie TV aggiunte', ['/api/shows', 'movies', '']),
|
||||||
# ('Generi', ['/api/genres', 'search_movie_by_genre', '']),
|
# ('Generi', ['/api/genres', 'search_movie_by_genre', '']),
|
||||||
# ('Anni {film}', ['', 'search_movie_by_year', '']),
|
# ('Anni {film}', ['', 'search_movie_by_year', '']),
|
||||||
# ('Cerca... bold', ['', 'search', ''])
|
# ('Cerca... bold', ['', 'search', ''])
|
||||||
@@ -33,19 +33,19 @@ def mainlist(item):
|
|||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info()
|
logger.debug()
|
||||||
item = Item()
|
item = Item()
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + '/api/movies'
|
item.url = host + '/api/movies'
|
||||||
elif categoria == 'series':
|
elif category == 'tvshow':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host+'/api/shows'
|
item.url = host+'/api/shows'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
@@ -66,8 +66,8 @@ def peliculas(item):
|
|||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
json_object = jsontools.load(data)
|
json_object = jsontools.load(data)
|
||||||
@@ -83,7 +83,7 @@ def episodios(item):
|
|||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def get_season(item, seas_url, seasonNumber):
|
def get_season(item, seas_url, seasonNumber):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = support.match(seas_url, headers=headers).data
|
data = support.match(seas_url, headers=headers).data
|
||||||
json_object = jsontools.load(data)
|
json_object = jsontools.load(data)
|
||||||
@@ -97,7 +97,7 @@ def get_season(item, seas_url, seasonNumber):
|
|||||||
return itemlist[::-1]
|
return itemlist[::-1]
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(item.url, "search", texto)
|
logger.debug(item.url, "search", texto)
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
try:
|
try:
|
||||||
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
|
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
|
||||||
@@ -118,18 +118,18 @@ def search(item, texto):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def search_movie_by_genre(item):
|
def search_movie_by_genre(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
json_object = jsontools.load(data)
|
json_object = jsontools.load(data)
|
||||||
for genre in json_object['hydra:member']:
|
for genre in json_object['hydra:member']:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action="peliculas",
|
item.clone(action="movies",
|
||||||
title=support.typo(genre['name'],'bold'),
|
title=support.typo(genre['name'],'bold'),
|
||||||
contentType='movie',
|
contentType='movie',
|
||||||
url="%s/api/movies?genres.id=%s" %(host,genre['id'])))
|
url="%s/api/movies?genres.id=%s" %(host,genre['id'])))
|
||||||
@@ -137,7 +137,7 @@ def search_movie_by_genre(item):
|
|||||||
|
|
||||||
|
|
||||||
def search_movie_by_year(item):
|
def search_movie_by_year(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
year = int(now.year)
|
year = int(now.year)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -148,12 +148,12 @@ def search_movie_by_year(item):
|
|||||||
plot="1",
|
plot="1",
|
||||||
type="movie",
|
type="movie",
|
||||||
title=support.typo(year_to_search,'bold'),
|
title=support.typo(year_to_search,'bold'),
|
||||||
action="peliculas"))
|
action="movies"))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
try:
|
try:
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
@@ -175,7 +175,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
|
|
||||||
def get_itemlist_element(element,item):
|
def get_itemlist_element(element,item):
|
||||||
support.info()
|
logger.debug()
|
||||||
contentSerieName = ''
|
contentSerieName = ''
|
||||||
contentTitle =''
|
contentTitle =''
|
||||||
try:
|
try:
|
||||||
@@ -209,7 +209,7 @@ def get_itemlist_element(element,item):
|
|||||||
infoLabels['tmdb_id']=element['tmdbId']
|
infoLabels['tmdb_id']=element['tmdbId']
|
||||||
else:
|
else:
|
||||||
contentSerieName = scrapedtitle
|
contentSerieName = scrapedtitle
|
||||||
next_action='episodios'
|
next_action='episodes'
|
||||||
quality=''
|
quality=''
|
||||||
url="%s%s"
|
url="%s%s"
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
|
from platformcode import logger
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
@@ -17,12 +18,12 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
film = [
|
film = [
|
||||||
('Generi', ['', 'menu', 'Film']),
|
('Generi', ['', 'menu', 'Film']),
|
||||||
('Più Visti', ['','peliculas', 'most'])
|
('Più Visti', ['','movies', 'most'])
|
||||||
]
|
]
|
||||||
|
|
||||||
tvshow = ['',
|
tvshow = ['',
|
||||||
('Generi', ['', 'menu', 'Serie Tv']),
|
('Generi', ['', 'menu', 'Serie Tv']),
|
||||||
('Ultimi Episodi', ['','peliculas', 'last'])
|
('Ultimi Episodi', ['','movies', 'last'])
|
||||||
]
|
]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
@@ -31,62 +32,62 @@ def mainlist(item):
|
|||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def menu(item):
|
def menu(item):
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = item.args + r' Categorie</a>\s*<ul(?P<block>.*?)</ul>'
|
patronBlock = item.args + r' Categorie</a>\s*<ul(?P<block>.*?)</ul>'
|
||||||
patronMenu = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^>]+)<'
|
patronMenu = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^>]+)<'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info('search', item)
|
logger.debug('search', item)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
text = text.replace(' ', '+')
|
text = text.replace(' ', '+')
|
||||||
item.url = host + '/search/keyword/' + text
|
item.url = host + '/search/keyword/' + text
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
return itemlist
|
return itemlist
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
item.url = host
|
item.url = host
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
try:
|
try:
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
else:
|
else:
|
||||||
item.args = 'last'
|
item.args = 'last'
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
if item.contentType == 'tvshow' and not item.args:
|
if item.contentType == 'tvshow' and not item.args:
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
patron = r'<div class="movie-box">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)[^>]+>[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?P<year>\d+)'
|
patron = r'<div class="movie-box">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)[^>]+>[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?P<year>\d+)'
|
||||||
elif item.contentType == 'movie' and not item.args:
|
elif item.contentType == 'movie' and not item.args:
|
||||||
patron = r'<div class="existing_item col-6 col-lg-3 col-sm-4 col-xl-4">\s*<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<'
|
patron = r'<div class="existing_item col-6 col-lg-3 col-sm-4 col-xl-4">\s*<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<'
|
||||||
@@ -96,19 +97,19 @@ def peliculas(item):
|
|||||||
patron =r'div class="sm-113 item">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<title>[^<]+)'
|
patron =r'div class="sm-113 item">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<title>[^<]+)'
|
||||||
else:
|
else:
|
||||||
patron = r'<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<'
|
patron = r'<div class="movie-box">\s*<a href="(?P<url>(?:http(?:s)://[^/]+)?/(?P<type>[^/]+)/[^"]+)">[^>]+>[^>]+>\D+Streaming\s*(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>(?P<rating>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>\s*(?:(?P<year>\d+))?[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]*)<'
|
||||||
typeActionDict = {'findvideos':['movie'], 'episodios':['tvshow']}
|
typeActionDict = {'findvideos':['movie'], 'episodes':['tvshow']}
|
||||||
typeContentDict = {'movie':['movie'], 'tvshow':['tvshow']}
|
typeContentDict = {'movie':['movie'], 'tvshow':['tvshow']}
|
||||||
patronNext = r'<a href="([^"]+)"[^>]+>»'
|
patronNext = r'<a href="([^"]+)"[^>]+>»'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
patron = r'<div class="episode-box">[^>]+>[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>\D*(?P<season>\d+)[^>]+>\D*(?P<episode>\d+)'
|
patron = r'<div class="episode-box">[^>]+>[^>]+>[^>]+>\D+Streaming\s(?P<lang>[^"]+)">[^>]+>[^>]+>(?P<quality>[^<]+)<[^>]+>[^>]+>[^>]+>\s*<img src="(?P<thumb>[^"]+)"[^[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>\D*(?P<season>\d+)[^>]+>\D*(?P<episode>\d+)'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
# match = support.match(item, patron='wstream', debug=True)
|
# match = support.match(item, patron='wstream', debug=True)
|
||||||
return support.server(item)
|
return support.server(item)
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ host = support.config.get_channel_url()
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
top = [('Dirette {bold}', ['/dirette', 'live', '/palinsesto/onAir.json']),
|
top = [('Dirette {bullet bold}', ['/dirette', 'live', '/palinsesto/onAir.json']),
|
||||||
('Replay {bold}', ['/guidatv', 'replayMenu', '/guidatv.json'])]
|
('Replay {bullet bold}', ['/guidatv', 'replayMenu', '/guidatv.json'])]
|
||||||
|
|
||||||
menu = [('Film {bullet bold}', ['/film', 'menu', '/tipologia/film/index.json']),
|
menu = [('Film {bullet bold}', ['/film', 'menu', '/tipologia/film/index.json']),
|
||||||
('Serie TV {bullet bold}', ['/serietv', 'menu', '/tipologia/serietv/index.json']),
|
('Serie TV {bullet bold}', ['/serietv', 'menu', '/tipologia/serietv/index.json']),
|
||||||
@@ -43,14 +43,14 @@ def menu(item):
|
|||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item.disable_videolibrary = True
|
item.disable_videolibrary = True
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
|
|
||||||
if item.data:
|
if item.data:
|
||||||
for it in item.data:
|
for it in item.data:
|
||||||
url = getUrl(it['path_id'])
|
url = getUrl(it['path_id'])
|
||||||
action = 'genres'
|
action = 'genres'
|
||||||
itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), url=url.replace('.json','.html'), genre_url=url, data='', action=action))
|
itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), url=url.replace('.json','.html'), genre_url=url, data='', action=action))
|
||||||
support.thumb(itemlist, genre=True)
|
support.thumb(itemlist, mode='genre')
|
||||||
else:
|
else:
|
||||||
items = item.data if item.data else requests.get(host + item.args).json()['contents']
|
items = item.data if item.data else requests.get(host + item.args).json()['contents']
|
||||||
for it in items:
|
for it in items:
|
||||||
@@ -58,7 +58,7 @@ def menu(item):
|
|||||||
thumb = item.thumbnail
|
thumb = item.thumbnail
|
||||||
if 'RaiPlay Slider Generi Block' in it['type']:
|
if 'RaiPlay Slider Generi Block' in it['type']:
|
||||||
action = 'menu'
|
action = 'menu'
|
||||||
thumb = support.thumb('genres')
|
thumb = support.thumb('genre')
|
||||||
itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=it.get('contents', item.data), thumbnail=thumb, action=action))
|
itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=it.get('contents', item.data), thumbnail=thumb, action=action))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -68,7 +68,7 @@ def genres(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
items = requests.get(getUrl(item.genre_url)).json()['contents']
|
items = requests.get(getUrl(item.genre_url)).json()['contents']
|
||||||
for title, it in items.items():
|
for title, it in items.items():
|
||||||
if it: itemlist.append(item.clone(title=support.typo(title, 'bold'), data=it, action='peliculas', thumbnail=support.thumb('az')))
|
if it: itemlist.append(item.clone(title=support.typo(title, 'bold'), data=it, action='movies', thumbnail=support.thumb('az')))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -78,21 +78,21 @@ def search(item, text):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
item.data = requests.post(host + '/atomatic/raiplay-search-service/api/v3/search', json=post).json()['agg']['titoli']['cards']
|
item.data = requests.post(host + '/atomatic/raiplay-search-service/api/v3/search', json=post).json()['agg']['titoli']['cards']
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
return addinfo(item.data, item)
|
return addinfo(item.data, item)
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
@@ -100,8 +100,8 @@ def episodios(item):
|
|||||||
items = item.data
|
items = item.data
|
||||||
elif item.season_url:
|
elif item.season_url:
|
||||||
items = requests.get(item.season_url).json()['items']
|
items = requests.get(item.season_url).json()['items']
|
||||||
elif item.video_url:
|
elif item.videoUrl:
|
||||||
items = requests.get(item.video_url).json()['blocks']
|
items = requests.get(item.videoUrl).json()['blocks']
|
||||||
|
|
||||||
if 'sets' in items[0]:
|
if 'sets' in items[0]:
|
||||||
if len(items) > 1:
|
if len(items) > 1:
|
||||||
@@ -119,7 +119,7 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def epMenu(item):
|
def epMenu(item):
|
||||||
video_url = ''
|
videoUrl = ''
|
||||||
itemlist = []
|
itemlist = []
|
||||||
for it in item.data:
|
for it in item.data:
|
||||||
if 'sets' in it:
|
if 'sets' in it:
|
||||||
@@ -141,9 +141,9 @@ def live(item):
|
|||||||
current = it['currentItem']
|
current = it['currentItem']
|
||||||
next = it['nextItem']
|
next = it['nextItem']
|
||||||
plot = '[B]{}[/B]\n{}\n\nA Seguire: [B]{}[/B]\n{}'.format(current['name'], current['description'], next['name'], next['description'])
|
plot = '[B]{}[/B]\n{}\n\nA Seguire: [B]{}[/B]\n{}'.format(current['name'], current['description'], next['name'], next['description'])
|
||||||
itemlist.append(item.clone(title=title, fulltitle=title, fanart=fanart, plot=plot, url=url, video_url=url + '.json', action='play'))
|
itemlist.append(item.clone(title=title, fulltitle=title, fanart=fanart, plot=plot, url=url, videoUrl=url + '.json', action='findvideos'))
|
||||||
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||||
support.thumb(itemlist, live=True)
|
support.thumb(itemlist, mode='live')
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ def replayChannels(item):
|
|||||||
channel_url=channel_url,
|
channel_url=channel_url,
|
||||||
action='replay'))
|
action='replay'))
|
||||||
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||||
support.thumb(itemlist, live=True)
|
support.thumb(itemlist, mode='live')
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def replay(item):
|
def replay(item):
|
||||||
@@ -206,8 +206,8 @@ def replay(item):
|
|||||||
fanart = image,
|
fanart = image,
|
||||||
plot = info['description'],
|
plot = info['description'],
|
||||||
url = getUrl(it['weblink']),
|
url = getUrl(it['weblink']),
|
||||||
video_url = getUrl(it['path_id']),
|
videoUrl = getUrl(it['path_id']),
|
||||||
action = 'play',
|
action = 'findvideos',
|
||||||
forcethumb = True)
|
forcethumb = True)
|
||||||
|
|
||||||
|
|
||||||
@@ -225,10 +225,10 @@ def replay(item):
|
|||||||
return [Item(title='Non ci sono Replay per questo Canale')]
|
return [Item(title='Non ci sono Replay per questo Canale')]
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def play(item):
|
def findvideos(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
res = requests.get(item.video_url).json()
|
res = requests.get(item.videoUrl).json()
|
||||||
|
|
||||||
if 'first_item_path' in res:
|
if 'first_item_path' in res:
|
||||||
res = requests.get(getUrl(res['first_item_path'])).json()
|
res = requests.get(getUrl(res['first_item_path'])).json()
|
||||||
@@ -258,7 +258,7 @@ def getUrl(url):
|
|||||||
|
|
||||||
def addinfo(items, item):
|
def addinfo(items, item):
|
||||||
def itInfo(key, item):
|
def itInfo(key, item):
|
||||||
logger.debug(jsontools.dump(key))
|
# logger.debug(jsontools.dump(key))
|
||||||
item.forcethumb = True
|
item.forcethumb = True
|
||||||
if key.get('titolo', ''):
|
if key.get('titolo', ''):
|
||||||
key = requests.get(getUrl(key['path_id'])).json()['program_info']
|
key = requests.get(getUrl(key['path_id'])).json()['program_info']
|
||||||
@@ -279,14 +279,14 @@ def addinfo(items, item):
|
|||||||
thumbnail= getUrl(thumb),
|
thumbnail= getUrl(thumb),
|
||||||
fanart=getUrl(fanart),
|
fanart=getUrl(fanart),
|
||||||
url=getUrl(key.get('weblink', '')),
|
url=getUrl(key.get('weblink', '')),
|
||||||
video_url=getUrl(key['path_id']),
|
videoUrl=getUrl(key['path_id']),
|
||||||
plot=info.get('description', ''))
|
plot=info.get('description', ''))
|
||||||
|
|
||||||
if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'):
|
if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'):
|
||||||
it.action = 'play'
|
it.action = 'findvideos'
|
||||||
it.contentTitle = it.fulltitle
|
it.contentTitle = it.fulltitle
|
||||||
else:
|
else:
|
||||||
it.action = 'episodios'
|
it.action = 'episodes'
|
||||||
it.contentSerieName = it.fulltitle
|
it.contentSerieName = it.fulltitle
|
||||||
return it
|
return it
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,9 @@
|
|||||||
|
|
||||||
|
|
||||||
from core import support
|
from core import support
|
||||||
def findhost(url):
|
from platformcode import logger
|
||||||
return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match
|
# def findhost(url):
|
||||||
|
# return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -17,64 +18,64 @@ def mainlist(item):
|
|||||||
|
|
||||||
tvshow = [('Genere', ['', 'menu', 'genre']),
|
tvshow = [('Genere', ['', 'menu', 'genre']),
|
||||||
('A-Z', ['', 'menu', 'a-z']),
|
('A-Z', ['', 'menu', 'a-z']),
|
||||||
('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'peliculas']),
|
('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'movies']),
|
||||||
('Complete', ['/category/serie-tv-streaming/serie-complete', 'peliculas']),
|
('Complete', ['/category/serie-tv-streaming/serie-complete', 'movies']),
|
||||||
('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'peliculas']),
|
('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'movies']),
|
||||||
('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'peliculas']),
|
('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'movies']),
|
||||||
('Ultimi Episodi', ['/aggiornamenti', 'peliculas', 'last']),
|
('Ultimi Episodi', ['/aggiornamenti', 'movies', 'last']),
|
||||||
('Evidenza', ['', 'peliculas', 'best'])]
|
('Evidenza', ['', 'movies', 'best'])]
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.info(texto)
|
logger.debug(texto)
|
||||||
|
|
||||||
|
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore .
|
# Continua la ricerca in caso di errore .
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
item.url = host + '/aggiornamenti'
|
item.url = host + '/aggiornamenti'
|
||||||
item.args = 'last'
|
item.args = 'last'
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
|
|
||||||
if item.args == 'last':
|
if item.args == 'last':
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'singleUpdate">(?:[^>]+>){2}\s*<img src="(?P<thumb>[^"]+)"(?:[^>]+>){3}\s*<h2>(?P<title>[^<]+)<(?:[^>]+>){14,16}\s*<a href="(?P<url>[^"]+)">(?:[^>]+>){3}\s*(?P<season>\d+)\D+(?P<episode>\d+)(?:[^\(]*\()?(?P<lang>[^\)]+)?(?:\))?'
|
patron = r'singleUpdate">(?:[^>]+>){2}\s*<img src="(?P<thumb>[^"]+)"(?:[^>]+>){3}\s*<h2>(?P<title>[^<]+)<(?:[^>]+>){14,16}\s*<a href="(?P<url>[^"]+)">(?:[^>]+>){3}\s*(?P<season>\d+)\D+(?P<episode>\d+)(?:[^\(]*\()?(?P<lang>[^\)]+)?(?:\))?'
|
||||||
elif item.args == 'best':
|
elif item.args == 'best':
|
||||||
action='episodios'
|
action='episodes'
|
||||||
patron = r'col-md-3">\s*<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoVetrina">[^>]+>(?P<year>\d{4})(?:[^>]+>){2}(?P<title>[^<]+)<(?:[^>]+>){4}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)"'
|
patron = r'col-md-3">\s*<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoVetrina">[^>]+>(?P<year>\d{4})(?:[^>]+>){2}(?P<title>[^<]+)<(?:[^>]+>){4}(?P<rating>[^<]+)(?:[^>]+>){4}\s*<img src="(?P<thumb>[^"]+)"'
|
||||||
else:
|
else:
|
||||||
action='episodios'
|
action='episodes'
|
||||||
# patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+)<(?:[^>]+>){5}(?P<rating>[^<]+)?(?:[^>]+>){3}\s*<img src="(?P<thumb>[^"]+)"(?:[^>]+>){3}(?P<quality>[^<]+)<(?:[^>]+>){2}(?P<year>\d{4})'
|
# patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+)<(?:[^>]+>){5}(?P<rating>[^<]+)?(?:[^>]+>){3}\s*<img src="(?P<thumb>[^"]+)"(?:[^>]+>){3}(?P<quality>[^<]+)<(?:[^>]+>){2}(?P<year>\d{4})'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+?)(?:\[(?P<lang>[^\]]+)\])?<(?:[^>]+>){5}(?P<rating>[^<]+)?(?:[^>]+>){3}\s*(?:<img src="(?P<thumb>[^"]+)"[^>]+>)?(?:[^>]+>){0,2}(?P<quality>[^<]+)<(?:[^>]+>){2}(?P<year>\d{4})'
|
patron = r'<a href="(?P<url>[^"]+)">[^>]+>\s*<div class="infoSeries">\s*<h2>(?P<title>[^<]+?)(?:\[(?P<lang>[^\]]+)\])?<(?:[^>]+>){5}(?P<rating>[^<]+)?(?:[^>]+>){3}\s*(?:<img src="(?P<thumb>[^"]+)"[^>]+>)?(?:[^>]+>){0,2}(?P<quality>[^<]+)<(?:[^>]+>){2}(?P<year>\d{4})'
|
||||||
patronNext=r'next page-numbers" href="([^"]+)"'
|
patronNext=r'next page-numbers" href="([^"]+)"'
|
||||||
@@ -83,7 +84,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
def get_season(pageData, seas_url, season):
|
def get_season(pageData, seas_url, season):
|
||||||
data = ''
|
data = ''
|
||||||
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
||||||
@@ -104,7 +105,7 @@ def episodios(item):
|
|||||||
data = ''
|
data = ''
|
||||||
|
|
||||||
# debugging
|
# debugging
|
||||||
# support.dbg()
|
# logger.dbg()
|
||||||
# for i, season in enumerate(seasons.matches):
|
# for i, season in enumerate(seasons.matches):
|
||||||
# data += get_season(seasons.data if i == 0 else '', season[0], season[1])
|
# data += get_season(seasons.data if i == 0 else '', season[0], season[1])
|
||||||
import sys
|
import sys
|
||||||
@@ -136,13 +137,13 @@ def menu(item):
|
|||||||
patronMenu = r'<a href="(?P<url>[^"]+)" class="">(?P<title>[^<]+)'
|
patronMenu = r'<a href="(?P<url>[^"]+)" class="">(?P<title>[^<]+)'
|
||||||
|
|
||||||
blacklist = ['Serie TV Streaming','Serie TV Americane','Serie TV Italiane','Serie Complete','Serie in Corso','altadefinizione']
|
blacklist = ['Serie TV Streaming','Serie TV Americane','Serie TV Italiane','Serie Complete','Serie in Corso','altadefinizione']
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
item.url = item.url.replace('&', '&')
|
item.url = item.url.replace('&', '&')
|
||||||
support.info(item)
|
logger.debug(item)
|
||||||
if item.args == 'last':
|
if item.args == 'last':
|
||||||
url = support.match(item, patron = r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
|
url = support.match(item, patron = r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
|
||||||
matches = support.match(url,patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>').matches
|
matches = support.match(url,patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>').matches
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
Altrimenti:
|
Altrimenti:
|
||||||
- Prima fare la 'Rinumerazione' dal menu contestuale dal titolo della serie
|
- Prima fare la 'Rinumerazione' dal menu contestuale dal titolo della serie
|
||||||
"""
|
"""
|
||||||
import re
|
|
||||||
from core import support, httptools, scrapertools
|
from core import support, scrapertools
|
||||||
from platformcode import config
|
from platformcode import config, logger
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
|
||||||
|
|
||||||
@@ -31,33 +31,33 @@ headers = [['Referer', host]]
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
|
|
||||||
|
|
||||||
film = ['/ultimi-film-aggiunti/',
|
film = ['/ultimi-film-aggiunti/',
|
||||||
('A-Z', ['/lista-film/', 'peliculas', 'lista'])
|
('A-Z', ['/lista-film/', 'movies', 'lista'])
|
||||||
]
|
]
|
||||||
|
|
||||||
tvshow = ['',
|
tvshow = ['',
|
||||||
('Aggiornamenti', ['/ultimi-episodi-aggiunti/', 'peliculas', 'update']),
|
('Aggiornamenti', ['/ultimi-episodi-aggiunti/', 'movies', 'update']),
|
||||||
('Tutte', ['/lista-serie-tv/', 'peliculas', 'qualcosa']),
|
('Tutte', ['/lista-serie-tv/', 'movies', 'qualcosa']),
|
||||||
('Italiane', ['/lista-serie-tv-italiane/', 'peliculas', 'qualcosa']),
|
('Italiane', ['/lista-serie-tv-italiane/', 'movies', 'qualcosa']),
|
||||||
('Anni 50-60-70-80', ['/lista-serie-tv-anni-60-70-80/', 'peliculas', 'qualcosa']),
|
('Anni 50-60-70-80', ['/lista-serie-tv-anni-60-70-80/', 'movies', 'qualcosa']),
|
||||||
('HD', ['/lista-serie-tv-in-altadefinizione/', 'peliculas', 'qualcosa'])
|
('HD', ['/lista-serie-tv-in-altadefinizione/', 'movies', 'qualcosa'])
|
||||||
]
|
]
|
||||||
|
|
||||||
anime = ['/lista-cartoni-animati-e-anime/']
|
anime = ['/lista-cartoni-animati-e-anime/']
|
||||||
|
|
||||||
documentari = [('Documentari {bullet bold}', ['/lista-documentari/' , 'peliculas' , 'doc', 'tvshow'])]
|
documentari = [('Documentari {bullet bold}', ['/lista-documentari/' , 'movies' , 'doc', 'tvshow'])]
|
||||||
|
|
||||||
search = ''
|
search = ''
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
|
|
||||||
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime']
|
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime']
|
||||||
patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">'
|
patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">'
|
||||||
@@ -68,22 +68,22 @@ def peliculas(item):
|
|||||||
patronBlock = r'>Lista Serie Tv</a></li></ul></div><div id="box_movies">(?P<block>.*?)<div id="paginador">'
|
patronBlock = r'>Lista Serie Tv</a></li></ul></div><div id="box_movies">(?P<block>.*?)<div id="paginador">'
|
||||||
patron = r'<div class="movie">[^>]+[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.+?)(?:(?P<year>\d{4})|")[^>]*>\s*<a href="(?P<url>[^"]+)'
|
patron = r'<div class="movie">[^>]+[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.+?)(?:(?P<year>\d{4})|")[^>]*>\s*<a href="(?P<url>[^"]+)'
|
||||||
elif item.contentType == 'episode':
|
elif item.contentType == 'episode':
|
||||||
pagination = 35
|
pagination = True
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>.*?)(?P<episode>\d+x\d+)[ ]?(?P<title2>[^<]+)?<'
|
patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>.*?)(?P<episode>\d+x\d+)[ ]?(?P<title2>[^<]+)?<'
|
||||||
|
|
||||||
elif item.contentType == 'tvshow':
|
elif item.contentType == 'tvshow':
|
||||||
# SEZIONE Serie TV- Anime - Documentari
|
# SEZIONE Serie TV- Anime - Documentari
|
||||||
pagination = 35
|
pagination = True
|
||||||
|
|
||||||
if not item.args and 'anime' not in item.url:
|
if not item.args and 'anime' not in item.url:
|
||||||
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+? href="(?P<url>[^"]+)">.*?<h2>(?P<title>[^"]+)</h2>\s?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
|
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+? href="(?P<url>[^"]+)">.*?<h2>(?P<title>[^"]+)</h2>\s?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
|
||||||
else:
|
else:
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
|
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
|
||||||
else:
|
else:
|
||||||
# SEZIONE FILM
|
# SEZIONE FILM
|
||||||
pagination = 25
|
pagination = True
|
||||||
|
|
||||||
if item.args == 'lista':
|
if item.args == 'lista':
|
||||||
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)(?:\s(?P<year>\d{4})|<)'
|
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)(?:\s(?P<year>\d{4})|<)'
|
||||||
@@ -99,15 +99,15 @@ def peliculas(item):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.action = 'episodios'
|
item.action = 'episodes'
|
||||||
return item
|
return item
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patronBlock = r'<table>(?P<block>.*)<\/table>'
|
patronBlock = r'<table>(?P<block>.*)<\/table>'
|
||||||
patron = r'<tr><td>(?P<title>.*?)?[ ](?:Parte)?(?P<episode>\d+x\d+|\d+)(?:|[ ]?(?P<title2>.+?)?(?:avi)?)<(?P<data>.*?)<\/td><tr>'
|
patron = r'<tr><td>(?P<title>.*?)?[ ](?:Parte)?(?P<episode>\d+x\d+|\d+)(?:|[ ]?(?P<title2>.+?)?(?:avi)?)<(?P<data>.*?)<\/td><tr>'
|
||||||
@@ -121,47 +121,47 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info("CERCA :" ,text, item)
|
logger.debug("CERCA :" ,text, item)
|
||||||
|
|
||||||
item.url = "%s/?s=%s" % (host, text)
|
item.url = "%s/?s=%s" % (host, text)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
|
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + '/ultimi-film-aggiunti/'
|
item.url = host + '/ultimi-film-aggiunti/'
|
||||||
elif categoria == 'series':
|
elif category == 'tvshow':
|
||||||
item.args = 'update'
|
item.args = 'update'
|
||||||
item.contentType = 'episode'
|
item.contentType = 'episode'
|
||||||
item.url = host +'/ultimi-episodi-aggiunti/'
|
item.url = host +'/ultimi-episodi-aggiunti/'
|
||||||
try:
|
try:
|
||||||
item.action = 'peliculas'
|
item.action = 'movies'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
if item.contentType == 'movie':
|
if item.contentType == 'movie':
|
||||||
return support.server(item, headers=headers)
|
return support.server(item, headers=headers)
|
||||||
else:
|
else:
|
||||||
@@ -179,6 +179,6 @@ def findvideos(item):
|
|||||||
series = support.typo(item.contentSerieName, ' bold color kod')
|
series = support.typo(item.contentSerieName, ' bold color kod')
|
||||||
itemlist = support.server(item, data=url_video)
|
itemlist = support.server(item, data=url_video)
|
||||||
|
|
||||||
itemlist.append(item.clone(title=goseries + series, contentType='tvshow', url=url_serie, action='episodios', plot = goseries + series + "con tutte le puntate", args=''))
|
itemlist.append(item.clone(title=goseries + series, contentType='tvshow', url=url_serie, action='episodes', plot = goseries + series + "con tutte le puntate", args=''))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
"visible": true
|
"visible": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "include_in_newest_series",
|
"id": "include_in_newest_tvshow",
|
||||||
"type": "bool",
|
"type": "bool",
|
||||||
"label": "Includi in Novità - Serie TV",
|
"label": "Includi in Novità - Serie TV",
|
||||||
"default": true,
|
"default": true,
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import time
|
|||||||
|
|
||||||
from core import httptools, tmdb, scrapertools, support
|
from core import httptools, tmdb, scrapertools, support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core.support import info
|
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
@@ -21,10 +20,9 @@ list_language = IDIOMAS.values()
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
info()
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
tvshowSub = [
|
tvshowSub = [
|
||||||
('Novità {bold}',[ '', 'peliculas_tv', '', 'tvshow']),
|
('Novità {bold}',[ '', 'movies_tv', '', 'tvshow']),
|
||||||
('Serie TV {bold}',[ '', 'lista_serie', '', 'tvshow']),
|
('Serie TV {bold}',[ '', 'lista_serie', '', 'tvshow']),
|
||||||
('Per Lettera', ['', 'list_az', 'serie', 'tvshow'])
|
('Per Lettera', ['', 'list_az', 'serie', 'tvshow'])
|
||||||
]
|
]
|
||||||
@@ -52,12 +50,12 @@ def cleantitle(scrapedtitle):
|
|||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
info()
|
logger.debug()
|
||||||
data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data
|
data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).data
|
||||||
data = re.sub(r'\n|\t|\s+', ' ', data)
|
data = re.sub(r'\n|\t|\s+', ' ', data)
|
||||||
# recupero il blocco contenente i link
|
# recupero il blocco contenente i link
|
||||||
blocco = scrapertools.find_single_match(data, r'<div class="entry">([\s\S.]*?)<div class="post').replace('..:: Episodio ', 'Episodio ').strip()
|
blocco = scrapertools.find_single_match(data, r'<div class="entry">([\s\S.]*?)<div class="post').replace('..:: Episodio ', 'Episodio ').strip()
|
||||||
matches = scrapertools.find_multiple_matches(blocco, r'(S(\d*)E(\d*))\s')
|
matches = scrapertools.findMultipleMatches(blocco, r'(S(\d*)E(\d*))\s')
|
||||||
if len(matches) > 0:
|
if len(matches) > 0:
|
||||||
for fullseasonepisode, season, episode in matches:
|
for fullseasonepisode, season, episode in matches:
|
||||||
blocco = blocco.replace(fullseasonepisode + ' ', 'Episodio ' + episode + ' ')
|
blocco = blocco.replace(fullseasonepisode + ' ', 'Episodio ' + episode + ' ')
|
||||||
@@ -66,10 +64,10 @@ def findvideos(item):
|
|||||||
|
|
||||||
episodio = item.infoLabels['episode']
|
episodio = item.infoLabels['episode']
|
||||||
patron = r'\.\.:: Episodio %s([\s\S]*?)(<div class="post|..:: Episodio)' % episodio
|
patron = r'\.\.:: Episodio %s([\s\S]*?)(<div class="post|..:: Episodio)' % episodio
|
||||||
info(patron)
|
logger.debug(patron)
|
||||||
info(blocco)
|
logger.debug(blocco)
|
||||||
|
|
||||||
matches = scrapertools.find_multiple_matches(blocco, patron)
|
matches = scrapertools.findMultipleMatches(blocco, patron)
|
||||||
if len(matches):
|
if len(matches):
|
||||||
data = matches[0][0]
|
data = matches[0][0]
|
||||||
|
|
||||||
@@ -80,7 +78,7 @@ def findvideos(item):
|
|||||||
['Referer', keeplinks]]
|
['Referer', keeplinks]]
|
||||||
|
|
||||||
html = httptools.downloadpage(keeplinks, headers=headers2).data
|
html = httptools.downloadpage(keeplinks, headers=headers2).data
|
||||||
data += str(scrapertools.find_multiple_matches(html, '</lable><a href="([^"]+)" target="_blank"'))
|
data += str(scrapertools.findMultipleMatches(html, '</lable><a href="([^"]+)" target="_blank"'))
|
||||||
|
|
||||||
return support.server(item, data=data)
|
return support.server(item, data=data)
|
||||||
|
|
||||||
@@ -89,7 +87,7 @@ def findvideos(item):
|
|||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
def lista_serie(item):
|
def lista_serie(item):
|
||||||
info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
PERPAGE = 15
|
PERPAGE = 15
|
||||||
@@ -112,7 +110,7 @@ def lista_serie(item):
|
|||||||
if i >= p * PERPAGE: break
|
if i >= p * PERPAGE: break
|
||||||
title = cleantitle(scrapedtitle)
|
title = cleantitle(scrapedtitle)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action="episodios",
|
item.clone(action="episodes",
|
||||||
title=title,
|
title=title,
|
||||||
url=scrapedurl,
|
url=scrapedurl,
|
||||||
thumbnail=scrapedthumbnail,
|
thumbnail=scrapedthumbnail,
|
||||||
@@ -136,8 +134,8 @@ def lista_serie(item):
|
|||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
def episodios(item, itemlist=[]):
|
def episodes(item, itemlist=[]):
|
||||||
info()
|
logger.debug()
|
||||||
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?'
|
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>.*?'
|
||||||
patron += r'<p><a href="([^"]+)">'
|
patron += r'<p><a href="([^"]+)">'
|
||||||
|
|
||||||
@@ -159,7 +157,7 @@ def episodios(item, itemlist=[]):
|
|||||||
blocco = scrapertools.find_single_match(data, r'<div class="entry">[\s\S.]*?<div class="post')
|
blocco = scrapertools.find_single_match(data, r'<div class="entry">[\s\S.]*?<div class="post')
|
||||||
blocco = blocco.replace('<strong>Episodio ', '<strong>Episodio ').replace(' </strong>', ' </strong>')
|
blocco = blocco.replace('<strong>Episodio ', '<strong>Episodio ').replace(' </strong>', ' </strong>')
|
||||||
blocco = blocco.replace('<strong>Episodio ', '<strong>S' + season.zfill(2) + 'E')
|
blocco = blocco.replace('<strong>Episodio ', '<strong>S' + season.zfill(2) + 'E')
|
||||||
matches = scrapertools.find_multiple_matches(blocco, r'(S(\d*)E(\d*))\s')
|
matches = scrapertools.findMultipleMatches(blocco, r'(S(\d*)E(\d*))\s')
|
||||||
episodes = []
|
episodes = []
|
||||||
if len(matches) > 0:
|
if len(matches) > 0:
|
||||||
for fullepisode_s, season, episode in matches:
|
for fullepisode_s, season, episode in matches:
|
||||||
@@ -175,7 +173,7 @@ def episodios(item, itemlist=[]):
|
|||||||
title = scrapedtitle.split(" S0")[0].strip()
|
title = scrapedtitle.split(" S0")[0].strip()
|
||||||
title = title.split(" S1")[0].strip()
|
title = title.split(" S1")[0].strip()
|
||||||
title = title.split(" S2")[0].strip()
|
title = title.split(" S2")[0].strip()
|
||||||
episodes = scrapertools.find_multiple_matches(scrapedtitle, r'((\d*)x(\d*))')
|
episodes = scrapertools.findMultipleMatches(scrapedtitle, r'((\d*)x(\d*))')
|
||||||
|
|
||||||
for fullepisode, season, episode in episodes:
|
for fullepisode, season, episode in episodes:
|
||||||
infoLabels = {}
|
infoLabels = {}
|
||||||
@@ -200,7 +198,7 @@ def episodios(item, itemlist=[]):
|
|||||||
next_page = scrapertools.find_single_match(data, patron)
|
next_page = scrapertools.find_single_match(data, patron)
|
||||||
if next_page != "":
|
if next_page != "":
|
||||||
item.url = next_page
|
item.url = next_page
|
||||||
itemlist = episodios(item, itemlist)
|
itemlist = episodes(item, itemlist)
|
||||||
else:
|
else:
|
||||||
item.url = item.originalUrl
|
item.url = item.originalUrl
|
||||||
support.videolibrary(itemlist, item, 'bold color kod')
|
support.videolibrary(itemlist, item, 'bold color kod')
|
||||||
@@ -211,8 +209,8 @@ def episodios(item, itemlist=[]):
|
|||||||
# ================================================================================================================
|
# ================================================================================================================
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
def peliculas_tv(item):
|
def movies_tv(item):
|
||||||
info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>'
|
patron = r'<div class="post-meta">\s*<a href="([^"]+)"\s*title="([^"]+)"\s*class=".*?"></a>'
|
||||||
@@ -229,7 +227,7 @@ def peliculas_tv(item):
|
|||||||
scrapedplot = ""
|
scrapedplot = ""
|
||||||
scrapedtitle = cleantitle(scrapedtitle)
|
scrapedtitle = cleantitle(scrapedtitle)
|
||||||
infoLabels = {}
|
infoLabels = {}
|
||||||
episode = scrapertools.find_multiple_matches(scrapedtitle, r'((\d*)x(\d*))')
|
episode = scrapertools.findMultipleMatches(scrapedtitle, r'((\d*)x(\d*))')
|
||||||
if episode: # workaround per quando mettono le serie intere o altra roba, sarebbero da intercettare TODO
|
if episode: # workaround per quando mettono le serie intere o altra roba, sarebbero da intercettare TODO
|
||||||
episode = episode[0]
|
episode = episode[0]
|
||||||
title = scrapedtitle.split(" S0")[0].strip()
|
title = scrapedtitle.split(" S0")[0].strip()
|
||||||
@@ -255,7 +253,7 @@ def peliculas_tv(item):
|
|||||||
|
|
||||||
# Paginazione
|
# Paginazione
|
||||||
patron = r'<strong class="on">\d+</strong>\s?<a href="([^<]+)">\d+</a>'
|
patron = r'<strong class="on">\d+</strong>\s?<a href="([^<]+)">\d+</a>'
|
||||||
support.nextPage(itemlist, item, data, patron)
|
support.nextPage(itemlist, item, data=data, patron=patron)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -264,16 +262,16 @@ def peliculas_tv(item):
|
|||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
item.url = host
|
item.url = host
|
||||||
item.extra = 'serie'
|
item.extra = 'serie'
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
itemlist = peliculas_tv(item)
|
itemlist = movies_tv(item)
|
||||||
if itemlist[-1].action == 'peliculas_tv':
|
if itemlist[-1].action == 'movies_tv':
|
||||||
itemlist.pop(-1)
|
itemlist.pop(-1)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
@@ -289,7 +287,7 @@ def newest(categoria):
|
|||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------------
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
info(texto)
|
logger.debug(texto)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
try:
|
try:
|
||||||
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
patron = r'<li class="cat-item cat-item-\d+"><a href="([^"]+)"\s?>([^<]+)</a>'
|
||||||
@@ -300,7 +298,7 @@ def search(item, texto):
|
|||||||
scrapedplot = ""
|
scrapedplot = ""
|
||||||
title = cleantitle(scrapedtitle)
|
title = cleantitle(scrapedtitle)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action="episodios",
|
item.clone(action="episodes",
|
||||||
title=title,
|
title=title,
|
||||||
url=scrapedurl,
|
url=scrapedurl,
|
||||||
thumbnail=scrapedthumbnail,
|
thumbnail=scrapedthumbnail,
|
||||||
@@ -313,7 +311,7 @@ def search(item, texto):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.info('search log:', line)
|
logger.error('search log:', line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -325,7 +323,7 @@ def search(item, texto):
|
|||||||
|
|
||||||
|
|
||||||
def list_az(item):
|
def list_az(item):
|
||||||
info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
alphabet = dict()
|
alphabet = dict()
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
"language": ["ita", "sub-ita"],
|
"language": ["ita", "sub-ita"],
|
||||||
"thumbnail": "serietvu.png",
|
"thumbnail": "serietvu.png",
|
||||||
"banner": "serietvu.png",
|
"banner": "serietvu.png",
|
||||||
"categories": ["tvshow", "vos"],
|
"categories": ["tvshow", "sub"],
|
||||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime"],
|
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,9 @@
|
|||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from core import support, httptools, scrapertools
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core.support import info
|
from platformcode import config, logger
|
||||||
from platformcode import config
|
|
||||||
|
|
||||||
host = config.get_channel_url()
|
host = config.get_channel_url()
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
@@ -24,7 +23,7 @@ headers = [['Referer', host]]
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
tvshow = ['/category/serie-tv',
|
tvshow = ['/category/serie-tv',
|
||||||
('Ultimi episodi', ['/ultimi-episodi/', 'peliculas', 'update']),
|
('Ultimi episodi', ['/ultimi-episodi/', 'movies', 'update']),
|
||||||
('Generi', ['', 'genres', 'genres'])
|
('Generi', ['', 'genres', 'genres'])
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -32,31 +31,31 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug=True
|
# debug=True
|
||||||
patronBlock = r'<div class="wrap">\s*<h.>.*?</h.>(?P<block>.*?)<footer>'
|
patronBlock = r'<div class="wrap">\s*<h.>.*?</h.>(?P<block>.*?)<footer>'
|
||||||
|
|
||||||
if item.args != 'update':
|
if item.args != 'update':
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
patron = r'<div class="item">\s*?<a href="(?P<url>[^"]+)" data-original="(?P<thumb>[^"]+)" class="lazy inner">(?:[^>]+>){4}(?P<title>[^<]+)<'
|
patron = r'<div class="item">\s*?<a href="(?P<url>[^"]+)" data-original="(?P<thumb>[^"]+)" class="lazy inner">(?:[^>]+>){4}(?P<title>[^<]+)<'
|
||||||
else:
|
else:
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'<div class="item">\s*?<a href="(?P<url>[^"]+)"\s*?data-original="(?P<thumb>[^"]+)"(?:[^>]+>){5}(?P<title>.+?)<[^>]+>\((?P<episode>[\dx\-]+)\s+?(?P<lang>Sub-Ita|[iITtAa]+)\)<'
|
patron = r'<div class="item">\s*?<a href="(?P<url>[^"]+)"\s*?data-original="(?P<thumb>[^"]+)"(?:[^>]+>){5}(?P<title>.+?)<[^>]+>\((?P<episode>[\dx\-]+)\s+?(?P<lang>Sub-Ita|[iITtAa]+)\)<'
|
||||||
pagination = 25
|
pagination = True
|
||||||
|
|
||||||
patronNext = r'<li><a href="([^"]+)"\s+?>Pagina successiva'
|
patronNext = r'<li><a href="([^"]+)"\s+?>Pagina successiva'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
seasons = support.match(item, patron=r'<option value="(\d+)"[^>]*>\D+(\d+)').matches
|
seasons = support.match(item, patron=r'<option value="(\d+)"[^>]*>\D+(\d+)').matches
|
||||||
patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">'
|
patronBlock = r'</select><div style="clear:both"></div></h2>(?P<block>.*?)<div id="trailer" class="tab">'
|
||||||
patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)'
|
patron = r'(?:<div class="list (?:active)?")?\s*<a data-id="\d+(?:[ ](?P<lang>[SuUbBiItTaA\-]+))?"(?P<other>[^>]+)>.*?Episodio [0-9]+\s?(?:<br>(?P<title>[^<]+))?.*?Stagione (?P<season>[0-9]+) , Episodio - (?P<episode>[0-9]+).*?<(?P<url>.*?<iframe)'
|
||||||
def itemHook(i):
|
def itemHook(i):
|
||||||
for value, season in seasons:
|
for value, season in seasons:
|
||||||
info(value)
|
logger.debug(value)
|
||||||
info(season)
|
logger.debug(season)
|
||||||
i.title = i.title.replace(value+'x',season+'x')
|
i.title = i.title.replace(value+'x',season+'x')
|
||||||
i.other += '\n' + i.url
|
i.other += '\n' + i.url
|
||||||
i.url = item.url
|
i.url = item.url
|
||||||
@@ -67,50 +66,50 @@ def episodios(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def genres(item):
|
def genres(item):
|
||||||
blacklist = ["Home Page", "Calendario Aggiornamenti"]
|
blacklist = ["Home Page", "Calendario Aggiornamenti"]
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
patronBlock = r'<h2>Sfoglia</h2>\s*<ul>(?P<block>.*?)</ul>\s*</section>'
|
patronBlock = r'<h2>Sfoglia</h2>\s*<ul>(?P<block>.*?)</ul>\s*</section>'
|
||||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a></li>'
|
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a></li>'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
info(text)
|
logger.debug(text)
|
||||||
item.url = host + "/?s=" + text
|
item.url = host + "/?s=" + text
|
||||||
try:
|
try:
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("%s" % line)
|
logger.debug("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
info(categoria)
|
logger.debug(category)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
item = Item()
|
item = Item()
|
||||||
try:
|
try:
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.url = host + "/ultimi-episodi"
|
item.url = host + "/ultimi-episodi"
|
||||||
item.action = "peliculas"
|
item.action = "movies"
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.args = 'update'
|
item.args = 'update'
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
info("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
info(item)
|
logger.debug(item)
|
||||||
if item.args != 'update':
|
if item.args != 'update':
|
||||||
return support.server(item, data=item.other)
|
return support.server(item, data=item.other)
|
||||||
else:
|
else:
|
||||||
@@ -127,7 +126,7 @@ def findvideos(item):
|
|||||||
item.clone(title=support.typo("Vai alla Serie Completa: " + item.fulltitle, ' bold'),
|
item.clone(title=support.typo("Vai alla Serie Completa: " + item.fulltitle, ' bold'),
|
||||||
contentType='tvshow',
|
contentType='tvshow',
|
||||||
url=url_serie,
|
url=url_serie,
|
||||||
action='episodios',
|
action='episodes',
|
||||||
thumbnail = support.thumb('tvshow')))
|
thumbnail = support.thumb('tvshow')))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
"thumbnail": "popcornstream.png",
|
"thumbnail": "popcornstream.png",
|
||||||
"banner": "popcornstream.png",
|
"banner": "popcornstream.png",
|
||||||
"categories": ["movie","tvshow","anime"],
|
"categories": ["movie","tvshow","anime"],
|
||||||
"not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime"],
|
"not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import support, httptools
|
from core import support, httptools
|
||||||
from core.item import Item
|
from platformcode import config, logger
|
||||||
from platformcode import config
|
|
||||||
import sys
|
import sys
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
from urllib.parse import unquote
|
from urllib.parse import unquote
|
||||||
@@ -32,14 +31,14 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info("[streamingaltadefinizione.py] " + item.url + " search " + text)
|
logger.debug(text)
|
||||||
item.url = item.url + "/?s=" + text
|
item.url = item.url + "/?s=" + text
|
||||||
try:
|
try:
|
||||||
return support.dooplay_search(item)
|
return support.dooplay_search(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@@ -47,16 +46,16 @@ def search(item, text):
|
|||||||
def genre(item):
|
def genre(item):
|
||||||
patronMenu = '<a href="(?P<url>[^"#]+)">(?P<title>[a-zA-Z]+)'
|
patronMenu = '<a href="(?P<url>[^"#]+)">(?P<title>[a-zA-Z]+)'
|
||||||
patronBlock='<a href="#">Genere</a><ul class="sub-menu">(?P<block>.*?)</ul>'
|
patronBlock='<a href="#">Genere</a><ul class="sub-menu">(?P<block>.*?)</ul>'
|
||||||
action='peliculas'
|
action='movies'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
return support.dooplay_peliculas(item, True if "/genere/" in item.url else False)
|
return support.dooplay_movies(item, True if "/genere/" in item.url else False)
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
return support.dooplay_get_episodes(item)
|
return support.dooplay_get_episodes(item)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,5 +6,15 @@
|
|||||||
"thumbnail": "streamingcommunity.png",
|
"thumbnail": "streamingcommunity.png",
|
||||||
"banner": "streamingcommunity.png",
|
"banner": "streamingcommunity.png",
|
||||||
"categories": ["movie","tvshow"],
|
"categories": ["movie","tvshow"],
|
||||||
"settings": []
|
"settings": [
|
||||||
|
{
|
||||||
|
"id": "pagination",
|
||||||
|
"type": "list",
|
||||||
|
"label": "Pagination",
|
||||||
|
"default": 1,
|
||||||
|
"enabled": true,
|
||||||
|
"visible": true,
|
||||||
|
"lvalues": ["10", "20", "30", "40", "50", "60"]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,42 +4,56 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import json, requests, sys
|
import json, requests, sys
|
||||||
from core import support, channeltools
|
from core import support, channeltools, jsontools
|
||||||
from platformcode import logger
|
from platformcode import config, logger
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
from concurrent import futures
|
from concurrent import futures
|
||||||
else:
|
else:
|
||||||
from concurrent_py2 import futures
|
from concurrent_py2 import futures
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
def findhost(url):
|
||||||
|
matches = support.match(url, patron='<a href="([^"]+)" target="_blank"').matches
|
||||||
|
if matches:
|
||||||
|
return matches[-1]
|
||||||
|
|
||||||
|
host = support.config.get_channel_url(findhost)
|
||||||
session = requests.Session()
|
session = requests.Session()
|
||||||
headers = {}
|
headers = {}
|
||||||
|
perpage = config.getSetting('pagination', 'streamingcommunity', default=1) * 10 + 10
|
||||||
|
|
||||||
def getHeaders():
|
def getHeaders(forced=False):
|
||||||
global headers
|
global headers
|
||||||
|
global host
|
||||||
if not headers:
|
if not headers:
|
||||||
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'}
|
try:
|
||||||
response = session.get(host, headers=headers)
|
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14'}
|
||||||
csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match
|
response = session.get(host, headers=headers)
|
||||||
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
|
if not response.url.startswith(host):
|
||||||
'content-type': 'application/json;charset=UTF-8',
|
host = support.config.get_channel_url(findhost, forceFindhost=True)
|
||||||
'Referer': host,
|
csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match
|
||||||
'x-csrf-token': csrf_token,
|
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
|
||||||
'Cookie': '; '.join([x.name + '=' + x.value for x in response.cookies])}
|
'content-type': 'application/json;charset=UTF-8',
|
||||||
|
'Referer': host,
|
||||||
|
'x-csrf-token': csrf_token,
|
||||||
|
'Cookie': '; '.join([x.name + '=' + x.value for x in response.cookies])}
|
||||||
|
except:
|
||||||
|
host = support.config.get_channel_url(findhost, forceFindhost=True)
|
||||||
|
if not forced: getHeaders(True)
|
||||||
|
|
||||||
getHeaders()
|
getHeaders()
|
||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
film=['',
|
film=['',
|
||||||
('Generi',['/film','genres']),
|
('Generi',['/film','genres']),
|
||||||
('Titoli del Momento',['/film','peliculas',0]),
|
('Titoli del Momento',['/film','movies',0]),
|
||||||
('Novità',['/film','peliculas',1]),
|
('Novità',['/film','movies',1]),
|
||||||
('Popolari',['/film','peliculas',2])]
|
('Popolari',['/film','movies',2])]
|
||||||
tvshow=['',
|
tvshow=['',
|
||||||
('Generi',['/serie-tv','genres']),
|
('Generi',['/serie-tv','genres']),
|
||||||
('Titoli del Momento',['/serie-tv','peliculas',0]),
|
('Titoli del Momento',['/serie-tv','movies',0]),
|
||||||
('Novità',['/serie-tv','peliculas',1]),
|
('Novità',['/serie-tv','movies',1]),
|
||||||
('Popolari',['/serie-tv','peliculas',2])]
|
('Popolari',['/serie-tv','movies',2])]
|
||||||
search=''
|
search=''
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@@ -51,8 +65,8 @@ def genres(item):
|
|||||||
data = support.scrapertools.decodeHtmlentities(support.match(item).data)
|
data = support.scrapertools.decodeHtmlentities(support.match(item).data)
|
||||||
args = support.match(data, patronBlock=r'genre-options-json="([^\]]+)\]', patron=r'name"\s*:\s*"([^"]+)').matches
|
args = support.match(data, patronBlock=r'genre-options-json="([^\]]+)\]', patron=r'name"\s*:\s*"([^"]+)').matches
|
||||||
for arg in args:
|
for arg in args:
|
||||||
itemlist.append(item.clone(title=support.typo(arg, 'bold'), args=arg, action='peliculas'))
|
itemlist.append(item.clone(title=support.typo(arg, 'bold'), args=arg, action='movies'))
|
||||||
support.thumb(itemlist, genre=True)
|
support.thumb(itemlist, mode=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -61,7 +75,7 @@ def search(item, text):
|
|||||||
item.search = text
|
item.search = text
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -75,15 +89,17 @@ def newest(category):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
item.args = 1
|
item.args = 1
|
||||||
if category == 'peliculas':
|
if category == 'movie':
|
||||||
|
item.contentType= 'movie'
|
||||||
item.url = host + '/film'
|
item.url = host + '/film'
|
||||||
else:
|
else:
|
||||||
|
item.contentType= 'tvshow'
|
||||||
item.url = host + '/serie-tv'
|
item.url = host + '/serie-tv'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
|
|
||||||
if itemlist[-1].action == 'peliculas':
|
if itemlist[-1].action == 'movies':
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
@@ -96,20 +112,19 @@ def newest(category):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# getHeaders()
|
# getHeaders()
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
recordlist = []
|
|
||||||
videoType = 'movie' if item.contentType == 'movie' else 'tv'
|
videoType = 'movie' if item.contentType == 'movie' else 'tv'
|
||||||
|
|
||||||
page = item.page if item.page else 0
|
page = item.page if item.page else 0
|
||||||
offset = page * 60
|
offset = page * perpage
|
||||||
if item.records:
|
|
||||||
records = item.records
|
if type(item.args) == int:
|
||||||
elif type(item.args) == int:
|
|
||||||
data = support.scrapertools.decodeHtmlentities(support.match(item).data)
|
data = support.scrapertools.decodeHtmlentities(support.match(item).data)
|
||||||
records = json.loads(support.match(data, patron=r'slider-title titles-json="(.*?)" slider-name="').matches[item.args])
|
records = json.loads(support.match(data, patron=r'slider-title titles-json="(.*?)" slider-name="').matches[item.args])
|
||||||
|
|
||||||
elif not item.search:
|
elif not item.search:
|
||||||
payload = json.dumps({'type': videoType, 'offset':offset, 'genre':item.args})
|
payload = json.dumps({'type': videoType, 'offset':offset, 'genre':item.args})
|
||||||
records = session.post(host + '/api/browse', headers=headers, data=payload).json()['records']
|
records = session.post(host + '/api/browse', headers=headers, data=payload).json()['records']
|
||||||
@@ -124,29 +139,35 @@ def peliculas(item):
|
|||||||
else:
|
else:
|
||||||
js = records
|
js = records
|
||||||
|
|
||||||
for i, it in enumerate(js):
|
logger.debug(jsontools.dump(js))
|
||||||
if i < 20:
|
|
||||||
itemlist.append(makeItem(i, it, item))
|
itemlist = makeItems(item, js)
|
||||||
else:
|
|
||||||
recordlist.append(it)
|
|
||||||
|
|
||||||
itemlist.sort(key=lambda item: item.n)
|
|
||||||
if recordlist:
|
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page, records=recordlist))
|
|
||||||
elif len(itemlist) >= 20:
|
|
||||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), records=[], page=page + 1))
|
|
||||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
|
if len(itemlist) == perpage:
|
||||||
|
support.nextPage(itemlist, item, 'movies', page=page + 1)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
|
def makeItems(item, items):
|
||||||
|
itemlist = []
|
||||||
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
|
itlist = [executor.submit(makeItem, n, it, item) for n, it in enumerate(items) if n < perpage]
|
||||||
|
for res in futures.as_completed(itlist):
|
||||||
|
if res.result():
|
||||||
|
itemlist.append(res.result())
|
||||||
|
itemlist.sort(key=lambda item: item.n)
|
||||||
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def makeItem(n, it, item):
|
def makeItem(n, it, item):
|
||||||
info = session.post(host + '/api/titles/preview/{}'.format(it['id']), headers=headers).json()
|
info = session.post(host + '/api/titles/preview/{}'.format(it['id']), headers=headers).json()
|
||||||
title, lang = support.match(info['name'], patron=r'([^\[|$]+)(?:\[([^\]]+)\])?').match
|
title, lang = support.match(info['name'], patron=r'([^\[|$]+)(?:\[([^\]]+)\])?').match
|
||||||
if not lang:
|
if not lang:
|
||||||
lang = 'ITA'
|
lang = 'ITA'
|
||||||
itm = item.clone(title=support.typo(title,'bold') + support.typo(lang,'_ [] color kod bold'))
|
itm = item.clone(title=title, contentType = info['type'].replace('tv', 'tvshow'), contentLanguage = lang, year = info['release_date'].split('-')[0])
|
||||||
itm.contentType = info['type'].replace('tv', 'tvshow')
|
|
||||||
itm.language = lang
|
|
||||||
itm.year = info['release_date'].split('-')[0]
|
|
||||||
|
|
||||||
|
|
||||||
if itm.contentType == 'movie':
|
if itm.contentType == 'movie':
|
||||||
@@ -160,13 +181,13 @@ def makeItem(n, it, item):
|
|||||||
# itm.contentType = 'tvshow'
|
# itm.contentType = 'tvshow'
|
||||||
itm.contentTitle = ''
|
itm.contentTitle = ''
|
||||||
itm.fulltitle = itm.show = itm.contentSerieName = title
|
itm.fulltitle = itm.show = itm.contentSerieName = title
|
||||||
itm.action = 'episodios'
|
itm.action = 'episodes'
|
||||||
itm.season_count = info['seasons_count']
|
itm.season_count = info['seasons_count']
|
||||||
itm.url = host + '/titles/%s-%s' % (it['id'], it['slug'])
|
itm.url = host + '/titles/%s-%s' % (it['id'], it['slug'])
|
||||||
itm.n = n
|
itm.n = n
|
||||||
return itm
|
return itm
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
# getHeaders()
|
# getHeaders()
|
||||||
logger.debug()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -176,16 +197,15 @@ def episodios(item):
|
|||||||
for episodes in js:
|
for episodes in js:
|
||||||
for it in episodes['episodes']:
|
for it in episodes['episodes']:
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
support.Item(channel=item.channel,
|
item.clone(
|
||||||
title=support.typo(str(episodes['number']) + 'x' + str(it['number']).zfill(2) + ' - ' + it['name'], 'bold'),
|
contentEpisodeNumber = it['number'],
|
||||||
episode = it['number'],
|
contentSeason=episodes['number'],
|
||||||
season=episodes['number'],
|
|
||||||
thumbnail=it['images'][0]['original_url'] if 'images' in it and 'original_url' in it['images'][0] else item.thumbnail,
|
thumbnail=it['images'][0]['original_url'] if 'images' in it and 'original_url' in it['images'][0] else item.thumbnail,
|
||||||
fanart=item.fanart,
|
fanart=item.fanart,
|
||||||
plot=it['plot'],
|
plot=it['plot'],
|
||||||
action='findvideos',
|
action='findvideos',
|
||||||
contentType='episode',
|
contentType='episode',
|
||||||
contentSerieName=item.fulltitle,
|
contentTitle=support.cleantitle(it['name']),
|
||||||
url=host + '/watch/' + str(episodes['title_id']),
|
url=host + '/watch/' + str(episodes['title_id']),
|
||||||
episodeid= '?e=' + str(it['id'])))
|
episodeid= '?e=' + str(it['id'])))
|
||||||
|
|
||||||
@@ -195,34 +215,26 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
video_urls = []
|
channelParams = channeltools.get_channel_parameters(item.channel)
|
||||||
data = support.match(item.url + item.episodeid, headers=headers).data.replace('"','"').replace('\\','')
|
itemlist = [item.clone(title = channelParams['title'], server='directo', thumbnail=channelParams["thumbnail"], forcethumb=True, action='play')]
|
||||||
url = support.match(data, patron=r'video_url"\s*:\s*"([^"]+)"').match
|
|
||||||
|
|
||||||
def calculateToken():
|
|
||||||
from time import time
|
|
||||||
from base64 import b64encode as b64
|
|
||||||
import hashlib
|
|
||||||
o = 48
|
|
||||||
n = support.match(host + '/client-address').data
|
|
||||||
i = 'Yc8U6r8KjAKAepEA'
|
|
||||||
t = int(time() + (3600 * o))
|
|
||||||
l = '{}{} {}'.format(t, n, i)
|
|
||||||
md5 = hashlib.md5(l.encode())
|
|
||||||
s = '?token={}&expires={}'.format(b64(md5.digest()).decode().replace('=', '').replace('+', "-").replace('\\', "_"), t)
|
|
||||||
return s
|
|
||||||
token = calculateToken()
|
|
||||||
|
|
||||||
def videourls(res):
|
|
||||||
newurl = '{}/{}{}'.format(url, res, token)
|
|
||||||
if requests.head(newurl, headers=headers).status_code == 200:
|
|
||||||
video_urls.append(["m3u8 {} [StreamingCommunity]".format(res), newurl])
|
|
||||||
|
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
|
||||||
for res in ['480p', '720p', '1080p']:
|
|
||||||
executor.submit(videourls, res)
|
|
||||||
|
|
||||||
if not video_urls: video_urls = [["m3u8 [StreamingCommunity]", url + token]]
|
|
||||||
else: video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match))
|
|
||||||
itemlist = [item.clone(title = channeltools.get_channel_parameters(item.channel)['title'], server='directo', video_urls=video_urls, thumbnail=channeltools.get_channel_parameters(item.channel)["thumbnail"], forcethumb=True)]
|
|
||||||
return support.server(item, itemlist=itemlist)
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|
||||||
|
def play(item):
|
||||||
|
from time import time
|
||||||
|
from base64 import b64encode
|
||||||
|
from hashlib import md5
|
||||||
|
|
||||||
|
data = support.httptools.downloadpage(item.url + item.episodeid, headers=headers).data.replace('"','"').replace('\\','')
|
||||||
|
scws_id = support.match(data, patron=r'scws_id"\s*:\s*(\d+)').match
|
||||||
|
|
||||||
|
if not scws_id:
|
||||||
|
return []
|
||||||
|
|
||||||
|
# Calculate Token
|
||||||
|
client_ip = support.httptools.downloadpage('https://scws.xyz/videos/' + scws_id, headers=headers).json.get('client_ip')
|
||||||
|
expires = int(time() + 172800)
|
||||||
|
token = b64encode(md5('{}{} Yc8U6r8KjAKAepEA'.format(expires, client_ip).encode('utf-8')).digest()).decode('utf-8').replace('=', '').replace('+', '-').replace('/', '_')
|
||||||
|
|
||||||
|
url = 'https://scws.xyz/master/{}?token={}&expires={}&n=1'.format(scws_id, token, expires)
|
||||||
|
|
||||||
|
return [item.clone(server='directo', url=url, manifest='hls')]
|
||||||
@@ -24,7 +24,7 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
patron = """tgme_widget_message_photo_wrap.*?image:url\("(?P<thumbnail>[^"]+).*?//telegram\.org/img/emoji/40/(?:F09F8EAC|F09F8EA5)\.png"\)">.*?</i>\s?(?:<b>)?(?P<title>[^<]+).*?(?:Audio(?:</b>)?: (?P<lang>.*?<br>))?.*?Anno(?:</b>)?: (?P<year>[0-9]{4}).*?(?:<b>Stream</b>|Risoluzione|<b>Tipo</b>|Tipo|Stream): (?P<quality>[^<]+).*?tgme_widget_message_inline_button url_button" href="(?P<url>[^"]+)"""
|
patron = """tgme_widget_message_photo_wrap.*?image:url\("(?P<thumbnail>[^"]+).*?//telegram\.org/img/emoji/40/(?:F09F8EAC|F09F8EA5)\.png"\)">.*?</i>\s?(?:<b>)?(?P<title>[^<]+).*?(?:Audio(?:</b>)?: (?P<lang>.*?<br>))?.*?Anno(?:</b>)?: (?P<year>[0-9]{4}).*?(?:<b>Stream</b>|Risoluzione|<b>Tipo</b>|Tipo|Stream): (?P<quality>[^<]+).*?tgme_widget_message_inline_button url_button" href="(?P<url>[^"]+)"""
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
retItemlist = []
|
retItemlist = []
|
||||||
@@ -34,7 +34,7 @@ def peliculas(item):
|
|||||||
i.contentType = 'movie'
|
i.contentType = 'movie'
|
||||||
if '/SerieTv/' in i.url:
|
if '/SerieTv/' in i.url:
|
||||||
i.contentType = 'tvshow'
|
i.contentType = 'tvshow'
|
||||||
i.action = 'episodios'
|
i.action = 'episodes'
|
||||||
if item.contentType == i.contentType or item.contentType == 'list': # list = ricerca globale quando c'è un solo tipo di risultato
|
if item.contentType == i.contentType or item.contentType == 'list': # list = ricerca globale quando c'è un solo tipo di risultato
|
||||||
retItemlist.append(i)
|
retItemlist.append(i)
|
||||||
# rimuovo duplicati
|
# rimuovo duplicati
|
||||||
@@ -66,14 +66,14 @@ def peliculas(item):
|
|||||||
# return item
|
# return item
|
||||||
|
|
||||||
if item.contentType == 'tvshow':
|
if item.contentType == 'tvshow':
|
||||||
action = 'episodios'
|
action = 'episodes'
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
item.url = host + "/?q=" + texto
|
item.url = host + "/?q=" + texto
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
@@ -82,19 +82,19 @@ def search(item, texto):
|
|||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
item = Item()
|
item = Item()
|
||||||
if categoria == "series":
|
if category == 'tvshow':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = host + '?q=%23SerieTv'
|
item.url = host + '?q=%23SerieTv'
|
||||||
else:
|
else:
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = host + '?q=%23Film'
|
item.url = host + '?q=%23Film'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
|
|
||||||
# cerco il titolo, così mi escono fuori tutti i messaggi contenenti puntate singole o serie
|
# cerco il titolo, così mi escono fuori tutti i messaggi contenenti puntate singole o serie
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
url = item.url
|
url = item.url
|
||||||
item.cercaSerie = True
|
item.cercaSerie = True
|
||||||
itemlist = search(item, item.fulltitle.replace("'", ""))
|
itemlist = search(item, item.fulltitle.replace("'", ""))
|
||||||
@@ -134,7 +134,7 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
# support.dbg()
|
# logger.dbg()
|
||||||
domain = scrapertools.find_single_match(item.url, 'https?://[a-z0-9.-]+')
|
domain = scrapertools.find_single_match(item.url, 'https?://[a-z0-9.-]+')
|
||||||
if item.contentType == 'movie':
|
if item.contentType == 'movie':
|
||||||
id = item.url.split('/')[-1]
|
id = item.url.split('/')[-1]
|
||||||
|
|||||||
@@ -6,6 +6,6 @@
|
|||||||
"thumbnail": "tantifilm.png",
|
"thumbnail": "tantifilm.png",
|
||||||
"banner": "tantifilm.png",
|
"banner": "tantifilm.png",
|
||||||
"categories": ["tvshow", "movie", "anime"],
|
"categories": ["tvshow", "movie", "anime"],
|
||||||
"not_active":["include_in_newest_anime", "include_in_newest_peliculas"],
|
"not_active":["include_in_newest_anime", "include_in_newest_movie"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,9 @@
|
|||||||
# Canale per Tantifilm
|
# Canale per Tantifilm
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import scrapertools, httptools, support
|
from core import support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from core.support import info
|
from platformcode import logger, config
|
||||||
from platformcode import logger
|
|
||||||
from platformcode import config
|
|
||||||
|
|
||||||
|
|
||||||
# def findhost(url):
|
# def findhost(url):
|
||||||
@@ -23,7 +21,7 @@ player_iframe = r'<iframe.*?src="([^"]+)"[^>]+></iframe>\s*<div class="player'
|
|||||||
|
|
||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
info()
|
logger.debug()
|
||||||
|
|
||||||
top = [('Generi', ['', 'category'])]
|
top = [('Generi', ['', 'category'])]
|
||||||
film = ['/film',
|
film = ['/film',
|
||||||
@@ -47,7 +45,7 @@ def mainlist(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debug = True
|
# debug = True
|
||||||
if item.args == 'search':
|
if item.args == 'search':
|
||||||
patron = r'<a href="(?P<url>[^"]+)" title="Permalink to\s*(?P<title>[^"]+) \((?P<year>[0-9]+)[^<]*\)[^"]*"[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)".*?<div class="calitate">\s*<p>(?P<quality>[^<]+)<\/p>'
|
patron = r'<a href="(?P<url>[^"]+)" title="Permalink to\s*(?P<title>[^"]+) \((?P<year>[0-9]+)[^<]*\)[^"]*"[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)".*?<div class="calitate">\s*<p>(?P<quality>[^<]+)<\/p>'
|
||||||
@@ -57,7 +55,7 @@ def peliculas(item):
|
|||||||
patronBlock = r'<div id="main_col">(?P<block>.*?)<!\-\- main_col \-\->'
|
patronBlock = r'<div id="main_col">(?P<block>.*?)<!\-\- main_col \-\->'
|
||||||
|
|
||||||
# if item.args != 'all' and item.args != 'search':
|
# if item.args != 'all' and item.args != 'search':
|
||||||
# action = 'findvideos' if item.extra == 'movie' else 'episodios'
|
# action = 'findvideos' if item.extra == 'movie' else 'episodes'
|
||||||
# item.contentType = 'movie' if item.extra == 'movie' else 'tvshow'
|
# item.contentType = 'movie' if item.extra == 'movie' else 'tvshow'
|
||||||
# debug = True
|
# debug = True
|
||||||
return locals()
|
return locals()
|
||||||
@@ -65,7 +63,7 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
def get_season(pageData, seas_url, season):
|
def get_season(pageData, seas_url, season):
|
||||||
data = ''
|
data = ''
|
||||||
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
||||||
@@ -106,33 +104,33 @@ def episodios(item):
|
|||||||
@support.scrape
|
@support.scrape
|
||||||
def category(item):
|
def category(item):
|
||||||
blacklist = ['Ultimi Film Aggiornati', 'Anime', 'Serie TV Altadefinizione', 'HD AltaDefinizione', 'Al Cinema', 'Serie TV', 'Miniserie', 'Programmi Tv', 'Live', 'Trailers', 'Serie TV Aggiornate', 'Aggiornamenti', 'Featured']
|
blacklist = ['Ultimi Film Aggiornati', 'Anime', 'Serie TV Altadefinizione', 'HD AltaDefinizione', 'Al Cinema', 'Serie TV', 'Miniserie', 'Programmi Tv', 'Live', 'Trailers', 'Serie TV Aggiornate', 'Aggiornamenti', 'Featured']
|
||||||
patron = '<li><a href="(?P<url>[^"]+)"><span></span>(?P<title>[^<]+)</a></li>'
|
patronGenreMenu = '<li><a href="(?P<url>[^"]+)"><span></span>(?P<title>[^<]+)</a></li>'
|
||||||
patron_block = '<ul class="table-list">(.*?)</ul>'
|
patron_block = '<ul class="table-list">(.*?)</ul>'
|
||||||
action = 'peliculas'
|
action = 'movies'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
info(texto)
|
logger.debug(texto)
|
||||||
|
|
||||||
|
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
try:
|
try:
|
||||||
item.args = 'search'
|
item.args = 'search'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
logger.error("%s" % line)
|
logger.error('{}'.format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
if categoria == 'series':
|
if category == 'tvshow':
|
||||||
item = Item(url=host + '/aggiornamenti-serie-tv')
|
item = Item(url=host + '/aggiornamenti-serie-tv')
|
||||||
data = support.match(item).data.replace('<u>','').replace('</u>','')
|
data = support.match(item).data.replace('<u>','').replace('</u>','')
|
||||||
item.contentType = 'episode'
|
item.contentType = 'episode'
|
||||||
@@ -155,32 +153,32 @@ def hdpass(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
info()
|
logger.debug()
|
||||||
support.info("ITEMLIST: ", item)
|
logger.debug("ITEMLIST: ", item)
|
||||||
data = support.match(item.url, headers=headers).data
|
data = support.match(item.url, headers=headers).data
|
||||||
check = support.match(data, patron=r'<div class="category-film">(.*?)</div>').match
|
check = support.match(data, patron=r'<div class="category-film">(.*?)</div>').match
|
||||||
if 'sub' in check.lower():
|
if 'sub' in check.lower():
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
support.info("CHECK : ", check)
|
logger.debug("CHECK : ", check)
|
||||||
if 'anime' in check.lower():
|
if 'anime' in check.lower():
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.data = data
|
item.data = data
|
||||||
support.info('select = ### è una anime ###')
|
logger.debug('select = ### è una anime ###')
|
||||||
try:
|
try:
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
elif 'serie' in check.lower():
|
elif 'serie' in check.lower():
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.data = data
|
item.data = data
|
||||||
return episodios(item)
|
return episodes(item)
|
||||||
else:
|
else:
|
||||||
item.contentTitle = item.fulltitle
|
item.contentTitle = item.fulltitle
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
|
|
||||||
# if 'protectlink' in data:
|
# if 'protectlink' in data:
|
||||||
# urls = scrapertools.find_multiple_matches(data, r'<iframe src="[^=]+=(.*?)"')
|
# urls = scrapertools.findMultipleMatches(data, r'<iframe src="[^=]+=(.*?)"')
|
||||||
# support.info("SONO QUI: ", urls)
|
# logger.debug("SONO QUI: ", urls)
|
||||||
# for url in urls:
|
# for url in urls:
|
||||||
# url = url.decode('base64')
|
# url = url.decode('base64')
|
||||||
# # tiro via l'ultimo carattere perchè non c'entra
|
# # tiro via l'ultimo carattere perchè non c'entra
|
||||||
@@ -191,19 +189,19 @@ def findvideos(item):
|
|||||||
# if url:
|
# if url:
|
||||||
# listurl.add(url)
|
# listurl.add(url)
|
||||||
# data += '\n'.join(listurl)
|
# data += '\n'.join(listurl)
|
||||||
info(data)
|
logger.debug(data)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# support.dbg()
|
# logger.dbg()
|
||||||
|
|
||||||
if '/serietv/series/names' in item.url:
|
if '/serietv/series/names' in item.url:
|
||||||
itemlist.extend(support.server(item, itemlist=hdpass(Item(url=item.url))))
|
itemlist.extend(support.server(item, itemlist=hdpass(Item(url=item.url))))
|
||||||
else:
|
else:
|
||||||
urls = support.match(data, patron=player_iframe).matches
|
urls = support.match(data, patron=player_iframe).matches
|
||||||
# support.dbg()
|
# logger.dbg()
|
||||||
if item.otherLinks:
|
if item.otherLinks:
|
||||||
urls += support.match(item.otherLinks, patron=r'href="([^"]+)').matches
|
urls += support.match(item.otherLinks, patron=r'href="([^"]+)').matches
|
||||||
|
|
||||||
info('URLS', urls)
|
logger.debug('URLS', urls)
|
||||||
for u in urls:
|
for u in urls:
|
||||||
if 'hdplayer.casa/series/' in u:
|
if 'hdplayer.casa/series/' in u:
|
||||||
urls.remove(u)
|
urls.remove(u)
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
from core import support, httptools
|
from core import support, httptools
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
|
from platformcode import logger
|
||||||
import sys
|
import sys
|
||||||
if sys.version_info[0] >= 3: from concurrent import futures
|
if sys.version_info[0] >= 3: from concurrent import futures
|
||||||
else: from concurrent_py2 import futures
|
else: from concurrent_py2 import futures
|
||||||
@@ -25,8 +26,8 @@ def mainlist(item):
|
|||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
support.info(item)
|
logger.debug(item)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
@@ -48,12 +49,12 @@ def episodios(item):
|
|||||||
def genres(item):
|
def genres(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
for n, genre in enumerate(httptools.downloadpage(host + api_url + 'categories', post={}).json.get('categories', [])):
|
for n, genre in enumerate(httptools.downloadpage(host + api_url + 'categories', post={}).json.get('categories', [])):
|
||||||
itemlist.append(item.clone(action="peliculas", genre=genre.get('name'), title=genre.get('value'), n=n))
|
itemlist.append(item.clone(action="movies", genre=genre.get('name'), title=genre.get('value'), n=n))
|
||||||
return support.thumb(itemlist, genre=True)
|
return support.thumb(itemlist, mode='genre')
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item, text=''):
|
def movies(item, text=''):
|
||||||
support.info('search', item)
|
logger.debug('search', item)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
filter_type = False
|
filter_type = False
|
||||||
if item.genre:
|
if item.genre:
|
||||||
@@ -75,7 +76,7 @@ def peliculas(item, text=''):
|
|||||||
itemlist.append(item.clone(id=result.get('id'), title=result.get('title'), contentTitle=result.get('title'),
|
itemlist.append(item.clone(id=result.get('id'), title=result.get('title'), contentTitle=result.get('title'),
|
||||||
contentSerieName='' if contentType == 'movie' else result.get('title'),
|
contentSerieName='' if contentType == 'movie' else result.get('title'),
|
||||||
contentPlot=result.get('description'), thumbnail=result.get('poster'),
|
contentPlot=result.get('description'), thumbnail=result.get('poster'),
|
||||||
fanart=result.get('backdrop'), year=result.get('year'), action='episodios' if contentType == 'tvshow' else 'findvideos',
|
fanart=result.get('backdrop'), year=result.get('year'), action='episodes' if contentType == 'tvshow' else 'findvideos',
|
||||||
url='{}/{}/{}-{}'.format('https://filmigratis.org', contentType, result.get('id'), support.scrapertools.slugify(result.get('title'))),
|
url='{}/{}/{}-{}'.format('https://filmigratis.org', contentType, result.get('id'), support.scrapertools.slugify(result.get('title'))),
|
||||||
contentType=contentType))
|
contentType=contentType))
|
||||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
@@ -87,7 +88,7 @@ def peliculas(item, text=''):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
return peliculas(item, text)
|
return movies(item, text)
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
"active": true,
|
"active": true,
|
||||||
"thumbnail": "toonitalia.png",
|
"thumbnail": "toonitalia.png",
|
||||||
"banner": "toonitalia.png",
|
"banner": "toonitalia.png",
|
||||||
"categories": ["tvshow", "movie", "vos", "anime"],
|
"categories": ["tvshow", "movie", "sub", "anime"],
|
||||||
"not_active":["include_in_newest_peliculas", "include_in_newest_series"],
|
"not_active":["include_in_newest_movie", "include_in_newest_tvshow"],
|
||||||
"default_off":["include_in_newest"],
|
"default_off":["include_in_newest"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import scrapertools, support
|
from core import scrapertools, support
|
||||||
|
from platformcode import logger
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
@@ -13,59 +14,59 @@ headers = [['Referer', host]]
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
top = [('Novità',['', 'peliculas', 'new', 'tvshow']),
|
top = [('Novità',['', 'movies', 'new', 'tvshow']),
|
||||||
('Aggiornamenti', ['', 'peliculas', 'last', 'tvshow'])]
|
('Aggiornamenti', ['', 'movies', 'last', 'tvshow'])]
|
||||||
tvshow = ['/category/serie-tv/']
|
tvshow = ['/category/serie-tv/']
|
||||||
anime =['/category/anime/',
|
anime =['/category/anime/',
|
||||||
('Sub-Ita',['/category/anime-sub-ita/', 'peliculas', 'sub']),
|
('Sub-Ita',['/category/anime-sub-ita/', 'movies', 'sub']),
|
||||||
('Film Animati',['/category/film-animazione/','peliculas', '', 'movie'])]
|
('Film Animati',['/category/film-animazione/','movies', '', 'movie'])]
|
||||||
search = ''
|
search = ''
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
# item.args='search'
|
# item.args='search'
|
||||||
item.text = text
|
item.text = text
|
||||||
item.url = item.url + '/?a=b&s=' + text.replace(' ', '+')
|
item.url = item.url + '/?a=b&s=' + text.replace(' ', '+')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
support.info(categoria)
|
logger.debug(category)
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
try:
|
try:
|
||||||
item.contentType = 'undefined'
|
item.contentType = 'undefined'
|
||||||
item.url= host
|
item.url= host
|
||||||
item.args= 'new'
|
item.args= 'new'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("{0}".format(line))
|
logger.error("{0}".format(line))
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
# debugBlock = True
|
# debugBlock = True
|
||||||
# debug = True
|
# debug = True
|
||||||
# search = item.text
|
# search = item.text
|
||||||
if item.contentType != 'movie': anime = True
|
if item.contentType != 'movie': numerationEnabled = True
|
||||||
action = 'findvideos' if item.contentType == 'movie' else 'episodios'
|
action = 'findvideos' if item.contentType == 'movie' else 'episodes'
|
||||||
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
|
blacklist = ['-Film Animazione disponibili in attesa di recensione ']
|
||||||
|
|
||||||
if item.action == 'search':
|
if item.action == 'search':
|
||||||
pagination = ''
|
pagination = True
|
||||||
#patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
|
#patronBlock = '"lcp_catlist"[^>]+>(?P<block>.*)</ul>'
|
||||||
patronBlock = '<main[^>]+>(?P<block>.*?)</ma'
|
patronBlock = '<main[^>]+>(?P<block>.*?)</ma'
|
||||||
#patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
#patron = r'href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
||||||
@@ -82,7 +83,7 @@ def peliculas(item):
|
|||||||
patronNext = '<a class="next page-numbers" href="([^"]+)">'
|
patronNext = '<a class="next page-numbers" href="([^"]+)">'
|
||||||
|
|
||||||
def itemHook(item):
|
def itemHook(item):
|
||||||
support.info(item.title)
|
logger.debug(item.title)
|
||||||
if item.args == 'sub':
|
if item.args == 'sub':
|
||||||
item.title += support.typo('Sub-ITA', 'bold color kod _ []')
|
item.title += support.typo('Sub-ITA', 'bold color kod _ []')
|
||||||
item.contentLanguage = 'Sub-ITA'
|
item.contentLanguage = 'Sub-ITA'
|
||||||
@@ -91,8 +92,8 @@ def peliculas(item):
|
|||||||
|
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
anime = True
|
numerationEnabled = True
|
||||||
# debug = True
|
# debug = True
|
||||||
patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)'
|
patron = r'>\s*(?:(?P<season>\d+)(?:×|x|×))?(?P<episode>\d+)(?:\s+–\s+)?[ –]+(?P<title2>[^<]+)[ –]+<a (?P<data>.*?)(?:<br|</p)'
|
||||||
# data = ''
|
# data = ''
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
# Canale per tunein
|
# Canale per tunein
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
from core import scrapertools, support
|
from core import scrapertools, support, config
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
|
|
||||||
host = 'http://api.radiotime.com'
|
host = 'http://api.radiotime.com'
|
||||||
@@ -21,21 +21,22 @@ def mainlist(item):
|
|||||||
return item
|
return item
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search')))
|
item.clone(title=support.typo(config.getLocalizedString(70741) % 'Musica… ', 'bold'), action='search', thumbnail=support.thumb('search')))
|
||||||
support.channel_config(item, itemlist)
|
support.channel_config(item, itemlist)
|
||||||
return itemlist
|
return itemlist
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
|
|
||||||
def radio(item):
|
def radio(item):
|
||||||
support.info()
|
logger.debug()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"')
|
data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"')
|
||||||
if data.matches:
|
if data.matches:
|
||||||
for title, location, url, quality, song, type, thumbnail in data.matches:
|
for title, location, url, quality, song, type, thumbnail in data.matches:
|
||||||
title = scrapertools.decodeHtmlentities(title)
|
title = scrapertools.decodeHtmlentities(title)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title = support.typo(title, 'bold') + support.typo(quality + ' kbps','_ [] bold color kod'),
|
item.clone(contentTitle = title,
|
||||||
|
quality= quality,
|
||||||
thumbnail = thumbnail,
|
thumbnail = thumbnail,
|
||||||
url = url,
|
url = url,
|
||||||
contentType = 'music',
|
contentType = 'music',
|
||||||
@@ -49,7 +50,7 @@ def radio(item):
|
|||||||
infoLabels={}
|
infoLabels={}
|
||||||
infoLabels['duration'] = duration
|
infoLabels['duration'] = duration
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title = support.typo(title, 'bold'),
|
item.clone(contentTitle = title,
|
||||||
thumbnail = thumbnail,
|
thumbnail = thumbnail,
|
||||||
infolLbels = infoLabels,
|
infolLbels = infoLabels,
|
||||||
url = url,
|
url = url,
|
||||||
@@ -62,11 +63,11 @@ def radio(item):
|
|||||||
title = scrapertools.unescape(title)
|
title = scrapertools.unescape(title)
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(channel = item.channel,
|
item.clone(channel = item.channel,
|
||||||
title = support.typo(title, 'bold'),
|
contentTitle = title,
|
||||||
thumbnail = item.thumbnail,
|
thumbnail = item.thumbnail,
|
||||||
url = url,
|
url = url,
|
||||||
action = 'radio'))
|
action = 'radio'))
|
||||||
support.nextPage(itemlist, item, data.data, r'(?P<url>[^"]+)" key="nextStations')
|
support.nextPage(itemlist, item, data=data.data, patron=r'(?P<url>[^"]+)" key="nextStations')
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -76,14 +77,15 @@ def findvideos(item):
|
|||||||
item.action = 'play'
|
item.action = 'play'
|
||||||
urls = support.match(item.url).data.strip().split()
|
urls = support.match(item.url).data.strip().split()
|
||||||
for url in urls:
|
for url in urls:
|
||||||
|
item.title = 'TuneIn'
|
||||||
item.url= url
|
item.url= url
|
||||||
item.server = 'directo'
|
item.server = 'directo'
|
||||||
itemlist.append(item)
|
itemlist.append(item)
|
||||||
return itemlist
|
return support.server(item, itemlist=itemlist)
|
||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
item.url = host + '/Search.ashx?query=' +text
|
item.url = host + '/Search.ashx?query=' +text
|
||||||
try:
|
try:
|
||||||
return radio(item)
|
return radio(item)
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ blacklist = ['CB01.UNO ▶ TROVA L’INDIRIZZO UFFICIALE ', 'AVVISO IMP
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
|
|
||||||
film = [
|
film = [
|
||||||
('I più votati', ["ratings/?get=movies", 'peliculas']),
|
('I più votati', ["ratings/?get=movies", 'movies']),
|
||||||
('I più popolari', ["trending/?get=movies", 'peliculas']),
|
('I più popolari', ["trending/?get=movies", 'movies']),
|
||||||
('Generi', ['ratings/?get=movies', 'menu', 'genres']),
|
('Generi', ['ratings/?get=movies', 'menu', 'genres']),
|
||||||
('Anno', ["", 'menu', 'releases']),
|
('Anno', ["", 'menu', 'releases']),
|
||||||
]
|
]
|
||||||
@@ -36,8 +36,8 @@ def search(item, text):
|
|||||||
return support.dooplay_search(item, blacklist)
|
return support.dooplay_search(item, blacklist)
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
return support.dooplay_peliculas(item, False, blacklist)
|
return support.dooplay_movies(item, False, blacklist)
|
||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
"id": "vvvvid",
|
"id": "vvvvid",
|
||||||
"name": "VVVVID",
|
"name": "VVVVID",
|
||||||
"active": true,
|
"active": true,
|
||||||
"language": ["ita","vos"],
|
"language": ["ita","sub-ita"],
|
||||||
"thumbnail": "vvvvid.png",
|
"thumbnail": "vvvvid.png",
|
||||||
"banner": "vvvvid.png",
|
"banner": "vvvvid.png",
|
||||||
"categories": ["anime","tvshow","movie","vos"],
|
"categories": ["anime","tvshow","movie","sub"],
|
||||||
"settings": []
|
"settings": []
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,8 @@
|
|||||||
# Canale per vvvvid
|
# Canale per vvvvid
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
import requests, sys, inspect
|
import requests, sys, inspect
|
||||||
from core import jsontools, support, tmdb
|
from core import channeltools, support, tmdb
|
||||||
from platformcode import autorenumber, logger, config
|
from platformcode import autorenumber, logger, config, platformtools
|
||||||
|
|
||||||
host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
|
|
||||||
@@ -31,35 +31,35 @@ main_host = host + '/vvvvid/ondemand/'
|
|||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
if conn_id:
|
if conn_id:
|
||||||
anime = ['/vvvvid/ondemand/anime/',
|
anime = ['/vvvvid/ondemand/anime/',
|
||||||
('Popolari',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10002/last/']),
|
('Popolari',['/vvvvid/ondemand/anime/', 'movies', 'channel/10002/last/']),
|
||||||
('Nuove Uscite',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10007/last/']),
|
('Nuove Uscite',['/vvvvid/ondemand/anime/', 'movies', 'channel/10007/last/']),
|
||||||
('Generi',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10004/last/?category=']),
|
('Generi',['/vvvvid/ondemand/anime/', 'movies', 'channel/10004/last/?category=']),
|
||||||
('A-Z',['/vvvvid/ondemand/anime/', 'peliculas', 'channel/10003/last/?filter='])
|
('A-Z',['/vvvvid/ondemand/anime/', 'movies', 'channel/10003/last/?filter='])
|
||||||
]
|
]
|
||||||
film = ['/vvvvid/ondemand/film/',
|
film = ['/vvvvid/ondemand/film/',
|
||||||
('Popolari',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10002/last/']),
|
('Popolari',['/vvvvid/ondemand/film/', 'movies', 'channel/10002/last/']),
|
||||||
('Nuove Uscite',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10007/last/']),
|
('Nuove Uscite',['/vvvvid/ondemand/film/', 'movies', 'channel/10007/last/']),
|
||||||
('Generi',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10004/last/?category=']),
|
('Generi',['/vvvvid/ondemand/film/', 'movies', 'channel/10004/last/?category=']),
|
||||||
('A-Z',['/vvvvid/ondemand/film/', 'peliculas', 'channel/10003/last/?filter=']),
|
('A-Z',['/vvvvid/ondemand/film/', 'movies', 'channel/10003/last/?filter=']),
|
||||||
]
|
]
|
||||||
tvshow = ['/vvvvid/ondemand/series/',
|
tvshow = ['/vvvvid/ondemand/series/',
|
||||||
('Popolari',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10002/last/']),
|
('Popolari',['/vvvvid/ondemand/series/', 'movies', 'channel/10002/last/']),
|
||||||
('Nuove Uscite',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10007/last/']),
|
('Nuove Uscite',['/vvvvid/ondemand/series/', 'movies', 'channel/10007/last/']),
|
||||||
('Generi',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10004/last/?category=']),
|
('Generi',['/vvvvid/ondemand/series/', 'movies', 'channel/10004/last/?category=']),
|
||||||
('A-Z',['/vvvvid/ondemand/series/', 'peliculas', 'channel/10003/last/?filter='])
|
('A-Z',['/vvvvid/ondemand/series/', 'movies', 'channel/10003/last/?filter='])
|
||||||
]
|
]
|
||||||
show = [('Show {bold} {tv}',['/vvvvid/ondemand/show/', 'peliculas', '', 'tvshow']),
|
show = [('Show {bold} {tv}',['/vvvvid/ondemand/show/', 'movies', '', 'tvshow']),
|
||||||
('Popolari {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10002/last/', 'tvshow']),
|
('Popolari {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10002/last/', 'tvshow']),
|
||||||
('Nuove Uscite {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10007/last/', 'tvshow']),
|
('Nuove Uscite {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10007/last/', 'tvshow']),
|
||||||
('Generi {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']),
|
('Generi {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10004/last/?category=', 'tvshow']),
|
||||||
('A-Z {submenu} {tv}',['/vvvvid/ondemand/show/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']),
|
('A-Z {submenu} {tv}',['/vvvvid/ondemand/show/', 'movies', 'channel/10003/last/?filter=', 'tvshow']),
|
||||||
('Cerca Show... {bold submenu} {tv}', ['/vvvvid/ondemand/show/', 'search', '', 'tvshow'])
|
('Cerca Show... {bold submenu} {tv}', ['/vvvvid/ondemand/show/', 'search', '', 'tvshow'])
|
||||||
]
|
]
|
||||||
kids = [('Kids {bold}',['/vvvvid/ondemand/kids/', 'peliculas', '', 'tvshow']),
|
kids = [('Kids {bold}',['/vvvvid/ondemand/kids/', 'movies', '', 'tvshow']),
|
||||||
('Popolari {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10002/last/', 'tvshow']),
|
('Popolari {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10002/last/', 'tvshow']),
|
||||||
('Nuove Uscite {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10007/last/', 'tvshow']),
|
('Nuove Uscite {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10007/last/', 'tvshow']),
|
||||||
('Generi {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10004/last/?category=', 'tvshow']),
|
('Generi {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10004/last/?category=', 'tvshow']),
|
||||||
('A-Z {submenu} {kids}',['/vvvvid/ondemand/kids/', 'peliculas', 'channel/10003/last/?filter=', 'tvshow']),
|
('A-Z {submenu} {kids}',['/vvvvid/ondemand/kids/', 'movies', 'channel/10003/last/?filter=', 'tvshow']),
|
||||||
('Cerca Kids... {bold submenu} {kids}', ['/vvvvid/ondemand/kids/', 'search', '', 'tvshow'])
|
('Cerca Kids... {bold submenu} {kids}', ['/vvvvid/ondemand/kids/', 'search', '', 'tvshow'])
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
@@ -68,44 +68,48 @@ def mainlist(item):
|
|||||||
|
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
support.info(text)
|
logger.debug(text)
|
||||||
itemlist = []
|
itemlist = []
|
||||||
if conn_id:
|
if conn_id:
|
||||||
if 'film' in item.url: item.contentType = 'movie'
|
if 'film' in item.url: item.contentType = 'movie'
|
||||||
else: item.contentType = 'tvshow'
|
else: item.contentType = 'tvshow'
|
||||||
item.search = text
|
item.search = text
|
||||||
try:
|
try:
|
||||||
itemlist = peliculas(item)
|
itemlist = movies(item)
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
support.logger.error("%s" % line)
|
logger.error("%s" % line)
|
||||||
return []
|
return []
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(category):
|
||||||
item = support.Item()
|
item = support.Item()
|
||||||
item.args = 'channel/10007/last/'
|
item.args = 'channel/10007/last/'
|
||||||
if categoria == 'peliculas':
|
if category == 'movie':
|
||||||
item.contentType = 'movie'
|
item.contentType = 'movie'
|
||||||
item.url = main_host + 'film/'
|
item.url = main_host + 'film/'
|
||||||
if categoria == 'series':
|
if category == 'tvshow':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = main_host + 'series/'
|
item.url = main_host + 'series/'
|
||||||
if categoria == 'anime':
|
if category == 'anime':
|
||||||
item.contentType = 'tvshow'
|
item.contentType = 'tvshow'
|
||||||
item.url = main_host + 'anime/'
|
item.url = main_host + 'anime/'
|
||||||
return peliculas(item)
|
return movies(item)
|
||||||
|
|
||||||
|
|
||||||
def peliculas(item):
|
def movies(item):
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
# support.dbg()
|
# logger.dbg()
|
||||||
if not item.args:
|
if not item.args:
|
||||||
json_file =loadjs(item.url + 'channel/10005/last/')
|
json_file =loadjs(item.url + 'channel/10005/last/')
|
||||||
support.logger.debug(json_file)
|
logger.debug(json_file)
|
||||||
make_itemlist(itemlist, item, json_file)
|
make_itemlist(itemlist, item, json_file)
|
||||||
|
itemlist = support.pagination(itemlist, item, 'movies')
|
||||||
|
if item.contentType != 'movie': autorenumber.start(itemlist)
|
||||||
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
|
|
||||||
elif ('=' not in item.args) and ('=' not in item.url):
|
elif ('=' not in item.args) and ('=' not in item.url):
|
||||||
json_file=loadjs(item.url + item.args)
|
json_file=loadjs(item.url + item.args)
|
||||||
@@ -120,22 +124,21 @@ def peliculas(item):
|
|||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title = support.typo(key.upper() if Filter == 'filter' else key['name'], 'bold'),
|
item.clone(title = support.typo(key.upper() if Filter == 'filter' else key['name'], 'bold'),
|
||||||
url = item.url + item.args + (key if Filter == 'filter' else str(key['id'])),
|
url = item.url + item.args + (key if Filter == 'filter' else str(key['id'])),
|
||||||
action = 'peliculas',
|
action = 'movies',
|
||||||
args = 'filters'))
|
args = 'filters'))
|
||||||
|
|
||||||
else :
|
else:
|
||||||
json_file=loadjs(item.url)
|
json_file=loadjs(item.url)
|
||||||
item.args=''
|
item.args=''
|
||||||
make_itemlist(itemlist, item, json_file)
|
make_itemlist(itemlist, item, json_file)
|
||||||
|
|
||||||
if 'category' in item.args:
|
if 'category' in item.args:
|
||||||
support.thumb(itemlist,genre=True)
|
support.thumb(itemlist,mode='genre')
|
||||||
elif not 'filter' in item.args:
|
|
||||||
if item.contentType != 'movie': autorenumber.start(itemlist)
|
|
||||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
def episodios(item):
|
def episodes(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
if item.episodes:
|
if item.episodes:
|
||||||
episodes = item.episodes
|
episodes = item.episodes
|
||||||
@@ -154,19 +157,23 @@ def episodios(item):
|
|||||||
|
|
||||||
for episode in episodes:
|
for episode in episodes:
|
||||||
try:
|
try:
|
||||||
title = 'Episodio ' + episode['number'] + ' - ' + episode['title'].encode('utf8')
|
title = episode['title'].encode('utf8')
|
||||||
except:
|
except:
|
||||||
title = 'Episodio ' + episode['number'] + ' - ' + episode['title']
|
title = episode['title']
|
||||||
|
|
||||||
if type(title) == tuple: title = title[0]
|
if type(title) == tuple: title = title[0]
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(title = support.typo(title, 'bold'),
|
item.clone(title = title,
|
||||||
url= main_host + show_id + '/season/' + str(season_id),
|
contentType = 'episode',
|
||||||
action= 'findvideos',
|
contentEpisodeNumber = int(episode['number']),
|
||||||
video_id= episode['video_id']))
|
url= main_host + show_id + '/season/' + str(season_id),
|
||||||
|
action= 'findvideos',
|
||||||
|
video_id= episode['video_id']))
|
||||||
|
|
||||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||||
autorenumber.start(itemlist, item)
|
autorenumber.start(itemlist, item)
|
||||||
|
for i in itemlist:
|
||||||
|
logger.debug(i)
|
||||||
|
|
||||||
support.videolibrary(itemlist,item)
|
support.videolibrary(itemlist,item)
|
||||||
return itemlist
|
return itemlist
|
||||||
@@ -191,7 +198,7 @@ def findvideos(item):
|
|||||||
url = url.split()[-1]
|
url = url.split()[-1]
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action= 'play',
|
item.clone(action= 'play',
|
||||||
title=config.get_localized_string(30137),
|
title=config.getLocalizedString(30137),
|
||||||
url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url,
|
url= 'https://or01.top-ix.org/videomg/_definst_/mp4:' + item.url + '/' + url,
|
||||||
server= 'directo')
|
server= 'directo')
|
||||||
)
|
)
|
||||||
@@ -201,16 +208,16 @@ def findvideos(item):
|
|||||||
|
|
||||||
itemlist.append(
|
itemlist.append(
|
||||||
item.clone(action= 'play',
|
item.clone(action= 'play',
|
||||||
title=config.get_localized_string(30137),
|
title=config.getLocalizedString(30137),
|
||||||
url= item.url + '?' + key,
|
url= item.url + '?' + key,
|
||||||
server= 'directo')
|
server= 'directo'))
|
||||||
)
|
|
||||||
|
|
||||||
return support.server(item, itemlist=itemlist, Download=False)
|
return support.server(item, itemlist=itemlist, Download=False)
|
||||||
|
|
||||||
def make_itemlist(itemlist, item, data):
|
def make_itemlist(itemlist, item, data):
|
||||||
search = item.search if item.search else ''
|
search = item.search if item.search else ''
|
||||||
infoLabels = {}
|
infoLabels = {}
|
||||||
|
|
||||||
for key in data['data']:
|
for key in data['data']:
|
||||||
if search.lower() in encode(key['title']).lower():
|
if search.lower() in encode(key['title']).lower():
|
||||||
title = encode(key['title'])
|
title = encode(key['title'])
|
||||||
@@ -223,7 +230,7 @@ def make_itemlist(itemlist, item, data):
|
|||||||
fulltitle= title,
|
fulltitle= title,
|
||||||
show= title,
|
show= title,
|
||||||
url= main_host + str(key['show_id']) + '/seasons/',
|
url= main_host + str(key['show_id']) + '/seasons/',
|
||||||
action= 'findvideos' if item.contentType == 'movie' else 'episodios',
|
action= 'findvideos' if item.contentType == 'movie' else 'episodes',
|
||||||
contentType = item.contentType,
|
contentType = item.contentType,
|
||||||
contentSerieName= fulltitle if item.contentType != 'movie' else '',
|
contentSerieName= fulltitle if item.contentType != 'movie' else '',
|
||||||
contentTitle= fulltitle if item.contentType == 'movie' else '',
|
contentTitle= fulltitle if item.contentType == 'movie' else '',
|
||||||
@@ -234,7 +241,7 @@ def make_itemlist(itemlist, item, data):
|
|||||||
def loadjs(url):
|
def loadjs(url):
|
||||||
if '?category' not in url:
|
if '?category' not in url:
|
||||||
url += '?full=true'
|
url += '?full=true'
|
||||||
support.info('Json URL;',url)
|
logger.debug('Json URL;',url)
|
||||||
json = current_session.get(url, headers=headers, params=payload).json()
|
json = current_session.get(url, headers=headers, params=payload).json()
|
||||||
return json
|
return json
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import glob, os
|
|||||||
|
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
from core.support import thumb
|
||||||
addon = config.__settings__
|
addon = config.__settings__
|
||||||
downloadenabled = addon.getSetting('downloadenabled')
|
downloadenabled = addon.getSetting('downloadenabled')
|
||||||
|
|
||||||
@@ -14,47 +15,46 @@ def getmainlist(view="thumb_"):
|
|||||||
|
|
||||||
# Main Menu Channels
|
# Main Menu Channels
|
||||||
if addon.getSetting('enable_news_menu') == "true":
|
if addon.getSetting('enable_news_menu') == "true":
|
||||||
itemlist.append(Item(title=config.get_localized_string(30130), channel="news", action="mainlist",
|
itemlist.append(Item(title=config.getLocalizedString(30130), channel="news", action="mainlist",
|
||||||
thumbnail=get_thumb("news.png", view), category=config.get_localized_string(30119), viewmode="thumbnails",
|
thumbnail=thumb("news"), category=config.getLocalizedString(30119), viewmode="thumbnails",
|
||||||
context=[{"title": config.get_localized_string(70285), "channel": "shortcuts", "action": "SettingOnPosition", "category":7, "setting":1}]))
|
context=[{"title": config.getLocalizedString(70285), "channel": "shortcuts", "action": "SettingOnPosition", "category":7, "setting":1}]))
|
||||||
|
|
||||||
if addon.getSetting('enable_channels_menu') == "true":
|
if addon.getSetting('enable_channels_menu') == "true":
|
||||||
itemlist.append(Item(title=config.get_localized_string(30118), channel="channelselector", action="getchanneltypes",
|
itemlist.append(Item(title=config.getLocalizedString(30118), channel="channelselector", action="getchanneltypes",
|
||||||
thumbnail=get_thumb("channels.png", view), view=view, category=config.get_localized_string(30119), viewmode="thumbnails"))
|
thumbnail=thumb("channels"), view=view, category=config.getLocalizedString(30119), viewmode="thumbnails"))
|
||||||
|
|
||||||
if addon.getSetting('enable_search_menu') == "true":
|
if addon.getSetting('enable_search_menu') == "true":
|
||||||
itemlist.append(Item(title=config.get_localized_string(30103), channel="search", path='special', action="mainlist",
|
itemlist.append(Item(title=config.getLocalizedString(30103), channel="search", path='special', action="mainlist",
|
||||||
thumbnail=get_thumb("search.png", view), category=config.get_localized_string(30119), viewmode="list",
|
thumbnail=thumb("search"), category=config.getLocalizedString(30119), viewmode="list",
|
||||||
context = [{"title": config.get_localized_string(60412), "action": "setting_channel_new", "channel": "search"},
|
context = [{"title": config.getLocalizedString(60412), "action": "channels_selections", "channel": "search"},
|
||||||
{"title": config.get_localized_string(70286), "channel": "shortcuts", "action": "SettingOnPosition", "category":5 , "setting":1}]))
|
{"title": config.getLocalizedString(70286), "channel": "shortcuts", "action": "SettingOnPosition", "category":5 , "setting":1}]))
|
||||||
|
|
||||||
if addon.getSetting('enable_onair_menu') == "true":
|
if addon.getSetting('enable_onair_menu') == "true":
|
||||||
itemlist.append(Item(channel="filmontv", action="mainlist", title=config.get_localized_string(50001),
|
itemlist.append(Item(channel="filmontv", action="mainlist", title=config.getLocalizedString(50001),
|
||||||
thumbnail=get_thumb("on_the_air.png"), viewmode="thumbnails"))
|
thumbnail=thumb("live"), viewmode="thumbnails"))
|
||||||
|
|
||||||
if addon.getSetting('enable_link_menu') == "true":
|
if addon.getSetting('enable_link_menu') == "true":
|
||||||
itemlist.append(Item(title=config.get_localized_string(70527), channel="kodfavorites", action="mainlist", thumbnail=get_thumb("mylink.png", view),
|
itemlist.append(Item(title=config.getLocalizedString(70527), channel="kodfavorites", action="mainlist", thumbnail=thumb("mylink"),
|
||||||
view=view, category=config.get_localized_string(70527), viewmode="thumbnails"))
|
view=view, category=config.getLocalizedString(70527), viewmode="thumbnails"))
|
||||||
|
|
||||||
if addon.getSetting('enable_fav_menu') == "true":
|
if addon.getSetting('enable_fav_menu') == "true":
|
||||||
itemlist.append(Item(title=config.get_localized_string(30102), channel="favorites", action="mainlist",
|
itemlist.append(Item(title=config.getLocalizedString(30102), channel="favorites", action="mainlist",
|
||||||
thumbnail=get_thumb("favorites.png", view), category=config.get_localized_string(30102), viewmode="thumbnails"))
|
thumbnail=thumb("favorites"), category=config.getLocalizedString(30102), viewmode="thumbnails"))
|
||||||
|
|
||||||
if config.get_videolibrary_support() and addon.getSetting('enable_library_menu') == "true":
|
if config.get_videolibrary_support() and addon.getSetting('enable_library_menu') == "true":
|
||||||
itemlist.append(Item(title=config.get_localized_string(30131), channel="videolibrary", action="mainlist",
|
itemlist.append(Item(title=config.getLocalizedString(30131), channel="videolibrary", action="mainlist",
|
||||||
thumbnail=get_thumb("videolibrary.png", view), category=config.get_localized_string(30119), viewmode="thumbnails",
|
thumbnail=thumb("videolibrary"), category=config.getLocalizedString(30119), viewmode="thumbnails",
|
||||||
context=[{"title": config.get_localized_string(70287), "channel": "shortcuts", "action": "SettingOnPosition", "category":2, "setting":1},
|
context=[{"title": config.getLocalizedString(70287), "channel": "shortcuts", "action": "SettingOnPosition", "category":2, "setting":1},
|
||||||
{"title": config.get_localized_string(60568), "channel": "videolibrary", "action": "update_videolibrary"}]))
|
{"title": config.getLocalizedString(60568), "channel": "videolibrary", "action": "update_videolibrary"}]))
|
||||||
if downloadenabled != "false":
|
if downloadenabled != "false":
|
||||||
itemlist.append(Item(title=config.get_localized_string(30101), channel="downloads", action="mainlist", thumbnail=get_thumb("downloads.png", view), viewmode="list",
|
itemlist.append(Item(title=config.getLocalizedString(30101), channel="downloads", action="mainlist", thumbnail=thumb("download"), viewmode="list",
|
||||||
context=[{"title": config.get_localized_string(70288), "channel": "shortcuts", "action": "SettingOnPosition", "category":6}]))
|
context=[{"title": config.getLocalizedString(70288), "channel": "shortcuts", "action": "SettingOnPosition", "category":6}]))
|
||||||
|
|
||||||
thumb_setting = "setting_%s.png" % 0 # config.get_setting("plugin_updates_available")
|
|
||||||
|
|
||||||
itemlist.append(Item(title=config.get_localized_string(30100), channel="setting", action="settings",
|
itemlist.append(Item(title=config.getLocalizedString(30100), channel="setting", action="settings",
|
||||||
thumbnail=get_thumb(thumb_setting, view), category=config.get_localized_string(30100), viewmode="list", folder=False))
|
thumbnail=thumb('setting'), category=config.getLocalizedString(30100), viewmode="list", folder=False))
|
||||||
itemlist.append(Item(title=config.get_localized_string(30104) + " (v" + config.get_addon_version(with_fix=True) + ")", channel="help", action="mainlist",
|
itemlist.append(Item(title=config.getLocalizedString(30104) + " (v" + config.getAddonVersion(with_fix=True) + ")", channel="help", action="mainlist",
|
||||||
thumbnail=get_thumb("help.png", view), category=config.get_localized_string(30104), viewmode="list"))
|
thumbnail=thumb("help"), category=config.getLocalizedString(30104), viewmode="list"))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ def getchanneltypes(view="thumb_"):
|
|||||||
logger.debug()
|
logger.debug()
|
||||||
|
|
||||||
# Category List
|
# Category List
|
||||||
channel_types = ["movie", "tvshow", "anime", "documentary", "vos", "live", "torrent", "music"] #, "direct"
|
channel_types = ["movie", "tvshow", "anime", "documentary", "sub", "live", "torrent", "music"] #, "direct"
|
||||||
|
|
||||||
# Channel Language
|
# Channel Language
|
||||||
channel_language = auto_filter()
|
channel_language = auto_filter()
|
||||||
@@ -70,19 +70,19 @@ def getchanneltypes(view="thumb_"):
|
|||||||
|
|
||||||
# Build Itemlist
|
# Build Itemlist
|
||||||
itemlist = list()
|
itemlist = list()
|
||||||
title = config.get_localized_string(30121)
|
title = config.getLocalizedString(30121)
|
||||||
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", view=view,
|
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", view=view,
|
||||||
category=title, channel_type="all", thumbnail=get_thumb("all.png", view),
|
category=title, channel_type="all", thumbnail=thumb("all"),
|
||||||
viewmode="thumbnails"))
|
viewmode="thumbnails"))
|
||||||
|
|
||||||
for channel_type in channel_types:
|
for channel_type in channel_types:
|
||||||
title = config.get_localized_category(channel_type)
|
title = config.getLocalizedCategory(channel_type)
|
||||||
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", category=title,
|
itemlist.append(Item(title=title, channel="channelselector", action="filterchannels", category=title,
|
||||||
channel_type=channel_type, viewmode="thumbnails",
|
channel_type=channel_type, viewmode="thumbnails",
|
||||||
thumbnail=get_thumb("%s.png" % channel_type, view)))
|
thumbnail=thumb(channel_type)))
|
||||||
|
|
||||||
itemlist.append(Item(title=config.get_localized_string(70685), channel="community", action="mainlist", view=view,
|
itemlist.append(Item(title=config.getLocalizedString(70685), channel="community", action="mainlist", view=view,
|
||||||
category=config.get_localized_string(70685), channel_type="all", thumbnail=get_thumb("community.png", view),
|
category=config.getLocalizedString(70685), channel_type="all", thumbnail=thumb("community"),
|
||||||
viewmode="thumbnails"))
|
viewmode="thumbnails"))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ def filterchannels(category, view="thumb_"):
|
|||||||
category = "all"
|
category = "all"
|
||||||
appenddisabledchannels = True
|
appenddisabledchannels = True
|
||||||
|
|
||||||
channel_path = os.path.join(config.get_runtime_path(), 'channels', '*.json')
|
channel_path = os.path.join(config.getRuntimePath(), 'channels', '*.json')
|
||||||
logger.debug("channel_path = %s" % channel_path)
|
logger.debug("channel_path = %s" % channel_path)
|
||||||
|
|
||||||
channel_files = glob.glob(channel_path)
|
channel_files = glob.glob(channel_path)
|
||||||
@@ -126,15 +126,15 @@ def filterchannels(category, view="thumb_"):
|
|||||||
logger.debug("channel_parameters=%s" % repr(channel_parameters))
|
logger.debug("channel_parameters=%s" % repr(channel_parameters))
|
||||||
|
|
||||||
# If you prefer the banner and the channel has it, now change your mind
|
# If you prefer the banner and the channel has it, now change your mind
|
||||||
if view == "banner_" and "banner" in channel_parameters:
|
# if view == "banner_" and "banner" in channel_parameters:
|
||||||
channel_parameters["thumbnail"] = channel_parameters["banner"]
|
# channel_parameters["thumbnail"] = channel_parameters["banner"]
|
||||||
|
|
||||||
# if the channel is deactivated the channel is not shown in the list
|
# if the channel is deactivated the channel is not shown in the list
|
||||||
if not channel_parameters["active"]:
|
if not channel_parameters["active"]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# The channel is skipped if it is not active and we are not activating / deactivating the channels
|
# The channel is skipped if it is not active and we are not activating / deactivating the channels
|
||||||
channel_status = config.get_setting("enabled", channel_parameters["channel"])
|
channel_status = config.getSetting("enabled", channel_parameters["channel"])
|
||||||
|
|
||||||
if channel_status is None:
|
if channel_status is None:
|
||||||
# if channel_status does not exist, there is NO value in _data.json.
|
# if channel_status does not exist, there is NO value in _data.json.
|
||||||
@@ -158,7 +158,7 @@ def filterchannels(category, view="thumb_"):
|
|||||||
# If you have configuration we add an item in the context
|
# If you have configuration we add an item in the context
|
||||||
context = []
|
context = []
|
||||||
if channel_parameters["has_settings"]:
|
if channel_parameters["has_settings"]:
|
||||||
context.append({"title": config.get_localized_string(70525), "channel": "setting", "action": "channel_config",
|
context.append({"title": config.getLocalizedString(70525), "channel": "setting", "action": "channel_config",
|
||||||
"config": channel_parameters["channel"]})
|
"config": channel_parameters["channel"]})
|
||||||
|
|
||||||
channel_info = set_channel_info(channel_parameters)
|
channel_info = set_channel_info(channel_parameters)
|
||||||
@@ -175,46 +175,51 @@ def filterchannels(category, view="thumb_"):
|
|||||||
|
|
||||||
channelslist.sort(key=lambda item: item.title.lower().strip())
|
channelslist.sort(key=lambda item: item.title.lower().strip())
|
||||||
|
|
||||||
if not config.get_setting("only_channel_icons"):
|
if not config.getSetting("only_channel_icons"):
|
||||||
|
from core.support import thumb
|
||||||
|
|
||||||
if category == "all":
|
if category == "all":
|
||||||
channel_parameters = channeltools.get_channel_parameters('url')
|
channel_parameters = channeltools.get_channel_parameters('url')
|
||||||
# If you prefer the banner and the channel has it, now change your mind
|
# If you prefer the banner and the channel has it, now change your mind
|
||||||
if view == "banner_" and "banner" in channel_parameters:
|
# if view == "banner_" and "banner" in channel_parameters:
|
||||||
channel_parameters["thumbnail"] = channel_parameters["banner"]
|
# channel_parameters["thumbnail"] = channel_parameters["banner"]
|
||||||
|
|
||||||
channelslist.insert(0, Item(title=config.get_localized_string(60088), action="mainlist", channel="url",
|
channelslist.insert(0, Item(title=config.getLocalizedString(60088), action="mainlist", channel="url",
|
||||||
thumbnail=channel_parameters["thumbnail"], type="generic", viewmode="list"))
|
thumbnail=channel_parameters["thumbnail"], type="generic", viewmode="list"))
|
||||||
# Special Category
|
# Special Category
|
||||||
if category in ['movie', 'tvshow']:
|
if category in ['movie', 'tvshow']:
|
||||||
titles = [config.get_localized_string(70028), config.get_localized_string(30985), config.get_localized_string(70559), config.get_localized_string(60264), config.get_localized_string(70560)]
|
ch_list = []
|
||||||
|
titles = [config.getLocalizedString(70028), config.getLocalizedString(30985), config.getLocalizedString(70559), config.getLocalizedString(60264), config.getLocalizedString(70560)]
|
||||||
ids = ['popular', 'top_rated', 'now_playing', 'on_the_air']
|
ids = ['popular', 'top_rated', 'now_playing', 'on_the_air']
|
||||||
for x in range(0,3):
|
for x in range(0,3):
|
||||||
if x == 2 and category != 'movie':
|
if x == 2 and category != 'movie':
|
||||||
title=titles[x+1]
|
title=titles[x+1] + '{tv}'
|
||||||
id = ids[x+1]
|
id = ids[x+1]
|
||||||
else:
|
else:
|
||||||
title=titles[x]
|
title=titles[x] + '{movie}'
|
||||||
id = ids[x]
|
id = ids[x]
|
||||||
channelslist.insert(x,
|
ch_list.insert(x,
|
||||||
Item(channel='search', action='discover_list', title=title, search_type='list',
|
Item(channel='classicsearch', action='discover_list', title=title, search_type='list',
|
||||||
list_type='%s/%s' % (category.replace('show',''), id), mode=category, thumbnail=get_thumb(id+".png")))
|
list_type='%s/%s' % (category.replace('show',''), id), mode=category))
|
||||||
|
|
||||||
channelslist.insert(3, Item(channel='search', action='genres_menu', title=config.get_localized_string(30987),
|
|
||||||
type=category.replace('show',''), mode=category ,thumbnail=get_thumb("genres.png")))
|
ch_list.insert(3, Item(channel='classicsearch', action='genres_menu', title=config.getLocalizedString(30987) + '{' + category.replace('show','') + '}',
|
||||||
|
type=category.replace('show',''), mode=category))
|
||||||
|
channelslist = thumb(ch_list) + channelslist
|
||||||
|
|
||||||
return channelslist
|
return channelslist
|
||||||
|
|
||||||
|
|
||||||
def get_thumb(thumb_name, view="thumb_"):
|
# def get_thumb(thumb_name, view="thumb_"):
|
||||||
from core import filetools
|
# from core import filetools
|
||||||
if thumb_name.startswith('http'):
|
# if thumb_name.startswith('http'):
|
||||||
return thumb_name
|
# return thumb_name
|
||||||
elif config.get_setting('enable_custom_theme') and config.get_setting('custom_theme') and filetools.isfile(config.get_setting('custom_theme') + view + thumb_name):
|
# elif config.getSetting('enable_custom_theme') and config.getSetting('custom_theme') and filetools.isfile(config.getSetting('custom_theme') + view + thumb_name):
|
||||||
media_path = config.get_setting('custom_theme')
|
# media_path = config.getSetting('custom_theme')
|
||||||
else:
|
# else:
|
||||||
icon_pack_name = config.get_setting('icon_set', default="default")
|
# icon_pack_name = config.getSetting('icon_set', default="default")
|
||||||
media_path = filetools.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes", icon_pack_name)
|
# media_path = filetools.join("https://raw.githubusercontent.com/kodiondemand/media/master/themes/new", icon_pack_name)
|
||||||
return filetools.join(media_path, view + thumb_name)
|
# return filetools.join(media_path, thumb_name)
|
||||||
|
|
||||||
|
|
||||||
def set_channel_info(parameters):
|
def set_channel_info(parameters):
|
||||||
@@ -241,22 +246,22 @@ def set_channel_info(parameters):
|
|||||||
categories = parameters['categories']
|
categories = parameters['categories']
|
||||||
for cat in categories:
|
for cat in categories:
|
||||||
if content != '':
|
if content != '':
|
||||||
content = '%s, %s' % (content, config.get_localized_category(cat))
|
content = '%s, %s' % (content, config.getLocalizedCategory(cat))
|
||||||
else:
|
else:
|
||||||
content = config.get_localized_category(cat)
|
content = config.getLocalizedCategory(cat)
|
||||||
|
|
||||||
info = '[B]' + config.get_localized_string(70567) + ' [/B]' + content + '\n\n'
|
info = '[B]' + config.getLocalizedString(70567) + ' [/B]' + content + '\n\n'
|
||||||
info += '[B]' + config.get_localized_string(70568) + ' [/B] ' + language
|
info += '[B]' + config.getLocalizedString(70568) + ' [/B] ' + language
|
||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
||||||
def auto_filter(auto_lang=False):
|
def auto_filter(auto_lang=False):
|
||||||
list_lang = ['ita', 'vos', 'sub-ita']
|
list_lang = ['ita', 'vos', 'sub-ita']
|
||||||
if config.get_setting("channel_language") == 'auto' or auto_lang == True:
|
if config.getSetting("channel_language") == 'auto' or auto_lang == True:
|
||||||
lang = config.get_localized_string(20001)
|
lang = config.getLocalizedString(20001)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
lang = config.get_setting("channel_language", default="all")
|
lang = config.getSetting("channel_language", default="all")
|
||||||
|
|
||||||
if lang not in list_lang:
|
if lang not in list_lang:
|
||||||
lang = 'all'
|
lang = 'all'
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
import xbmc, sys, xbmcgui, os
|
import xbmc, sys, xbmcgui, os
|
||||||
|
|
||||||
librerias = xbmc.translatePath(os.path.join(config.get_runtime_path(), 'lib'))
|
librerias = xbmc.translatePath(os.path.join(config.getRuntimePath(), 'lib'))
|
||||||
sys.path.insert(0, librerias)
|
sys.path.insert(0, librerias)
|
||||||
|
|
||||||
from core import jsontools, support
|
from core import jsontools, support
|
||||||
|
|
||||||
addon_id = config.get_addon_core().getAddonInfo('id')
|
addon_id = config.getAddonCore().getAddonInfo('id')
|
||||||
|
|
||||||
LOCAL_FILE = os.path.join(config.get_runtime_path(), "platformcode/contextmenu/contextmenu.json")
|
LOCAL_FILE = os.path.join(config.getRuntimePath(), "platformcode/contextmenu/contextmenu.json")
|
||||||
f = open(LOCAL_FILE)
|
f = open(LOCAL_FILE)
|
||||||
contextmenu_settings = jsontools.load(open(LOCAL_FILE).read())
|
contextmenu_settings = jsontools.load(open(LOCAL_FILE).read())
|
||||||
f.close()
|
f.close()
|
||||||
@@ -53,7 +53,7 @@ def build_menu():
|
|||||||
|
|
||||||
|
|
||||||
def empty_item():
|
def empty_item():
|
||||||
return config.get_localized_string(90004)
|
return config.getLocalizedString(90004)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ from . import filetools
|
|||||||
from platformcode import config
|
from platformcode import config
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from lib.sqlitedict import SqliteDict
|
from lib.sqlitedict import SqliteDict
|
||||||
|
import zlib, pickle, sqlite3
|
||||||
|
|
||||||
|
|
||||||
class nested_dict_sqlite(defaultdict):
|
class nested_dict_sqlite(defaultdict):
|
||||||
@@ -29,6 +30,19 @@ class nested_dict_sqlite(defaultdict):
|
|||||||
self[key].close()
|
self[key].close()
|
||||||
self.clear()
|
self.clear()
|
||||||
|
|
||||||
|
def encode(obj):
|
||||||
|
return sqlite3.Binary(zlib.compress(pickle.dumps(obj, pickle.HIGHEST_PROTOCOL)))
|
||||||
|
|
||||||
|
def decode(obj):
|
||||||
|
return pickle.loads(zlib.decompress(bytes(obj)))
|
||||||
|
|
||||||
|
db_name = filetools.join(config.getDataPath(), "db.sqlite")
|
||||||
|
vdb_name = filetools.join(config.getVideolibraryPath(), "videolibrary.sqlite")
|
||||||
|
|
||||||
db_name = filetools.join(config.get_data_path(), "db.sqlite")
|
|
||||||
db = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))
|
db = nested_dict_sqlite(lambda table: SqliteDict(db_name, table, 'c', True))
|
||||||
|
videolibrarydb = nested_dict_sqlite(lambda table: SqliteDict(vdb_name, table, 'c', True, encode=encode, decode=decode))
|
||||||
|
|
||||||
|
|
||||||
|
if 'played_time' not in SqliteDict.get_tablenames(vdb_name):
|
||||||
|
for k, v in dict(db['viewed']).items():
|
||||||
|
videolibrarydb['played_time'][k] = v
|
||||||
|
|||||||
@@ -9,13 +9,6 @@ __channel__ = "autoplay"
|
|||||||
|
|
||||||
PLAYED = False
|
PLAYED = False
|
||||||
|
|
||||||
quality_list = ['4k', '2160p', '2160', '4k2160p', '4k2160', '4k 2160p', '4k 2160', '2k',
|
|
||||||
'fullhd', 'fullhd 1080', 'fullhd 1080p', 'full hd', 'full hd 1080', 'full hd 1080p', 'hd1080', 'hd1080p', 'hd 1080', 'hd 1080p', '1080', '1080p',
|
|
||||||
'hd', 'hd720', 'hd720p', 'hd 720', 'hd 720p', '720', '720p', 'hdtv',
|
|
||||||
'sd', '480p', '480', '360p', '360', '240p', '240',
|
|
||||||
'default']
|
|
||||||
|
|
||||||
|
|
||||||
def start(itemlist, item):
|
def start(itemlist, item):
|
||||||
'''
|
'''
|
||||||
Main method from which the links are automatically reproduced
|
Main method from which the links are automatically reproduced
|
||||||
@@ -39,13 +32,13 @@ def start(itemlist, item):
|
|||||||
if not config.is_xbmc():
|
if not config.is_xbmc():
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
if config.get_setting('autoplay') or (item.channel == 'community' and item.autoplay):
|
if config.getSetting('autoplay') or item.autoplay:
|
||||||
# Save the current value of "Action and Player Mode" in preferences
|
# Save the current value of "Action and Player Mode" in preferences
|
||||||
user_config_setting_action = config.get_setting("default_action")
|
user_config_setting_action = config.getSetting("default_action")
|
||||||
# user_config_setting_player = config.get_setting("player_mode")
|
# user_config_setting_player = config.getSetting("player_mode")
|
||||||
|
|
||||||
# Enable the "View in high quality" action (if the server returns more than one quality, eg gdrive)
|
# Enable the "View in high quality" action (if the server returns more than one quality, eg gdrive)
|
||||||
if not user_config_setting_action: config.set_setting("default_action", 2)
|
if not user_config_setting_action: config.setSetting("default_action", 2)
|
||||||
|
|
||||||
from core.servertools import sort_servers
|
from core.servertools import sort_servers
|
||||||
autoplay_list = sort_servers(itemlist)
|
autoplay_list = sort_servers(itemlist)
|
||||||
@@ -55,8 +48,8 @@ def start(itemlist, item):
|
|||||||
max_intents_servers = {}
|
max_intents_servers = {}
|
||||||
|
|
||||||
# If something is playing it stops playing
|
# If something is playing it stops playing
|
||||||
if platformtools.is_playing():
|
if platformtools.isPlaying():
|
||||||
platformtools.stop_video()
|
platformtools.stopVideo()
|
||||||
|
|
||||||
for autoplay_elem in autoplay_list:
|
for autoplay_elem in autoplay_list:
|
||||||
play_item = Item
|
play_item = Item
|
||||||
@@ -64,7 +57,7 @@ def start(itemlist, item):
|
|||||||
if autoplay_elem.channel == 'videolibrary':
|
if autoplay_elem.channel == 'videolibrary':
|
||||||
channel_id = autoplay_elem.contentChannel
|
channel_id = autoplay_elem.contentChannel
|
||||||
|
|
||||||
if not platformtools.is_playing() and not PLAYED:
|
if not platformtools.isPlaying() and not PLAYED:
|
||||||
videoitem = autoplay_elem
|
videoitem = autoplay_elem
|
||||||
if videoitem.server.lower() not in max_intents_servers:
|
if videoitem.server.lower() not in max_intents_servers:
|
||||||
max_intents_servers[videoitem.server.lower()] = max_intents
|
max_intents_servers[videoitem.server.lower()] = max_intents
|
||||||
@@ -76,15 +69,16 @@ def start(itemlist, item):
|
|||||||
lang = " [{}]".format(videoitem.language) if videoitem.language else ''
|
lang = " [{}]".format(videoitem.language) if videoitem.language else ''
|
||||||
quality = ' [{}]'.format(videoitem.quality) if videoitem.quality and videoitem.quality != 'default' else ''
|
quality = ' [{}]'.format(videoitem.quality) if videoitem.quality and videoitem.quality != 'default' else ''
|
||||||
name = servername(videoitem.server)
|
name = servername(videoitem.server)
|
||||||
platformtools.dialog_notification('AutoPlay', '{}{}{}'.format(name, lang, quality), sound=False)
|
platformtools.dialogNotification('AutoPlay', '{}{}{}'.format(name, lang, quality), sound=False)
|
||||||
|
|
||||||
# Try to play the links If the channel has its own play method, use it
|
# Try to play the links If the channel has its own play method, use it
|
||||||
try: channel = __import__('channels.%s' % channel_id, None, None, ["channels.%s" % channel_id])
|
channel = platformtools.channelImport(channel_id)
|
||||||
except: channel = __import__('specials.%s' % channel_id, None, None, ["specials.%s" % channel_id])
|
if not channel:
|
||||||
|
return
|
||||||
if hasattr(channel, 'play'):
|
if hasattr(channel, 'play'):
|
||||||
resolved_item = getattr(channel, 'play')(videoitem)
|
resolved_item = getattr(channel, 'play')(videoitem)
|
||||||
if len(resolved_item) > 0:
|
if len(resolved_item) > 0:
|
||||||
if isinstance(resolved_item[0], list): videoitem.video_urls = resolved_item
|
if isinstance(resolved_item[0], list): videoitem.videoUrls = resolved_item
|
||||||
else: videoitem = resolved_item[0]
|
else: videoitem = resolved_item[0]
|
||||||
|
|
||||||
play_item.autoplay = True
|
play_item.autoplay = True
|
||||||
@@ -94,16 +88,16 @@ def start(itemlist, item):
|
|||||||
if base_item.contentChannel == 'videolibrary' or base_item.nfo:
|
if base_item.contentChannel == 'videolibrary' or base_item.nfo:
|
||||||
# Fill the video with the data of the main item and play
|
# Fill the video with the data of the main item and play
|
||||||
play_item = base_item.clone(**videoitem.__dict__)
|
play_item = base_item.clone(**videoitem.__dict__)
|
||||||
platformtools.play_video(play_item, autoplay=True)
|
platformtools.playVideo(play_item, autoplay=True)
|
||||||
else:
|
else:
|
||||||
videoitem.window = base_item.window
|
videoitem.window = base_item.window
|
||||||
# If it doesn't come from the video library, just play
|
# If it doesn't come from the video library, just play
|
||||||
platformtools.play_video(videoitem, autoplay=True)
|
platformtools.playVideo(videoitem, autoplay=True)
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
# sleep(3)
|
# sleep(3)
|
||||||
try:
|
try:
|
||||||
if platformtools.is_playing():
|
if platformtools.isPlaying():
|
||||||
PLAYED = True
|
PLAYED = True
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
@@ -114,20 +108,20 @@ def start(itemlist, item):
|
|||||||
|
|
||||||
# If the maximum number of attempts of this server has been reached, ask if we want to continue testing or ignore it.
|
# If the maximum number of attempts of this server has been reached, ask if we want to continue testing or ignore it.
|
||||||
if max_intents_servers[videoitem.server.lower()] == 0:
|
if max_intents_servers[videoitem.server.lower()] == 0:
|
||||||
text = config.get_localized_string(60072) % name
|
text = config.getLocalizedString(60072) % name
|
||||||
if not platformtools.dialog_yesno("AutoPlay", text, config.get_localized_string(60073)):
|
if not platformtools.dialogYesNo("AutoPlay", text, config.getLocalizedString(60073)):
|
||||||
max_intents_servers[videoitem.server.lower()] = max_intents
|
max_intents_servers[videoitem.server.lower()] = max_intents
|
||||||
|
|
||||||
# If there are no items in the list, it is reported
|
# If there are no items in the list, it is reported
|
||||||
if autoplay_elem == autoplay_list[-1]:
|
if autoplay_elem == autoplay_list[-1]:
|
||||||
platformtools.dialog_notification('AutoPlay', config.get_localized_string(60072) % name)
|
platformtools.dialogNotification('AutoPlay', config.getLocalizedString(60072) % name)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
platformtools.dialog_notification(config.get_localized_string(60074), config.get_localized_string(60075))
|
platformtools.dialogNotification(config.getLocalizedString(60074), config.getLocalizedString(60075))
|
||||||
|
|
||||||
# Restore if necessary the previous value of "Action and Player Mode" in preferences
|
# Restore if necessary the previous value of "Action and Player Mode" in preferences
|
||||||
if not user_config_setting_action: config.set_setting("default_action", user_config_setting_action)
|
if not user_config_setting_action: config.setSetting("default_action", user_config_setting_action)
|
||||||
# if user_config_setting_player != 0: config.set_setting("player_mode", user_config_setting_player)
|
# if user_config_setting_player != 0: config.setSetting("player_mode", user_config_setting_player)
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
@@ -139,7 +133,7 @@ def play_multi_channel(item, itemlist):
|
|||||||
|
|
||||||
def servername(server):
|
def servername(server):
|
||||||
from core.servertools import translate_server_name
|
from core.servertools import translate_server_name
|
||||||
path = filetools.join(config.get_runtime_path(), 'servers', server.lower() + '.json')
|
path = filetools.join(config.getRuntimePath(), 'servers', server.lower() + '.json')
|
||||||
name = jsontools.load(open(path, "rb").read())['name']
|
name = jsontools.load(open(path, "rb").read())['name']
|
||||||
if name.startswith('@'): name = config.get_localized_string(int(name.replace('@','')))
|
if name.startswith('@'): name = config.getLocalizedString(int(name.replace('@','')))
|
||||||
return translate_server_name(name)
|
return translate_server_name(name)
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ remote_path = 'https://raw.githubusercontent.com/kodiondemand/media/master/'
|
|||||||
|
|
||||||
def is_enabled(channel_name):
|
def is_enabled(channel_name):
|
||||||
logger.debug("channel_name=" + channel_name)
|
logger.debug("channel_name=" + channel_name)
|
||||||
return get_channel_parameters(channel_name)["active"] and get_channel_setting("enabled", channel=channel_name,
|
return get_channel_parameters(channel_name)["active"] and getChannelSetting("enabled", channel=channel_name, default=True)
|
||||||
default=True)
|
|
||||||
|
|
||||||
|
|
||||||
def get_channel_parameters(channel_name):
|
def get_channel_parameters(channel_name):
|
||||||
@@ -37,8 +36,7 @@ def get_channel_parameters(channel_name):
|
|||||||
channel_parameters["update_url"] = channel_parameters.get("update_url", DEFAULT_UPDATE_URL)
|
channel_parameters["update_url"] = channel_parameters.get("update_url", DEFAULT_UPDATE_URL)
|
||||||
channel_parameters["language"] = channel_parameters.get("language", ["all"])
|
channel_parameters["language"] = channel_parameters.get("language", ["all"])
|
||||||
channel_parameters["active"] = channel_parameters.get("active", False)
|
channel_parameters["active"] = channel_parameters.get("active", False)
|
||||||
channel_parameters["include_in_global_search"] = channel_parameters.get("include_in_global_search",
|
channel_parameters["include_in_global_search"] = channel_parameters.get("include_in_global_search", False)
|
||||||
False)
|
|
||||||
channel_parameters["categories"] = channel_parameters.get("categories", list())
|
channel_parameters["categories"] = channel_parameters.get("categories", list())
|
||||||
|
|
||||||
channel_parameters["thumbnail"] = channel_parameters.get("thumbnail", "")
|
channel_parameters["thumbnail"] = channel_parameters.get("thumbnail", "")
|
||||||
@@ -91,13 +89,13 @@ def get_channel_json(channel_name):
|
|||||||
from core import filetools
|
from core import filetools
|
||||||
channel_json = None
|
channel_json = None
|
||||||
try:
|
try:
|
||||||
channel_path = filetools.join(config.get_runtime_path(), "channels", channel_name + ".json")
|
channel_path = filetools.join(config.getRuntimePath(), "channels", channel_name + ".json")
|
||||||
if not filetools.isfile(channel_path):
|
if not filetools.isfile(channel_path):
|
||||||
channel_path = filetools.join(config.get_runtime_path(), "specials", channel_name + ".json")
|
channel_path = filetools.join(config.getRuntimePath(), "specials", channel_name + ".json")
|
||||||
if not filetools.isfile(channel_path):
|
if not filetools.isfile(channel_path):
|
||||||
channel_path = filetools.join(config.get_runtime_path(), "servers", channel_name + ".json")
|
channel_path = filetools.join(config.getRuntimePath(), "servers", channel_name + ".json")
|
||||||
if not filetools.isfile(channel_path):
|
if not filetools.isfile(channel_path):
|
||||||
channel_path = filetools.join(config.get_runtime_path(), "servers", "debriders",
|
channel_path = filetools.join(config.getRuntimePath(), "servers", "debriders",
|
||||||
channel_name + ".json")
|
channel_name + ".json")
|
||||||
|
|
||||||
if filetools.isfile(channel_path):
|
if filetools.isfile(channel_path):
|
||||||
@@ -108,7 +106,7 @@ def get_channel_json(channel_name):
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
template = "An exception of type %s occured. Arguments:\n%r"
|
template = "An exception of type %s occured. Arguments:\n%r"
|
||||||
message = template % (type(ex).__name__, ex.args)
|
message = template % (type(ex).__name__, ex.args)
|
||||||
logger.error(" %s" % message)
|
logger.error("{} | {}".format(channel_name,message))
|
||||||
|
|
||||||
return channel_json
|
return channel_json
|
||||||
|
|
||||||
@@ -116,24 +114,27 @@ def get_channel_json(channel_name):
|
|||||||
def get_channel_controls_settings(channel_name):
|
def get_channel_controls_settings(channel_name):
|
||||||
logger.debug("channel_name=" + channel_name)
|
logger.debug("channel_name=" + channel_name)
|
||||||
dict_settings = {}
|
dict_settings = {}
|
||||||
# import web_pdb; web_pdb.set_trace()
|
|
||||||
# list_controls = get_channel_json(channel_name).get('settings', list())
|
|
||||||
list_controls = get_default_settings(channel_name)
|
list_controls = get_default_settings(channel_name)
|
||||||
|
|
||||||
for c in list_controls:
|
for c in list_controls:
|
||||||
if 'id' not in c or 'type' not in c or 'default' not in c:
|
if 'id' not in c or 'type' not in c or 'default' not in c:
|
||||||
# If any control in the list does not have id, type or default, we ignore it
|
# If any control in the list does not have id, type or default, we ignore it
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# new dict with key(id) and value(default) from settings
|
# new dict with key(id) and value(default) from settings
|
||||||
dict_settings[c['id']] = c['default']
|
if c['type'] == 'list' and c.get('values'):
|
||||||
|
dict_settings[c['id']] = list(c['values'])[c['default']]
|
||||||
|
elif c['type'] == 'list' and c.get('dvalues'):
|
||||||
|
dict_settings[c['id']] = list(c['dvalues'].values())[c['default']]
|
||||||
|
else:
|
||||||
|
dict_settings[c['id']] = c['default']
|
||||||
|
|
||||||
return list_controls, dict_settings
|
return list_controls, dict_settings
|
||||||
|
|
||||||
|
|
||||||
def get_lang(channel_name):
|
def get_lang(channel_name):
|
||||||
channel = __import__('channels.%s' % channel_name, fromlist=["channels.%s" % channel_name])
|
channel = __import__('channels.%s' % channel_name, fromlist=["channels.%s" % channel_name])
|
||||||
list_language = [config.get_localized_string(70522)]
|
list_language = [config.getLocalizedString(70522)]
|
||||||
if hasattr(channel, 'list_language'):
|
if hasattr(channel, 'list_language'):
|
||||||
for language in channel.list_language:
|
for language in channel.list_language:
|
||||||
list_language.append(language)
|
list_language.append(language)
|
||||||
@@ -161,7 +162,7 @@ def get_default_settings(channel_name):
|
|||||||
from core import filetools
|
from core import filetools
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
default_path = filetools.join(config.get_runtime_path(), 'default_channel_settings' + '.json')
|
default_path = filetools.join(config.getRuntimePath(), 'default_channel_settings' + '.json')
|
||||||
if channel_name not in ['trakt', 'autoplay']:
|
if channel_name not in ['trakt', 'autoplay']:
|
||||||
global default_file
|
global default_file
|
||||||
else:
|
else:
|
||||||
@@ -169,9 +170,8 @@ def get_default_settings(channel_name):
|
|||||||
if not default_file:
|
if not default_file:
|
||||||
default_file = jsontools.load(filetools.read(default_path))
|
default_file = jsontools.load(filetools.read(default_path))
|
||||||
|
|
||||||
channel_path = filetools.join(config.get_runtime_path(), 'channels', channel_name + '.json')
|
channel_path = filetools.join(config.getRuntimePath(), 'channels', channel_name + '.json')
|
||||||
|
|
||||||
# from core.support import dbg; dbg()
|
|
||||||
if filetools.exists(channel_path):
|
if filetools.exists(channel_path):
|
||||||
default_controls = default_file['settings']
|
default_controls = default_file['settings']
|
||||||
default_controls_renumber = default_file['renumber']
|
default_controls_renumber = default_file['renumber']
|
||||||
@@ -185,36 +185,36 @@ def get_default_settings(channel_name):
|
|||||||
default_off = channel_json['default_off'] if 'default_off' in channel_json else []
|
default_off = channel_json['default_off'] if 'default_off' in channel_json else []
|
||||||
|
|
||||||
# Apply default configurations if they do not exist
|
# Apply default configurations if they do not exist
|
||||||
|
# logger.dbg()
|
||||||
for control in copy.deepcopy(default_controls):
|
for control in copy.deepcopy(default_controls):
|
||||||
if control['id'] not in str(channel_controls):
|
if control['id'] not in str(channel_controls):
|
||||||
if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active and control[
|
if 'include_in_newest' in control['id'] and 'include_in_newest' not in not_active and control['id'] not in not_active:
|
||||||
'id'] not in not_active:
|
|
||||||
label = control['id'].split('_')
|
label = control['id'].split('_')
|
||||||
label = label[-1]
|
label = label[-1]
|
||||||
if label == 'peliculas':
|
if label == 'movie':
|
||||||
if 'movie' in categories:
|
if 'movie' in categories:
|
||||||
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string( 30122)
|
control['label'] = config.getLocalizedString(70727) + ' - ' + config.getLocalizedString( 30122)
|
||||||
control['default'] = False if ('include_in_newest' in default_off) or ( ' include_in_newest_peliculas' in default_off) else True
|
control['default'] = False if ('include_in_newest' in default_off) or ( ' include_in_newest_movie' in default_off) else True
|
||||||
channel_controls.append(control)
|
channel_controls.append(control)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
elif label == 'series':
|
elif label == 'tvshow':
|
||||||
if 'tvshow' in categories:
|
if 'tvshow' in categories:
|
||||||
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string( 30123)
|
control['label'] = config.getLocalizedString(70727) + ' - ' + config.getLocalizedString( 30123)
|
||||||
control['default'] = False if ('include_in_newest' in default_off) or ( 'include_in_newest_series' in default_off) else True
|
control['default'] = False if ('include_in_newest' in default_off) or ( 'include_in_newest_tvshow' in default_off) else True
|
||||||
channel_controls.append(control)
|
channel_controls.append(control)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
elif label == 'anime':
|
elif label == 'anime':
|
||||||
if 'anime' in categories:
|
if 'anime' in categories:
|
||||||
control['label'] = config.get_localized_string(70727) + ' - ' + config.get_localized_string( 30124)
|
control['label'] = config.getLocalizedString(70727) + ' - ' + config.getLocalizedString( 30124)
|
||||||
control['default'] = False if ('include_in_newest' in default_off) or ( 'include_in_newest_anime' in default_off) else True
|
control['default'] = False if ('include_in_newest' in default_off) or ( 'include_in_newest_anime' in default_off) else True
|
||||||
channel_controls.append(control)
|
channel_controls.append(control)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
else:
|
else:
|
||||||
control['label'] = config.get_localized_string(70727) + ' - ' + label.capitalize()
|
control['label'] = config.getLocalizedString(70727) + ' - ' + label.capitalize()
|
||||||
control['default'] = control['default'] if control['id'] not in default_off else False
|
control['default'] = control['default'] if control['id'] not in default_off else False
|
||||||
channel_controls.append(control)
|
channel_controls.append(control)
|
||||||
|
|
||||||
@@ -234,7 +234,7 @@ def get_default_settings(channel_name):
|
|||||||
return channel_controls
|
return channel_controls
|
||||||
|
|
||||||
|
|
||||||
def get_channel_setting(name, channel, default=None):
|
def getChannelSetting(name, channel, default=None):
|
||||||
from core import filetools
|
from core import filetools
|
||||||
"""
|
"""
|
||||||
Returns the configuration value of the requested parameter.
|
Returns the configuration value of the requested parameter.
|
||||||
@@ -258,7 +258,7 @@ def get_channel_setting(name, channel, default=None):
|
|||||||
@rtype: any
|
@rtype: any
|
||||||
|
|
||||||
"""
|
"""
|
||||||
file_settings = filetools.join(config.get_data_path(), "settings_channels", channel + "_data.json")
|
file_settings = filetools.join(config.getDataPath(), "settings_channels", channel + "_data.json")
|
||||||
dict_settings = {}
|
dict_settings = {}
|
||||||
dict_file = {}
|
dict_file = {}
|
||||||
|
|
||||||
@@ -291,7 +291,7 @@ def get_channel_setting(name, channel, default=None):
|
|||||||
return dict_settings.get(name, default)
|
return dict_settings.get(name, default)
|
||||||
|
|
||||||
|
|
||||||
def set_channel_setting(name, value, channel):
|
def setChannelSetting(name, value, channel):
|
||||||
from core import filetools
|
from core import filetools
|
||||||
"""
|
"""
|
||||||
Sets the configuration value of the indicated parameter.
|
Sets the configuration value of the indicated parameter.
|
||||||
@@ -315,10 +315,10 @@ def set_channel_setting(name, value, channel):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
# We create the folder if it does not exist
|
# We create the folder if it does not exist
|
||||||
if not filetools.exists(filetools.join(config.get_data_path(), "settings_channels")):
|
if not filetools.exists(filetools.join(config.getDataPath(), "settings_channels")):
|
||||||
filetools.mkdir(filetools.join(config.get_data_path(), "settings_channels"))
|
filetools.mkdir(filetools.join(config.getDataPath(), "settings_channels"))
|
||||||
|
|
||||||
file_settings = filetools.join(config.get_data_path(), "settings_channels", channel + "_data.json")
|
file_settings = filetools.join(config.getDataPath(), "settings_channels", channel + "_data.json")
|
||||||
dict_settings = {}
|
dict_settings = {}
|
||||||
|
|
||||||
dict_file = None
|
dict_file = None
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user