Compare commits
105 Commits
prove_inte
...
alpha
| 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:
|
||||
|
||||
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)
|
||||
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,5 +7,3 @@ custom_code.json
|
||||
last_commit.txt
|
||||
__pycache__/
|
||||
.vscode/settings.json
|
||||
bin/
|
||||
lib/abi
|
||||
|
||||
15
addon.xml
15
addon.xml
@@ -1,10 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<addon id="plugin.video.kod" name="Kodi on Demand BETA" version="1.7.6" provider-name="KoD Team">
|
||||
<addon id="plugin.video.kod" name="Kodi on Demand ALPHA" version="2.0" provider-name="KoD Team">
|
||||
<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" />
|
||||
</requires>
|
||||
<extension point="xbmc.python.pluginsource" library="default.py">
|
||||
@@ -23,15 +19,14 @@
|
||||
<summary lang="it">Kodi on Demand è un addon di Kodi per cercare e guardare contenuti sul web.</summary>
|
||||
<assets>
|
||||
<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-2.png</screenshot>
|
||||
<screenshot>resources/media/screenshot-3.png</screenshot>
|
||||
</assets>
|
||||
<news>- fix di routine ai canali/server
|
||||
- disabilitati cb01anime e tantifilm
|
||||
- aggiunta opzione "mostra server" nel menu contestuale della libreria
|
||||
- più opzioni per quanto riguarda l'aggiornamento della videoteca
|
||||
<news>- Aggiunto menu globale "opzioni di KoD"
|
||||
- Aggiunto canale tapmovie e server annessi
|
||||
- Notifica quando il tipo di vista viene salvata (con indicazione del tipo di contenuto)
|
||||
</news>
|
||||
<description lang="it">Naviga velocemente sul web e guarda i contenuti presenti</description>
|
||||
<disclaimer>[COLOR red]The owners and submitters to this addon do not host or distribute any of the content displayed by these addons nor do they have any affiliation with the content providers.[/COLOR]
|
||||
|
||||
@@ -1,44 +1,53 @@
|
||||
{
|
||||
"direct": {
|
||||
"altadefinizione01": "https://www.altadefinizione01.sbs",
|
||||
"altadefinizione01": "https://www.altadefinizione01.plus",
|
||||
"altadefinizione01_link": "https://altadefinizione01.travel",
|
||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||
"animeforce": "https://www.animeforce.it",
|
||||
"animesaturn": "https://www.animesaturn.in",
|
||||
"animeleggendari": "https://animezeus.com",
|
||||
"animesaturn": "https://www.animesaturn.it",
|
||||
"animeunity": "https://www.animeunity.tv",
|
||||
"animeuniverse": "https://www.animeuniverse.it",
|
||||
"animeworld": "https://www.animeworld.tv",
|
||||
"aniplay": "https://aniplay.it",
|
||||
"casacinema": "https://www.casacinema.lol",
|
||||
"casacinema": "https://www.casacinema.page",
|
||||
"cb01anime": "https://www.cineblog01.red",
|
||||
"cinemalibero": "https://cinemalibero.cafe",
|
||||
"cineblog01": "https://cb01.uno",
|
||||
"cinemalibero": "https://cinemalibero.surf",
|
||||
"cinetecadibologna": "http://cinestore.cinetecadibologna.it",
|
||||
"discoveryplus": "https://www.discoveryplus.com",
|
||||
"dreamsub": "https://www.animeworld.tv",
|
||||
"eurostreaming": "https://eurostreaming.party",
|
||||
"eurostreaming_actor": "https://eurostreaming.actor",
|
||||
"filmstreaming": "https://filmstreaming.media",
|
||||
"dreamsub": "https://dreamsub.stream",
|
||||
"dsda": "https://www.dsda.press",
|
||||
"eurostreaming": "https://eurostreaming.world",
|
||||
"filmigratis": "https://filmigratis.org",
|
||||
"guardaseriecam": "https://guardaserie.cam",
|
||||
"guardaserieclick": "https://www.guardaserie.builders",
|
||||
"guardaserieicu": "https://guardaserie.center",
|
||||
"hd4me": "https://hd4me.net",
|
||||
"ilcorsaronero": "https://ilcorsaronero.link",
|
||||
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.sbs",
|
||||
"mediasetplay": "https://mediasetinfinity.mediaset.it",
|
||||
"ilgeniodellostreaming": "https://ilgeniodellostreaming.bet",
|
||||
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.city",
|
||||
"italiaserie": "https://italiaserie.men",
|
||||
"mediasetplay": "https://www.mediasetplay.mediaset.it",
|
||||
"mondoserietv": "https://mondoserietv.club",
|
||||
"paramount": "https://www.mtv.it",
|
||||
"paramount": "https://www.paramountnetwork.it",
|
||||
"piratestreaming": "https://www.piratestreaming.design",
|
||||
"plutotv": "https://pluto.tv",
|
||||
"polpotv": "https://roma.polpo.tv",
|
||||
"raiplay": "https://www.raiplay.it",
|
||||
"seriehd": "https://altadefinizionecommunity.casa",
|
||||
"serietvonline": "https://serietvonline.art",
|
||||
"serietvsubita": "http://serietvsubita.xyz",
|
||||
"serietvu": "https://www.serietvu.live",
|
||||
"streamingcommunity": "https://streamingcommunity.tech",
|
||||
"streamingita": "https://www.streamingita.wtf",
|
||||
"streamtime": "https://t.me/s/StreamTime",
|
||||
"tantifilm": "https://www.tantifilm.yachts",
|
||||
"toonitalia": "https://toonitalia.co"
|
||||
"tantifilm": "https://www.tantifilm.cfd",
|
||||
"tapmovie": "https://it.tapmovie.net",
|
||||
"toonitalia": "https://toonitalia.co",
|
||||
"vvvvid": "https://www.vvvvid.it"
|
||||
},
|
||||
"findhost": {
|
||||
"altadefinizione": "https://altadefinizione.nuovo.live",
|
||||
"altadefinizionecommunity": "https://altaregistrazione.net",
|
||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||
"cineblog01": "https://cb01.uno",
|
||||
"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,
|
||||
"thumbnail": "",
|
||||
"banner": "",
|
||||
"categories": ["movie", "tvshow", "anime", "vos", "documentary"],
|
||||
"categories": ["movie", "tvshow", "anime", "sub, "documentary"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"settings": [
|
||||
{
|
||||
@@ -35,7 +35,7 @@ se vanno cancellati tutti deve rimanere la voce:
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_peliculas",
|
||||
"id": "include_in_newest_movie",
|
||||
"type": "bool",
|
||||
"label": "@70727",
|
||||
"default": false,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# fix:
|
||||
# 1. aggiunto pagination e sistemate alcune voci
|
||||
# 2. modificato problemi in eccezioni
|
||||
# 3. aggiunta la def check
|
||||
# 3. aggiunta la def select
|
||||
# 4. modifica alla legenda e altre aggiunte
|
||||
|
||||
# Questo vuole solo essere uno scheletro per velocizzare la scrittura di un canale.
|
||||
@@ -75,20 +75,19 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.info(item)
|
||||
|
||||
# Ordine delle voci
|
||||
# Voce FILM, puoi solo impostare l'url
|
||||
film = ['', # url per la voce FILM, se possibile la pagina principale con le ultime novità
|
||||
#Voce Menu,['url','action','args',contentType]
|
||||
('Al Cinema', ['', 'peliculas', '']),
|
||||
('Al Cinema', ['', 'movies', '']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Per Lettera', ['', 'genres', 'letters']),
|
||||
('Anni', ['', 'genres', 'years']),
|
||||
('Qualità', ['', 'genres', 'quality']),
|
||||
('Mi sento fortunato', ['', 'genres', 'lucky']),
|
||||
('Popolari', ['', 'peliculas', '']),
|
||||
('Sub-ITA', ['', 'peliculas', ''])
|
||||
('Popolari', ['', 'movies', '']),
|
||||
('Sub-ITA', ['', 'movies', ''])
|
||||
]
|
||||
|
||||
# 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.
|
||||
# AVVERTENZE: Se il titolo è trovato nella ricerca TMDB/TVDB/Altro allora le locandine e altre info non saranno quelle recuperate nel sito.!!!!
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.info(item)
|
||||
#support.dbg() # decommentare per attivare web_pdb
|
||||
def movies(item):
|
||||
#logger.dbg() # decommentare per attivare web_pdb
|
||||
|
||||
action = ''
|
||||
blacklist = ['']
|
||||
patron = r''
|
||||
patronBlock = r''
|
||||
patronNext = ''
|
||||
pagination = ''
|
||||
pagination = True
|
||||
|
||||
#debug = True # True per testare le regex sul sito
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.info(item)
|
||||
#support.dbg()
|
||||
def episodes(item):
|
||||
#logger.dbg()
|
||||
|
||||
action = ''
|
||||
blacklist = ['']
|
||||
patron = r''
|
||||
patronBlock = r''
|
||||
patronNext = ''
|
||||
pagination = ''
|
||||
pagination = True
|
||||
|
||||
#debug = True
|
||||
return locals()
|
||||
@@ -178,15 +175,14 @@ def episodios(item):
|
||||
# per genere, per anno, per lettera, per qualità ecc ecc
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.info(item)
|
||||
#support.dbg()
|
||||
#logger.dbg()
|
||||
|
||||
action = ''
|
||||
blacklist = ['']
|
||||
patron = r''
|
||||
patronBlock = r''
|
||||
patronNext = ''
|
||||
pagination = ''
|
||||
pagination = True
|
||||
|
||||
#debug = True
|
||||
return locals()
|
||||
@@ -196,18 +192,18 @@ def genres(item):
|
||||
|
||||
# per quei casi dove il sito non differenzia film e/o serie e/o anime
|
||||
# e la ricerca porta i titoli mischiati senza poterli distinguere tra loro
|
||||
# andranno modificate anche le def peliculas e episodios ove occorre
|
||||
def check(item):
|
||||
support.info('select --->', item)
|
||||
#support.dbg()
|
||||
# andranno modificate anche le def movies e episodes ove occorre
|
||||
def select(item):
|
||||
logger.debug()
|
||||
#logger.dbg()
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
# pulizia di data, in caso commentare le prossime 2 righe
|
||||
data = re.sub('\n|\t', ' ', data)
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
block = scrapertools.find_single_match(data, r'')
|
||||
if re.findall('', data, re.IGNORECASE):
|
||||
support.info('select = ### è una serie ###')
|
||||
return episodios(Item(channel=item.channel,
|
||||
logger.debug('select = ### è una serie ###')
|
||||
return episodes(Item(channel=item.channel,
|
||||
title=item.title,
|
||||
fulltitle=item.fulltitle,
|
||||
url=item.url,
|
||||
@@ -219,7 +215,7 @@ def check(item):
|
||||
############## Fondo Pagina
|
||||
# da adattare al canale
|
||||
def search(item, text):
|
||||
support.info('search', item)
|
||||
logger.debug(text)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/index.php?do=search&story=%s&subaction=search' % (text)
|
||||
@@ -227,35 +223,35 @@ def search(item, text):
|
||||
# se il canale è solo film, si può omettere, altrimenti bisgona aggiungerlo e discriminare.
|
||||
item.contentType = item.contentType
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info('search log:', line)
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
# da adattare al canale
|
||||
# inserire newest solo se il sito ha la pagina con le ultime novità/aggiunte
|
||||
# altrimenti NON inserirlo
|
||||
def newest(categoria):
|
||||
support.info('newest ->', categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == 'peliculas':
|
||||
if category == 'movie':
|
||||
item.url = host
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == 'peliculas':
|
||||
if itemlist[-1].action == 'movies':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('newest log: ', {0}.format(line))
|
||||
logger.debug('newest log: ', {0}.format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -265,5 +261,5 @@ def newest(categoria):
|
||||
# sia per i siti con hdpass
|
||||
#support.server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=True)
|
||||
def findvideos(item):
|
||||
support.info('findvideos ->', item)
|
||||
logger.debug()
|
||||
return support.server(item, headers=headers)
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
"id": "1337x",
|
||||
"name": "1337x",
|
||||
"language": ["ita", "sub-ita", "eng"],
|
||||
"active": true,
|
||||
"thumbnail": "1337x.png",
|
||||
"banner": "1337x.png",
|
||||
"categories": ["movie", "tvshow", "torrent"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "itaSearch",
|
||||
"type": "bool",
|
||||
"label": "Cerca contenuti in italiano",
|
||||
"default": false,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,193 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per 1337x
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import inspect
|
||||
from core import support
|
||||
from platformcode import logger, config
|
||||
|
||||
# host = support.config.get_channel_url()
|
||||
host = 'https://www.1337x.to'
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
menu = [('Film ITA {bullet bold}',['/movie-lib-sort/all/it/popularity/desc/all/1/', 'peliculas', '', 'movie']),
|
||||
('Film {submenu}',['/movie-library/1/', 'peliculas', 'filter', 'movie']),
|
||||
('Serie TV {bullet bold}',['/series-library/', 'az', '', 'tvshow'])]
|
||||
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def moviefilter(item):
|
||||
if logger.testMode:
|
||||
return host +'/movie-lib-sort/all/all/score/desc/all/1/'
|
||||
from platformcode import platformtools
|
||||
|
||||
item.args = ''
|
||||
controls = []
|
||||
data = support.match(item).data
|
||||
|
||||
patronBlock = r'<select name="{}"[^>]+>(.+?)</select>'
|
||||
patron = r'value="([^"]+)">([^<]+)'
|
||||
|
||||
genres = support.match(data, patronBlock=patronBlock.format('genre'), patron=patron).matches
|
||||
years = support.match(data, patronBlock=patronBlock.format('year'), patron=patron).matches
|
||||
langs = support.match(data, patronBlock=patronBlock.format('lang'), patron=patron).matches
|
||||
sorts = support.match(data, patronBlock=patronBlock.format('sortby'), patron=patron).matches
|
||||
orders = support.match(data, patronBlock=patronBlock.format('sort'), patron=patron).matches
|
||||
|
||||
item.genreValues = [x[0] for x in genres]
|
||||
item.yearValues = [x[0] for x in years]
|
||||
item.langValues = [x[0] for x in langs]
|
||||
item.sortValues = [x[0] for x in sorts]
|
||||
item.orderValues = [x[0] for x in orders]
|
||||
|
||||
genres = [g[1] for g in genres]
|
||||
years = [g[1] for g in years]
|
||||
langs = [g[1] for g in langs]
|
||||
sorts = [g[1] for g in sorts]
|
||||
orders = [g[1] for g in orders]
|
||||
|
||||
controls.append({'id': 'lang', 'label': 'Lingua', 'type': 'list', 'enabled':True, 'visible':True, 'lvalues':langs, 'default': 0})
|
||||
controls.append({'id': 'genre', 'label': 'Genere', 'type': 'list', 'enabled':True, 'visible':True, 'lvalues':genres, 'default': 0})
|
||||
controls.append({'id': 'year', 'label': 'Anno', 'type': 'list', 'enabled':True, 'visible':True, 'lvalues':years, 'default': 0})
|
||||
controls.append({'id': 'sort', 'label': 'Anno', 'type': 'list', 'enabled':True, 'visible':True, 'lvalues':sorts, 'default': 0})
|
||||
controls.append({'id': 'order', 'label': 'Anno', 'type': 'list', 'enabled':True, 'visible':True, 'lvalues':orders, 'default': 0})
|
||||
return platformtools.show_channel_settings(list_controls=controls, item=item, caption='Filtro', callback='filtered')
|
||||
|
||||
|
||||
|
||||
def filtered(item, values):
|
||||
genre = item.genreValues[values['genre']]
|
||||
lang = item.langValues[values['lang']]
|
||||
sortby = item.sortValues[values['sort']]
|
||||
order = item.orderValues[values['order']]
|
||||
year = item.yearValues[values['year']]
|
||||
|
||||
return '{}/movie-lib-sort/{}/{}/{}/{}/{}/1/'.format(host, genre, lang, sortby, order, year)
|
||||
|
||||
|
||||
def az(item):
|
||||
import string
|
||||
itemlist = [item.clone(title='1-9', url=item.url +'num/1/', action='peliculas', thumbnail=support.thumb('az'))]
|
||||
for letter in list(string.ascii_lowercase):
|
||||
itemlist.append(item.clone(title=letter.upper(), url=item.url + letter +'/1/', action='peliculas', thumbnail=support.thumb('az')))
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info('search', text)
|
||||
item.args = 'search'
|
||||
if config.get_setting('itaSearch', channel=item.channel, default=False):
|
||||
text += ' ita'
|
||||
text = text.replace(' ', '+')
|
||||
item.url = '{}/search/{}/1/'.format(host, text)
|
||||
try:
|
||||
return peliculas(item)
|
||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("search except: ", line)
|
||||
return []
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
if item.args == 'filter':
|
||||
item.url = moviefilter(item)
|
||||
if not item.url:
|
||||
data = ' '
|
||||
else:
|
||||
data = support.match(item).data
|
||||
|
||||
if item.args == 'search':
|
||||
sceneTitle = 'undefined'
|
||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<(?:[^>]+>){3,7}(?P<seed>[^<]+)<(?:[^>]+>){6}(?P<size>[^<]+)<span'
|
||||
patronNext = r'"([^"]+)">>>'
|
||||
elif item.contentType == 'movie':
|
||||
patron = r'<img alt="[^"]*" data-original="(?P<thumb>[^"]+)(?:[^>]+>){15}(?P<title>[^<]+)(?:[^>]+>){18,23}\s*<a href="(?P<url>[^"]+)'
|
||||
patronNext = r'"([^"]+)">>>'
|
||||
else:
|
||||
action = 'seasons'
|
||||
patron = r'<img src="(?P<thumb>[^"]+)(?:[^>]+>){4}\s*<a href="(?P<url>[^"]+)[^>]+>(?P<title>[^<]+)'
|
||||
|
||||
if (item.args == 'search' or item.contentType != 'movie') and not support.stackCheck(['get_channel_results']):
|
||||
patronNext = None
|
||||
def itemlistHook(itemlist):
|
||||
lastUrl = support.match(data, patron=r'href="([^"]+)">Last').match
|
||||
if lastUrl:
|
||||
currentPage = support.match(item.url, string=True, patron=r'/(\d+)/').match
|
||||
nextPage = int(currentPage) + 1
|
||||
support.nextPage(itemlist, item, next_page=item.url.replace('/{}'.format(currentPage), '/{}'.format(nextPage)), function_or_level='peliculas')
|
||||
return itemlist
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def seasons(item):
|
||||
item.contentType = 'season'
|
||||
action = 'episodios'
|
||||
patron = r'<li>\s*<a href="(?P<url>[^"]+)[^>]+>\s*<img alt="[^"]*"\ssrc="(?P<thumb>[^"]+)(?:([^>]+)>){2}\s*(?P<title>\w+ (?P<season>\d+))'
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
patron = r'<img src="(?P<thumb>[^"]+)(?:[^>]+>){13}\s*(?P<season>\d+)x(?P<episode>\d+)\s*<span class="seperator">(?:[^>]+>){2}\s*<a href="(?P<url>[^"]+)">(?P<title>[^<]+)'
|
||||
def itemlistHook(itemlist):
|
||||
itemlist.reverse()
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
item.disableAutoplay = True
|
||||
if item.args == 'search':
|
||||
itemlist.append(item.clone(server='torrent', action='play'))
|
||||
else:
|
||||
from lib.guessit import guessit
|
||||
|
||||
items = support.match(item.url, patron=r'<a href="([^"]+)">([^<]+)<(?:[^>]+>){3}([^<]+)<(?:[^>]+>){6}([^<]+)<span').matches
|
||||
|
||||
for url, title, seed, size in items:
|
||||
parsedTitle = guessit(title)
|
||||
|
||||
title = support.scrapertools.unescape(parsedTitle.get('title', ''))
|
||||
|
||||
lang = ''
|
||||
if parsedTitle.get('language'):
|
||||
langs = parsedTitle.get('language')
|
||||
if isinstance(langs, list):
|
||||
lang = 'MULTI'
|
||||
else:
|
||||
lang = vars(langs).get('alpha3').upper()
|
||||
if not (lang.startswith('MUL') or lang.startswith('ITA')):
|
||||
subs = parsedTitle.get('subtitle_language')
|
||||
if isinstance(subs, list):
|
||||
lang = 'Multi-Sub'
|
||||
else:
|
||||
lang = vars(subs).get('alpha3').upper()
|
||||
if lang:
|
||||
title = '{} [{}]'.format(title, lang)
|
||||
|
||||
sizematch = support.match(size, patron='(\d+(?:\.\d+)?)\s* (\w+)').match
|
||||
sizenumber = float(sizematch[0])
|
||||
if sizematch[1].lower() == 'gb':
|
||||
sizenumber = sizenumber * 1024
|
||||
|
||||
itemlist.append(item.clone(title = '{} [{} SEEDS] [{}]'.format(title, seed, size), seed=int(seed), size=sizenumber, url=host + url, server='torrent', action='play'))
|
||||
itemlist.sort(key=lambda it: (it.seed, it.size), reverse=True)
|
||||
|
||||
Videolibrary = True if 'movie' in item.args else False
|
||||
return support.server(item, itemlist=itemlist, Videolibrary=Videolibrary, Sorted=False)
|
||||
|
||||
|
||||
def play(item):
|
||||
from core import servertools
|
||||
data = support.match(item.url, patron=r'href="(magnet[^"]+)').match
|
||||
return servertools.find_video_items(item, data=data)
|
||||
@@ -3,6 +3,7 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
# 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.*"
|
||||
try:
|
||||
@@ -10,3 +11,4 @@ try:
|
||||
import core
|
||||
except:
|
||||
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")))
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import random
|
||||
from core import httptools, support
|
||||
from core import httptools, support, config
|
||||
from platformcode import logger
|
||||
|
||||
host = 'https://www.accuradio.com'
|
||||
@@ -12,29 +12,27 @@ api_url = host + '/c/m/json/{}/'
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
itemlist = []
|
||||
item.action = 'peliculas'
|
||||
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(
|
||||
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
||||
title=support.typo(it['name'],'italic') + support.typo(it.get('channels',''),'_ [] color kod')
|
||||
))
|
||||
for it in js.get('brands',[]):
|
||||
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')
|
||||
extraInfo = it.get('channels',''),
|
||||
title=it['name'],
|
||||
thumbnail = support.thumb('music')
|
||||
))
|
||||
|
||||
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)
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
tmdbEnabled = False
|
||||
action = 'playradio'
|
||||
patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)'
|
||||
return locals()
|
||||
@@ -68,7 +66,7 @@ def playradio(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
item.url = host + '/search/' + text
|
||||
itemlist = []
|
||||
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
|
||||
if 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
|
||||
itemlist += peliculas(item)
|
||||
itemlist += movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "altadefinizione",
|
||||
"name": "Altadefinizione",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"thumbnail": "altadefinizione.png",
|
||||
"banner": "altadefinizione.png",
|
||||
"categories": ["movie", "tvshow", "vos"],
|
||||
"settings": []
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per altadefinizione
|
||||
# ------------------------------------------------------------
|
||||
|
||||
|
||||
from core import httptools, support
|
||||
from platformcode import config, logger
|
||||
|
||||
|
||||
def findhost(url):
|
||||
host = support.match(url, patron=r'<h2[^>]+><a href="([^"]+)').match.rstrip('/')
|
||||
return host
|
||||
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
film = ['/category/film/',
|
||||
('Al Cinema', ['/al-cinema/', 'peliculas']),
|
||||
('Generi', ['', 'genres']),
|
||||
# ('Sub-ITA', ['/sub-ita/', 'peliculas'])
|
||||
]
|
||||
|
||||
tvshow = ['/category/serie-tv/',
|
||||
('Aggiornamenti Serie TV', ['/aggiornamenti-serie-tv/', 'peliculas']),]
|
||||
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action = 'peliculas'
|
||||
blacklist = ['Scegli il Genere', 'Film', 'Serie TV', 'Sub-Ita', 'Anime']
|
||||
patronMenu = r'<option value="(?P<url>[^"]+)">(?P<title>[^<]+)'
|
||||
def itemlistHook(itemlist):
|
||||
itl = []
|
||||
for item in itemlist:
|
||||
if len(item.fulltitle) != 3:
|
||||
itl.append(item)
|
||||
return itl
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
item.url = "{}/search/{}/feed/rss2/".format(host, text)
|
||||
item.args = 'search'
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
n = '22' if '/?s=' in item.url else '8'
|
||||
item.contentType = "undefined"
|
||||
action = 'check'
|
||||
patron = r'src="(?P<poster>http[^"]+)(?:[^>]+>){4}\s*<a href="(?P<url>[^"]+)[^>]+>\s*(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*</a>\s*</h2>'
|
||||
if item.args == 'search':
|
||||
patron = r'<title>(?P<title>[^\[\(\<]+)(?:\[(?P<quality>[^\]]+)\])?\s*(?:\((?P<lang>[a-zA-z-]+)\))?\s*(?:\((?P<year>\d+)\))?\s*[^>]+>\s*<link>(?P<url>[^<]+)'
|
||||
patronNext = r'href="([^"]+)[^>]+>Successivo'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
item.quality = ''
|
||||
data = item.data
|
||||
action='findvideos'
|
||||
# debug=True
|
||||
patronBlock = r'<span>\s*\w+\s*[Ss]tagione.*?(?P<lang>(?:[Ss][Uu][Bb][-]?)?[Ii][Tt][Aa])(?: in )?(?P<quality>[^<]*)?(?:[^>]+>){4}(?P<block>.*?)/p>'
|
||||
patron = r'(?P<season>\d+)x(?P<episode>\d+)[^>]+>(?P<data>.*?)(?:</table)'
|
||||
return locals()
|
||||
|
||||
|
||||
def check(item):
|
||||
item.data = httptools.downloadpage(item.url).data
|
||||
if 'Stagione' in item.data:
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
else:
|
||||
return findvideos(item)
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
if item.contentType == 'movie' and isinstance(item.data, str):
|
||||
item.data = support.match(item.data, patron=r'data-id="([^"]+)').matches
|
||||
return support.server(item, item.data)
|
||||
@@ -5,6 +5,6 @@
|
||||
"active": true,
|
||||
"thumbnail": "altadefinizione01.png",
|
||||
"banner": "altadefinizione01.png",
|
||||
"categories": ["movie", "vos"],
|
||||
"categories": ["movie", "sub"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -2,22 +2,11 @@
|
||||
# ------------------------------------------------------------
|
||||
# Canale per altadefinizione01
|
||||
# ------------------------------------------------------------
|
||||
"""
|
||||
|
||||
Eccezioni note che non superano il test del canale:
|
||||
|
||||
Avvisi:
|
||||
- L'url si prende da questo file.
|
||||
- è presente nelle novità-> Film.
|
||||
|
||||
Ulteriori info:
|
||||
|
||||
"""
|
||||
from core import scrapertools, httptools, support
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
|
||||
# def findhost(url):
|
||||
# data = httptools.downloadpage(url).data
|
||||
# host = scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||
@@ -32,86 +21,81 @@ headers = [['Referer', host]]
|
||||
def mainlist(item):
|
||||
|
||||
film = [
|
||||
('Al Cinema', ['/cinema/', 'peliculas', 'pellicola']),
|
||||
('Ultimi Aggiornati-Aggiunti', ['','peliculas', 'update']),
|
||||
('Al Cinema', ['/cinema/', 'movies', 'pellicola']),
|
||||
('Ultimi Aggiornati-Aggiunti', ['','movies', 'update']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Lettera', ['/catalog/a/', 'genres', 'orderalf']),
|
||||
('Lettera', ['/catalog/a/', 'genres', 'az']),
|
||||
('Anni', ['', 'genres', 'years']),
|
||||
('Sub-ITA', ['/sub-ita/', 'peliculas', 'pellicola'])
|
||||
('Sub-ITA', ['/sub-ita/', 'movies', 'pellicola'])
|
||||
]
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.info('peliculas', item)
|
||||
def movies(item):
|
||||
|
||||
## deflang = 'ITA'
|
||||
action="findvideos"
|
||||
|
||||
patron = r'<div class="cover boxcaption"> +<h2>\s*<a href="(?P<url>[^"]+)">(?P<title>[^<]+).*?src="(?P<thumb>[^"]+).*?<div class="trdublaj">(?P<quality>[^<]+).*?<span class="ml-label">(?P<year>[0-9]+).*?<span class="ml-label">(?P<duration>[^<]+).*?<p>(?P<plot>[^<]+)'
|
||||
patronNext = '<span>\d</span> <a href="([^"]+)">'
|
||||
|
||||
if item.args == "search":
|
||||
patronBlock = r'</script> <div class="boxgrid caption">(?P<block>.*)<div id="right_bar">'
|
||||
|
||||
elif item.args == 'update':
|
||||
patronBlock = r'<div class="widget-title">Ultimi Film Aggiunti/Aggiornati</div>(?P<block>.*?)<div id="alt_menu">'
|
||||
patron = r'style="background-image:url\((?P<thumb>[^\)]+).+?<p class="h4">(?P<title>.*?)</p>[^>]+> [^>]+> [^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+> [^>]+> [^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+|N/A)?.+?>.*?(?:>Film (?P<lang>Sub ITA)</a></p> )?<p>(?P<plot>[^<]+)<.*?href="(?P<url>[^"]+)'
|
||||
patronNext = '' # non ha nessuna paginazione
|
||||
elif item.args == 'orderalf':
|
||||
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 == 'az':
|
||||
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"' \
|
||||
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<' \
|
||||
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
|
||||
else:
|
||||
patronBlock = r'<div class="cover_kapsul ml-mask">(?P<block>.*)<div class="page_nav">'
|
||||
|
||||
# debug = True
|
||||
patronNext = r'<a href="([^"]+)">»'
|
||||
patronTotalPages = r'>(\d+)(?:[^>]+>){3}»'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.info('genres',item)
|
||||
action = "peliculas"
|
||||
action = "movies"
|
||||
|
||||
blacklist = ['Altadefinizione01']
|
||||
if item.args == 'genres':
|
||||
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':
|
||||
patronBlock = r'<ul class="anno_list">(?P<block>.*?)</li> </ul> </div>'
|
||||
patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
|
||||
elif item.args == 'orderalf':
|
||||
elif item.args == 'az':
|
||||
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
|
||||
patronMenu = '<a title=.*?href="(?P<url>[^"]+)"><span>(?P<title>.*?)</span>'
|
||||
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def orderalf(item):
|
||||
support.info('orderalf',item)
|
||||
def az(item):
|
||||
|
||||
action = 'findvideos'
|
||||
patron = r'<td class="mlnh-thumb"><a href="(?P<url>[^"]+)".*?src="(?P<thumb>[^"]+)"'\
|
||||
'.+?[^>]+>[^>]+ [^>]+[^>]+ [^>]+>(?P<title>[^<]+).*?[^>]+>(?P<year>\d{4})<'\
|
||||
'[^>]+>[^>]+>(?P<quality>[A-Z]+)[^>]+> <td class="mlnh-5">(?P<lang>.*?)</td>'
|
||||
patronNext = r'<span>[^<]+</span>[^<]+<a href="(.*?)">'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(item, text)
|
||||
logger.debug(text)
|
||||
|
||||
|
||||
|
||||
itemlist = []
|
||||
text = text.replace(" ", "+")
|
||||
item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text)
|
||||
item.args = "search"
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||
except:
|
||||
import sys
|
||||
@@ -119,18 +103,18 @@ def search(item, text):
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == "peliculas":
|
||||
if category == "movie":
|
||||
item.url = host
|
||||
item.action = "peliculas"
|
||||
item.action = "movies"
|
||||
item.contentType = 'movie'
|
||||
itemlist = peliculas(item)
|
||||
if itemlist[-1].action == "peliculas":
|
||||
itemlist = movies(item)
|
||||
if itemlist[-1].action == "movies":
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
@@ -142,9 +126,9 @@ def newest(categoria):
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.info('findvideos', item)
|
||||
logger.debug()
|
||||
data = httptools.downloadpage(item.url).data
|
||||
iframe = support.match(data, patron='src="(http[^"]+)" frameborder').match
|
||||
iframe = support.match(data, patron='player-container[^>]+>\s*<iframe[^>]+src="([^"]+)').match
|
||||
if iframe:
|
||||
item.url = iframe
|
||||
return support.server(item)
|
||||
|
||||
10
channels/altadefinizione01_link.json
Normal file
10
channels/altadefinizione01_link.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "altadefinizione01_link",
|
||||
"name": "Altadefinizione01 L",
|
||||
"active": false,
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "altadefinizione01_L.png",
|
||||
"banner": "altadefinizione01_L.png",
|
||||
"categories": ["movie","sub"],
|
||||
"settings" :[]
|
||||
}
|
||||
96
channels/altadefinizione01_link.py
Normal file
96
channels/altadefinizione01_link.py
Normal file
@@ -0,0 +1,96 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- Channel altadefinizione01_link -*-
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
__channel__ = "altadefinizione01_link"
|
||||
|
||||
# ======== def per utility INIZIO ============================
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
# =========== home menu ===================
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
film = [
|
||||
('Al Cinema', ['/film-del-cinema', 'movies', '']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Anni', ['', 'genres', 'years']),
|
||||
('Qualità', ['/piu-visti.html', 'genres', 'quality']),
|
||||
('Mi sento fortunato', ['/piu-visti.html', 'genres', 'lucky']),
|
||||
('Popolari', ['/piu-visti.html', 'movies', '']),
|
||||
('Sub-ITA', ['/film-sub-ita/', 'movies', ''])
|
||||
]
|
||||
return locals()
|
||||
|
||||
# ======== def in ordine di action dal menu ===========================
|
||||
|
||||
@support.scrape
|
||||
def movies(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+[^>]+>'
|
||||
patronNext = r'<span>\d</span> <a href="([^"]+)">'
|
||||
return locals()
|
||||
|
||||
# =========== def pagina categorie ======================================
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
|
||||
action = 'movies'
|
||||
if item.args == 'genres':
|
||||
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
||||
elif item.args == 'years':
|
||||
patronBlock = r'<ul class="listSubCat" id="Anno">(?P<block>.*)<ul class="listSubCat" id="Qualita">'
|
||||
elif item.args == 'quality':
|
||||
patronBlock = r'<ul class="listSubCat" id="Qualita">(?P<block>.*)<blockquote'
|
||||
elif item.args == 'lucky': # sono i titoli random nella pagina
|
||||
patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>'
|
||||
action = 'findvideos'
|
||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||
return locals()
|
||||
|
||||
# =========== def per cercare film/serietv =============
|
||||
#host+/index.php?do=search&story=avatar&subaction=search
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
itemlist = []
|
||||
text = text.replace(" ", "+")
|
||||
item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text)
|
||||
try:
|
||||
return movies(item)
|
||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
# =========== def per le novità nel menu principale =============
|
||||
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if category == "movie":
|
||||
item.url = host
|
||||
item.action = "movies"
|
||||
item.contentType='movie'
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == "movies":
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug('findvideos', item)
|
||||
return support.server(item, support.match(item, patron='<ul class="playernav">.*?</ul>', headers=headers).match)
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "altadefinizioneclick",
|
||||
"name": "AltadefinizioneClick",
|
||||
"active": false,
|
||||
"active": true,
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "altadefinizioneclick.png",
|
||||
"bannermenu": "altadefinizioneciclk.png",
|
||||
"categories": ["tvshow","movie","vos"],
|
||||
"not_active":["include_in_newest_series"],
|
||||
"categories": ["tvshow","movie","sub"],
|
||||
"not_active":["include_in_newest_tvshow"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -1,151 +1,178 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Altadefinizione Click
|
||||
# Canale per altadefinizioneclick
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from platformcode import logger
|
||||
from core import support
|
||||
from platformcode import config, logger
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
|
||||
def findhost(url):
|
||||
return support.match(url, patron=r'<div class="elementor-button-wrapper">\s*<a href="([^"]+)"').match
|
||||
data = support.httptools.downloadpage(url).data
|
||||
host = support.scrapertools.find_single_match(data, '<div class="elementor-button-wrapper">\s*<a href="([^"]+)"')
|
||||
return host
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
if host.endswith('/'):
|
||||
host = host[:-1]
|
||||
headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'}
|
||||
order = ['', 'i_piu_visti', 'i_piu_votati', 'i_piu_votati_dellultimo_mese', 'titolo_az', 'voto_imdb_piu_alto'][config.get_setting('order', 'altadefinizionecommunity')]
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
logger.debug(item)
|
||||
film = ['',
|
||||
('Novità', ['/nuove-uscite/', 'movies', 'news']),
|
||||
('Al Cinema', ['/al-cinema/', 'movies', 'cinema']),
|
||||
('A-Z',['/lista-film/', 'genres', 'az']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Anni', ['', 'genres', 'years']),
|
||||
('Qualità', ['', 'genres', 'quality']),
|
||||
('Mi sento Fortunato',[ '', 'genres', 'lucky']),
|
||||
('Sub-ITA', ['/sub-ita/', 'movies', 'sub'])
|
||||
]
|
||||
|
||||
film = ['/type/movie',
|
||||
('Generi', ['/type/movie', 'genres', 'genres']),
|
||||
('Anni', ['/type/movie', 'genres', 'year']),]
|
||||
tvshow = ['/serie-tv/']
|
||||
|
||||
tvshow = ['/serie-tv/tvshow',
|
||||
('Generi', ['/serie-tv/tvshow', 'genres', 'genres']),
|
||||
('Anni', ['/serie-tv/tvshow', 'genres', 'year'])]
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
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>)'
|
||||
|
||||
if item.args == 'az':
|
||||
patron = r'<img style="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)" [^>]+>(?P<title>[^<\[]+)(?:\[(?P<lang>[^\]]+)\]\s*)?<'\
|
||||
r'[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<year>\d{4})[^>]+>[^>]+>\s*(?P<quality>[^<]+).*?<span class="label">(?P<ratting>[^<]+)<'
|
||||
patronBlock =''
|
||||
|
||||
elif item.args == 'search':
|
||||
patronBlock = r'<section id="lastUpdate">(?P<block>.*?)(?:<div class="row ismobile">|<section)'
|
||||
patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:\s*<span class="year">(?P<year>[^<]+)<\/span>)?(?:\s*<span class="hd">(?P<quality>[^<]+)<\/span>)?[^>]+>\s*<img[^s]+src="(?P<thumb>[^"]+)"(?:(?:[^>]+>){5}\s*(?P<rating>[^<]+))?(?:[^>]+>){4}(?P<title>[^<]+)'
|
||||
|
||||
if not item.args:
|
||||
# patronBlock = r'(?:ULTIMI INSERITI|Serie TV)(?P<block>.*?)</section'
|
||||
patronBlock = r'({})(?P<block>.*?)</section'.format('ULTIMI INSERITI' if item.contentType == 'movie' else 'Serie TV')
|
||||
# debugBlock = True
|
||||
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
||||
patronTotalPages = r'>(\d+)(?:[^>]+>){3}<a class="next'
|
||||
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action = 'movies'
|
||||
patronGenreMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||
|
||||
def search(item, texto):
|
||||
logger.debug("search ", texto)
|
||||
if item.args == 'genres':
|
||||
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
||||
elif item.args == 'years':
|
||||
patronBlock = r'<ul class="listSubCat" id="Anno">(?P<block>.*)<ul class="listSubCat" id="Qualita">'
|
||||
elif item.args == 'quality':
|
||||
patronBlock = r'<ul class="listSubCat" id="Qualita">(?P<block>.*)</li>\s*?</ul>\s*?</div>\s*?</div>\s*?</div>\s*?<a'
|
||||
elif item.args == 'lucky': # sono i titoli random nella pagina
|
||||
patronBlock = r'<h3 class="titleSidebox dado">FILM RANDOM</h3>(?P<block>.*)</section>'
|
||||
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<[]+)(?:\[(?P<lang>.+?)\])?<'
|
||||
action = 'findvideos'
|
||||
elif item.args == 'az':
|
||||
blacklist = ['FILM 4K IN STREAMING']
|
||||
patron = r'<a title="(?P<title>[^"]+)" href="(?P<url>[^"]+)"'
|
||||
item.args = 'az'
|
||||
if not item.args == 'az':
|
||||
item.args = 'genres'
|
||||
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
|
||||
item.args = 'search'
|
||||
item.url = host + "/search?s={}&f={}&page=1".format(texto, item.contentType)
|
||||
item.url = host + "?s=" + text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
logger.debug(item)
|
||||
data = support.httptools.downloadpage(item.url, cloudscraper=True).data
|
||||
blacklist= ['Film', 'Serie TV']
|
||||
|
||||
if item.args == 'genres':
|
||||
categories ={}
|
||||
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':
|
||||
patron = 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>'
|
||||
action = 'peliculas'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
item.quality = 'HD'
|
||||
json = {}
|
||||
params ={'type':item.contentType, 'anno':item.year_id, 'quality':item.quality_id, 'cat':item.cat_id, 'order':order}
|
||||
|
||||
|
||||
if item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
else:
|
||||
action = 'episodios'
|
||||
if not item.page: item.page = 1
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
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
|
||||
if category == "movie":
|
||||
item.args = 'news'
|
||||
item.contentType = 'movie'
|
||||
item.url = host + "/nuove-uscite/"
|
||||
item.action = "movies"
|
||||
itemlist = movies(item)
|
||||
|
||||
url = '{}/load-more-film?{}'.format(host, support.urlencode(params))
|
||||
json = support.httptools.downloadpage(url, headers=headers).json
|
||||
data = "\n".join(json['data'])
|
||||
if itemlist[-1].action == "movies":
|
||||
itemlist.pop()
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
data = ' '
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
from platformcode import logger
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
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-]+))?'
|
||||
# patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">[^>]+>(?P<year>\d+)(?:[^>]+>){2}(?P<rating>[^<]+)(?:[^>]+>){2}(?P<quality>[^<]+)(?:[^>]+>){2}\s*<img src="(?P<thumb>[^"]+)(?:[^>]+>){3}(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
|
||||
return itemlist
|
||||
|
||||
# paginazione
|
||||
if json.get('have_next') or 'have_next_film=true' in data:
|
||||
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='peliculas')
|
||||
return itemlist
|
||||
|
||||
return locals()
|
||||
def check(item):
|
||||
item.contentType = 'tvshow'
|
||||
def get_season(pageData, seas_url, season):
|
||||
data = ''
|
||||
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
||||
for episode_url, episode in episodes:
|
||||
title = season + "x" + episode.zfill(2) + ' - ' + item.fulltitle
|
||||
data += title + '|' + episode_url + '\n'
|
||||
return data
|
||||
|
||||
patron_season = '<div class="[^"]+" id="seasonsModal"[^>]+>(.*?)</ul>'
|
||||
patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>'
|
||||
patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>'
|
||||
|
||||
url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen')
|
||||
seasons = support.match(url.match, patronBlock=patron_season, patron=patron_option)
|
||||
if not seasons.match:
|
||||
item.contentType = 'tvshow'
|
||||
item.data = url.data
|
||||
return findvideos(item)
|
||||
|
||||
data = ''
|
||||
|
||||
import sys
|
||||
if sys.version_info[0] >= 3: from concurrent import futures
|
||||
else: from concurrent_py2 import futures
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
thL = []
|
||||
for i, season in enumerate(seasons.matches):
|
||||
thL.append(executor.submit(get_season, seasons.data if i == 0 else '', season[0], season[1]))
|
||||
for res in futures.as_completed(thL):
|
||||
if res.result():
|
||||
data += res.result()
|
||||
item.data = data
|
||||
return episodes(item)
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
logger.debug(item)
|
||||
# debug = True
|
||||
def episodes(item):
|
||||
data = item.data
|
||||
patron = r'class="playtvshow "\s+data-href="(?P<url>[^"]+)'
|
||||
|
||||
def itemHook(it):
|
||||
spl = it.url.split('/')[-2:]
|
||||
it.infoLabels['season'] = int(spl[0])+1
|
||||
it.infoLabels['episode'] = int(spl[1])+1
|
||||
it.url = it.url.replace('/watch-unsubscribed', '/watch-external')
|
||||
it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.fulltitle)
|
||||
return it
|
||||
patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)'
|
||||
action = 'findvideos'
|
||||
|
||||
def itemlistHook(itemlist):
|
||||
itemlist.sort(key=lambda item: (item.infoLabels['season'], item.infoLabels['episode']))
|
||||
return itemlist
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
playWindow = support.match(item, patron='(?:playWindow|iframe)" (?:href|src)="([^"]+)').match
|
||||
if host in playWindow:
|
||||
url = support.match(playWindow, patron='allowfullscreen[^<]+src="([^"]+)"').match
|
||||
else:
|
||||
url = playWindow
|
||||
itemlist.append(item.clone(action='play', url=url, quality=''))
|
||||
logger.debug()
|
||||
return support.hdpass_get_servers(item, item.data)
|
||||
|
||||
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
"id": "altadefinizionecommunity",
|
||||
"name": "Altadefinizione Community",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"active": true,
|
||||
"thumbnail": "altadefinizionecommunity.png",
|
||||
"banner": "",
|
||||
"categories": ["movie", "tvshow", "vos"],
|
||||
"categories": ["movie", "tvshow", "sub"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"settings": [
|
||||
{
|
||||
@@ -23,15 +23,5 @@
|
||||
"label": "password",
|
||||
"type": "text",
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "order",
|
||||
"type": "list",
|
||||
"label": "Ordine di Visualizzazione",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": [ "Nessuno", "I più visti", "I più votati", "I più votati dell'ultimo mese", "Titolo A-Z", "Voto IMDB più alto"]
|
||||
}
|
||||
]
|
||||
}]
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ 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.get_setting('order', 'altadefinizionecommunity')]
|
||||
order = ['', 'i_piu_visti', 'i_piu_votati', 'i_piu_votati_dellultimo_mese', 'titolo_az', 'voto_imdb_piu_alto'][config.getSetting('order', 'altadefinizionecommunity')]
|
||||
|
||||
|
||||
@support.menu
|
||||
@@ -49,7 +49,7 @@ def search(item, text):
|
||||
item.args = 'search'
|
||||
item.url = host + "/search?s={}&f={}".format(text.replace(' ', '+'), item.contentType)
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
@@ -87,19 +87,19 @@ def genres(item):
|
||||
patronMenu = r'quality/(?P<quality_id>[^"]+)">(?P<title>[^<]+)'
|
||||
patronBlock = r'Risoluzione(?P<block>.*?)</ul>'
|
||||
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(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 'episodios'
|
||||
action = 'findvideos' if item.contentType == 'movie' else 'episodes'
|
||||
|
||||
try:
|
||||
# support.dbg()
|
||||
@@ -132,15 +132,14 @@ def peliculas(item):
|
||||
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='peliculas')
|
||||
support.nextPage(itemlist, item, function_or_level='movies')
|
||||
return itemlist
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
registerOrLogin()
|
||||
def episodes(item):
|
||||
logger.debug(item)
|
||||
# debug = True
|
||||
data = item.data
|
||||
@@ -169,9 +168,9 @@ def findvideos(item):
|
||||
def play(item):
|
||||
if host in item.url: # intercetto il server proprietario
|
||||
# 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:
|
||||
# platformtools.play_canceled = True
|
||||
# platformtools.playCanceled = True
|
||||
# return []
|
||||
else:
|
||||
return [item]
|
||||
@@ -181,9 +180,9 @@ def resolve_url(item):
|
||||
registerOrLogin()
|
||||
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="([^"]+)')
|
||||
video_url = playWindow.match
|
||||
videoUrl = playWindow.match
|
||||
item.data = playWindow.data
|
||||
item.url = video_url.replace('/watch-unsubscribed', '/watch-external')
|
||||
item.url = videoUrl.replace('/watch-unsubscribed', '/watch-external')
|
||||
return item
|
||||
|
||||
|
||||
@@ -196,33 +195,33 @@ def login():
|
||||
logger.info('Login in corso')
|
||||
post = {'_token': '',
|
||||
'form_action':'login',
|
||||
'email': config.get_setting('username', channel='altadefinizionecommunity'),
|
||||
'password':config.get_setting('password', channel='altadefinizionecommunity')}
|
||||
'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.dialog_ok('AltadefinizioneCommunity', 'Username/password non validi')
|
||||
platformtools.dialogOk('AltadefinizioneCommunity', 'Username/password non validi')
|
||||
return False
|
||||
|
||||
return 'id="logged"' in r.data
|
||||
|
||||
|
||||
def registerOrLogin():
|
||||
if config.get_setting('username', channel='altadefinizionecommunity') and config.get_setting('password', channel='altadefinizionecommunity'):
|
||||
if config.getSetting('username', channel='altadefinizionecommunity') and config.getSetting('password', channel='altadefinizionecommunity'):
|
||||
if login():
|
||||
return True
|
||||
|
||||
action = platformtools.dialog_yesno('AltadefinizioneCommunity',
|
||||
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.get_setting('username', channel='altadefinizionecommunity')
|
||||
password_pre = config.get_setting('password', channel='altadefinizionecommunity')
|
||||
user_pre = config.getSetting('username', channel='altadefinizionecommunity')
|
||||
password_pre = config.getSetting('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')
|
||||
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()
|
||||
@@ -236,7 +235,7 @@ def registerOrLogin():
|
||||
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)
|
||||
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)
|
||||
@@ -244,27 +243,27 @@ def registerOrLogin():
|
||||
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)
|
||||
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.dialog_ok('AltadefinizioneCommunity', 'Indirizzo mail già utilizzato')
|
||||
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.set_setting('username', mailbox.address, channel='altadefinizionecommunity')
|
||||
config.set_setting('password', randPsw, channel='altadefinizionecommunity')
|
||||
platformtools.dialog_ok('AltadefinizioneCommunity',
|
||||
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.dialog_ok('AltadefinizioneCommunity', 'Impossibile registrarsi automaticamente')
|
||||
platformtools.dialogOk('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']
|
||||
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:
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "animealtadefinizione",
|
||||
"name": "AnimealtAdefinizione",
|
||||
"name": "AnimealtaDefinizione",
|
||||
"active": true,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animealtadefinizione.png",
|
||||
"banner": "animealtadefinizione.png",
|
||||
"categories": ["anime", "sub-ita"],
|
||||
"categories": ["anime", "sub"],
|
||||
"default_off": ["include_in_newest"],
|
||||
"settings": [
|
||||
{
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
# Canale per animealtadefinizione
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from platformcode import platformtools
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
perpage_list = ['20','30','40','50','60','70','80','90','100']
|
||||
perpage = perpage_list[support.config.get_setting('perpage' , 'animealtadefinizione')]
|
||||
epPatron = r'<td>\s*(?P<title>[^<]+)[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>\s*<img[^>]+/Streaming'
|
||||
perpage = perpage_list[support.config.getSetting('perpage' , 'animealtadefinizione')]
|
||||
epPatron = r'<td>\s*(?P<title>[^<]+)[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
||||
|
||||
|
||||
@support.menu
|
||||
@@ -19,91 +21,92 @@ def mainlist(item):
|
||||
('Tipo',['', 'menu', 'Anime']),
|
||||
('Anno',['', 'menu', 'Anno']),
|
||||
('Genere', ['', 'menu','Genere']),
|
||||
('Ultimi Episodi',['', 'peliculas', 'last'])]
|
||||
('Ultimi Episodi',['', 'movies', 'last'])]
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
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>'
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||
if 'genere' in item.args.lower():
|
||||
patronGenreMenu = patronMenu
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info(texto)
|
||||
item.search = texto
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
item.search = text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.url = host
|
||||
item.args = "last"
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
if '/movie/' in item.url:
|
||||
item.contentType = 'movie'
|
||||
action='findvideos'
|
||||
elif item.args == 'last':
|
||||
item.contentType = 'episode'
|
||||
action='episodios'
|
||||
action='findvideos'
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
action='episodios'
|
||||
action='episodes'
|
||||
if item.search:
|
||||
query = 's'
|
||||
searchtext = item.search
|
||||
else:
|
||||
query='category_name'
|
||||
searchtext = item.url.split('/')[-2]
|
||||
if not item.pag: item.pag = 1
|
||||
# debug = True
|
||||
anime = True
|
||||
data = support.match(host + '/wp-admin/admin-ajax.php', post='action=itajax-sort&loop=main+loop&location=&thumbnail=1&rating=1sorter=recent&columns=4&numarticles='+perpage+'&paginated='+str(item.pag)+'¤tquery%5B'+query+'%5D='+searchtext).data.replace('\\','')
|
||||
|
||||
page = 1 if not item.page else item.page
|
||||
|
||||
numerationEnabled = True
|
||||
post = 'action=itajax-sort&loop=main+loop&location=&thumbnail=1&rating=1sorter=recent&columns=4&numarticles={}&paginated={}¤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'
|
||||
typeContentDict = {'movie':['movie']}
|
||||
typeActionDict = {'findvideos':['movie']}
|
||||
|
||||
def itemHook(item):
|
||||
item.url = support.re.sub('episodio-[0-9-]+', '', item.url)
|
||||
return item
|
||||
|
||||
def itemlistHook(itemlist):
|
||||
if item.search:
|
||||
itemlist = [ it for it in itemlist if ' Episodio ' not in it.title ]
|
||||
if len(itemlist) == int(perpage):
|
||||
item.pag += 1
|
||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas'))
|
||||
support.nextPage(itemlist, item, 'movies', page=page + 1, total_pages=int(res.match))
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
anime = True
|
||||
# debug = True
|
||||
pagination = int(perpage)
|
||||
def episodes(item):
|
||||
numerationEnabled = True
|
||||
pagination = True
|
||||
patron = epPatron
|
||||
return locals()
|
||||
|
||||
@@ -113,10 +116,9 @@ def findvideos(item):
|
||||
if item.contentType == 'movie':
|
||||
matches = support.match(item, patron=epPatron).matches
|
||||
for title, url in matches:
|
||||
# support.dbg()
|
||||
get_video_list(item, url, title, itemlist)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
# Canale per AnimeForce
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core import scrapertools, support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -11,83 +12,85 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
anime = ['/anime',
|
||||
('In Corso',['/anime/anime-status/in-corso/', 'peliculas', 'status']),
|
||||
('Completi',['/anime/anime-status/completo/', 'peliculas', 'status']),
|
||||
anime = ['/lista-anime/',
|
||||
('In Corso',['/anime/anime-status/in-corso/', 'movies', 'status']),
|
||||
('Completi',['/anime/anime-status/completo/', 'movies', 'status']),
|
||||
('Genere',['/anime', 'submenu', 'genre']),
|
||||
('Anno',['/anime', 'submenu', 'anime-year']),
|
||||
('Tipologia',['/anime', 'submenu', 'anime-type']),
|
||||
('Stagione',['/anime', 'submenu', 'anime-season']),
|
||||
('Ultime Serie',['/category/anime/articoli-principali/','peliculas','last'])
|
||||
('Ultime Serie',['/category/anime/articoli-principali/','movies','last'])
|
||||
]
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def submenu(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
patronBlock = r'data-taxonomy="' + item.args + r'"(?P<block>.*?)</select'
|
||||
patronMenu = r'<option class="level-\d+ (?P<url>[^"]+)"[^>]+>(?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):
|
||||
if not item.url.startswith('http'):
|
||||
item.url = host + '/anime/' + item.args + '/' + item.url
|
||||
item.title = support.typo(item.t, 'bold')
|
||||
item.url += host + '/anime/' + item.args + '/' + item.u
|
||||
# item.title = support.typo(item.t, 'bold')
|
||||
return item
|
||||
return locals()
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host
|
||||
item.args = 'newest'
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def search(item, text):
|
||||
support.info('search',text)
|
||||
logger.debug(text)
|
||||
item.search = text
|
||||
item.url = host + '/lista-anime/'
|
||||
item.contentType = 'tvshow'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
search = item.search
|
||||
anime = True
|
||||
action = 'check'
|
||||
numerationEnabled = True
|
||||
if 'movie' in item.url:
|
||||
action = 'findvideos'
|
||||
else:
|
||||
action = 'check'
|
||||
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
||||
|
||||
if search:
|
||||
patron = r'<a href="(?P<url>[^"]+)"\s*title="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
||||
if not item.args:
|
||||
pagination = True
|
||||
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)">'
|
||||
else:
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+>\s*<img src="(?P<thumb>[^"]+)" alt="(?P<title>.*?)(?: Sub| sub| SUB|")'
|
||||
|
||||
if item.args == 'newest': item.action = 'findvideos'
|
||||
|
||||
patronNext = '<li class="page-item disabled">(?:[^>]+>){4}<a class="page-link" href="([^"]+)'
|
||||
|
||||
def itemHook(item):
|
||||
if 'sub-ita' in item.url:
|
||||
if item.args != 'newest': item.title = item.title + support.typo('Sub-ITA','_ [] color kod')
|
||||
item.contentLanguage = 'Sub-ITA'
|
||||
return item
|
||||
|
||||
@@ -95,68 +98,76 @@ def peliculas(item):
|
||||
|
||||
|
||||
def check(item):
|
||||
m = support.match(item, headers=headers, patron=r'Tipologia[^>]+>\s*<a href="([^"]+)"')
|
||||
m = support.match(item, headers=headers, patron=r'Tipologia[^>]+><a href="([^"]+)"')
|
||||
item.data = m.data
|
||||
if 'movie' in m.match:
|
||||
item.contentType = 'movie'
|
||||
return findvideos(item)
|
||||
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
|
||||
pagination = 50
|
||||
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>[^"]+)"[^>]+>(?P<episode>\d+)'
|
||||
else:
|
||||
patron = r'<a\s*href="(?P<url>[^"]+)"\s*title="(?P<title>[^"]+)"\s*class="btn btn-dark mb-1">(?P<episode>\d+)'
|
||||
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):
|
||||
support.info(item)
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
if item.data:
|
||||
url = support.match(item.data, patron=r'<a\s*href="([^"]+)"\s*title="[^"]+"\s*class="btn btn-dark mb-1">').match
|
||||
|
||||
if 'adf.ly' in item.url:
|
||||
from servers.decrypters import adfly
|
||||
url = adfly.get_long_url(item.url)
|
||||
|
||||
elif 'bit.ly' in item.url:
|
||||
url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||
|
||||
else:
|
||||
url = item.url
|
||||
url = host
|
||||
for u in item.url.split('/'):
|
||||
if u and 'animeforce' not in u and 'http' not in u:
|
||||
url += '/' + u
|
||||
|
||||
# if 'adf.ly' in item.url:
|
||||
# from servers.decrypters import adfly
|
||||
# url = adfly.get_long_url(item.url)
|
||||
|
||||
# elif 'bit.ly' in item.url:
|
||||
# url = support.httptools.downloadpage(item.url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||
|
||||
# else:
|
||||
# url = host
|
||||
# for u in item.url.split('/'):
|
||||
# if u and 'animeforce' not in u and 'http' not in u:
|
||||
# url += '/' + u
|
||||
|
||||
|
||||
# if 'php?' in url:
|
||||
# url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||
# url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
|
||||
# else:
|
||||
# if item.data: url = item.data
|
||||
# if item.contentType == 'movie': url = support.match()
|
||||
# url = support.match(url, patron=r'data-href="([^"]+)" target').match
|
||||
# if not url: url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
|
||||
# if url.startswith('//'): url = 'https:' + url
|
||||
# elif url.startswith('/'): url = 'https:/' + url
|
||||
url = support.match(url, patron=r'data-href="([^"]+)" target').match
|
||||
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'))
|
||||
if 'php?' in url:
|
||||
url = support.httptools.downloadpage(url, only_headers=True, follow_redirects=False).headers.get("location")
|
||||
url = support.match(url, patron=r'class="button"><a href=(?:")?([^" ]+)', headers=headers).match
|
||||
else:
|
||||
if item.data: url = item.data
|
||||
url = support.match(url, patron=r'data-href="([^"]+)" target').match
|
||||
if not url: url = support.match(url, patron=[r'<source src=(?:")?([^" ]+)',r'name="_wp_http_referer" value="([^"]+)"']).match
|
||||
if 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'))
|
||||
else: itemlist.append(item.clone(action="play", title=support.config.getLocalizedString(30137), url=url, server='directo'))
|
||||
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
11
channels/animeleggendari.json
Normal file
11
channels/animeleggendari.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "animeleggendari",
|
||||
"name": "AnimePerTutti",
|
||||
"active": false,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animepertutti.png",
|
||||
"bannermenu": "animepertutti.png",
|
||||
"categories": ["anime", "sub"],
|
||||
"not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"],
|
||||
"settings": []
|
||||
}
|
||||
142
channels/animeleggendari.py
Normal file
142
channels/animeleggendari.py
Normal file
@@ -0,0 +1,142 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per animeleggendari
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
from lib.js2py.host import jsfunctions
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
||||
['Referer', host]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
anime = [
|
||||
# ('Leggendari', ['/category/anime-leggendari/', 'movies']),
|
||||
('ITA', ['/category/anime-ita/', 'movies']),
|
||||
('SUB-ITA', ['/category/anime-sub-ita/', 'movies']),
|
||||
('Conclusi', ['/category/serie-anime-concluse/', 'movies']),
|
||||
('in Corso', ['/category/serie-anime-in-corso/', 'movies']),
|
||||
('Genere', ['', 'genres'])
|
||||
]
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
|
||||
item.url = host + "/?s=" + text
|
||||
try:
|
||||
return movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
blacklist = ['Contattaci','Privacy Policy', 'DMCA']
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||
patronBlock = r'Generi</a>\s*<ul[^>]+>(?P<block>.*?)<\/ul>'
|
||||
action = 'movies'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
numerationEnabled = True
|
||||
blacklist = ['top 10 anime da vedere']
|
||||
if item.url != host: patronBlock = r'<div id="main-content(?P<block>.*?)<aside'
|
||||
patron = r'<figure class="(?:mh-carousel-thumb|mh-posts-grid-thumb)">\s*<a (?:class="[^"]+" )?href="(?P<url>[^"]+)" title="(?P<title>.*?)(?: \((?P<year>\d+)\))? (?:(?P<lang>SUB ITA|ITA))(?: (?P<title2>[Mm][Oo][Vv][Ii][Ee]))?[^"]*"><img (?:class="[^"]+"|width="[^"]+" height="[^"]+") src="(?P<thumb>[^"]+)"[^>]+'
|
||||
def itemHook(item):
|
||||
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.typo('Movie','_ () bold')
|
||||
item.contentType = 'movie'
|
||||
item.action = 'findvideos'
|
||||
return item
|
||||
def itemlistHook(itemlist):
|
||||
itlist = []
|
||||
for item in itemlist:
|
||||
if 'nuovo episodio:' not in item.title.lower():
|
||||
itlist += [item]
|
||||
return itlist
|
||||
|
||||
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
||||
action = 'episodes'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodes(item):
|
||||
data = support.match(item, headers=headers, patronBlock=r'entry-content clearfix">(.*?)class="mh-widget mh-posts-2 widget_text').block
|
||||
if not 'pagination clearfix' in data:
|
||||
logger.debug('NOT IN DATA')
|
||||
patron = r'<iframe.*?src="(?P<url>[^"]+)"'
|
||||
title = item.title
|
||||
def fullItemlistHook(itemlist):
|
||||
if len(itemlist) > 0:
|
||||
urls = []
|
||||
for item in itemlist:
|
||||
urls.append(item.url)
|
||||
item = itemlist[0]
|
||||
item.data = urls
|
||||
item.title = title
|
||||
item.contentType = 'movie'
|
||||
itemlist = []
|
||||
itemlist.append(item)
|
||||
return itemlist
|
||||
else:
|
||||
url = item.url
|
||||
numerationEnabled = True
|
||||
patronBlock = r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(?P<block>.*?)</span></a></div>'
|
||||
patron = r'(?:<a href="(?P<url>[^"]+)"[^>]+>)?<span class="pagelink">(?P<episode>\d+)'
|
||||
def itemHook(item):
|
||||
if not item.url:
|
||||
item.url = url
|
||||
if 'Movie Parte' in data:
|
||||
item.title = item.fulltitle + ' - Part ' + item.title
|
||||
item.contentType = 'movie'
|
||||
else:
|
||||
item.title = 'Episodio ' + item.title
|
||||
return item
|
||||
return locals()
|
||||
|
||||
def check(item):
|
||||
data = support.match(item, headers=headers).data
|
||||
if 'Lista Episodi' not in data:
|
||||
item.data = data
|
||||
return findvideos(item)
|
||||
|
||||
data = ''
|
||||
return data
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
if item.data:
|
||||
data = item.data
|
||||
else:
|
||||
matches = support.match(item, patron=r'<iframe.*?src="(?P<url>[^"]+)"').matches
|
||||
data = ''
|
||||
if matches:
|
||||
for match in matches:
|
||||
try: data += str(jsfunctions.unescape(support.re.sub('@|g','%', match)))
|
||||
except: data += ''
|
||||
data += str(match)
|
||||
else:
|
||||
data = ''
|
||||
|
||||
return support.server(item,data)
|
||||
@@ -3,27 +3,23 @@
|
||||
# Canale per AnimeSaturn
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from lib import js2py
|
||||
from core import support
|
||||
from platformcode import config
|
||||
from platformcode.logger import debug
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
__channel__ = 'animesaturn'
|
||||
cookie = support.config.get_setting('cookie', __channel__)
|
||||
cookie = support.config.getSetting('cookie', __channel__)
|
||||
headers = {'X-Requested-With': 'XMLHttpRequest', 'Cookie': cookie}
|
||||
|
||||
|
||||
def get_cookie(data):
|
||||
global cookie, headers
|
||||
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]]
|
||||
|
||||
|
||||
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
|
||||
if 'ASCookie' in data:
|
||||
get_cookie(data)
|
||||
@@ -38,40 +34,40 @@ def mainlist(item):
|
||||
('ITA',['', 'submenu', '/filter?language%5B0%5D=1']),
|
||||
('SUB-ITA',['', 'submenu', '/filter?language%5B0%5D=0']),
|
||||
('Più Votati',['/toplist','menu', 'top']),
|
||||
('In Corso',['/animeincorso','peliculas','incorso']),
|
||||
('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','peliculas','updated'])]
|
||||
('In Corso',['/animeincorso','movies','incorso']),
|
||||
('Ultimi Episodi',['/fetch_pages.php?request=episodes&d=1','movies','updated'])]
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info(texto)
|
||||
item.url = host + '/animelist?search=' + texto
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
item.url = host + '/animelist?search=' + text
|
||||
item.contentType = 'tvshow'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info()
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.url = host + '/fetch_pages.php?request=episodes&d=1'
|
||||
item.args = "updated"
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
@@ -83,7 +79,7 @@ def submenu(item):
|
||||
action = 'filter'
|
||||
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<data>.*?)</select>'
|
||||
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 locals()
|
||||
|
||||
@@ -92,15 +88,15 @@ def filter(item):
|
||||
itemlist = []
|
||||
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:
|
||||
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter'))
|
||||
support.thumb(itemlist, genre=True)
|
||||
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, mode='genre')
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
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")'
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
item.args = 'top'
|
||||
def itemHook(item2):
|
||||
item2.url = item.url
|
||||
@@ -110,8 +106,8 @@ def menu(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
anime = True
|
||||
def movies(item):
|
||||
numerationEnabled = True
|
||||
|
||||
deflang= 'Sub-ITA'
|
||||
action = 'check'
|
||||
@@ -133,7 +129,7 @@ def peliculas(item):
|
||||
action = 'findvideos'
|
||||
def itemlistHook(itemlist):
|
||||
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
|
||||
elif 'filter' in item.args:
|
||||
page = support.match(data, patron=r'totalPages:\s*(\d+)').match
|
||||
@@ -142,11 +138,11 @@ def peliculas(item):
|
||||
if item.nextpage: item.nextpage += 1
|
||||
else: item.nextpage = 2
|
||||
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
|
||||
|
||||
else:
|
||||
pagination = ''
|
||||
pagination = True
|
||||
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>[^<]+)<'
|
||||
else:
|
||||
@@ -159,27 +155,26 @@ def peliculas(item):
|
||||
def check(item):
|
||||
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie')
|
||||
if movie.match:
|
||||
episodes = episodios(item)
|
||||
episodes = episodes(item)
|
||||
if len(episodes) > 0:
|
||||
it = episodes[0].clone(contentType = 'movie', contentTitle=item.fulltitle, contentSerieName='')
|
||||
return findvideos(it)
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
return episodes(item)
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
if item.contentType != 'movie': anime = True
|
||||
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^\d<]+(?P<episode>\d+))\s*</a>'
|
||||
def episodes(item):
|
||||
if item.contentType != 'movie': numerationEnabled = True
|
||||
patron = r'episodi-link-button">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*(?P<title>[^<]+)</a>'
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
links = []
|
||||
|
||||
main_url = support.match(item, 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
|
||||
itemlist.append(item.clone(action="play", title='Primario', url=main_url, server='directo'))
|
||||
@@ -190,8 +185,16 @@ def findvideos(item):
|
||||
links.append(link)
|
||||
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]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,224 +1,244 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per AnimeUnity
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import cloudscraper, json, copy, inspect
|
||||
from core import support
|
||||
from platformcode import autorenumber, logger
|
||||
|
||||
session = cloudscraper.create_scraper()
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
response = session.get(host + '/archivio')
|
||||
csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match
|
||||
headers = {'content-type': 'application/json;charset=UTF-8',
|
||||
'x-csrf-token': csrf_token,
|
||||
'Cookie' : '; '.join([x.name + '=' + x.value for x in response.cookies])}
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
top = [('Ultimi Episodi', ['', 'news'])]
|
||||
|
||||
menu = [('Anime {bullet bold}',['', 'menu', {}, 'tvshow']),
|
||||
('Film {submenu}',['', 'menu', {'type': 'Movie'}]),
|
||||
('TV {submenu}',['', 'menu', {'type': 'TV'}, 'tvshow']),
|
||||
('OVA {submenu} {tv}',['', 'menu', {'type': 'OVA'}, 'tvshow']),
|
||||
('ONA {submenu} {tv}',['', 'menu', {'type': 'ONA'}, 'tvshow']),
|
||||
('Special {submenu} {tv}',['', 'menu', {'type': 'Special'}, 'tvshow'])]
|
||||
search =''
|
||||
return locals()
|
||||
|
||||
def menu(item):
|
||||
item.action = 'peliculas'
|
||||
ITA = copy.copy(item.args)
|
||||
ITA['title'] = '(ita)'
|
||||
InCorso = copy.copy(item.args)
|
||||
InCorso['status'] = 'In Corso'
|
||||
Terminato = copy.copy(item.args)
|
||||
Terminato['status'] = 'Terminato'
|
||||
itemlist = [item.clone(title=support.typo('Tutti','bold')),
|
||||
item.clone(title=support.typo('ITA','bold'), args=ITA),
|
||||
item.clone(title=support.typo('Genere','bold'), action='genres'),
|
||||
item.clone(title=support.typo('Anno','bold'), action='years')]
|
||||
if item.contentType == 'tvshow':
|
||||
itemlist += [item.clone(title=support.typo('In Corso','bold'), args=InCorso),
|
||||
item.clone(title=support.typo('Terminato','bold'), args=Terminato)]
|
||||
itemlist +=[item.clone(title=support.typo('Cerca...','bold'), action='search', thumbnail=support.thumb('search'))]
|
||||
return itemlist
|
||||
|
||||
|
||||
def genres(item):
|
||||
support.info()
|
||||
# support.dbg()
|
||||
itemlist = []
|
||||
|
||||
genres = json.loads(support.match(response.text, patron='genres="([^"]+)').match.replace('"','"'))
|
||||
|
||||
for genre in genres:
|
||||
item.args['genres'] = [genre]
|
||||
itemlist.append(item.clone(title=support.typo(genre['name'],'bold'), action='peliculas'))
|
||||
return support.thumb(itemlist)
|
||||
|
||||
def years(item):
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
from datetime import datetime
|
||||
current_year = datetime.today().year
|
||||
oldest_year = int(support.match(response.text, patron='anime_oldest_date="([^"]+)').match)
|
||||
|
||||
for year in list(reversed(range(oldest_year, current_year + 1))):
|
||||
item.args['year']=year
|
||||
itemlist.append(item.clone(title=support.typo(year,'bold'), action='peliculas'))
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info('search', item)
|
||||
if not item.args:
|
||||
item.args = {'title':text}
|
||||
else:
|
||||
item.args['title'] = text
|
||||
item.search = text
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.url = host
|
||||
|
||||
try:
|
||||
itemlist = news(item)
|
||||
|
||||
if itemlist[-1].action == 'news':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info(line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def news(item):
|
||||
support.info()
|
||||
item.contentType = 'episode'
|
||||
itemlist = []
|
||||
import cloudscraper
|
||||
session = cloudscraper.create_scraper()
|
||||
|
||||
fullJs = json.loads(support.match(session.get(item.url).text, headers=headers, patron=r'items-json="([^"]+)"').match.replace('"','"'))
|
||||
js = fullJs['data']
|
||||
|
||||
for it in js:
|
||||
itemlist.append(
|
||||
item.clone(title= support.typo(it['anime']['title'] + ' - EP. ' + it['number'], 'bold'),
|
||||
fulltitle=it['anime']['title'],
|
||||
thumbnail=it['anime']['imageurl'],
|
||||
forcethumb = True,
|
||||
scws_id=it.get('scws_id', ''),
|
||||
video_url=it.get('link', ''),
|
||||
plot=it['anime']['plot'],
|
||||
action='findvideos')
|
||||
)
|
||||
if 'next_page_url' in fullJs:
|
||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'),thumbnail=support.thumb(), url=fullJs['next_page_url']))
|
||||
return itemlist
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
support.info()
|
||||
itemlist = []
|
||||
|
||||
page = item.page if item.page else 0
|
||||
item.args['offset'] = page * 30
|
||||
|
||||
order = support.config.get_setting('order', item.channel)
|
||||
if order:
|
||||
order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ]
|
||||
item.args['order'] = order_list[order]
|
||||
|
||||
payload = json.dumps(item.args)
|
||||
records = session.post(host + '/archivio/get-animes', headers=headers, data=payload).json()['records']
|
||||
|
||||
for it in records:
|
||||
lang = support.match(it['title'], patron=r'\(([It][Tt][Aa])\)').match
|
||||
title = support.re.sub(r'\s*\([^\)]+\)', '', it['title'])
|
||||
|
||||
if 'ita' in lang.lower(): language = '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.contentLanguage = language
|
||||
itm.type = it['type']
|
||||
itm.thumbnail = it['imageurl']
|
||||
itm.plot = it['plot']
|
||||
itm.url = item.url
|
||||
|
||||
if it['episodes_count'] == 1:
|
||||
itm.contentType = 'movie'
|
||||
itm.fulltitle = itm.show = itm.contentTitle = title
|
||||
itm.contentSerieName = ''
|
||||
itm.action = 'findvideos'
|
||||
itm.scws_id = it['episodes'][0].get('scws_id', '')
|
||||
itm.video_url = it['episodes'][0].get('link', '')
|
||||
|
||||
else:
|
||||
itm.contentType = 'tvshow'
|
||||
itm.contentTitle = ''
|
||||
itm.fulltitle = itm.show = itm.contentSerieName = title
|
||||
itm.action = 'episodios'
|
||||
itm.episodes = it['episodes'] if 'episodes' in it else it.get('scws_id', '')
|
||||
|
||||
itemlist.append(itm)
|
||||
|
||||
autorenumber.start(itemlist)
|
||||
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))
|
||||
|
||||
return itemlist
|
||||
|
||||
def episodios(item):
|
||||
support.info()
|
||||
itemlist = []
|
||||
title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
|
||||
|
||||
for it in item.episodes:
|
||||
itemlist.append(
|
||||
item.clone(title=support.typo(title + it['number'], 'bold'),
|
||||
episode = it['number'],
|
||||
fulltitle=item.title,
|
||||
show=item.title,
|
||||
contentTitle='',
|
||||
contentSerieName=item.contentSerieName,
|
||||
thumbnail=item.thumbnail,
|
||||
plot=item.plot,
|
||||
action='findvideos',
|
||||
contentType='episode',
|
||||
scws_id=it.get('scws_id', ''),
|
||||
video_url=it.get('link', '')))
|
||||
|
||||
if inspect.stack(0)[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = [item.clone(title=support.config.get_localized_string(30137), server='streamingcommunityws', url=str(item.scws_id))]
|
||||
return support.server(item, itemlist=itemlist, referer=False)
|
||||
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per AnimeUnity
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import cloudscraper, json, copy, inspect
|
||||
from core import jsontools, support, config
|
||||
from core.httptools import downloadpage
|
||||
from platformcode import autorenumber, logger
|
||||
|
||||
session = cloudscraper.create_scraper()
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
response = session.get(host + '/archivio')
|
||||
csrf_token = support.match(response.text, patron='name="csrf-token" content="([^"]+)"').match
|
||||
headers = {'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])}
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
top = [('Ultimi Episodi', ['', 'news'])]
|
||||
|
||||
menu = [('Anime {bullet bold}',['', 'menu', {}, 'tvshow']),
|
||||
('Film {submenu}',['', 'menu', {'type': 'Movie'}]),
|
||||
('TV {submenu}',['', 'menu', {'type': 'TV'}, 'tvshow']),
|
||||
('OVA {submenu} {tv}',['', 'menu', {'type': 'OVA'}, 'tvshow']),
|
||||
('ONA {submenu} {tv}',['', 'menu', {'type': 'ONA'}, 'tvshow']),
|
||||
('Special {submenu} {tv}',['', 'menu', {'type': 'Special'}, 'tvshow'])]
|
||||
search =''
|
||||
return locals()
|
||||
|
||||
|
||||
def menu(item):
|
||||
item.action = 'movies'
|
||||
ITA = copy.copy(item.args)
|
||||
ITA['title'] = '(ita)'
|
||||
InCorso = copy.copy(item.args)
|
||||
InCorso['status'] = 'In Corso'
|
||||
Terminato = copy.copy(item.args)
|
||||
Terminato['status'] = 'Terminato'
|
||||
itemlist = [item.clone(title=support.typo('Tutti','bold')),
|
||||
item.clone(title='ITA', args=ITA),
|
||||
item.clone(title='Genere', action='genres'),
|
||||
item.clone(title='Anno', action='years')]
|
||||
if item.contentType == 'tvshow':
|
||||
itemlist += [item.clone(title='In Corso', args=InCorso),
|
||||
item.clone(title='Terminato', args=Terminato)]
|
||||
itemlist +=[item.clone(title=support.typo(config.getLocalizedString(70741).replace(' %s', '…'),'bold'), action='search', thumbnail=support.thumb('search'))]
|
||||
return itemlist
|
||||
|
||||
|
||||
def genres(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
genres = json.loads(support.match(response.text, patron='genres="([^"]+)').match.replace('"','"'))
|
||||
|
||||
for genre in genres:
|
||||
item.args['genres'] = [genre]
|
||||
itemlist.append(item.clone(title=genre['name'], action='movies'))
|
||||
return support.thumb(itemlist)
|
||||
|
||||
def years(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
from datetime import datetime
|
||||
current_year = datetime.today().year
|
||||
oldest_year = int(support.match(response.text, patron='anime_oldest_date="([^"]+)').match)
|
||||
|
||||
for year in list(reversed(range(oldest_year, current_year + 1))):
|
||||
item.args['year']=year
|
||||
itemlist.append(item.clone(title=year, action='movies'))
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
if not item.args:
|
||||
item.args = {'title':text}
|
||||
else:
|
||||
item.args['title'] = text
|
||||
item.search = text
|
||||
|
||||
try:
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.debug('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.url = host
|
||||
|
||||
try:
|
||||
itemlist = news(item)
|
||||
|
||||
if itemlist[-1].action == 'news':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.debug(line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def news(item):
|
||||
logger.debug()
|
||||
item.contentType = 'episode'
|
||||
itemlist = []
|
||||
import cloudscraper
|
||||
session = cloudscraper.create_scraper()
|
||||
|
||||
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']
|
||||
|
||||
for it in js:
|
||||
itemlist.append(
|
||||
item.clone(title=it['anime']['title'],
|
||||
contentTitle = it['anime']['title'],
|
||||
contentEpisodeNumber = int(it['number']),
|
||||
fulltitle=it['anime']['title'],
|
||||
thumbnail=it['anime']['imageurl'],
|
||||
forcethumb = True,
|
||||
videoUrl=it['scws_id'],
|
||||
plot=it['anime']['plot'],
|
||||
action='findvideos')
|
||||
)
|
||||
if fullJs.get('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
|
||||
|
||||
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
page = item.page if item.page else 0
|
||||
item.args['offset'] = page * 30
|
||||
|
||||
order = support.config.getSetting('order', item.channel)
|
||||
if order:
|
||||
order_list = [ "Standard", "Lista A-Z", "Lista Z-A", "Popolarità", "Valutazione" ]
|
||||
item.args['order'] = order_list[order]
|
||||
|
||||
payload = json.dumps(item.args)
|
||||
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:
|
||||
logger.debug(jsontools.dump(it))
|
||||
lang = support.match(it['title'], patron=r'\(([It][Tt][Aa])\)').match
|
||||
title = support.re.sub(r'\s*\([^\)]+\)', '', it['title'])
|
||||
|
||||
if 'ita' in lang.lower(): language = 'ITA'
|
||||
else: language = 'Sub-ITA'
|
||||
|
||||
itm = item.clone(title=title,
|
||||
contentLanguage = language,
|
||||
type = it['type'],
|
||||
thumbnail = it['imageurl'],
|
||||
plot = it['plot'],
|
||||
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:
|
||||
itm.contentType = 'movie'
|
||||
itm.fulltitle = itm.show = itm.contentTitle = title
|
||||
itm.contentSerieName = ''
|
||||
itm.action = 'play'
|
||||
item.forcethumb=True
|
||||
itm.videoUrl = it['episodes'][0]['scws_id']
|
||||
|
||||
else:
|
||||
itm.contentType = 'tvshow'
|
||||
itm.contentTitle = ''
|
||||
itm.fulltitle = itm.show = itm.contentSerieName = title
|
||||
itm.action = 'episodes'
|
||||
itm.episodes = it['episodes'] if 'episodes' in it else it['scws_id']
|
||||
# itm.videoUrl = item.url
|
||||
|
||||
itemlist.append(itm)
|
||||
|
||||
autorenumber.start(itemlist)
|
||||
if len(itemlist) == 30:
|
||||
support.nextPage(itemlist, item, 'movies', page=page + 1, total_pages=total_pages)
|
||||
|
||||
return itemlist
|
||||
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
# title = 'Parte ' if item.type.lower() == 'movie' else 'Episodio '
|
||||
for it in item.episodes:
|
||||
|
||||
episode2 = it['number'].split('.')[-1]
|
||||
episode = it['number'].split('.')[0]
|
||||
itemlist.append(
|
||||
item.clone(episodes = [],
|
||||
contentEpisodeNumber=int(float(it['number'])),
|
||||
episodeExtra = '.' + it['number'].split('.')[-1] if '.' in it['number'] else '',
|
||||
action='play',
|
||||
contentType='episode',
|
||||
forcethumb=True,
|
||||
videoUrl=it['scws_id']))
|
||||
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
|
||||
def play(item):
|
||||
from time import time
|
||||
from base64 import b64encode
|
||||
from hashlib import md5
|
||||
|
||||
# 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"],
|
||||
"thumbnail": "animeuniverse.png",
|
||||
"banner": "animeuniverse.png",
|
||||
"categories": ["anime", "sub-ita"],
|
||||
"categories": ["anime", "sub"],
|
||||
"default_off": ["include_in_newest"],
|
||||
"settings": [
|
||||
{
|
||||
|
||||
@@ -4,13 +4,14 @@
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = {}
|
||||
|
||||
perpage_list = ['20','30','40','50','60','70','80','90','100']
|
||||
perpage = perpage_list[support.config.get_setting('perpage' , 'animeuniverse')]
|
||||
epPatron = r'<td>\s*(?P<title>[^<]+)[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
||||
perpage = perpage_list[support.config.getSetting('perpage' , 'animeuniverse')]
|
||||
epPatron = r'<td>\s*(?P<title>[^ <]+)\s*(?P<episode>\d+)?[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"'
|
||||
|
||||
|
||||
@support.menu
|
||||
@@ -19,50 +20,52 @@ def mainlist(item):
|
||||
('Tipo',['', 'menu', 'Anime']),
|
||||
('Anno',['', 'menu', 'Anno']),
|
||||
('Genere', ['', 'menu','Genere']),
|
||||
('Ultimi Episodi',['/2/', 'peliculas', 'last']),
|
||||
('Hentai', ['/hentai/', 'peliculas'])]
|
||||
('Ultimi Episodi',['/2/', 'movies', 'last']),
|
||||
('Hentai', ['/hentai/', 'movies'])]
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
patronBlock = item.args + r'</a>\s*<ul class="sub-menu">(?P<block>.*?)</ul>'
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||
if 'genere' in item.args.lower():
|
||||
patronGenreMenu = patronMenu
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info(texto)
|
||||
item.search = texto
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
item.search = text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.url = host
|
||||
item.args = "last"
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
query = ''
|
||||
if '/mos/' in item.url:
|
||||
item.contentType = 'movie'
|
||||
@@ -74,7 +77,7 @@ def peliculas(item):
|
||||
action='findvideos'
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
action='episodios'
|
||||
action='episodes'
|
||||
if item.search:
|
||||
query = 's'
|
||||
searchtext = item.search
|
||||
@@ -83,7 +86,7 @@ def peliculas(item):
|
||||
searchtext = item.url.split('/')[-2] if item.url != host else ''
|
||||
if not item.pag: item.pag = 1
|
||||
|
||||
anime=True
|
||||
numerationEnabled = False
|
||||
# blacklist=['Altri Hentai']
|
||||
data = support.match(host + '/wp-content/themes/animeuniverse/functions/ajax.php', post='sorter=recent&location=&loop=main+loop&action=sort&numarticles='+perpage+'&paginated='+str(item.pag)+'¤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)?(?:"| \[)'
|
||||
@@ -91,7 +94,7 @@ def peliculas(item):
|
||||
def itemlistHook(itemlist):
|
||||
if len(itemlist) == int(perpage):
|
||||
item.pag += 1
|
||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), action='peliculas'))
|
||||
itemlist.append(item.clone(title=support.typo(support.config.getLocalizedString(30992), 'color kod bold'), action='movies'))
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
@@ -99,9 +102,9 @@ def peliculas(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
anime = True
|
||||
pagination = int(perpage)
|
||||
def episodes(item):
|
||||
numerationEnabled = True
|
||||
pagination = True
|
||||
patron = epPatron
|
||||
return locals()
|
||||
|
||||
@@ -113,7 +116,7 @@ def findvideos(item):
|
||||
for title, url in matches:
|
||||
get_video_list(url, title, itemlist)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "animeworld.png",
|
||||
"banner": "animeworld.png",
|
||||
"categories": ["anime", "vos"],
|
||||
"categories": ["anime", "sub"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "order",
|
||||
|
||||
@@ -5,33 +5,35 @@
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from core import httptools, support, jsontools
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
__channel__ = 'animeworld'
|
||||
cookie = support.config.get_setting('cookie', __channel__)
|
||||
cookie = support.config.getSetting('cookie', __channel__)
|
||||
headers = [['Cookie', cookie]]
|
||||
|
||||
|
||||
def get_cookie(data):
|
||||
global cookie, headers
|
||||
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]]
|
||||
|
||||
|
||||
def get_data(item):
|
||||
# support.dbg()
|
||||
url = httptools.downloadpage(item.url, headers=headers, follow_redirects=True, only_headers=True).url
|
||||
data = support.match(url, headers=headers, follow_redirects=True).data
|
||||
if 'AWCookieVerify' in data:
|
||||
get_cookie(data)
|
||||
data = get_data(item)
|
||||
data = ''
|
||||
if item.url:
|
||||
url = httptools.downloadpage(item.url, headers=headers, follow_redirects=True, only_headers=True).url
|
||||
data = support.match(url, headers=headers, follow_redirects=True).data
|
||||
if 'AWCookieVerify' in data:
|
||||
get_cookie(data)
|
||||
data = get_data(item)
|
||||
return data
|
||||
|
||||
|
||||
def order():
|
||||
# Seleziona l'ordinamento dei risultati
|
||||
return str(support.config.get_setting("order", __channel__))
|
||||
return str(support.config.getSetting("order", __channel__))
|
||||
|
||||
|
||||
@support.menu
|
||||
@@ -39,19 +41,19 @@ def mainlist(item):
|
||||
anime=['/filter?sort=',
|
||||
('ITA',['/filter?dub=1&sort=', 'menu', '1']),
|
||||
('SUB-ITA',['/filter?dub=0&sort=', 'menu', '0']),
|
||||
('In Corso', ['/ongoing', 'peliculas','noorder']),
|
||||
('Ultimi Episodi', ['/updated', 'peliculas', 'updated']),
|
||||
('Nuove Aggiunte',['/newest', 'peliculas','noorder' ]),
|
||||
('In Corso', ['/ongoing', 'movies','noorder']),
|
||||
('Ultimi Episodi', ['/updated', 'movies', 'updated']),
|
||||
('Nuove Aggiunte',['/newest', 'movies','noorder' ]),
|
||||
('Generi',['/?d=1','genres',])]
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
data = get_data(item)
|
||||
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):
|
||||
item.url = host + '/filter?' + item.name + '=' + item.value + '&sort='
|
||||
@@ -63,17 +65,20 @@ def genres(item):
|
||||
def menu(item):
|
||||
action = 'submenu'
|
||||
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):
|
||||
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), action='peliculas'))
|
||||
itemlist.append(item.clone(title=support.typo('Cerca...','bold'), action='search', search=True, thumbnail=support.thumb('search.png')))
|
||||
for item in itemlist:
|
||||
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 locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def submenu(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
data = item.other
|
||||
patronMenu = r'<input.*?name="(?P<name>[^"]+)" value="(?P<value>[^"]+)"\s*>[^>]+>(?P<title>[^<]+)<\/label>'
|
||||
def itemHook(item):
|
||||
@@ -82,24 +87,24 @@ def submenu(item):
|
||||
return locals()
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.url = host + '/updated'
|
||||
item.args = "updated"
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info(texto)
|
||||
logger.debug(texto)
|
||||
if item.search:
|
||||
item.url = host + '/filter?dub=' + item.args + '&keyword=' + texto + '&sort='
|
||||
else:
|
||||
@@ -107,18 +112,18 @@ def search(item, texto):
|
||||
item.url = host + '/search?keyword=' + texto
|
||||
item.contentType = 'tvshow'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
anime = True
|
||||
def movies(item):
|
||||
numerationEnabled = True
|
||||
# debug = True
|
||||
if item.args not in ['noorder', 'updated'] and not item.url[-1].isdigit(): item.url += order() # usa l'ordinamento di configura canale
|
||||
data = get_data(item)
|
||||
@@ -129,42 +134,42 @@ def peliculas(item):
|
||||
action='findvideos'
|
||||
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>)?'
|
||||
action='episodios'
|
||||
action='episodes'
|
||||
|
||||
# Controlla la lingua se assente
|
||||
patronNext=r'<a href="([^"]+)" class="[^"]+" id="go-next'
|
||||
patronTotalPages=r'<span class="total">(\d+)</span>'
|
||||
typeContentDict={'movie':['movie', 'special']}
|
||||
typeActionDict={'findvideos':['movie', 'special']}
|
||||
def itemHook(item):
|
||||
if not item.contentLanguage:
|
||||
if 'dub=1' in item.url or item.l == 'dub':
|
||||
item.contentLanguage = 'ITA'
|
||||
item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||
# item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||
else:
|
||||
item.contentLanguage = 'Sub-ITA'
|
||||
item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||
# item.title += support.typo(item.contentLanguage,'_ [] color kod')
|
||||
return item
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
data = get_data(item)
|
||||
anime = True
|
||||
pagination = 50
|
||||
numerationEnabled = True
|
||||
# pagination = True
|
||||
patronBlock= r'<div class="server\s*active\s*"(?P<block>.*?)(?:<div class="server|<link)'
|
||||
patron = r'<li[^>]*>\s*<a.*?href="(?P<url>[^"]+)"[^>]*>(?P<episode>[^-<]+)(?:-(?P<episode2>[^<]+))?'
|
||||
def itemHook(item):
|
||||
item.number = support.re.sub(r'\[[^\]]+\]', '', item.title)
|
||||
item.title += support.typo(item.fulltitle,'-- bold')
|
||||
return item
|
||||
# def itemHook(item):
|
||||
# item.title = item.fulltitle
|
||||
# return item
|
||||
action='findvideos'
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
import time
|
||||
support.info(item)
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
urls = []
|
||||
# resp = support.match(get_data(item), headers=headers, patron=r'data-name="(\d+)">([^<]+)<')
|
||||
@@ -172,8 +177,9 @@ def findvideos(item):
|
||||
data = resp.data
|
||||
|
||||
for ID, name in resp.matches:
|
||||
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
|
||||
# if not item.number: item.number = support.match(item.title, patron=r'(\d+) -').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:
|
||||
epID, epurl = match
|
||||
# if 'vvvvid' in name.lower():
|
||||
@@ -183,8 +189,7 @@ def findvideos(item):
|
||||
title = support.match(url, patron=r'http[s]?://(?:www.)?([^.]+)', string=True).match
|
||||
itemlist.append(item.clone(action="play", title=title, url=url, server='directo'))
|
||||
else:
|
||||
dataJson = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).data
|
||||
json = jsontools.load(dataJson)
|
||||
json = support.match(host + '/api/episode/info?id=' + epID + '&alt=0', headers=headers).response.json
|
||||
title = support.match(json['grabber'], patron=r'server\d+.([^.]+)', string=True).match
|
||||
if title: itemlist.append(item.clone(action="play", title=title, url=json['grabber'].split('=')[-1], server='directo'))
|
||||
else: urls.append(json['grabber'])
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "aniplay.png",
|
||||
"banner": "aniplay.png",
|
||||
"categories": ["anime", "vos"],
|
||||
"categories": ["anime", "sub"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "sort",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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
|
||||
|
||||
import sys
|
||||
@@ -9,9 +9,9 @@ else:
|
||||
from concurrent_py2 import futures
|
||||
|
||||
host = config.get_channel_url()
|
||||
sort = ['views', 'title', 'episodeNumber', 'startDate', 'endDate', 'createdDate'][config.get_setting('sort', 'aniplay')]
|
||||
order = 'asc' if config.get_setting('order', 'aniplay') else 'desc'
|
||||
perpage = [10, 20, 30 ,40, 50, 60, 70, 80, 90][config.get_setting('perpage', 'aniplay')]
|
||||
sort = ['views', 'title', 'episodeNumber', 'startDate', 'endDate', 'createdDate'][config.getSetting('sort', 'aniplay')]
|
||||
order = 'asc' if config.getSetting('order', 'aniplay') else 'desc'
|
||||
perpage = [10, 20, 30 ,40, 50, 60, 70, 80, 90][config.getSetting('perpage', 'aniplay')]
|
||||
|
||||
|
||||
@support.menu
|
||||
@@ -27,9 +27,9 @@ def mainlist(item):
|
||||
def submenu_az(item):
|
||||
itemlist = []
|
||||
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',
|
||||
action= 'peliculas',
|
||||
action= 'movies',
|
||||
variable= '&character=' + letter,
|
||||
thumbnail=support.thumb('az')))
|
||||
return itemlist
|
||||
@@ -40,7 +40,7 @@ def submenu_year(item):
|
||||
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
|
||||
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',
|
||||
variable= 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'}
|
||||
for label in links:
|
||||
link = links[label]
|
||||
itemlist.append(item.clone(title = support.typo(label, 'bold'),
|
||||
itemlist.append(item.clone(title = label,
|
||||
action= 'submenu_top_of',
|
||||
variable= link))
|
||||
return itemlist
|
||||
@@ -67,7 +67,7 @@ def submenu_season(item):
|
||||
itemlist.append(item.clone(title=title,
|
||||
url = '{}/api/seasonal-view/{}-{}'.format(host, s, item.variable),
|
||||
thumbnail = support.thumb(s),
|
||||
action = 'peliculas',
|
||||
action = 'movies',
|
||||
variable=''))
|
||||
return itemlist
|
||||
|
||||
@@ -80,61 +80,62 @@ def submenu_top_of(item):
|
||||
title = fulltitle.split('(')[0].strip()
|
||||
scrapedlang = scrapertools.find_single_match(fulltitle, r'\(([^\)]+)')
|
||||
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'],
|
||||
url = '{}/api/anime/{}'.format(host, anime['animeId']),
|
||||
thumbnail = get_thumbnail(anime, 'animeHorizontalImages'),
|
||||
action = 'episodios',
|
||||
action = 'episodes',
|
||||
variable=anime['animeId']))
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info(texto)
|
||||
logger.debug(texto)
|
||||
item.url = host + '/api/anime/advanced-search'
|
||||
item.variable = '&query=' + texto
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
return latest_added(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
def latest_added(item):
|
||||
itemlist = []
|
||||
|
||||
page = item.page if item.page else 0
|
||||
url= '{}/api/home/latest-episodes?page={}'.format(host, page)
|
||||
js = httptools.downloadpage(url).json
|
||||
|
||||
for episode in js:
|
||||
title = episode['title'] if episode['title'] else ''
|
||||
logger.debug(jsontools.dump(episode))
|
||||
title = episode['title'] if episode['title'] else episode['animeTitle']
|
||||
animeTitle, lang = get_lang(episode['animeTitle'])
|
||||
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')
|
||||
|
||||
itemlist.append(item.clone(title=long_title,
|
||||
itemlist.append(item.clone(title=title,
|
||||
fulltitle=title,
|
||||
animeId = episode['animeId'],
|
||||
id=episode['id'],
|
||||
@@ -155,7 +156,7 @@ def latest_added(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist = []
|
||||
@@ -165,18 +166,16 @@ def peliculas(item):
|
||||
for it in js:
|
||||
title, lang = get_lang(it['title'])
|
||||
|
||||
long_title = support.typo(title, 'bold') + support.typo(lang, '_ [] color kod')
|
||||
|
||||
itemlist.append(item.clone(title = long_title,
|
||||
itemlist.append(item.clone(title = title,
|
||||
fulltitle = title,
|
||||
show = title,
|
||||
contentLanguage = lang,
|
||||
contentType = 'movie' if it['type'] == 'Movie' else 'tvshow',
|
||||
contentTitle = title,
|
||||
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'],
|
||||
# year = it['startDate'].split('-')[0],
|
||||
year = it['startDate'].split('-')[0],
|
||||
url = '{}/api/anime/{}'.format(host, it['id']),
|
||||
thumbnail = get_thumbnail(it),
|
||||
fanart = get_thumbnail(it, 'horizontalImages')))
|
||||
@@ -189,7 +188,7 @@ def peliculas(item):
|
||||
return itemlist
|
||||
|
||||
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
@@ -208,6 +207,7 @@ def episodios(item):
|
||||
title = it['name']
|
||||
|
||||
itemlist.append(item.clone(title = title,
|
||||
contentTitle = title,
|
||||
id= '{}/season/{}'.format(it['animeId'], it['id']),
|
||||
contentType = 'season',
|
||||
action = 'list_episodes',
|
||||
@@ -259,10 +259,11 @@ def list_episodes(item, json=None):
|
||||
else:
|
||||
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')
|
||||
|
||||
itemlist.append(item.clone(title = title,
|
||||
itemlist.append(item.clone(title = it['title'],
|
||||
contentTitle = it['title'],
|
||||
id= it['id'],
|
||||
url= 'api/episode/{}'.format(it['id']),
|
||||
contentType = 'episode',
|
||||
@@ -283,17 +284,16 @@ def list_episodes(item, json=None):
|
||||
def findvideos(item):
|
||||
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
|
||||
|
||||
if json.get('episodes', []):
|
||||
json = httptools.downloadpage('{}/api/episode/{}'.format(host, json['episodes'][0]['id'])).json
|
||||
# logger.debug(json)
|
||||
|
||||
videourl = json['videoUrl']
|
||||
videourl = json['episodeVideo']
|
||||
|
||||
itemlist = [item.clone(title=config.get_localized_string(30137),
|
||||
itemlist = [item.clone(title=config.getLocalizedString(30137),
|
||||
url=videourl,
|
||||
server='directo')]
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"active": true,
|
||||
"thumbnail": "casacinema.png",
|
||||
"banner": "casacinema.png",
|
||||
"categories": ["tvshow", "movie","vos"],
|
||||
"categories": ["tvshow", "movie","sub"],
|
||||
"settings": [
|
||||
]
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -14,10 +15,11 @@ headers = [['Referer', host]]
|
||||
def mainlist(item):
|
||||
film = ['/category/film',
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Sub-ITA', ['/category/sub-ita/', 'movies', 'sub'])
|
||||
]
|
||||
|
||||
tvshow = ['/category/serie-tv',
|
||||
('Novità', ['/aggiornamenti-serie-tv', 'peliculas', '']),
|
||||
('Novità', ['/aggiornamenti-serie-tv', 'movies', '']),
|
||||
]
|
||||
|
||||
search = ''
|
||||
@@ -27,47 +29,47 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
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">'
|
||||
return locals()
|
||||
|
||||
|
||||
def check(item):
|
||||
def select(item):
|
||||
item.data = support.match(item).data
|
||||
if 'continua con il video' in item.data.lower():
|
||||
support.info('select = ### è un film ###')
|
||||
logger.debug('select = ### è un film ###')
|
||||
item.contentType = 'movie'
|
||||
return findvideos(item)
|
||||
else:
|
||||
support.info('select = ### è una serie ###')
|
||||
logger.debug('select = ### è una serie ###')
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
return episodes(item)
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/?s=' + text
|
||||
item.args = 'search'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('search log:', line)
|
||||
logger.error(line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
def newest(category):
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.args = 'newest'
|
||||
|
||||
try:
|
||||
if categoria == 'series':
|
||||
if category == 'tvshow':
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host+'/aggiornamenti-serie-tv'
|
||||
|
||||
@@ -75,32 +77,32 @@ def newest(categoria):
|
||||
item.contentType = 'movie'
|
||||
item.url = host+'/category/film'
|
||||
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == 'peliculas':
|
||||
if itemlist[-1].action == 'movies':
|
||||
itemlist.pop()
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("%s" % line)
|
||||
logger.error(line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
if item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
elif item.contentType == 'tvshow':
|
||||
action = 'episodios'
|
||||
pagination = ''
|
||||
action = 'episodes'
|
||||
pagination = True
|
||||
else:
|
||||
action = 'check'
|
||||
action = 'select'
|
||||
|
||||
if item.args == 'newest':
|
||||
patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?[ ]?(?:\(|\[)?(?P<lang>[sS]ub-[iI][tT][aA])?(?:\)|\])?[ ]?(?:\[(?P<quality>.+?)\])?[ ]?(?:\((?P<year>\d+)\))?<(?:[^>]+>.+?(?:title="Nuovi episodi">(?P<episode>\d+x\d+)[ ]?(?P<lang2>Sub-Ita)?|title="IMDb">(?P<rating>[^<]+)))?'
|
||||
@@ -109,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}\))?<'
|
||||
|
||||
patronNext = r'<a href="([^"]+)"\s*>Pagina'
|
||||
# debug = True
|
||||
patronTotalPages = r'>(\d+)(?:[^>]+>){4}Pagina'
|
||||
|
||||
def itemHook(item):
|
||||
if 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:
|
||||
item.contentLanguage = item.lang2
|
||||
item.title += support.typo(item.lang2, '_ [] color kod')
|
||||
if item.args == 'novita':
|
||||
item.title = item.title
|
||||
# item.title += support.typo(item.lang2, '_ [] color kod')
|
||||
# if item.args == 'novita':
|
||||
# item.title = item.title
|
||||
# if 'wp-content' in item.thumbnail and not item.infoLabels['year']:
|
||||
# item.infoLabels['year'] = item.thumbnail.split('/')[5]
|
||||
return item
|
||||
@@ -127,17 +129,14 @@ def peliculas(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
if item.data:
|
||||
data = item.data
|
||||
action = 'findvideos'
|
||||
item.contentType = 'tvshow'
|
||||
blacklist = ['']
|
||||
# debug = True
|
||||
patron = r'"season-no">(?P<season>\d+)x(?P<episode>\d+)(?:[^>]+>){5}\s*(?P<title>[^<]+)(?P<data>.*?)</table>'
|
||||
# patron = r'(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?(?:(?P<title>[^<]+)<(?P<data>.*?)|(\2[ ])(?:<(\3.*?)))(?:<br />|</p>)'
|
||||
patronBlock = r'<span>(?:.+?Stagione*.+?(?P<lang>[Ii][Tt][Aa]|[Ss][Uu][Bb][\-]?[iI][tT][aA]))?.*?</span>.*?class="content(?P<block>.*?)(?:"accordion-item|<script>)'
|
||||
# patronBlock = r'<strong>(?P<block>(?:.+?Stagione*.+?(?P<lang>[Ii][Tt][Aa]|[Ss][Uu][Bb][\-]?[iI][tT][aA]))?(?:.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
|
||||
patron = r'(?P<episode>\d+(?:×|×)?\d+\-\d+|\d+(?:×|×)\d+)[;]?(?:(?P<title>[^<]+)<(?P<data>.*?)|(\2[ ])(?:<(\3.*?)))(?:<br />|</p>)'
|
||||
patronBlock = r'<strong>(?P<block>(?:.+?Stagione*.+?(?P<lang>[Ii][Tt][Aa]|[Ss][Uu][Bb][\-]?[iI][tT][aA]))?(?:.+?|</strong>)(/?:</span>)?</p>.*?</p>)'
|
||||
return locals()
|
||||
|
||||
|
||||
@@ -148,7 +147,9 @@ def findvideos(item):
|
||||
matchData = item.data if item.data else item
|
||||
links = support.match(matchData, patron=r'(?:SRC|href)="([^"]+)"', patronBlock=r'<div class="col-md-10">(.+?)<div class="ads">').matches
|
||||
data = ''
|
||||
from lib.unshortenit import unshorten_only
|
||||
for link in links:
|
||||
support.info('URL=',link)
|
||||
data += link + '\n'
|
||||
logger.debug('URL=',link)
|
||||
url, c = unshorten_only(link.replace('#', 'speedvideo.net'))
|
||||
data += url + '\n'
|
||||
return support.server(item, data)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"id": "cb01anime",
|
||||
"name": "Cb01anime",
|
||||
"language": ["ita", "vos", "sub-ita"],
|
||||
"active": false,
|
||||
"thumbnail": "cb01anime.png",
|
||||
"banner": "cb01anime.png",
|
||||
"categories": ["anime"],
|
||||
"settings": []
|
||||
}
|
||||
"id": "cb01anime",
|
||||
"name": "Cb01anime",
|
||||
"language": ["ita", "sub, "sub-ita"],
|
||||
"active": true,
|
||||
"thumbnail": "cb01anime.png",
|
||||
"banner": "cb01anime.png",
|
||||
"categories": ["anime"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url() + '/cb01-anime-cartoon'
|
||||
|
||||
@@ -18,7 +19,7 @@ def mainlist(item):
|
||||
anime = [('Genere',['','menu', '2']),
|
||||
('Per Lettera',['','menu', '1']),
|
||||
('Per Anno',['','menu', '3']),
|
||||
('Ultimi Anime Aggiornati',['','peliculas', 'newest'])]
|
||||
('Ultimi Anime Aggiornati',['','movies', 'newest'])]
|
||||
return locals()
|
||||
|
||||
|
||||
@@ -27,7 +28,9 @@ def menu(item):
|
||||
blacklist = ['Anime per Genere', 'Anime per Anno', 'Anime per Lettera']
|
||||
patronBlock = r'<select name="select%s"(?P<block>.*?)</select>' % item.args
|
||||
patronMenu = r'<option value="(?P<url>[^"]+)">(?P<title>[^<]+)</option>'
|
||||
action = 'peliculas'
|
||||
if '2' in item.args:
|
||||
patronGenreMenu = patronMenu
|
||||
action = 'movies'
|
||||
def itemHook(item):
|
||||
item.url = item.url.replace('cb01-anime/','cb01-anime-cartoon/')
|
||||
return item
|
||||
@@ -35,37 +38,37 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info(texto)
|
||||
logger.debug(texto)
|
||||
item.url = host + "/search/" + texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('search log:', line)
|
||||
logger.error(line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.url = host
|
||||
item.args = 'newest'
|
||||
itemlist = peliculas(item)
|
||||
itemlist = movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug=True
|
||||
blacklist = Blacklist
|
||||
item.contentType = 'tvshow'
|
||||
@@ -78,20 +81,19 @@ def peliculas(item):
|
||||
return locals()
|
||||
|
||||
def check(item):
|
||||
# support.dbg()
|
||||
item.url = support.match(item, patron=r'(?:<p>|/>)(.*?)(?:<br|</td>|</p>)', patronBlock=r'Streaming:(.*?)</tr>').matches
|
||||
if 'Episodio' in str(item.url):
|
||||
item.contentType = 'tvshow'
|
||||
item.action ='episodios'
|
||||
return episodios(item)
|
||||
item.action ='episodes'
|
||||
return episodes(item)
|
||||
else:
|
||||
item.contentType = 'movie'
|
||||
item.action = 'findvideos'
|
||||
return findvideos(item)
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.info('EPISODIOS ', item.data)
|
||||
def episodes(item):
|
||||
logger.debug('EPISODIOS ', item.data)
|
||||
data = ''
|
||||
matches = item.data
|
||||
season = 1
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
"active": true,
|
||||
"thumbnail": "cb01.png",
|
||||
"banner": "cb01.png",
|
||||
"categories": ["tvshow", "movie", "vos", "documentary"],
|
||||
"categories": ["tvshow", "movie", "sub", "documentary"],
|
||||
"settings": []
|
||||
}
|
||||
@@ -2,21 +2,21 @@
|
||||
# ------------------------------------------------------------
|
||||
# Canale per cineblog01
|
||||
# ------------------------------------------------------------
|
||||
import datetime
|
||||
|
||||
import re
|
||||
|
||||
from core import scrapertools, httptools, servertools, support
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def findhost(url):
|
||||
host = httptools.downloadpage(url, follow_redirect=True).url
|
||||
if host == 'https://cb01.uno/':
|
||||
host = support.match(host, patron=r'<a href="([^"]+)').match
|
||||
return host
|
||||
# def findhost(url):
|
||||
# host = httptools.downloadpage(url, follow_redirect=True).url
|
||||
# if host == 'https://cb01.uno/':
|
||||
# host = support.match(host, patron=r'<a href="([^"]+)').match
|
||||
# return host
|
||||
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@@ -27,17 +27,17 @@ def mainlist(item):
|
||||
('Generi', ['', 'menu', 'Film per Genere']),
|
||||
('Anni', ['', 'menu', 'Film per Anno']),
|
||||
('Paese', ['', 'menu', 'Film per Paese']),
|
||||
('Ultimi Aggiornati', ['/ultimi-100-film-aggiornati/', 'peliculas', 'newest']),
|
||||
('Ultimi Aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'peliculas', 'newest'])
|
||||
('Ultimi Aggiornati', ['/ultimi-100-film-aggiornati/', 'movies', 'newest']),
|
||||
('Ultimi Aggiunti', ['/lista-film-ultimi-100-film-aggiunti/', 'movies', 'newest'])
|
||||
]
|
||||
tvshow = ['/serietv/',
|
||||
('Per Lettera', ['/serietv/', 'menu', 'Serie-Tv per Lettera']),
|
||||
('Per Genere', ['/serietv/', 'menu', 'Serie-Tv per Genere']),
|
||||
('Per anno', ['/serietv/', 'menu', 'Serie-Tv per Anno']),
|
||||
('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']),
|
||||
('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'peliculas'])
|
||||
docu = [('Documentari {bullet bold}', ['/category/documentario/', 'movies']),
|
||||
('HD {submenu} {documentari}', ['/category/hd-alta-definizione/documentario-hd/', 'movies'])
|
||||
]
|
||||
|
||||
return locals()
|
||||
@@ -45,27 +45,28 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
# debug=True
|
||||
patronBlock = item.args + r'<span.*?><\/span>.*?<ul.*?>(?P<block>.*?)<\/ul>'
|
||||
patronMenu = r'href="?(?P<url>[^">]+)"?>(?P<title>[^<»]+)'
|
||||
action = 'peliculas'
|
||||
patronMenu = r'href="?(?P<url>[^">]+)"?>(?P<title>.*?)<\/a>'
|
||||
if 'genere' in item.args.lower():
|
||||
patronGenreMenu = patronMenu
|
||||
action = 'movies'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "series":
|
||||
if category == 'tvshow':
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host + '/serietv/' # aggiornamento-quotidiano-serie-tv/'
|
||||
else:
|
||||
item.contentType = 'movie'
|
||||
item.url = host + '/lista-film-ultimi-100-film-aggiunti/'
|
||||
item.args = "newest"
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
@@ -75,12 +76,13 @@ def newest(categoria):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.info("search", text)
|
||||
|
||||
logger.info("search", item, text)
|
||||
if item.contentType == 'tvshow': item.url = host + '/serietv'
|
||||
else: item.url = host
|
||||
try:
|
||||
item.url = item.url + "/search/" + text.replace(' ', '+')
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
@@ -91,7 +93,7 @@ def search(item, text):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
# esclusione degli articoli 'di servizio'
|
||||
# curYear = datetime.date.today().year
|
||||
@@ -102,25 +104,26 @@ def peliculas(item):
|
||||
# 'Auguri di Buon Natale e Felice Anno Nuovo! – ' + str(curYear) + '!']
|
||||
|
||||
if 'newest' in item.args:
|
||||
pagination = ''
|
||||
pagination = True
|
||||
patronBlock = r'sequex-page-left(?P<block>.*?)sequex-page-right'
|
||||
if '/serietv/' not in item.url:
|
||||
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?)(?:\[(?P<quality>[a-zA-Z]+(?:[/]?3D)?)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z]+(?:[/]?3D)?)\]\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'
|
||||
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>[^<]+)<'
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
|
||||
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]+(?:[/]?3D)?)\]\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>[^<>]+))?'
|
||||
action = 'findvideos'
|
||||
|
||||
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>[^<]+)'
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
item.contentType = 'tvshow'
|
||||
|
||||
patronNext = '<a class="?page-link"? href="?([^>"]+)"?><i class="fa fa-angle-right">'
|
||||
patronTotalPages = '(\d+[\.]?\d+)</option>\s*</sele'
|
||||
|
||||
def itemHook(item):
|
||||
if item.quality2:
|
||||
@@ -131,109 +134,117 @@ def peliculas(item):
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
|
||||
def episodes(item):
|
||||
@support.scrape
|
||||
def folder(item, url):
|
||||
"""
|
||||
Quando c'è un link ad una cartella contenente più stagioni
|
||||
"""
|
||||
if url:
|
||||
data = support.match(url).data
|
||||
actLike = 'episodios'
|
||||
addVideolibrary = False
|
||||
downloadEnabled = False
|
||||
def listed(item, data):
|
||||
actLike = 'episodes'
|
||||
disableAll = True
|
||||
|
||||
patron = r'<td>(?P<title>[^<]+)<td><a [^>]+href="(?P<url>[^"]+)[^>]+>'
|
||||
sceneTitle = True
|
||||
# debug = True
|
||||
patronBlock = r'(?P<block>sp-head[^>]+>\s*(?:STAGION[EI]\s*(?:(?:DA)?\s*[0-9]+\s*A)?\s*[0-9]+|MINISSERIE)(?::\s*PARTE\s*[0-9]+)? - (?P<lang>[^-<]+)(?:- (?P<quality>[^-<]+))?.*?<\/div>.*?)spdiv[^>]*>'
|
||||
patron = r'(?:/>|<p>|<strong>)(?P<data>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
||||
|
||||
def itemHook(item):
|
||||
item.serieFolder = True
|
||||
return item
|
||||
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
|
||||
folderItemlist = folder(item, scrapertools.find_single_match(data, r'TUTT[EA] 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[^>]*>'
|
||||
patron = r'(?:/>|<p>|<strong>)(?P<other>.*?(?P<episode>[0-9]+(?:×|ÃÂ)[0-9]+)\s*(?P<title2>.*?)?(?:\s*–|\s*-|\s*<).*?)(?:<\/p>|<br)'
|
||||
def itemlistHook(itemlist):
|
||||
title_dict = {}
|
||||
itlist = []
|
||||
for i in itemlist:
|
||||
i.url = item.url
|
||||
i.title = re.sub(r'\.(\D)',' \\1', i.title)
|
||||
match = support.match(i.title, patron=r'(\d+.\d+)').match.replace('x','')
|
||||
i.order = match
|
||||
if match not in title_dict:
|
||||
title_dict[match] = i
|
||||
elif match in title_dict and i.contentLanguage == title_dict[match].contentLanguage \
|
||||
or i.contentLanguage == 'ITA' and not title_dict[match].contentLanguage \
|
||||
or title_dict[match].contentLanguage == 'ITA' and not i.contentLanguage:
|
||||
title_dict[match].url = i.url
|
||||
else:
|
||||
title_dict[match + '1'] = i
|
||||
itemlist = listed(item, data)
|
||||
itemlist.extend(folder(item, data) if 'TUTTE LE' in data or 'TUTTA LA' in data else [])
|
||||
|
||||
for key, value in title_dict.items():
|
||||
itlist.append(value)
|
||||
itemDict = {'ITA':{}, 'Sub-ITA':{}}
|
||||
seasons = []
|
||||
|
||||
itlist = sorted(itlist, key=lambda it: (it.contentLanguage, int(it.order)))
|
||||
for it in itemlist:
|
||||
it.contentType = 'episode'
|
||||
if it.contentSeason and it.contentSeason not in seasons:
|
||||
seasons.append(it.contentSeason)
|
||||
itemDict['ITA'][it.contentSeason] = []
|
||||
itemDict['Sub-ITA'][it.contentSeason] = []
|
||||
if it.contentSeason:
|
||||
if not it.contentLanguage: it.contentLanguage = 'ITA'
|
||||
itemDict[it.contentLanguage][it.contentSeason].append(it)
|
||||
|
||||
itlist.extend(folderItemlist)
|
||||
|
||||
return itlist
|
||||
return locals()
|
||||
itlist = []
|
||||
for season in sorted(seasons):
|
||||
itlist.extend(sorted(itemDict['ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
|
||||
itlist.extend(sorted(itemDict['Sub-ITA'].get(season, []), key=lambda it: (it.contentSeason, it.contentEpisodeNumber)))
|
||||
itemlist = itlist
|
||||
|
||||
if not support.stackCheck(['add_tvshow', 'get_episodes', 'update', 'find_episodes']):
|
||||
if len(seasons) > 1:
|
||||
itemlist = support.season_pagination(itemlist, item, [], 'episodes')
|
||||
else:
|
||||
itemlist = support.pagination(itemlist, item, 'episodes')
|
||||
if config.getSetting('episode_info'):
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
if item.serieFolder:
|
||||
return support.server(item, data=item.url)
|
||||
if item.contentType == "episode":
|
||||
return findvid_serie(item)
|
||||
|
||||
def load_links(itemlist, re_txt, desc_txt, quality=""):
|
||||
streaming = scrapertools.find_single_match(data, re_txt).replace('"', '')
|
||||
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()
|
||||
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:
|
||||
|
||||
itemlist = []
|
||||
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))
|
||||
|
||||
# Carica la pagina
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub('\n|\t', '', data)
|
||||
logger.debug()
|
||||
|
||||
# Estrae i contenuti - Streaming
|
||||
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
|
||||
itemlist = []
|
||||
|
||||
# Estrae i contenuti - Streaming HD
|
||||
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD")
|
||||
# Carica la pagina
|
||||
data = httptools.downloadpage(item.url).data
|
||||
data = re.sub('\n|\t', '', data)
|
||||
|
||||
# Estrae i contenuti - Streaming 3D
|
||||
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D")
|
||||
# Estrae i contenuti - Streaming
|
||||
load_links(itemlist, '<strong>Streamin?g:</strong>(.*?)cbtable', "Streaming", "SD")
|
||||
|
||||
# Extract the quality format
|
||||
patronvideos = r'([\w.]+)</strong></div></td>'
|
||||
return support.server(item, itemlist=itemlist, patronTag=patronvideos)
|
||||
# Estrae i contenuti - Streaming HD
|
||||
load_links(itemlist, '<strong>Streamin?g HD[^<]+</strong>(.*?)cbtable', "Streaming HD", "HD")
|
||||
|
||||
# Estrae i contenuti - Download
|
||||
# load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download")
|
||||
# Estrae i contenuti - Streaming 3D
|
||||
load_links(itemlist, '<strong>Streamin?g 3D[^<]+</strong>(.*?)cbtable', "Streaming 3D")
|
||||
|
||||
# Estrae i contenuti - Download HD
|
||||
# load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<tableclass=cbtable width=100% height=20>', "azure", "Download HD")
|
||||
itemlist = support.server(item, itemlist=itemlist)
|
||||
# Extract the quality format
|
||||
patronvideos = r'([\w.]+)</strong></div></td>'
|
||||
support.addQualityTag(item, itemlist, data, patronvideos)
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvid_serie(item):
|
||||
logger.debug()
|
||||
data = re.sub(r'((?:<p>|<strong>)?[^\d]*\d*(?:×|Ã)[0-9]+[^<]+)', '', item.other)
|
||||
# Estrae i contenuti - Download
|
||||
# load_links(itemlist, '<strong>Download:</strong>(.*?)<tableclass=cbtable height=30>', "aqua", "Download")
|
||||
|
||||
return support.server(item, data=data)
|
||||
# Estrae i contenuti - Download HD
|
||||
# load_links(itemlist, '<strong>Download HD[^<]+</strong>(.*?)<tableclass=cbtable width=100% height=20>', "azure", "Download HD")
|
||||
|
||||
|
||||
def play(item):
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
"thumbnail": "cinemalibero.png",
|
||||
"banner": "cinemalibero.png",
|
||||
"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": []
|
||||
}
|
||||
|
||||
@@ -7,15 +7,8 @@ import re
|
||||
|
||||
from core import httptools, support, scrapertools
|
||||
from core.item import Item
|
||||
from core.support import typo
|
||||
from platformcode import config, logger
|
||||
import sys
|
||||
|
||||
from platformcode.logger import debug
|
||||
if sys.version_info[0] >= 3:
|
||||
from concurrent import futures
|
||||
else:
|
||||
from concurrent_py2 import futures
|
||||
|
||||
# rimanda a .today che contiene tutti link a .plus
|
||||
# def findhost(url):
|
||||
@@ -36,15 +29,15 @@ headers = [['Referer', host]]
|
||||
def mainlist(item):
|
||||
|
||||
film = ['/category/film/',
|
||||
('Novità', ['', 'peliculas', 'update']),
|
||||
('Novità', ['', 'movies', 'update']),
|
||||
('Generi', ['', 'genres'])]
|
||||
|
||||
tvshow = ['/category/serie-tv/']
|
||||
|
||||
anime = ['/category/anime-giapponesi/']
|
||||
|
||||
## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'peliculas', 'sport', 'tvshow'])]
|
||||
news = [('Ultimi episodi Serie/Anime', ['/aggiornamenti-serie-tv/', 'peliculas', 'update', 'tvshow'])]
|
||||
## Sport = [(support.typo('Sport', 'bullet bold'), ['/category/sport/', 'movies', 'sport', 'tvshow'])]
|
||||
news = [('Ultimi episodi Serie/Anime', ['/aggiornamenti-serie-tv/', 'movies', 'update', 'tvshow'])]
|
||||
|
||||
search = ''
|
||||
|
||||
@@ -52,24 +45,22 @@ def mainlist(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
action = 'check'
|
||||
patronBlock = r'<div class="container">.*?class="col-md-12[^"]*?">(?P<block>.*?)<div class=(?:"container"|"bg-dark ")>'
|
||||
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\-]+)?\)?)?'
|
||||
pagination = 25
|
||||
pagination = True
|
||||
elif item.contentType == 'movie':
|
||||
# action = 'findvideos'
|
||||
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':
|
||||
patronBlock = r'<section id="slider">(?P<block>.*?)</section>'
|
||||
patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})?))/".+?url\((?P<thumb>[^\)]+)\)">'
|
||||
patron = r'<a href="(?P<url>(?:https:\/\/.+?\/(?P<title>[^\/]+[a-zA-Z0-9\-]+)(?P<year>\d{4})))/".+?url\((?P<thumb>[^\)]+)\)">'
|
||||
elif item.contentType == 'tvshow':
|
||||
# action = 'episodios'
|
||||
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>)'
|
||||
pagination = 25
|
||||
pagination = True
|
||||
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>[^\)< ]+))?'
|
||||
else:
|
||||
@@ -86,8 +77,8 @@ def peliculas(item):
|
||||
item.title += support.typo(item.lang2, '_ [] color kod')
|
||||
if item.args == 'update':
|
||||
item.title = item.title.replace('-', ' ')
|
||||
# if item.args == 'search':
|
||||
# item.contentType = 'tvshow' if 'serie-' in item.url else 'movie'
|
||||
if item.args == 'search':
|
||||
item.contentType = 'undefined'
|
||||
|
||||
return item
|
||||
|
||||
@@ -95,87 +86,50 @@ def peliculas(item):
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
data = item.data
|
||||
|
||||
def episodes(item):
|
||||
data=item.data
|
||||
# debug=True
|
||||
if item.args == 'anime':
|
||||
logger.debug("Anime :", item)
|
||||
# blacklist = ['Clipwatching', 'Verystream', 'Easybytez', 'Flix555', 'Cloudvideo']
|
||||
patron = r'<a target=(?P<url>[^>]+>(?P<title>Episodio\s(?P<episode>\d+))(?::)?(?:(?P<title2>[^<]+))?.*?(?:<br|</p))'
|
||||
patronBlock = r'(?:Stagione (?P<season>\d+))?(?:</span><br />|</span></p>|strong></p>)(?P<block>.*?)(?:<div style="margin-left|<span class="txt_dow">)'
|
||||
item.contentType = 'tvshow'
|
||||
elif item.args == 'sport':
|
||||
logger.debug("Sport :", item)
|
||||
patron = r'(?:/>|<p>)\s*(?P<title>[^-]+)-(?P<data>.+?)(?:<br|</p)'
|
||||
patronBlock = r'</strong>\s*</p>(?P<block>.*?</p>)'
|
||||
item.contentType = 'tvshow'
|
||||
elif item.args == 'serie' or item.contentType == 'tvshow':
|
||||
# item.contentType = 'tvshow'
|
||||
elif item.args == 'serie':
|
||||
logger.debug("Serie :", item)
|
||||
# debug=True
|
||||
patron = r'(?:/>|<p>)\s*(?:(?P<episode>\d+(?:x|×|×)\d+|Puntata \d+)(?:-(?P<episode2>\d+))?[;]?[ ]?(?P<title>[^<–-]+))?(?P<data>.*?)(?:<br|</p)'
|
||||
patronBlock = r'Stagione\s(?:[Uu]nica)?(?:(?P<lang>iTA|ITA|Sub-ITA|Sub-iTA))?.*?</strong>(?P<block>.+?)(?:strong>|<div class="at-below)'
|
||||
item.contentType = 'tvshow'
|
||||
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)'
|
||||
# item.contentType = 'tvshow'
|
||||
else:
|
||||
patron = r'(?P<title>\s*[0-9]{2}/[0-9]{2}/[0-9]{4})(?P<data>.*?)(?:<br|</p)'
|
||||
|
||||
def itemHook(it):
|
||||
if not scrapertools.find_single_match(it.title, r'(\d+x\d+)'):
|
||||
it.title = re.sub(r'(\d+) -', '1x\\1', it.title)
|
||||
return it
|
||||
|
||||
def itemlistHook(itl):
|
||||
ret = []
|
||||
if item.args == 'sport':
|
||||
return itl
|
||||
# support.dbg()
|
||||
for it in itl:
|
||||
ep = scrapertools.find_single_match(it.title, r'(\d+x\d+)')
|
||||
if not ep and 'http' in it.data: # stagione intera
|
||||
from lib import unshortenit
|
||||
data = unshortenit.findlinks(it.data)
|
||||
def get_ep(s):
|
||||
srv_mod = __import__('servers.%s' % s.server, None, None, ["servers.%s" % s.server])
|
||||
if hasattr(srv_mod, 'get_filename'):
|
||||
title = srv_mod.get_filename(s.url)
|
||||
ep = scrapertools.get_season_and_episode(title)
|
||||
if ep:
|
||||
if ep not in episodes:
|
||||
episodes[ep] = []
|
||||
episodes[ep].append(s)
|
||||
|
||||
servers = support.server(item, data, CheckLinks=False, Download=False, Videolibrary=False)
|
||||
episodes = {}
|
||||
for s in servers:
|
||||
get_ep(s)
|
||||
# ottengo l'episodio dal nome del file
|
||||
# with futures.ThreadPoolExecutor() as executor:
|
||||
# for s in servers:
|
||||
# executor.submit(get_ep, s)
|
||||
# logger.debug(it.contentLanguage)
|
||||
ret.extend([it.clone(title=typo(ep, 'bold')+typo(it.contentLanguage, '_ [] color kod bold'), contentSeason=int(ep.split('x')[0]), contentEpisodeNumber=int(ep.split('x')[1]), servers=[srv.tourl() for srv in episodes[ep]]) for ep in episodes])
|
||||
elif ep:
|
||||
ret.append(it)
|
||||
return sorted(ret, key=lambda i: i.title)
|
||||
def itemHook(item):
|
||||
if not scrapertools.find_single_match(item.title, r'(\d+x\d+)'):
|
||||
item.title = re.sub(r'(\d+) -', '1x\\1', item.title)
|
||||
return item
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action='peliculas'
|
||||
|
||||
action='movies'
|
||||
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()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.debug(item.url,texto)
|
||||
item.contentType = 'undefined'
|
||||
texto = texto.replace(' ', '+')
|
||||
item.url = host + "/?s=" + texto
|
||||
# item.contentType = 'tv'
|
||||
item.args = 'search'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
@@ -183,19 +137,18 @@ def search(item, texto):
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
logger.debug('newest ->', categoria)
|
||||
def newest(category):
|
||||
logger.debug('newest ->', category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.args = 'newest'
|
||||
try:
|
||||
if categoria == 'series' or categoria == 'anime':
|
||||
if category == 'tvshow' or category == 'anime':
|
||||
item.args = 'update'
|
||||
item.url = host+'/aggiornamenti-serie-tv/'
|
||||
item.contentType = 'tvshow'
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
@@ -208,77 +161,38 @@ def newest(categoria):
|
||||
def check(item):
|
||||
logger.debug()
|
||||
data = support.match(item.url, headers=headers).data
|
||||
# support.dbg()
|
||||
if data:
|
||||
ck = str(support.match(data, patronBlock=r'Genere:(.*?)</span>', patron=r'tag">([^<]+)').matches).lower()
|
||||
ck = support.match(data, patron=r'Supportaci condividendo quest[oa] ([^:]+)').match.lower()
|
||||
|
||||
if 'serie tv' in ck or 'anime' in ck:# in ['serie tv', 'wrestling wwe', 'anime']:
|
||||
if 'anime' in ck:
|
||||
item.args = 'anime'
|
||||
elif 'sport' in ck:
|
||||
item.args = 'sport'
|
||||
else:
|
||||
item.args = 'serie'
|
||||
if ck == 'serie tv':
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'serie'
|
||||
item.data = data
|
||||
itemlist = episodios(item)
|
||||
if not itemlist:
|
||||
item.data = data
|
||||
return findvideos(item)
|
||||
else:
|
||||
return episodes(item)
|
||||
|
||||
elif ck == 'anime':
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'anime'
|
||||
item.data = data
|
||||
return episodes(item)
|
||||
|
||||
elif ck == 'film':
|
||||
item.contentType = 'movie'
|
||||
item.data = data
|
||||
# item.action = 'findvideos'
|
||||
return findvideos(item)
|
||||
|
||||
return itemlist
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
item.data = data
|
||||
itemlist = episodes(item)
|
||||
if not itemlist:
|
||||
item.contentType = 'movie'
|
||||
item.data = data
|
||||
return findvideos(item)
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
def filter_ep(s):
|
||||
srv_mod = __import__('servers.%s' % s.server, None, None, ["servers.%s" % s.server])
|
||||
if hasattr(srv_mod, 'get_filename'):
|
||||
title = srv_mod.get_filename(s.url)
|
||||
# support.dbg()
|
||||
if scrapertools.get_season_and_episode(title) == str(item.contentSeason) + "x" + str(
|
||||
item.contentEpisodeNumber).zfill(2):
|
||||
servers.append(s)
|
||||
logger.debug()
|
||||
# support.dbg()
|
||||
if item.servers:
|
||||
return support.server(item, itemlist=[Item().fromurl(s) for s in item.servers])
|
||||
if not item.data:
|
||||
item.data = httptools.downloadpage(item.url)
|
||||
data = scrapertools.find_single_match(item.data, '<div class="at-above-post addthis_tool"(.*?)<div class="at-below-post')
|
||||
if data:
|
||||
item.data = data
|
||||
|
||||
servers = []
|
||||
if item.args == 'anime':
|
||||
if item.urls: # this is a episode
|
||||
return support.server(item, itemlist=[Item(url=support.unshortenit.FileCrypt().unshorten(u)) for u in item.urls])
|
||||
itemlist = []
|
||||
episodes = {}
|
||||
# support.dbg()
|
||||
for uri in support.unshortenit.FileCrypt().find(item.data):
|
||||
for ep in support.unshortenit.FileCrypt(uri).list_files():
|
||||
ep = ('.'.join(ep[0].split('.')[:-1]), ep[1]) # remove extension
|
||||
if not ep[0] in episodes:
|
||||
episodes[ep[0]] = []
|
||||
episodes[ep[0]].append(ep[1])
|
||||
for ep in episodes.keys():
|
||||
itemlist.append(item.clone(title=ep, urls=episodes[ep], action='findvideos', data=''))
|
||||
return itemlist
|
||||
total_servers = support.server(item, data=item.data)
|
||||
|
||||
if item.contentType == 'episode' and len(set([srv.server for srv in total_servers])) < len([srv.server for srv in total_servers]):
|
||||
# i link contengono più puntate, cerco quindi quella selezionata
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
for s in total_servers:
|
||||
if s.server:
|
||||
executor.submit(filter_ep, s)
|
||||
else:
|
||||
servers.append(s)
|
||||
return servers
|
||||
else:
|
||||
return total_servers
|
||||
item.data = item.data.replace('http://rapidcrypt.net/verys/', '').replace('http://rapidcrypt.net/open/', '') #blocca la ricerca
|
||||
return support.server(item, data=item.data)
|
||||
|
||||
@@ -6,6 +6,6 @@
|
||||
"thumbnail": "cinetecadibologna.png",
|
||||
"banner": "cinetecadibologna.png",
|
||||
"categories": ["documentary"],
|
||||
"not_active":["include_in_newest_peliculas", "include_in_newest_series", "include_in_newest_anime", "include_in_global_search"],
|
||||
"not_active":["include_in_newest_movie", "include_in_newest_tvshow", "include_in_newest_anime"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
# ------------------------------------------------------------
|
||||
# Canale per cinetecadibologna
|
||||
# ------------------------------------------------------------
|
||||
from core.item import Item
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
@@ -22,7 +22,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
if 'epoche' in item.url:
|
||||
patronMenu =r'<li>\s*<a href="(?P<url>[^"]+)">(?P<title>[^>]+)<'
|
||||
elif 'percorsi' in item.url:
|
||||
@@ -34,23 +34,23 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
item.args = 'noorder'
|
||||
item.url = host + '/ricerca/type_ALL/ricerca_' + text
|
||||
item.contentType = 'movie'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
if 'alfabetico' in item.url:
|
||||
patron = r'<img src="(?P<thumb>[^"]+)"[^>]+>\s*[^>]+>\s*<div[^>]+>\s*<div[^>]+>[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?:\[)?(?P<title>[^\]<]+)(?:\]|<)'
|
||||
else:
|
||||
@@ -62,13 +62,13 @@ def peliculas(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
matches = support.match(item, patron=r'filename: "(.*?)"').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)
|
||||
|
||||
|
||||
@@ -2,33 +2,30 @@
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Rai Play
|
||||
# ------------------------------------------------------------
|
||||
import functools
|
||||
|
||||
import requests, uuid
|
||||
from core import jsontools, support, httptools
|
||||
import requests
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
|
||||
typo = support.typo
|
||||
session = requests.Session()
|
||||
session.request = functools.partial(session.request, timeout=httptools.HTTPTOOLS_DEFAULT_DOWNLOAD_TIMEOUT)
|
||||
host = support.config.get_channel_url()
|
||||
deviceId = uuid.uuid4().hex
|
||||
|
||||
# domain = 'https://eu1-prod-direct.discoveryplus.com'
|
||||
domain = 'https://' + session.get("https://prod-realmservice.mercury.dnitv.com/realm-config/www.discoveryplus.com%2Fit%2Fepg").json()["domain"]
|
||||
token = session.get('{}/token?deviceId={}&realm=dplay&shortlived=true'.format(domain, deviceId)).json()['data']['attributes']['token']
|
||||
session.headers = {'User-Agent': 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
|
||||
'Referer': host,
|
||||
'Origin': host,
|
||||
'Cookie': 'st={}'.format(token),
|
||||
'content-type': 'application/json',
|
||||
'x-disco-params': 'realm=dplay,siteLookupKey=dplus_it'}
|
||||
token = session.get('https://disco-api.discoveryplus.it/token?realm=dplayit').json()['data']['attributes']['token']
|
||||
|
||||
api = "https://disco-api.discoveryplus.it"
|
||||
headers = {'User-Agent': 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0',
|
||||
'Referer': host,
|
||||
'Cookie' : 'st=' + token}
|
||||
|
||||
def Dict(item):
|
||||
global pdict
|
||||
pdict = session.get(api + '/cms/routes/{}?decorators=viewingHistory&include=default'.format(item.args), headers=headers).json()['included']
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
top = [('Dirette {bold}', ['', 'live']),
|
||||
('Programmi {bullet bold tv}', ['', 'programs', 'programmi'])]
|
||||
top = [('Dirette {bullet bold}', ['', 'live']),
|
||||
('Programmi {bullet bold tv}', ['', 'movies', 'programmi']),
|
||||
('Generi {bullet bold tv}', ['', 'genres'])]
|
||||
|
||||
search = ''
|
||||
|
||||
@@ -37,189 +34,158 @@ def mainlist(item):
|
||||
|
||||
def search(item, text):
|
||||
itemlist = []
|
||||
|
||||
item.args = 'search'
|
||||
item.text = text
|
||||
|
||||
try:
|
||||
itemlist = peliculas(item)
|
||||
itemlist = movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error(line)
|
||||
logger.error("%s" % line)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def live(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist =[]
|
||||
data = session.get(domain + '/cms/routes/epg?include=default').json()['included']
|
||||
|
||||
for key in data:
|
||||
|
||||
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', []):
|
||||
itemlist.append(item.clone(title = typo(key['attributes']['name'], 'bold'),
|
||||
fulltitle = key['attributes']['name'],
|
||||
plot = key['attributes'].get('description', ''),
|
||||
url = "{}/canali/{}".format(host, key['attributes']['alternateId']),
|
||||
id = key['id'],
|
||||
action = 'findvideos'))
|
||||
return support.thumb(itemlist, live=True)
|
||||
title = key['attributes']['name']
|
||||
plot = key['attributes']['description']
|
||||
url = '{}/canali/{}'.format(host, key['attributes']['alternateId'])
|
||||
_id = key['id']
|
||||
|
||||
|
||||
def programs(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist = []
|
||||
data = session.get(domain + '/cms/routes/browse?include=default').json()['included']
|
||||
images = {key['id'] : key['attributes']['src'] for key in data if key['type'] == 'image'}
|
||||
|
||||
channels = {}
|
||||
for key in data:
|
||||
if key['type'] == 'link' and 'Free' in key['attributes']['packages']:
|
||||
logger.debug(jsontools.dump(key))
|
||||
_title = key['attributes'].get('title', key['attributes'].get('name',''))
|
||||
_id = key['relationships']['linkedContent']['data']['id']
|
||||
_thumb = images.get(key['relationships'].get('images', {}).get('data',[{}])[0].get('id'))
|
||||
channels[_title] ={'id':_id, 'thumb':_thumb}
|
||||
|
||||
itemlist = [item.clone(title='Tutti', id=channels['Tutti']['id'], action='peliculas'),
|
||||
item.clone(title='Generi', id=channels['Tutti']['id'], action='genres'),
|
||||
item.clone(title='Per canale', channels=channels, action='channels')]
|
||||
|
||||
return support.thumb(itemlist)
|
||||
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):
|
||||
logger.debug()
|
||||
|
||||
itemlist = []
|
||||
data = session.get('{}/cms/collections/{}?include=default'. format(domain, item.id)).json()['included']
|
||||
collection = {k['id']: k['relationships'].get('show', k['relationships'].get('collection'))['data']['id'] for k in data if k['type'] == 'collectionItem'}
|
||||
|
||||
included = {}
|
||||
for key in data:
|
||||
if key.get('relationships', {}).get('items') and key['type'] == 'collection' and key['attributes']['title'] not in ['A-Z', 'I più visti']:
|
||||
included[key['attributes']['title']] = [k['id'] for k in key['relationships']['items']['data']]
|
||||
|
||||
for title, values in included.items():
|
||||
itemlist.append(item.clone(title=title, action='peliculas', filter=[collection[k] for k in values]))
|
||||
|
||||
itemlist.sort(key=lambda it: it.title)
|
||||
|
||||
return support.thumb(itemlist, genre=True)
|
||||
|
||||
|
||||
def channels(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist = [item.clone(title=k, id=v['id'], thumbnail=v['thumb'], action='peliculas') for k, v in item.channels.items() if k !='Tutti']
|
||||
itemlist.sort(key=lambda it: it.title)
|
||||
|
||||
item.action = 'movies'
|
||||
itemlist = [
|
||||
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='Serie TV', args='genere/serie-tv'),
|
||||
item.clone(title='Casa', args='genere/casa'),
|
||||
item.clone(title='Comedy', args='genere/comedy'),
|
||||
item.clone(title='Crime', args='genere/crime'),
|
||||
item.clone(title='Documentari', args='genere/documentari'),
|
||||
# item.clone(title='Discovery + Originals', args='genere/discoveryplus-original'),
|
||||
item.clone(title='Food', args='genere/food'),
|
||||
item.clone(title='Medical', args='genere/medical'),
|
||||
item.clone(title='Motori', args='genere/motori'),
|
||||
item.clone(title='Natura', args='genere/natura'),
|
||||
item.clone(title='Paranormal', args='genere/paranormal'),
|
||||
item.clone(title='People', args='genere/people'),
|
||||
item.clone(title='Real Adventure', args='genere/real-adventure'),
|
||||
item.clone(title='Real Life', args='genere/real-life'),
|
||||
item.clone(title='Scienza e Spazio', args='genere/scienza-e-spazio'),
|
||||
item.clone(title='Sex and love', args='genere/sex-and-love'),
|
||||
item.clone(title='Sport', args='genere/sport'),
|
||||
item.clone(title='Talent Show', args='genere/talent-show'),
|
||||
]
|
||||
return itemlist
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist =[]
|
||||
|
||||
if item.text:
|
||||
data = session.get('{}/cms/routes/search/result?include=default&contentFilter[query]={}'.format(domain, item.text)).json()['included']
|
||||
if 'search' in item.args:
|
||||
pdict = session.get('{}/content/shows?include=genres,images,primaryChannel.images,contentPackages&page[size]=12&query={}'.format(api, item.text), headers=headers).json()['data']
|
||||
else:
|
||||
data = session.get('{}/cms/collections/{}?include=default'.format(domain, item.id)).json()['included']
|
||||
pdict = session.get('{}/cms/routes/{}?decorators=viewingHistory&include=default'.format(api, item.args), headers=headers).json()['included']
|
||||
images = list(filter(lambda x: x['type'] == 'image', pdict))
|
||||
|
||||
images = {key['id'] : key['attributes']['src'] for key in data if key['type'] == 'image'}
|
||||
|
||||
for key in data:
|
||||
if key['type'] == 'show' and 'Free' in str(key.get('relationships',{}).get('contentPackages',{}).get('data',[])) and key['attributes']['episodeCount']:
|
||||
|
||||
if item.filter and key['id'] not in item.filter:
|
||||
continue
|
||||
|
||||
thumbId = key['relationships'].get('images',{}).get('data', [{},{},{}])[2].get('id', '')
|
||||
fanartId = key['relationships'].get('images',{}).get('data', [{}])[0].get('id', '')
|
||||
for key in pdict:
|
||||
if key['type'] == 'show' and 'Free' in str(key.get('relationships',{}).get('contentPackages',{}).get('data',[])):
|
||||
title = key['attributes']['name']
|
||||
plot = key['attributes'].get('description','')
|
||||
url = '{}/programmi/{}'.format(host, key['attributes']['alternateId'])
|
||||
seasons = key['attributes']['seasonNumbers']
|
||||
thumbs = [image['attributes']['src'] for image in images if image['id'] == key['relationships']['images']['data'][0]['id']]
|
||||
thumb = thumbs[0] if thumbs else item.thumbnail
|
||||
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
|
||||
itemlist.append(
|
||||
item.clone(title=typo(key['attributes']['name'],'bold'),
|
||||
plot=key['attributes'].get('description',''),
|
||||
programid=key['attributes']['alternateId'],
|
||||
seasons=key['attributes']['seasonNumbers'],
|
||||
action='seasons',
|
||||
thumbnail=images[thumbId] if thumbId else item.thumbnail,
|
||||
fanart=images[fanartId] if fanartId else item.fanart,
|
||||
contentType='tvshow'))
|
||||
|
||||
itemlist.sort(key=lambda it: it.title)
|
||||
|
||||
if not itemlist:
|
||||
from core.item import Item
|
||||
itemlist = [Item(title='Nessun Contenuto Free Disponibile', thumbnail=support.thumb('info'))]
|
||||
item.clone(title=title,
|
||||
fulltitle=title,
|
||||
plot=plot,
|
||||
url=url,
|
||||
programid=key['attributes']['alternateId'],
|
||||
id=key['id'],
|
||||
seasons=seasons,
|
||||
action='episodes',
|
||||
thumbnail=thumb,
|
||||
fanart=fanart,
|
||||
contentType='tvshow'))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def seasons(item):
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist = []
|
||||
data = session.get('{}/cms/routes/show/{}?include=default'.format(domain, item.programid)).json()['included']
|
||||
|
||||
for key in data:
|
||||
if key['type'] == 'collection':
|
||||
for option in key['attributes']['component']['filters'][0]['options']:
|
||||
itemlist.append(item.clone(title="Stagione {}".format(option['value']),
|
||||
season=int(option['value']),
|
||||
seasonparams=option['parameter'],
|
||||
showparams=key['attributes']['component']['mandatoryParams'],
|
||||
id=key['id'],
|
||||
contentType='season',
|
||||
action='episodios'))
|
||||
break
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def episodios(item):
|
||||
logger.debug()
|
||||
|
||||
itemlist =[]
|
||||
data = session.get('{}/cms/collections/{}?include=default&{}&{}'.format(domain, item.id, item.seasonparams, item.showparams)).json()['included']
|
||||
images = {key['id'] : key['attributes']['src'] for key in data if key['type'] == 'image'}
|
||||
pdict = session.get(api + '/cms/routes/programmi/{}?decorators=viewingHistory&include=default'.format(item.programid), headers=headers).json()['included']
|
||||
|
||||
for key in data:
|
||||
if key['type'] == 'video' and 'Free' in str(key.get('relationships',{}).get('contentPackages',{}).get('data',[])):
|
||||
itemlist.append(item.clone(title = "{}x{:02d} - {}".format(item.season, key['attributes']['episodeNumber'], key['attributes']['name']),
|
||||
plot = key['attributes']['description'],
|
||||
episode = key['attributes']['episodeNumber'],
|
||||
contentType = 'episode',
|
||||
action = 'findvideos',
|
||||
thumbnail = images[key['relationships']['images']['data'][0]['id']],
|
||||
id=key['id']))
|
||||
for key in pdict:
|
||||
if key['type'] == 'collection' and key.get('attributes',{}).get('component',{}).get('id', '') == 'tabbed-content':
|
||||
mandatory = key['attributes']['component'].get('mandatoryParams','')
|
||||
if not mandatory: return [support.Item(title='CONTENUTO PLUS')]
|
||||
for option in key['attributes']['component']['filters'][0]['options']:
|
||||
url = '{}/cms/collections/{}?decorators=viewingHistory&include=default&{}&{}'.format(api, key['id'], mandatory, option['parameter'])
|
||||
seasons = []
|
||||
season = {}
|
||||
try:
|
||||
season = session.get(url, headers=headers).json()
|
||||
seasons.append(season['included'])
|
||||
pages = season['data'].get('meta',{}).get('itemsTotalPages', 0)
|
||||
if pages:
|
||||
for page in range(2,pages + 1):
|
||||
url = '{}/cms/collections/{}?decorators=viewingHistory&include=default&{}&{}&page[items.number]={}'.format(api, key['id'], mandatory, option['parameter'], page)
|
||||
logger.debug(url)
|
||||
season = session.get(url, headers=headers).json()['included']
|
||||
seasons.append(season)
|
||||
except:
|
||||
pass
|
||||
|
||||
itemlist.sort(key=lambda it: it.episode)
|
||||
|
||||
if not itemlist:
|
||||
from core.item import Item
|
||||
itemlist = [Item(title='Nessun Episodio Free Disponibile', thumbnail=support.thumb('info'))]
|
||||
for season in seasons:
|
||||
for episode in season:
|
||||
if episode['type'] == 'video' and 'Free' in episode['attributes']['packages']:
|
||||
title = '{}x{:02d} - {}'.format(option['id'], episode['attributes']['episodeNumber'], episode['attributes']['name'])
|
||||
plot = episode['attributes']['description']
|
||||
itemlist.append(
|
||||
item.clone(title=title,
|
||||
fulltitle=title,
|
||||
plot=plot,
|
||||
id=episode['id'],
|
||||
action='findvideos',
|
||||
contentType='episode',
|
||||
season=option['id'],
|
||||
episode=episode['attributes']['episodeNumber'],
|
||||
forcethumb=True,
|
||||
no_return=True))
|
||||
|
||||
if itemlist: itemlist.sort(key=lambda it: (int(it.season), int(it.episode)))
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
return support.server(item, itemlist=[item.clone(server='directo', action='play')])
|
||||
|
||||
content = 'video' if item.contentType == 'episode' else 'channel'
|
||||
post = {content + 'Id': item.id, 'deviceInfo': {'adBlocker': False,'drmSupported': True}}
|
||||
|
||||
data = session.post('{}/playback/v3/{}PlaybackInfo'.format(domain, content), json=post).json().get('data',{}).get('attributes',{})
|
||||
|
||||
if data.get('protection', {}).get('drmEnabled',False):
|
||||
def play(item):
|
||||
if item.livefilter:
|
||||
item.id = liveDict()[item.livefilter]['id']
|
||||
item.fulltitle = item.livefilter
|
||||
item.forcethumb = True
|
||||
item.no_return = 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',{})
|
||||
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):
|
||||
item.url = data['streaming']['dash']['url']
|
||||
item.drm = 'com.widevine.alpha'
|
||||
item.license ="{}|PreAuthorization={}|R{{SSM}}|".format(data['protection']['schemes']['widevine']['licenseUrl'], data['protection']['drmToken'])
|
||||
item.license = data['protection']['schemes']['widevine']['licenseUrl'] + '|PreAuthorization=' + data['protection']['drmToken'] + '|R{SSM}|'
|
||||
else:
|
||||
item.url = data['streaming'][0]['url']
|
||||
item.url = data['streaming']['hls']['url']
|
||||
item.manifest = 'hls'
|
||||
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
return [item]
|
||||
@@ -2,9 +2,9 @@
|
||||
"id": "dreamsub",
|
||||
"name": "DreamSub",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"active": true,
|
||||
"thumbnail": "dreamsub.png",
|
||||
"banner": "dreamsub.png",
|
||||
"categories": ["anime", "vos"],
|
||||
"categories": ["anime", "sub"],
|
||||
"settings": []
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,22 +4,21 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.info(item)
|
||||
|
||||
anime = ['/search?typeY=tv',
|
||||
('Movie', ['/search?typeY=movie', 'peliculas', '', 'movie']),
|
||||
('OAV', ['/search?typeY=oav', 'peliculas', '', 'tvshow']),
|
||||
('Spinoff', ['/search?typeY=spinoff', 'peliculas', '', 'tvshow']),
|
||||
('Movie', ['/search?typeY=movie', 'movies', '', 'movie']),
|
||||
('OAV', ['/search?typeY=oav', 'movies', '', 'tvshow']),
|
||||
('Spinoff', ['/search?typeY=spinoff', 'movies', '', 'tvshow']),
|
||||
('Generi', ['','menu','Generi']),
|
||||
('Stato', ['','menu','Stato']),
|
||||
('Ultimi Episodi', ['', 'peliculas', ['last', 'episodiRecenti']]),
|
||||
('Ultimi Aggiornamenti', ['', 'peliculas', ['last', 'episodiNuovi']])
|
||||
('Ultimi Episodi', ['', 'movies', ['last', 'episodiRecenti']]),
|
||||
('Ultimi Aggiornamenti', ['', 'movies', ['last', 'episodiNuovi']])
|
||||
]
|
||||
|
||||
return locals()
|
||||
@@ -28,14 +27,15 @@ def mainlist(item):
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
item.contentType = ''
|
||||
action = 'peliculas'
|
||||
|
||||
action = 'movies'
|
||||
|
||||
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>'
|
||||
|
||||
if 'generi' in item.args.lower():
|
||||
patronGenreMenu = patronMenu
|
||||
|
||||
def itemHook(item):
|
||||
support.info(item.type)
|
||||
for Type, ID in support.match(item.other, patron=r'data-type="([^"]+)" data-id="([^"]+)"').matches:
|
||||
item.url = host + '/search?' + Type + 'Y=' + ID
|
||||
return item
|
||||
@@ -43,52 +43,52 @@ def menu(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/search/' + text
|
||||
item.args = 'search'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('search log:', line)
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
if category == "anime":
|
||||
item.url = host
|
||||
item.args = ['last', 'episodiNuovi']
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
anime = True
|
||||
numerationEnabled = True
|
||||
if 'movie' in item.url:
|
||||
item.contentType = 'movie'
|
||||
action = 'findvideos'
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
|
||||
if len(item.args) > 1 and item.args[0] == 'last':
|
||||
patronBlock = r'<div id="%s"[^>]+>(?P<block>.*?)<div class="vistaDettagliata"' % item.args[1]
|
||||
patron = r'<li>\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)" class="thumb">[^>]+>[^>]+>[^>]+>\s*[EePp]+\s*(?P<episode>\d+)[^>]+>\s+<img src="(?P<thumb>[^"]+)"'
|
||||
patron = r'<li>\s*<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)" class="thumb">[^>]+>[^>]+>[^>]+>\s*[EePp]+\s*(?P<episode>\d+)[^>]+>\s<img src="(?P<thumb>[^"]+)"'
|
||||
else:
|
||||
patron = r'<div class="showStreaming">\s*<b>(?P<title>[^<]+)[^>]+>[^>]+>\s*<span>Lingua:\s*(?:DUB|JAP)?\s*(?P<lang>(?:SUB )?ITA)[^>]+>[<>br\s]+a href="(?P<url>[^"]+)"[^>]+>.*?--image-url:url\(/*(?P<thumb>[^\)]+).*?Anno di inizio</b>:\s*(?P<year>[0-9]{4})'
|
||||
patronNext = '<li class="currentPage">[^>]+><li[^<]+<a href="([^"]+)">'
|
||||
@@ -102,35 +102,33 @@ def peliculas(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
anime = True
|
||||
# debug = True
|
||||
pagination = 100
|
||||
def episodes(item):
|
||||
numerationEnabled = True
|
||||
pagination = True
|
||||
|
||||
if item.data:
|
||||
data = item.data
|
||||
|
||||
patron = r'<div class="sli-name">\s*<a\s+href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<'
|
||||
patron = r'<div class="sli-name">\s*<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
support.info()
|
||||
# support.dbg()
|
||||
logger.debug()
|
||||
|
||||
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':
|
||||
item.data = matches.data
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
return episodes(item)
|
||||
|
||||
if 'vvvvid' in matches.data:
|
||||
itemlist.append(item.clone(action="play", title='VVVVID', url=support.match(matches.data, patron=r'(http://www.vvvvid[^"]+)').match, server='vvvvid'))
|
||||
else:
|
||||
support.info('VIDEO')
|
||||
logger.debug('VIDEO')
|
||||
for url in matches.matches:
|
||||
lang = url.split('/')[-2]
|
||||
if 'ita' in lang.lower():
|
||||
|
||||
10
channels/dsda.json
Normal file
10
channels/dsda.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "dsda",
|
||||
"name": "D.S.D.A",
|
||||
"language": ["ita"],
|
||||
"active": false,
|
||||
"thumbnail": "dsda.png",
|
||||
"banner": "dsda.png",
|
||||
"categories": ["documentary"],
|
||||
"settings": []
|
||||
}
|
||||
140
channels/dsda.py
Normal file
140
channels/dsda.py
Normal file
@@ -0,0 +1,140 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per documentaristreamingda
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import logger, config
|
||||
|
||||
host = config.get_channel_url()
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
docu = [('Documentari {bullet bold}',('/elenco-documentari','movies')),
|
||||
('Categorie {submenu documentary}',('','menu')),
|
||||
('Cerca... {bullet bold documentary}',('','search')),]
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action = 'movies'
|
||||
patronMenu = r'<li class="menu-item menu-item-type-taxonomy[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)<'
|
||||
def fullItemlistHook(itemlist):
|
||||
item_list = []
|
||||
title_list = []
|
||||
for item in itemlist:
|
||||
if item.title not in title_list:
|
||||
item_list.append(item)
|
||||
title_list.append(item.title)
|
||||
itemlist = item_list
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
def newest(category):
|
||||
logger.debug()
|
||||
item = Item()
|
||||
try:
|
||||
if category == "documentales":
|
||||
item.url = host + "/elenco-documentari"
|
||||
item.action = "movies"
|
||||
return movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.debug(texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
blacklist = ['GUIDA PRINCIPIANTI Vedere film e documentari streaming gratis', 'Guida Dsda']
|
||||
data = support.match(item).data
|
||||
# debug =True
|
||||
if item.args == 'collection':
|
||||
if 'class="panel"' in data:
|
||||
item.args = 'raccolta'
|
||||
patron = r'class="title-episodio">(?P<title>[^<]+)<(?P<url>.*?)<p'
|
||||
# patron = r'<a (?:style="[^"]+" )?href="(?P<url>[^"]+)"[^>]+>(?:[^>]+><strong>)?(?P<title>[^<]+)(?:</a>)?</strong'
|
||||
else:
|
||||
patron = r'<div class="cover-racolta">\s*<a href="(?P<url>[^"]+)"[^>]+>\s*<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)".*?<p class="title[^>]+>(?P<title>[^<]+)<'
|
||||
else:
|
||||
patron = r'<article[^>]+>[^>]+>[^>]+>(?:<img width="[^"]+" height="[^"]+" src="(?P<thumb>[^"]+)"[^>]+>)?.*?<a href="(?P<url>[^"]+)"[^>]*>\s*(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*<p>(?P<plot>[^<]+)<'
|
||||
patronNext = r'<a class="page-numbers next" href="([^"]+)">'
|
||||
|
||||
# select category
|
||||
def itemHook(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()
|
||||
if 'serie' in item.fulltitle.lower():
|
||||
item.contentType = 'tvshow'
|
||||
item.action = 'episodes'
|
||||
item.contentSerieName = title
|
||||
item.contentTitle = ''
|
||||
elif 'collezion' in item.fulltitle.lower() or \
|
||||
'raccolt' in item.fulltitle.lower() or \
|
||||
'filmografia' in item.fulltitle.lower():
|
||||
item.args = 'collection'
|
||||
item.action = 'movies'
|
||||
item.contentTitle = title
|
||||
item.contentSerieName = ''
|
||||
else:
|
||||
item.contentTitle = title
|
||||
item.contentSerieName = ''
|
||||
|
||||
item.title = support.typo(title,'bold')
|
||||
item.fulltitle = item.show = title
|
||||
return item
|
||||
# remove duplicates
|
||||
def fullItemlistHook(itemlist):
|
||||
item_list = []
|
||||
title_list = []
|
||||
for item in itemlist:
|
||||
if item.title not in title_list:
|
||||
item_list.append(item)
|
||||
title_list.append(item.title)
|
||||
itemlist = item_list
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodes(item):
|
||||
html = support.match(item, patron=r'class="title-episodio">(\d+x\d+)')
|
||||
data = html.data
|
||||
if html.match:
|
||||
patron = r'class="title-episodio">(?P<episode>[^<]+)<(?P<url>.*?)<p'
|
||||
else:
|
||||
patron = r'class="title-episodio">(?P<title>[^<]+)<(?P<url>.*?)<p'
|
||||
|
||||
# def itemlistHook(itemlist):
|
||||
# counter = 0
|
||||
# for item in itemlist:
|
||||
# episode = support.match(item.title, patron=r'\d+').match
|
||||
# if episode == '1':
|
||||
# counter += 1
|
||||
# item.title = support.typo(str(counter) + 'x' + episode.zfill(2) + support.re.sub(r'\[[^\]]+\](?:\d+)?','',item.title),'bold')
|
||||
# return itemlist
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
if item.args == 'raccolta' or item.contentType == 'episode':
|
||||
return support.server(item, item.url)
|
||||
else:
|
||||
return support.server(item)
|
||||
@@ -5,6 +5,6 @@
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "eurostreaming.png",
|
||||
"banner": "eurostreaming.png",
|
||||
"categories": ["tvshow","anime","vos"],
|
||||
"categories": ["tvshow","anime","sub"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import logger
|
||||
|
||||
# def findhost(url):
|
||||
# permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
|
||||
@@ -17,40 +18,38 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.info()
|
||||
tvshow = []
|
||||
anime = ['/category/anime-cartoni-animati/']
|
||||
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi-nuovi/', 'peliculas', 'newest']),
|
||||
('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'peliculas'])]
|
||||
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'movies', 'newest']),
|
||||
('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'movies'])]
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
|
||||
if item.args == 'newest':
|
||||
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>'
|
||||
pagination = ''
|
||||
pagination = True
|
||||
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>'
|
||||
patronNext=r'a class="next page-numbers" href="?([^>"]+)">Avanti »</a>'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
# debug = True
|
||||
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
|
||||
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>'
|
||||
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):
|
||||
i.url = item.url
|
||||
@@ -59,50 +58,44 @@ def episodios(item):
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info()
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
|
||||
item.url = "%s/?s=%s" % (host, texto)
|
||||
item.url = "%s/?s=%s" % (host, text)
|
||||
item.contentType = 'tvshow'
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info(line)
|
||||
logger.error(line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info()
|
||||
def newest(category):
|
||||
logger.debug()
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'newest'
|
||||
try:
|
||||
item.url = "%s/aggiornamento-nuovi-episodi/" % host
|
||||
item.action = "peliculas"
|
||||
itemlist = peliculas(item)
|
||||
item.url = "%s/aggiornamento-episodi/" % host
|
||||
item.action = "movies"
|
||||
itemlist = movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
itemlist = support.server(item, item.other)
|
||||
# testo che tutti i link siano stati risolti
|
||||
if support.logger.testMode:
|
||||
if len(itemlist) < len(support.match(item.other, patron='<a href="([^"]+)').matches):
|
||||
raise Exception('Manca qualche server')
|
||||
return itemlist
|
||||
|
||||
logger.debug()
|
||||
return support.server(item, item.data)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "eurostreaming_actor",
|
||||
"name": "Eurostreaming Actor",
|
||||
"active": true,
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "eurostreaming.png",
|
||||
"banner": "eurostreaming.png",
|
||||
"categories": ["tvshow","anime","vos"],
|
||||
"settings": []
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Eurostreaming.Actor
|
||||
# by Napster32
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.info()
|
||||
tvshow = []
|
||||
anime = ['/animazione/']
|
||||
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'peliculas', 'newest'])]
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
action = 'episodios'
|
||||
|
||||
if item.args == 'newest':
|
||||
item.contentType = 'episode'
|
||||
patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>[^<]+) –\s*<a href="(?P<url>[^"]+)"[^>]*>(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>'
|
||||
patronNext = r'class="next".*?"(.+?)"'
|
||||
|
||||
else:
|
||||
patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)[\<]?[/(](?P<year>.*?)[\)|a]'
|
||||
patronNext = r'next.*?href="(.*?)"'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
# debug = True
|
||||
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
|
||||
|
||||
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'tab-content(?P<block>.*?)serie-player'
|
||||
patron = r'data-link="(?P<url>http.*?)".*?data.num..(?P<season>\d+)x(?P<episode>\d+)" data-title="(?P<title>[^"]+)'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info()
|
||||
|
||||
item.url = host + '/index.php?story=%s&do=search&subaction=search' % (texto)
|
||||
item.contentType = 'tvshow'
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info(line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info()
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'newest'
|
||||
try:
|
||||
item.url = "%s/aggiornamento-episodi/" % host
|
||||
item.action = "peliculas"
|
||||
itemlist = peliculas(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
itemlist = support.server(item, item.url)
|
||||
return itemlist
|
||||
11
channels/fastsubita.json
Normal file
11
channels/fastsubita.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "fastsubita",
|
||||
"name": "Fastsubita",
|
||||
"language": ["sub-ita"],
|
||||
"active": false,
|
||||
"thumbnail": "fastsubita.png",
|
||||
"banner": "fastsubita.png",
|
||||
"categories": ["tvshow", "sub"],
|
||||
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||
"settings": []
|
||||
}
|
||||
208
channels/fastsubita.py
Normal file
208
channels/fastsubita.py
Normal file
@@ -0,0 +1,208 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per fastsubita.py
|
||||
# ------------------------------------------------------------
|
||||
"""
|
||||
|
||||
Su questo canale, nella category 'Ricerca Globale'
|
||||
non saranno presenti le voci 'Aggiungi alla Videoteca'
|
||||
e 'Scarica Film'/'Scarica Serie', dunque,
|
||||
la loro assenza, nel Test, NON dovrà essere segnalata come ERRORE.
|
||||
|
||||
Novità. Indicare in quale/i sezione/i è presente il canale:
|
||||
- serie
|
||||
|
||||
Ulteriori info:
|
||||
- SOLO SUB-ITA
|
||||
|
||||
"""
|
||||
from core import support, httptools
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
Tvshow = [
|
||||
('Aggiornamenti', ['', 'movies', 'update']),
|
||||
('Cerca... {bold}{TV}', ['', 'search'])
|
||||
]
|
||||
|
||||
# search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
deflang = 'Sub-ITA'
|
||||
|
||||
# è una singola pagina con tutti gli episodi
|
||||
if item.grouped and not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
||||
item.grouped = False
|
||||
return episodes_args(item)
|
||||
|
||||
# ogni puntata è un articolo a se
|
||||
if item.fulltitle:
|
||||
item.url = host + '?s=' + item.fulltitle
|
||||
actLike = 'episodes'
|
||||
|
||||
action = 'findvideos'
|
||||
blacklist = ['']
|
||||
if item.args == 'genres':
|
||||
patronBlock = r'<h4 id="mctm1-.">'+item.fulltitle+'</h4>(?P<block>.+?)</div>'
|
||||
patron = r'[^>]+>[^>]+>.+?href="(?P<url>[^"]+)[^>]>(?P<title>[^<]+)\s<'
|
||||
action = 'episodes'
|
||||
elif item.args == 'search':
|
||||
group = True
|
||||
patronBlock = r'</header>(?P<block>.*?)</main>'
|
||||
patron = '(?:<img[^>]+src="(?P<thumb>[^"]+)".*?)?<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+?)(?:(?P<episode>\d+×\d+|\d+×\d+)|\[[sS](?P<season>[0-9]+)[^]]+\])\s?(?:(?P<lang>\([a-zA-Z\s]+\)) (?:[Ss]\d+[Ee]\d+)?\s?(?:[&#\d;|.{3}]+)(?P<title2>[^”[<]+)(?:&#\d)?)?'
|
||||
else:
|
||||
# è 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]+-'):
|
||||
return episodes_args(item)
|
||||
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'
|
||||
|
||||
# def itemlistHook(itemlist):
|
||||
# from core import scraper
|
||||
# return scraper.sort_episode_list(itemlist)
|
||||
|
||||
patronNext = '<a class="next page-numbers" href="(.*?)">Successivi'
|
||||
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
def episodes_args(item):
|
||||
actLike = 'episodes'
|
||||
|
||||
deflang = 'Sub-ITA'
|
||||
action = 'findvideos'
|
||||
patron = '(?P<episode>\d+×\d+|\d+[Ã.]+\d+)(?:\s?\((?P<lang>[a-zA-Z ]+)\))?(?:\s[Ss]\d+[Ee]+\d+)? +(?:“|“)(?P<title2>.*?)(?:”|”).*?(?P<other>.*?)(?:/>|<p)'
|
||||
patronBlock = r'<main id="main" class="site-main" role="main">(?P<block>.*?)</main>'
|
||||
patronNext = '<a class="next page-numbers" href="(.*?)">Successivi'
|
||||
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodes(item):
|
||||
return episodes_args(item)
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
logger.debug()
|
||||
|
||||
action = 'movies'
|
||||
patronBlock = r'<div id="mcTagMapNav">(?P<block>.+?)</div>'
|
||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>.+?)</a>'
|
||||
|
||||
def itemHook(item):
|
||||
item.url = host+'/elenco-serie-tv/'
|
||||
item.contentType = 'tvshow'
|
||||
return item
|
||||
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug('search', text)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '?s=' + text
|
||||
try:
|
||||
item.args = 'search'
|
||||
item.contentType = 'tvshow'
|
||||
return movies(item)
|
||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(category):
|
||||
logger.debug('newest ->', category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
if category == 'tvshow':
|
||||
try:
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'newest'
|
||||
item.url = host
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == 'movies':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error('newest log: ', line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug('findvideos ->', item)
|
||||
patron = r'<a href="([^"]+)">'
|
||||
|
||||
itemlist = []
|
||||
if item.other.startswith('http'):
|
||||
resp = httptools.downloadpage(item.url, follow_redirects=False)
|
||||
data = resp.headers.get("location", "") + '\n'
|
||||
elif item.other:
|
||||
html = support.match(item.other, patron=patron, headers=headers)
|
||||
matches = html.matches
|
||||
data = html.data
|
||||
for scrapedurl in matches:
|
||||
if 'is.gd' in scrapedurl:
|
||||
resp = httptools.downloadpage(scrapedurl, follow_redirects=False)
|
||||
data += resp.headers.get("location", "") + '\n'
|
||||
elif not support.scrapertools.find_single_match(item.url, '-[0-9]+x[0-9]+-'):
|
||||
return episodes(item)
|
||||
else:
|
||||
patronBlock = '<div class="entry-content">(?P<block>.*)<footer class="entry-footer">'
|
||||
html = support.match(item, patron=patron, patronBlock=patronBlock, headers=headers)
|
||||
matches = html.matches
|
||||
data= html.data
|
||||
|
||||
if item.args != 'episodes':
|
||||
item.infoLabels['mediatype'] = 'episode'
|
||||
for scrapedurl in matches:
|
||||
if 'is.gd' in scrapedurl:
|
||||
resp = httptools.downloadpage(scrapedurl, follow_redirects=False)
|
||||
data += resp.headers.get("location", "") + '\n'
|
||||
|
||||
itemlist += support.server(item, data)
|
||||
|
||||
# data = support.match(item.url).data
|
||||
# patron = r'>Posted in <a href="https?://fastsubita.com/serietv/([^/]+)/(?:[^"]+)?"'
|
||||
# series = scrapertools.find_single_match(data, patron)
|
||||
# titles = support.typo(series.upper().replace('-', ' '), 'bold color kod')
|
||||
# goseries = support.typo("Vai alla Serie:", ' bold color kod')
|
||||
# itemlist.append(
|
||||
# item.clone(channel=item.channel,
|
||||
# # title=goseries + titles,
|
||||
# title=titles,
|
||||
# fulltitle=titles,
|
||||
# show=series,
|
||||
# contentType='tvshow',
|
||||
# contentSerieName=series,
|
||||
# url=host+"/serietv/"+series,
|
||||
# action='episodes',
|
||||
# contentTitle=titles,
|
||||
# plot = "Vai alla Serie " + titles + " con tutte le puntate",
|
||||
# ))
|
||||
|
||||
return itemlist
|
||||
11
channels/film4k.json
Normal file
11
channels/film4k.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "film4k",
|
||||
"name": "Film4k",
|
||||
"language": ["ita"],
|
||||
"active": false,
|
||||
"thumbnail": "film4k.png",
|
||||
"banner": "film4k.png",
|
||||
"categories": ["tvshow", "movie", "anime"],
|
||||
"not_active": ["include_in_newest_movie", "include_in_newest_anime", "include_in_newest_tvshow"],
|
||||
"settings": []
|
||||
}
|
||||
82
channels/film4k.py
Normal file
82
channels/film4k.py
Normal file
@@ -0,0 +1,82 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per film4k
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def findhost(url):
|
||||
return support.httptools.downloadpage(url).url
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
film = ['movies',
|
||||
('Qualità', ['', 'menu', 'quality']),
|
||||
('Generi', ['movies', 'menu', 'genres']),
|
||||
('Anno', ['movies', 'menu', 'releases']),
|
||||
('Più popolari', ['trending/?get=movies', 'movies']),
|
||||
('Più votati', ['ratings/?get=movies', 'movies'])]
|
||||
tvshow = ['/tvshows',
|
||||
('Più popolari', ['trending/?get=tv', 'movies']),
|
||||
('Più votati', ['ratings/?get=tv', 'movies'])]
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.info('search', text)
|
||||
item.url = item.url + "/?s=" + text
|
||||
try:
|
||||
return support.dooplay_search(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
def movies(item):
|
||||
if 'anime' in item.url:
|
||||
return support.dooplay_movies(item, True)
|
||||
else:
|
||||
return support.dooplay_movies(item, False)
|
||||
|
||||
|
||||
def episodes(item):
|
||||
itemlist = support.dooplay_get_episodes(item)
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
if item.contentType == 'episode':
|
||||
linkHead = support.httptools.downloadpage(item.url, only_headers=True).headers['link']
|
||||
epId = support.scrapertools.find_single_match(linkHead, r'\?p=([0-9]+)>')
|
||||
for link in support.dooplay_get_links(item, host, paramList=[['tv', epId, 1, 'title', 'server']]):
|
||||
itemlist.append(
|
||||
item.clone(action="play", url=link['url']))
|
||||
else:
|
||||
for link, quality in support.match(item.url, patron="(" + host + """links/[^"]+).*?class="quality">([^<]+)""").matches:
|
||||
srv = support.servertools.find_video_items(data=support.httptools.downloadpage(link).data)
|
||||
for s in srv:
|
||||
s.quality = quality
|
||||
itemlist.extend(srv)
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action = 'movies'
|
||||
if item.args in ['genres','releases']:
|
||||
patronBlock = r'<nav class="' + item.args + r'">(?P<block>.*?)</nav'
|
||||
patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<'
|
||||
else:
|
||||
patronBlock = r'class="main-header">(?P<block>.*?)headitems'
|
||||
patronMenu = r'(?P<url>' + host + r'quality/[^/]+/\?post_type=movies)">(?P<title>[^<]+)'
|
||||
return locals()
|
||||
35
channels/filmigratis.json
Normal file
35
channels/filmigratis.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"id": "filmigratis",
|
||||
"name": "Filmi Gratis",
|
||||
"active": false,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "filmigratis.png",
|
||||
"banner": "filmigratis.png",
|
||||
"categories": ["movie","tvshow"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_newest_movie",
|
||||
"type": "bool",
|
||||
"label": "@70727",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_tvshow",
|
||||
"type": "bool",
|
||||
"label": "@70727",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_anime",
|
||||
"type": "bool",
|
||||
"label": "@70727",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
}
|
||||
]
|
||||
}
|
||||
151
channels/filmigratis.py
Normal file
151
channels/filmigratis.py
Normal file
@@ -0,0 +1,151 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Filmi Gratis
|
||||
# ------------------------------------------------------------
|
||||
"""
|
||||
La voce "Al cinema" si riferisce ai titoli che scorrono nella home page
|
||||
|
||||
Problemi:
|
||||
- Nessuno noto
|
||||
|
||||
Novità, il canale, è presente in:
|
||||
- FILM
|
||||
"""
|
||||
import re
|
||||
|
||||
from core import httptools, support
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
|
||||
|
||||
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
film = [
|
||||
('Al Cinema ', ['', 'movies', 'cinema']),
|
||||
('Categorie', ['', 'genres', 'genres']),
|
||||
]
|
||||
|
||||
tvshow = ['/serie/ALL',
|
||||
('Generi', ['', 'genres', 'genres'])
|
||||
]
|
||||
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
|
||||
if item.args == 'search':
|
||||
action = ''
|
||||
patron = r'<div class="cnt">.*?src="([^"]+)"[^>]+>[^>]+>[^>]+>\s+(?P<title>.+?)(?:\[(?P<lang>Sub-ITA|SUB-ITA|SUB)\])?\s?(?:\[?(?P<quality>HD).+\]?)?\s?(?:\(?(?P<year>\d+)?\)?)?\s+<[^>]+>[^>]+>[^>]+>\s<a href="(?P<url>[^"]+)"[^<]+<'
|
||||
patronBlock = r'<div class="container">(?P<block>.*?)</main>'
|
||||
elif item.contentType == 'movie':
|
||||
if not item.args:
|
||||
# voce menu: Film
|
||||
patronBlock = r'<h1>Film streaming ita in alta definizione</h1>(?P<block>.*?)<div class="content-sidebar">'
|
||||
patron = r'<div class="timeline-right">[^>]+>\s<a href="(?P<url>.*?)".*?src="(?P<thumb>.*?)".*?<h3 class="timeline-post-title">(?:(?P<title>.+?)\s\[?(?P<lang>Sub-ITA)?\]?\s?\[?(?P<quality>HD)?\]?\s?\(?(?P<year>\d+)?\)?)<'
|
||||
patronNext = r'<a class="page-link" href="([^"]+)">>'
|
||||
elif item.args == 'cinema':
|
||||
patronBlock = r'<div class="owl-carousel" id="postCarousel">(?P<block>.*?)<section class="main-content">'
|
||||
patron = r'background-image: url\((?P<thumb>.*?)\).*?<h3.*?>(?:(?P<title>.+?)\s\[?(?P<lang>Sub-ITA)?\]?\s?\[?(?P<quality>HD)?\]?\s?\(?(?P<year>\d+)?\)?)<.+?<a.+?<a href="(?P<url>[^"]+)"[^>]+>'
|
||||
elif item.args == 'genres':
|
||||
# ci sono dei titoli dove ' viene sostituito con " da support
|
||||
data = httptools.downloadpage(item.url, headers=headers, ignore_response_code=True).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>[^"]+)"'
|
||||
patronBlock = r'<div class="container">(?P<block>.*?)</main>'
|
||||
pagination = True
|
||||
|
||||
patronNext = '<a class="page-link" href="([^"]+)">>>'
|
||||
else:
|
||||
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>[^"]+)"'
|
||||
## 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>[^"]+)"'
|
||||
patronBlock = r'<div class="container">(?P<block>.*?)</main>'
|
||||
|
||||
def itemHook(item):
|
||||
if item.args == 'search':
|
||||
if 'series' in item.url:
|
||||
item.action = 'episodes'
|
||||
item.contentType = 'tvshow'
|
||||
else:
|
||||
item.action = 'findvideos'
|
||||
item.contentType = 'movie'
|
||||
return item
|
||||
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodes(item):
|
||||
action = 'findvideos'
|
||||
patronBlock = r'<div class="row">(?P<block>.*?)<section class="main-content">'
|
||||
patron = r'href="(?P<url>.*?)">(?:.+?)?\s+S(?P<season>\d+)\s\-\sEP\s(?P<episode>\d+)[^<]+<'
|
||||
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
if item.contentType == 'movie':
|
||||
action = 'movies'
|
||||
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
|
||||
patronBlock = r'CATEGORIES.*?<ul>(?P<block>.*?)</ul>'
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
action = 'movies'
|
||||
blacklist = ['Al-Cinema']
|
||||
patron = r'<a href="(?P<url>.*?)">(?P<title>.*?)<'
|
||||
patronBlock = r'class="material-button submenu-toggle"> SERIE TV.*?<ul>.*?</li>(?P<block>.*?)</ul>'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug('search', text)
|
||||
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/search/?s=' + text
|
||||
try:
|
||||
item.args = 'search'
|
||||
return movies(item)
|
||||
# Se captura la excepcion, para no interrumpir al buscador global si un canal falla
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
def newest(category):
|
||||
logger.debug('newest ->', category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if category == 'movie':
|
||||
item.url = host
|
||||
item.contentType = 'movie'
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == 'movies':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error({0}.format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
return support.server(item)
|
||||
@@ -3,14 +3,12 @@
|
||||
# Canale per filmpertutti.py
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import httptools, support
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from platformcode import config, logger
|
||||
|
||||
def findhost(url):
|
||||
page = httptools.downloadpage(url).data
|
||||
url = support.scrapertools.find_single_match(page, 'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)')
|
||||
return url
|
||||
return support.match(url, patron=r'Il nuovo indirizzo di FILMPERTUTTI è ?<a href="([^"]+)').match
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
headers = [['Referer', host]]
|
||||
@@ -24,7 +22,7 @@ def mainlist(item):
|
||||
]
|
||||
|
||||
tvshow = ['/category/serie-tv/',
|
||||
('Aggiornamenti', ['/aggiornamenti-serie-tv/', 'peliculas', 'newest']),
|
||||
('Aggiornamenti', ['/aggiornamenti-serie-tv/', 'movies', 'newest']),
|
||||
('Per Lettera', ['/category/serie-tv/', 'genres', 'lettersS'])
|
||||
]
|
||||
|
||||
@@ -33,11 +31,7 @@ def mainlist(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
support.info()
|
||||
# debug = True
|
||||
#debugBlock = True
|
||||
# support.dbg()
|
||||
def movies(item):
|
||||
|
||||
if item.args != 'newest':
|
||||
patronBlock = r'<ul class="posts">(?P<block>.*)<\/ul>'
|
||||
@@ -50,7 +44,7 @@ def peliculas(item):
|
||||
if item.args == 'search':
|
||||
action = 'check'
|
||||
elif item.contentType == 'tvshow':
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
elif item.contentType == 'movie':
|
||||
action ='findvideos'
|
||||
else:
|
||||
@@ -63,12 +57,12 @@ def peliculas(item):
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
# debug = True
|
||||
def episodes(item):
|
||||
# debug=True
|
||||
data = support.match(item.url, headers=headers).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)'
|
||||
patron = r'<img src="(?P<thumb>[^"]+)"(?:[^>]*>){4}\s*<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:
|
||||
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)'
|
||||
@@ -90,64 +84,64 @@ def genres(item):
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
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()
|
||||
|
||||
|
||||
def check(item):
|
||||
support.info()
|
||||
logger.debug()
|
||||
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
|
||||
if block.lower() != 'film':
|
||||
support.info('select = ### è una serie ###')
|
||||
logger.debug('### è una Serie ###')
|
||||
item.contentType='tvshow'
|
||||
return episodios(item)
|
||||
return episodes(item)
|
||||
else:
|
||||
support.info('select = ### è un movie ###')
|
||||
logger.debug(' ### è un Film ###')
|
||||
item.contentType='movie'
|
||||
return findvideos(item)
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info()
|
||||
item.url = host + "/search/" + texto
|
||||
logger.debug()
|
||||
item.url = host + "/?s=" + texto
|
||||
item.args = 'search'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info()
|
||||
def newest(category):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == "peliculas":
|
||||
if category == "movie":
|
||||
item.url = host + "/category/film/"
|
||||
item.action = "peliculas"
|
||||
item.action = "movies"
|
||||
item.extra = "movie"
|
||||
item.contentType = 'movie'
|
||||
itemlist = peliculas(item)
|
||||
itemlist = movies(item)
|
||||
else:
|
||||
item.url = host + "/aggiornamenti-serie-tv/"
|
||||
item.action = "peliculas"
|
||||
item.action = "movies"
|
||||
item.args = "newest"
|
||||
item.contentType = 'tvshow'
|
||||
itemlist = peliculas(item)
|
||||
itemlist = movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
{
|
||||
"id": "filmstreaming",
|
||||
"name": "Film Streaming",
|
||||
"language": ["ita"],
|
||||
"active": true,
|
||||
"thumbnail": "filmstreaming.png",
|
||||
"banner": "filmstreaming.png",
|
||||
"categories": ["movie"],
|
||||
"settings": []
|
||||
}
|
||||
@@ -1,94 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per filmstreaming
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
film = ['/film',
|
||||
('Al Cinema', ['/cinema', 'peliculas']),
|
||||
('Ultimi Inseriti', ['', 'peliculas', 'last']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Anno', ['', 'genres', 'years'])]
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug('search', text)
|
||||
itemlist = []
|
||||
text = text.replace(" ", "+")
|
||||
item.url = '{}/index.php?do=search&subaction=search&story={}'.format(host, text)
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
logger.debug(categoria)
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == "peliculas":
|
||||
item.url = host
|
||||
item.action = "peliculas"
|
||||
item.contentType = 'movie'
|
||||
item.args = 'last'
|
||||
itemlist = peliculas(item)
|
||||
if itemlist[-1].action == "peliculas":
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug=True
|
||||
if item.args == 'last':
|
||||
patronBlock = r'inseriti:(?P<block>.*?)<div class="block-showmore'
|
||||
patron = r'item-movie">[^>]+><a href="(?P<url>[^"]+)[^>]+><img data-src="(?P<thumb>[^"]+)(?:[^>]+>){6}(?P<title>[^<]+)(?:[^>]+>){4}(?P<year>\d+)?(?:[^>]+>){2}(?P<quality>[^<]+)'
|
||||
# patron = r'item-movie">[^>]+><a href="(?P<url>[^"]+)[^>]+><img data-src="(?P<thumb>[^"]+)(?:[^>]+>){6}(?P<title>[^<]+)(?:[^>]+>){6}(?P<quality>[^<]+)'
|
||||
patronNext = r'<a href="([^"]+)">&rarr'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action = "peliculas"
|
||||
_type ={'years':'Anno', 'genres':'Categorie'}
|
||||
|
||||
patronBlock = _type[item.args] + r'(?:[^>]+>){4}(?P<block>.*?)</ul>'
|
||||
patronMenu = '<li><a href="(?P<url>[^"]+)">(?P<title>.*?)</a>'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
urls = []
|
||||
data = support.match(item.url).data
|
||||
urls += support.match(data, patron=r'<span data-link="([^"]+)').matches
|
||||
url = support.match(data, patron='<iframe [^>]+src="([^"]+)').match
|
||||
if url:
|
||||
urls.append(support.match(url).data)
|
||||
return support.server(item, urls)
|
||||
@@ -2,7 +2,7 @@
|
||||
"id": "guardaseriecam",
|
||||
"name": "GuardaSerie Cam",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": true,
|
||||
"active": false,
|
||||
"thumbnail": "https://raw.githubusercontent.com/32Dexter/DexterRepo/master/media/guardaserie_live.png",
|
||||
"banner": "",
|
||||
"categories": ["tvshow"],
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
# possibilità di miglioramento: inserire menu per genere - lista serie tv e gestire le novità
|
||||
|
||||
from core import support
|
||||
from core.support import info
|
||||
from platformcode import logger, config
|
||||
|
||||
host = config.get_channel_url()
|
||||
@@ -29,40 +28,39 @@ def mainlist(item):
|
||||
@support.scrape
|
||||
def list(item):
|
||||
patronMenu = r'<a title="(?P<title>[^"]+)" href="(?P<url>[^"]+)'
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
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})'
|
||||
patronNext = 'pagenavi.*?<a href="([^"]+)">\d+'
|
||||
action = 'episodios'
|
||||
patronNext = 'pagenavi.*?<span>.</span>.*?<a href="([^"]+)'
|
||||
action = 'episodes'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
patronBlock = r'<div class="tab-pane fade" id="season-(?P<season>.)"(?P<block>.*?)</ul>\s*</div>'
|
||||
def episodes(item):
|
||||
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>[^<]+)'
|
||||
action = 'findvideos'
|
||||
# debugBlock = True
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info('search', text)
|
||||
logger.debug('search', text)
|
||||
item.contentType = 'tvshow'
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/index.php?story=%s&do=search&subaction=search' % (text)
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info('search log:', line)
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
{
|
||||
"id": "guardaserieclick",
|
||||
"name": "GuardaSerie.click",
|
||||
"active": false,
|
||||
"language": ["ita", "vos"],
|
||||
"active": true,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "guardaserieclick.png",
|
||||
"bannermenu": "guardaserieclick.png",
|
||||
"categories": ["tvshow", "anime"],
|
||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime"],
|
||||
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_newest_peliculas",
|
||||
"id": "include_in_newest_movie",
|
||||
"type": "bool",
|
||||
"label": "@70727",
|
||||
"default": false,
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from core.support import info
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -26,28 +25,28 @@ headers = [['Referer', host]]
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
tvshow = ['',
|
||||
('Aggiornamenti', ['', 'peliculas', 'update']),
|
||||
('Aggiornamenti', ['', 'movies', 'update']),
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('News Sub-ITA', ['', 'peliculas', 'ined']),
|
||||
('Anime/Cartoni', ["/category/animazione/", 'peliculas', 'genres'])
|
||||
('News Sub-ITA', ['', 'movies', 'ined']),
|
||||
('Anime/Cartoni', ["/category/animazione/", 'movies', 'genres'])
|
||||
]
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
##@support.scrape
|
||||
##def peliculas(item):
|
||||
##def movies(item):
|
||||
#### 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">'
|
||||
##
|
||||
## if item.args == 'ined':
|
||||
## deflang = 'SUB-ITA'
|
||||
## 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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
## elif item.args == 'update':
|
||||
## 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>[^<]+)<'
|
||||
@@ -59,25 +58,25 @@ def mainlist(item):
|
||||
## elif item.args == 'nolost':
|
||||
## 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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
## elif item.args == 'classic':
|
||||
## 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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
## else:
|
||||
## 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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
##
|
||||
## debug = True
|
||||
## return locals()
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
## import web_pdb; web_pdb.set_trace()
|
||||
info('peliculas ->\n', item)
|
||||
logger.debug('movies ->\n', item)
|
||||
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
blacklist = ['DMCA']
|
||||
|
||||
if item.args == 'genres' or item.args == 'search':
|
||||
@@ -91,36 +90,36 @@ def peliculas(item):
|
||||
else:
|
||||
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>.+?)<'
|
||||
pagination = 25
|
||||
pagination = True
|
||||
if item.args == 'ined':
|
||||
deflang = 'SUB-ITA'
|
||||
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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
elif item.args == 'update':
|
||||
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>.+?)<'
|
||||
# elif item.args == 'nolost':
|
||||
# patronBlock = r'<h2 class="title-typology styck-top" meta-class="title-serie-danonperd">' + end_block
|
||||
# pagination = 25
|
||||
# pagination = True
|
||||
# elif item.args == 'classic':
|
||||
# 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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
## elif item.args == 'anime':
|
||||
##
|
||||
else:
|
||||
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>.+?)<'
|
||||
## pagination = 25
|
||||
## pagination = True
|
||||
# support.regexDbg(item, patronBlock, headers)
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
info()
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
|
||||
action = 'findvideos'
|
||||
patron = r'<div class="number-episodes-on-img">\s?\d+.\d+\s?(?:\((?P<lang>[a-zA-Z\-]+)\))?</div>.+?(?:<span class="pull-left bottom-year">(?P<title2>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<plot>[^<]+)<[^>]+>[^>]+>[^>]+>\s?)?<span(?: meta-nextep="[^"]+")? class="[^"]+" meta-serie="(?P<title>[^"]+)" meta-stag="(?P<season>\d+)" meta-ep="(?P<episode>\d+)" meta-embed="(?P<url>[^>]+)">'
|
||||
@@ -136,9 +135,9 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
info()
|
||||
logger.debug()
|
||||
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
patronMenu = r'<li>\s<a\shref="(?P<url>[^"]+)"[^>]+>(?P<title>[^<]+)</a></li>'
|
||||
patron_block = r'<ul\sclass="dropdown-menu category">(?P<block>.*?)</ul>'
|
||||
# debug = True
|
||||
@@ -146,42 +145,42 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
info(text)
|
||||
item.url = host + "/?s=" + text
|
||||
logger.debug(text)
|
||||
item.url = host + "/search/" + text
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'search'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
info()
|
||||
def newest(category):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
item = Item()
|
||||
item.contentType = 'tvshow'
|
||||
item.args = 'update'
|
||||
try:
|
||||
if categoria == "series":
|
||||
if category == 'tvshow':
|
||||
item.url = host
|
||||
item.action = "peliculas"
|
||||
itemlist = peliculas(item)
|
||||
item.action = "movies"
|
||||
itemlist = movies(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
info('--->', item)
|
||||
logger.debug('--->', item)
|
||||
return support.server(item, item.url)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"id": "guardaserieicu",
|
||||
"name": "Guarda Serie Icu",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"active": true,
|
||||
"thumbnail": "https://raw.githubusercontent.com/32Dexter/DexterRepo/master/media/guarda_serie.jpg",
|
||||
"banner": "",
|
||||
"categories": ["tvshow"],
|
||||
|
||||
@@ -10,56 +10,50 @@
|
||||
|
||||
# possibilità di miglioramento: gestire le novità (sezione Ultimi episodi sul sito)
|
||||
|
||||
from core.support import info
|
||||
|
||||
from core import support
|
||||
from platformcode import config
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
tvshow = ['/serie']
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
# patronBlock = r'movies-list movies-list-full(?P<block>.*?)footer>'
|
||||
if item.args == 'search':
|
||||
patron = r'<div data-movie-id[^>]+>\s*<a href="(?P<url>[^"]+)"[^>]+>(?:\s*<span class="mli-quality">(?P<quality>[^>]+)</span>)?\s*<img src="(?P<thumbnail>[^"]+)[^>]+>[^>]+>[^>]+>(?P<title>[^<]+).*?jt-info[^>]+>[^:]+:\s*(?P<rating>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d*)[^>]+>[^>]+>[^>]+>(?P<duration>\d*).*?"f-desc">(?:\s*<p>(?P<plot>[^<]+))?'
|
||||
else:
|
||||
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*)'
|
||||
def movies(item):
|
||||
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*)'
|
||||
patronNext = '<li class=.active.>.*?href=.(.*?).>'
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
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]+)'
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
info(text)
|
||||
logger.debug(text)
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host + "/?s=" + text
|
||||
try:
|
||||
item.args = 'search'
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.info('findvideos', item)
|
||||
logger.debug('findvideos', item)
|
||||
data = support.match(item, headers=headers, patron=r'div class="movieplay">([^>]+)').matches
|
||||
return support.server(item, data=data )
|
||||
@@ -5,7 +5,7 @@
|
||||
"active": true,
|
||||
"thumbnail": "hd4me.png",
|
||||
"banner": "hd4me.png",
|
||||
"categories": ["movie", "vos"],
|
||||
"categories": ["movie", "sub"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
@@ -19,22 +20,22 @@ def mainlist(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
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>[^"]+)'
|
||||
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>[^"]+)'
|
||||
patronNext = r'current(?:[^>]*>){2}\s*<a class="[^"]+"\s* href="([^"]+)'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genre(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
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):
|
||||
if item.fulltitle in ['Classici Disney', 'Studio Ghibli', 'Pixar']:
|
||||
item.args = 'alternative'
|
||||
@@ -43,15 +44,15 @@ def genre(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
item.url = host + '/?s=' + text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("search except: %s" % line)
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
# def findhost(url):
|
||||
# data = support.httptools.downloadpage(url).data
|
||||
@@ -11,7 +12,7 @@ from core import support
|
||||
# return url[:-1] if url.endswith('/') else url
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
support.info('HOST',host)
|
||||
logger.debug('HOST',host)
|
||||
# host = 'https://ilcorsaronero.xyz'
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -20,22 +21,22 @@ headers = [['Referer', host]]
|
||||
def mainlist(item):
|
||||
|
||||
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']),
|
||||
('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']),
|
||||
('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']),
|
||||
('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']),
|
||||
('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']),
|
||||
('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']),
|
||||
('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']),
|
||||
# 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 Tutto... {color kod bold}', ['/argh.php?search=', 'search', ['search', 'all', False]])
|
||||
]
|
||||
@@ -44,46 +45,38 @@ def mainlist(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug = True
|
||||
action = 'findvideos'
|
||||
sceneTitle = item.args[2]
|
||||
if item.args[1] in ['tvshow', 'anime', 'music', 'other']:
|
||||
patron = r'>[^"<]+'
|
||||
else:
|
||||
patron = r'>(?P<quality>[^"<]+)'
|
||||
patron += '<TD[^>]+><A class="tab" HREF="(?P<url>[^"]+)"\s*>[^<]+<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<size>[^<]+)<[^>]+>[^>]+>[^>]+><form action="[^"]+/\d+/(?P<title>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<seed>[^<]+)'
|
||||
|
||||
def itemHook(item):
|
||||
if not sceneTitle:
|
||||
item.title = item.title.replace('_', ' ')
|
||||
item.title = support.scrapertools.decodeHtmlentities(support.urlparse.unquote(item.title))
|
||||
return item
|
||||
patron += r'</td> <TD[^>]+><A class="tab" HREF="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<size>[^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>(?P<seed>[^<]+)'
|
||||
|
||||
if 'search' not in item.args:
|
||||
item.url += str(item.args[0])
|
||||
def itemlistHook(itemlist):
|
||||
args = item.args
|
||||
args[0] += 1
|
||||
support.nextPage(itemlist, item, next_page=item.url, function_or_level="peliculas")
|
||||
# itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), args=args, thumbnail=support.thumb()))
|
||||
support.nextPage(itemlist, item, 'movies', next_page=item.url, total_pages=15)
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(item, text)
|
||||
logger.debug( text)
|
||||
if 'all' in item.args:
|
||||
item.url += text
|
||||
else:
|
||||
item.url += text + '.html'
|
||||
try:
|
||||
return peliculas(item)
|
||||
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||
return movies(item)
|
||||
# Cattura l' eccezione così non interrompe la ricerca globle se il canale si rompe!
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("search except: %s" % line)
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"id": "ilgeniodellostreaming",
|
||||
"name": "IlGenioDelloStreaming",
|
||||
"active": false,
|
||||
"active": true,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "ilgeniodellostreaming.png",
|
||||
"banner": "ilgeniodellostreaming.png",
|
||||
"categories": ["movie", "tvshow", "anime", "vos"],
|
||||
"categories": ["movie", "tvshow", "anime", "sub"],
|
||||
"settings": ["include_in_newest_anime"]
|
||||
}
|
||||
|
||||
@@ -6,29 +6,27 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from core.support import info
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.info(item)
|
||||
|
||||
film = ['/film/',
|
||||
('Generi',['', 'genres', 'genres']),
|
||||
('Per Lettera',['/film-a-z/', 'genres', 'letter']),
|
||||
('Anni',['', 'genres', 'year']),
|
||||
('Popolari',['/trending/?get=movies', 'peliculas', 'populared']),
|
||||
('Più Votati', ['/ratings/?get=movies', 'peliculas', 'populared'])
|
||||
('Popolari',['/trending/?get=movies', 'movies', 'populared']),
|
||||
('Più Votati', ['/ratings/?get=movies', 'movies', 'populared'])
|
||||
]
|
||||
|
||||
tvshow = ['/serie/',
|
||||
('Aggiornamenti', ['/aggiornamenti-serie/', 'peliculas', 'update']),
|
||||
('Popolari',['/trending/?get=tv', 'peliculas', 'populared']),
|
||||
('Più Votati', ['/ratings/?get=tv', 'peliculas', 'populared'])
|
||||
('Aggiornamenti', ['/aggiornamenti-serie/', 'movies', 'update']),
|
||||
('Popolari',['/trending/?get=tv', 'movies', 'populared']),
|
||||
('Più Votati', ['/ratings/?get=tv', 'movies', 'populared'])
|
||||
|
||||
]
|
||||
|
||||
@@ -36,7 +34,7 @@ def mainlist(item):
|
||||
]
|
||||
|
||||
Tvshow = [
|
||||
('Show TV {bullet bold}', ['/tv-show/', 'peliculas', '', 'tvshow'])
|
||||
('Show TV {bullet bold}', ['/tv-show/', 'movies', '', 'tvshow'])
|
||||
]
|
||||
|
||||
search = ''
|
||||
@@ -45,8 +43,8 @@ def mainlist(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
info()
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
# debugBlock = 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>'
|
||||
|
||||
typeContentDict={'movie': ['film'], 'tvshow': ['tv']}
|
||||
typeActionDict={'findvideos': ['film'], 'episodios': ['tv']}
|
||||
typeActionDict={'findvideos': ['film'], 'episodes': ['tv']}
|
||||
else:
|
||||
|
||||
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'
|
||||
else:
|
||||
# TVSHOW
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
if item.args == 'update':
|
||||
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"'
|
||||
pagination = 25
|
||||
pagination = True
|
||||
def itemHook(item):
|
||||
item.contentType = 'episode'
|
||||
return item
|
||||
@@ -95,10 +93,10 @@ def peliculas(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
info()
|
||||
def episodes(item):
|
||||
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>[^"]+)">.*?'\
|
||||
'<div class="numerando">(?P<episode>[^<]+).*?<div class="episodiotitle">'\
|
||||
'[^>]+>(?P<title>[^<]+)<\/a>'
|
||||
@@ -108,9 +106,9 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
info(item)
|
||||
logger.debug(item)
|
||||
|
||||
action='peliculas'
|
||||
action='movies'
|
||||
if item.args == 'genres':
|
||||
patronBlock = r'<div class="sidemenu"><h2>Genere</h2>(?P<block>.*?)/li></ul></div>'
|
||||
elif item.args == 'year':
|
||||
@@ -126,50 +124,50 @@ def genres(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
info(text)
|
||||
logger.debug(text)
|
||||
import uuid
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/?' + uuid.uuid4().hex + '=' + uuid.uuid4().hex + '&s=' + text
|
||||
try:
|
||||
item.args = 'search'
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
|
||||
if categoria == 'peliculas':
|
||||
if category == 'movie':
|
||||
item.contentType = 'movie'
|
||||
item.url = host + '/film/'
|
||||
elif categoria == 'series':
|
||||
elif category == 'tvshow':
|
||||
item.args = 'update'
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host + '/aggiornamenti-serie/'
|
||||
## elif categoria == 'anime':
|
||||
## elif category == 'anime':
|
||||
## item.contentType = 'tvshow'
|
||||
## item.url = host + '/anime/'
|
||||
try:
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
info()
|
||||
logger.debug()
|
||||
matches = support.match(item, patron=[r'var ilinks\s?=\s?([^;]+)',r' href="#option-\d">([^\s]+)\s*([^\s]+)']).matches
|
||||
itemlist = []
|
||||
list_url = []
|
||||
@@ -193,7 +191,7 @@ def findvideos(item):
|
||||
for i, url in enumerate(list_url):
|
||||
itemlist.append(support.Item(
|
||||
channel=item.channel,
|
||||
title=list_servers[i],
|
||||
# title=list_servers[i],
|
||||
url=url,
|
||||
action='play',
|
||||
quality=list_quality[i],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "ilgeniodellostreaming_cam",
|
||||
"name": "IlGenioDelloStreaming CAM",
|
||||
"active": true,
|
||||
"active": false,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "ilgeniodellostreaming.png",
|
||||
"banner": "ilgeniodellostreaming.png",
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from core.support import info
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -15,7 +14,7 @@ headers = [['Referer', host]]
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
film = ['/film/',
|
||||
('In Sala', ['', 'peliculas', 'sala']),
|
||||
('In Sala', ['', 'movies', 'sala']),
|
||||
('Generi',['', 'genres', 'genres']),
|
||||
('Per Lettera',['/catalog/all', 'genres', 'az']),
|
||||
('Anni',['', 'genres', 'year'])]
|
||||
@@ -24,74 +23,71 @@ def mainlist(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
if item.text:
|
||||
data = support.httptools.downloadpage(host + '/?s=' + item.text, post={'story': item.text, 'do': 'search', 'subaction': 'search'}).data
|
||||
patron = '<img src="(?P<thumb>[^"]+)(?:[^>]+>){8}\s*<a href="(?P<url>[^"]+)[^>]+>(?P<title>[^<]+)(?:[^>]+>){4}IMDb\s(?P<rating>[^<]+)(?:[^>]+>){2}(?P<year>\d+)'
|
||||
def movies(item):
|
||||
if item.args == 'sala':
|
||||
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})'
|
||||
elif item.args == 'az':
|
||||
patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>.*?<span class="labelimdb">(?P<rating>[^>]+)<'
|
||||
else:
|
||||
if item.args == 'sala':
|
||||
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})'
|
||||
elif item.args == 'az':
|
||||
patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)[^>]+>(?P<title>[^<]+)<[^>]+>[^>]+>[^>]+>.*?<span class="labelimdb">(?P<rating>[^>]+)<'
|
||||
else:
|
||||
patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[^<]+)[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<plot>[^<]+)<[^>]+>'
|
||||
patron = r'<img src="(?P<thumb>[^"]+)[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<rating>[^<]+)[^>]+>[^>]+>(?P<quality>[^<]+)[^>]+>[^>]+>[^>]+>[^>]+><a href="(?P<url>[^"]+)">(?P<title>[^<]+)[^>]+>[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<plot>[^<]+)<[^>]+>'
|
||||
|
||||
patronNext = 'href="([^>]+)">»'
|
||||
patronNext = 'href="([^>]+)">»'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action='peliculas'
|
||||
action='movies'
|
||||
if item.args == 'genres':
|
||||
patronBlock = r'<div class="sidemenu">\s*<h2>Genere</h2>(?P<block>.*?)</ul'
|
||||
elif item.args == 'year':
|
||||
item.args = 'genres'
|
||||
patronBlock = r'<div class="sidemenu">\s*<h2>Anno di uscita</h2>(?P<block>.*?)</ul'
|
||||
elif item.args == 'az':
|
||||
patronBlock = r'<div class="movies-letter">(?P<block>.*?)<div class="clearfix">'
|
||||
|
||||
patronMenu = r'<a(?:.+?)?href="(?P<url>.*?)"[ ]?>(?P<title>.*?)<\/a>'
|
||||
|
||||
if 'genres' in item.args:
|
||||
patronGenreMenu = patronMenu
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
info(text)
|
||||
item.text = text
|
||||
logger.debug(text)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + "/search/" + text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
|
||||
if categoria == 'peliculas':
|
||||
if category == 'movie':
|
||||
item.contentType = 'movie'
|
||||
item.url = host + '/film/'
|
||||
try:
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
info("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
info()
|
||||
logger.debug()
|
||||
urls = []
|
||||
data = support.match(item).data
|
||||
urls += support.match(data, patron=r'id="urlEmbed" value="([^"]+)').matches
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "italiaserie",
|
||||
"name": "Italia Serie",
|
||||
"active": false,
|
||||
"active": true,
|
||||
"language": ["ita","sub-ita"],
|
||||
"thumbnail": "italiaserie.png",
|
||||
"bannermenu": "italiaserie.png",
|
||||
"categories": ["tvshow", "vos"],
|
||||
"not_active": ["include_in_newest_peliculas", "include_in_newest_anime"],
|
||||
"categories": ["tvshow", "sub"],
|
||||
"not_active": ["include_in_newest_movie", "include_in_newest_anime"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -15,30 +15,30 @@ headers = [['Referer', host]]
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
tvshow = ['',
|
||||
('Aggiornamenti', ['/aggiornamento-episodi/', 'peliculas', 'update']),
|
||||
('Top 10', ['/top-10', 'peliculas', 'top']),
|
||||
('Netflix {tv submenu}', ['/genere/netflix', 'peliculas'])
|
||||
('Aggiornamenti', ['/aggiornamento-episodi/', 'movies', 'update']),
|
||||
('Top 10', ['/top-10', 'movies', 'top']),
|
||||
('Netflix {tv submenu}', ['/genere/netflix', 'movies'])
|
||||
]
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug=True
|
||||
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>[^"]+)"[^>]+>'
|
||||
|
||||
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[\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':
|
||||
patron = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>(?:[^>]+>){3}<img.*?src="(?P<thumb>[^"]+)"[^>]+>(?:[^>]+>){5}:\s*(?P<rating>[^/]+)'
|
||||
if item.args =='a-z':
|
||||
pagination = ''
|
||||
pagination = True
|
||||
patron = r'<li ><a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)"'
|
||||
patronNext = r'<a class="next page-numbers" href="(.*?)">'
|
||||
|
||||
@@ -50,7 +50,7 @@ def peliculas(item):
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
res = support.match(item, patron=r'<a href="([^"]+)">>')
|
||||
if res.match: data = support.match(res.match).data
|
||||
else: data = res.data
|
||||
@@ -66,38 +66,38 @@ def episodios(item):
|
||||
|
||||
@support.scrape
|
||||
def category(item):
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
patron = r'<li class="cat-item.*?href="(?P<url>[^"]+)".*?>(?P<title>.*?)</a>'
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info("s=", texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
item.url = host + "/?s=" + text
|
||||
item.contentType = 'tvshow'
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info("newest", categoria)
|
||||
def newest(category):
|
||||
logger.debug("newest", category)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == "series":
|
||||
if category == 'tvshow':
|
||||
item.url = host + "/aggiornamento-episodi/"
|
||||
item.action = "peliculas"
|
||||
item.action = "movies"
|
||||
item.args = "update"
|
||||
item.contentType = "episode"
|
||||
itemlist = peliculas(item)
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == "peliculas":
|
||||
if itemlist[-1].action == "movies":
|
||||
itemlist.pop()
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
import requests
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
DRM = 'com.widevine.alpha'
|
||||
key_widevine = "https://la7.prod.conax.cloud/widevine/license"
|
||||
@@ -23,26 +24,26 @@ headers = {
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
top = [('Dirette {bold}', ['', 'live']),
|
||||
('Replay {bold}', ['', 'replay_channels'])]
|
||||
top = [('Dirette {bullet bold}', ['', 'live']),
|
||||
('Replay {bullet bold}', ['', 'replay_channels'])]
|
||||
|
||||
menu = [('Programmi TV {bullet bold}', ['/tutti-i-programmi', 'peliculas', '', 'tvshow']),
|
||||
('Teche La7 {bullet bold}', ['/i-protagonisti', 'peliculas', '', 'tvshow'])]
|
||||
menu = [('Programmi TV {bullet bold}', ['/tutti-i-programmi', 'movies', '', 'tvshow']),
|
||||
('Teche La7 {bullet bold}', ['/i-protagonisti', 'movies', '', 'tvshow'])]
|
||||
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
|
||||
def live(item):
|
||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='findvideos', forcethumb = True, no_return=True),
|
||||
item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='findvideos', forcethumb = True, no_return=True)]
|
||||
return support.thumb(itemlist, live=True)
|
||||
itemlist = [item.clone(title='La7', fulltitle='La7', url= host + '/dirette-tv', action='findvideos', forcethumb = True),
|
||||
item.clone(title='La7d', fulltitle='La7d', url= host + '/live-la7d', action='findvideos', forcethumb = True)]
|
||||
return support.thumb(itemlist, mode='live')
|
||||
|
||||
|
||||
def replay_channels(item):
|
||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), 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)]
|
||||
return support.thumb(itemlist, live=True)
|
||||
itemlist = [item.clone(title='La7', fulltitle='La7', url= host + '/rivedila7/0/la7', 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, mode='live')
|
||||
|
||||
|
||||
@support.scrape
|
||||
@@ -50,7 +51,7 @@ def replay_menu(item):
|
||||
action = 'replay'
|
||||
patron = r'href="(?P<url>[^"]+)"><div class="giorno-text">\s*(?P<day>[^>]+)</div><[^>]+>\s*(?P<num>[^<]+)</div><[^>]+>\s*(?P<month>[^<]+)<'
|
||||
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 locals()
|
||||
|
||||
@@ -60,7 +61,7 @@ def replay(item):
|
||||
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>[^<]+)<'
|
||||
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.thumbnail = 'http:' + item.t
|
||||
item.fanart = item.thumbnail
|
||||
@@ -69,36 +70,41 @@ def replay(item):
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
logger.debug(text)
|
||||
item.url = host + '/tutti-i-programmi'
|
||||
item.search = text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('search log:', line)
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
search = item.search
|
||||
disabletmdb = True
|
||||
addVideolibrary = False
|
||||
downloadEnabled = False
|
||||
action = 'episodios'
|
||||
disableAll = True
|
||||
action = 'episodes'
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
|
||||
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
|
||||
return item
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
data = support.match(item).data
|
||||
# debug = True
|
||||
action = 'findvideos'
|
||||
if '>puntate<' in data:
|
||||
patronBlock = r'>puntate<(?P<block>.*?)home-block-outbrain'
|
||||
@@ -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>[^"]+)"'
|
||||
patronNext = r'<a href="([^"]+)">›'
|
||||
addVideolibrary = False
|
||||
videlibraryEnabled = False
|
||||
downloadEnabled = False
|
||||
|
||||
def itemHook(item):
|
||||
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
|
||||
if item.Title: item.title = support.typo(item.Title, 'bold')
|
||||
if item.Title: item.title = item.Title
|
||||
if item.date:
|
||||
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
|
||||
item.forcethumb = True
|
||||
item.fanart = item.thumbnail
|
||||
@@ -128,14 +134,12 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
if item.livefilter:
|
||||
for it in live(item):
|
||||
if it.fulltitle == item.livefilter:
|
||||
item = it
|
||||
break
|
||||
data = support.match(item).data
|
||||
logger.debug()
|
||||
return support.server(item, itemlist=[item.clone(server='directo', action='play')])
|
||||
|
||||
def play(item):
|
||||
logger.debug()
|
||||
data = support.match(item).data
|
||||
url = support.match(data, patron=r'''["]?dash["]?\s*:\s*["']([^"']+)["']''').match
|
||||
if url:
|
||||
preurl = support.match(data, patron=r'preTokenUrl = "(.+?)"').match
|
||||
@@ -169,6 +173,5 @@ def findvideos(item):
|
||||
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(title='Direct', server='directo', url=url, action='play')
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
item = item.clone(url=url, server='directo', action='play')
|
||||
return support.servertools.find_video_items(item, data=url)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"id": "mediasetplay",
|
||||
"name": "Mediaset play infinity [free]",
|
||||
"name": "Mediaset Play",
|
||||
"active": true,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "mediasetplayinfinity.png",
|
||||
"banner": "mediasetplayinfinity.png",
|
||||
"thumbnail": "mediasetplay.png",
|
||||
"banner": "mediasetplay.png",
|
||||
"categories": ["movie", "tvshow", "documentary", "live"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"default_off": ["include_in_global_search"],
|
||||
|
||||
@@ -41,14 +41,14 @@ session.headers.update({'authorization': 'Bearer ' + Token})
|
||||
sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['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
|
||||
def mainlist(item):
|
||||
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']),
|
||||
('Programmi TV{ bullet bold}', ['/programmitv', 'menu', '5acfc8011de1c4000b6ec953', 'tvshow']),
|
||||
('Documentari {bullet bold}', ['/documentari', 'menu', '5bfd17c423eec6001aec49f9', 'undefined']),
|
||||
@@ -66,7 +66,7 @@ def menu(item):
|
||||
itemlist.append(item.clone(title=support.typo(it['title'], 'bullet bold'),
|
||||
url= it['landingUrl'],
|
||||
args={'uxReference':it.get('uxReferenceV2', ''), 'params':it.get('uxReferenceV2Params', ''), 'feed':it.get('feedurlV2','')},
|
||||
action='peliculas'))
|
||||
action='movies'))
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -90,9 +90,9 @@ def live(item):
|
||||
plot = '[B]{}[/B]\n{}'.format(guide.get('currentListing', {}).get('mediasetlisting$epgTitle', ''),guide.get('currentListing', {}).get('description', ''))
|
||||
if 'nextListing' in guide.keys():
|
||||
plot += '\n\nA Seguire:\n[B]{}[/B]\n{}'.format(guide.get('nextListing', {}).get('mediasetlisting$epgTitle', ''),guide.get('nextListing', {}).get('description', ''))
|
||||
itemlist.append(item.clone(title=support.typo(title, 'bold'),
|
||||
itemlist.append(item.clone(title=title,
|
||||
fulltitle=title, callSign=it['callSign'],
|
||||
# urls=[guide['publicUrl']],
|
||||
urls=guide['tuningInstruction']['urn:theplatform:tv:location:any'],
|
||||
plot=plot,
|
||||
url=url,
|
||||
action='findvideos',
|
||||
@@ -100,7 +100,7 @@ def live(item):
|
||||
forcethumb=True))
|
||||
|
||||
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||
support.thumb(itemlist, live=True)
|
||||
support.thumb(itemlist, mode='live')
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ def search(item, text):
|
||||
item.args = {'uxReference':'main', 'params':'channel≈', 'query':text}
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
@@ -117,7 +117,7 @@ def search(item, text):
|
||||
return []
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
itemlist = []
|
||||
res = get_programs(item)
|
||||
video_id= ''
|
||||
@@ -150,7 +150,7 @@ def peliculas(item):
|
||||
if thumb and fanart:
|
||||
break
|
||||
|
||||
itemlist.append(item.clone(title=support.typo(title, 'bold'),
|
||||
itemlist.append(item.clone(title=title,
|
||||
fulltitle=title,
|
||||
contentTitle=title,
|
||||
contentSerieName=contentSerieName,
|
||||
@@ -182,22 +182,22 @@ def epmenu(item):
|
||||
for s in item.seriesid:
|
||||
itemlist.append(
|
||||
item.clone(seriesid = s['id'],
|
||||
title=support.typo(s['title'], 'bold')))
|
||||
title=s['title']))
|
||||
if len(itemlist) == 1: return epmenu(itemlist[0])
|
||||
else:
|
||||
res = requests.get(epUrl.format(item.seriesid)).json()['entries']
|
||||
for it in res:
|
||||
itemlist.append(
|
||||
item.clone(seriesid = '',
|
||||
title=support.typo(it['description'], 'bold'),
|
||||
title=it['description'],
|
||||
subbrand=it['mediasetprogram$subBrandId'],
|
||||
action='episodios'))
|
||||
action='episodes'))
|
||||
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
|
||||
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
# create month list
|
||||
months = []
|
||||
try:
|
||||
@@ -235,25 +235,30 @@ def episodios(item):
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
return support.server(item, itemlist=[item.clone(server='directo', action='play')])
|
||||
|
||||
|
||||
def play(item):
|
||||
logger.debug()
|
||||
item.no_return=True
|
||||
# support.dbg()
|
||||
mpd = config.get_setting('mpd', item.channel)
|
||||
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}}|'
|
||||
url = ''
|
||||
# support.dbg()
|
||||
|
||||
if item.urls:
|
||||
url = ''
|
||||
pid = ''
|
||||
# Format = 'dash+xml' if mpd else 'x-mpegURL'
|
||||
# for it in item.urls:
|
||||
# if Format in it['format']:
|
||||
item.url = requests.head(item.urls[0], headers={'User-Agent': support.httptools.get_user_agent()}).headers['Location']
|
||||
# pid = it['releasePids'][0]
|
||||
# if mpd and 'widevine' in it['assetTypes']:
|
||||
# break
|
||||
Format = 'dash+xml' if mpd else 'x-mpegURL'
|
||||
for it in item.urls:
|
||||
if Format in it['format']:
|
||||
item.url = requests.head(it['publicUrls'][0]).headers['Location']
|
||||
pid = it['releasePids'][0]
|
||||
if mpd and 'widevine' in it['assetTypes']:
|
||||
break
|
||||
|
||||
if mpd:
|
||||
item.manifest = 'mpd'
|
||||
@@ -262,15 +267,15 @@ def findvideos(item):
|
||||
|
||||
else:
|
||||
item.manifest = 'hls'
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
return[item]
|
||||
|
||||
elif item.video_id:
|
||||
payload = {"contentId":item.video_id, "streamType":"VOD", "delivery":"Streaming", "createDevice":"true", "overrideAppName":"web//mediasetplay-web/5.2.4-6ad16a4"}
|
||||
res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, json=payload).json()['response']['mediaSelector']
|
||||
payload = '{"contentId":"' + item.video_id + ' ","streamType":"VOD","delivery":"Streaming","createDevice":true}'
|
||||
res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, data=payload).json()['response']['mediaSelector']
|
||||
|
||||
else:
|
||||
payload = {"channelCode":item.callSign, "streamType":"LIVE", "delivery":"Streaming", "createDevice":"true", "overrideAppName":"web//mediasetplay-web/5.2.4-6ad16a4"}
|
||||
res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, json=payload).json()['response']['mediaSelector']
|
||||
payload = '{"channelCode":"' + item.callSign + '","streamType":"LIVE","delivery":"Streaming","createDevice":true}'
|
||||
res = session.post('https://api-ott-prod-fe.mediaset.net/PROD/play/playback/check/v2.0?sid=' + sid, data=payload).json()['response']['mediaSelector']
|
||||
|
||||
url = res['url']
|
||||
mpd = True if 'dash' in res['formats'].lower() else False
|
||||
@@ -278,7 +283,7 @@ def findvideos(item):
|
||||
if url:
|
||||
|
||||
sec_data = support.match(url + '?' + urlencode(res)).data
|
||||
item.url = support.match(sec_data, patron=r'<video src="([^"]+)').match + '|User-Agent=' + support.httptools.get_user_agent()
|
||||
item.url = support.match(sec_data, patron=r'<video src="([^"]+)').match
|
||||
pid = support.match(sec_data, patron=r'pid=([^|]+)').match
|
||||
|
||||
if mpd and pid:
|
||||
@@ -288,10 +293,11 @@ def findvideos(item):
|
||||
else:
|
||||
item.manifest = 'hls'
|
||||
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
return [item]
|
||||
|
||||
|
||||
def get_from_id(item):
|
||||
logger.debug()
|
||||
sessionKey = session.get(sessionUrl.format(uuid=str(uuid.uuid4())), verify=False).json()['sessionKey']
|
||||
session.headers.update({'x-session': sessionKey})
|
||||
res = session.get(entry.format(id=item.args)).json()
|
||||
|
||||
@@ -30,7 +30,7 @@ current_session.headers.update({'Content-Type': 'application/json', 'User-Agent'
|
||||
|
||||
# login anonimo
|
||||
res = current_session.post(loginUrl, json=loginData, verify=False)
|
||||
support.dbg()
|
||||
logger.dbg()
|
||||
Token = res.json['response']['beToken']
|
||||
sid = res.json['response']['sid']
|
||||
current_session.headers.update({'authorization': 'Bearer' + Token})
|
||||
@@ -100,11 +100,11 @@ def search(item, text):
|
||||
item.search = text
|
||||
|
||||
try:
|
||||
itemlist = peliculas(item)
|
||||
itemlist = movies(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -117,7 +117,7 @@ def menu(item):
|
||||
for it in json:
|
||||
logger.debug(jsontools.dump(it))
|
||||
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
|
||||
|
||||
|
||||
@@ -150,10 +150,10 @@ def live(item):
|
||||
plot=value['plot'],
|
||||
action='play',
|
||||
no_return=True))
|
||||
return support.thumb(itemlist, live=True)
|
||||
return support.thumb(itemlist, mode='live')
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
titlelist = []
|
||||
@@ -228,16 +228,16 @@ def epmenu(item):
|
||||
for entry in entries:
|
||||
if 'mediasetprogram$subBrandId' in entry:
|
||||
itemlist.append(
|
||||
item.clone(action='episodios',
|
||||
item.clone(action='episodes',
|
||||
title=support.typo(entry['description'], 'bold'),
|
||||
url=entry['mediasetprogram$subBrandId'],
|
||||
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)
|
||||
return itemlist
|
||||
|
||||
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
if not item.nextIndex: item.nextIndex = 1
|
||||
@@ -318,7 +318,7 @@ def get_from_id(item):
|
||||
def get_programs(item, ret=[], args={}):
|
||||
hasMore = False
|
||||
url = ''
|
||||
# support.dbg()
|
||||
# logger.dbg()
|
||||
|
||||
if 'search' in item.args:
|
||||
args['uxReference'] = item.args[2]
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
# Canale per altadefinizione01
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core import support, config
|
||||
from platformcode import logger
|
||||
|
||||
host = 'https://metalvideo.com'
|
||||
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
||||
@@ -12,7 +13,7 @@ headers = {'X-Requested-With': 'XMLHttpRequest'}
|
||||
@support.scrape
|
||||
def mainlist(item):
|
||||
item.url = host
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
patronBlock = r'<ul class="dropdown-menu(?P<block>.*?)</ul>\s*</div'
|
||||
patron = r'<a href="(?P<url>[^"]+)"(?: class="")?>(?P<title>[^<]+)<'
|
||||
def itemHook(item):
|
||||
@@ -24,27 +25,23 @@ def mainlist(item):
|
||||
itemlist.append(
|
||||
support.Item(
|
||||
channel=item.channel,
|
||||
title=support.typo('Cerca...', 'bold'),
|
||||
title=support.typo(config.getLocalizedString(70741) % 'Musica… ', 'bold'),
|
||||
contentType='music',
|
||||
url=item.url,
|
||||
action='search',
|
||||
thumbnail=support.thumb('search')))
|
||||
thumbnail=support.thumb('music_search')))
|
||||
|
||||
support.channel_config(item, itemlist)
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
# debug=True
|
||||
action = 'findvideos'
|
||||
patron= r'<img src="[^"]+" alt="(?P<title>[^"]+)" data-echo="(?P<thumb>[^"]+)"(?:[^>]+>){7}<a href="(?P<url>[^"]+)"'
|
||||
patronNext = r'<a href="([^"]+)">(?:»|»)'
|
||||
typeContentDict = {'': 'music'}
|
||||
def itemHook(item):
|
||||
item.contentType = 'music'
|
||||
item.thumbnail = item.thumbnail.replace('https:','http:')
|
||||
return item
|
||||
return locals()
|
||||
|
||||
|
||||
@@ -53,13 +50,13 @@ def findvideos(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
item.url = host + '/search.php?keywords=' + text + '&video-id='
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = {'Referer': host}
|
||||
@@ -13,7 +14,7 @@ headers = {'Referer': host}
|
||||
def mainlist(item):
|
||||
|
||||
film = ['/lista-film',
|
||||
('Ultimi Film Aggiunti', ['/ultimi-film-aggiunti', 'peliculas' , 'last'])]
|
||||
('Ultimi Film Aggiunti', ['/ultimi-film-aggiunti', 'movies' , 'last'])]
|
||||
|
||||
tvshow = ['/lista-serie-tv',
|
||||
('HD {TV}', ['/lista-serie-tv-in-altadefinizione']),
|
||||
@@ -22,7 +23,7 @@ def mainlist(item):
|
||||
|
||||
anime = ['/lista-cartoni-animati-e-anime']
|
||||
|
||||
docu = [('Documentari {bullet bold}',['/lista-documentari', 'peliculas', '', 'tvshow'])]
|
||||
docu = [('Documentari {bullet bold}',['/lista-documentari', 'movies', '', 'tvshow'])]
|
||||
|
||||
search = ''
|
||||
|
||||
@@ -30,48 +31,48 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
logger.debug(text)
|
||||
if item.contentType == 'movie' or item.extra == 'movie':
|
||||
action = 'findvideos'
|
||||
else:
|
||||
action = 'episodios'
|
||||
action = 'episodes'
|
||||
item.args = 'search'
|
||||
item.url = host + "?a=b&s=" + text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore .
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "series":
|
||||
if category == 'tvshow':
|
||||
item.contentType= 'tvshow'
|
||||
item.url = host + '/ultimi-episodi-aggiunti'
|
||||
item.args = "lastep"
|
||||
if categoria == "peliculas":
|
||||
if category == "movie":
|
||||
item.contentType= 'movie'
|
||||
item.url = host + '/ultimi-film-aggiunti'
|
||||
item.args = "last"
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
pagination = ''
|
||||
anime = True
|
||||
def movies(item):
|
||||
pagination = True
|
||||
numerationEnabled = True
|
||||
patronNext = r'href="([^"]+)" title="[^"]+" class="lcp_nextlink"'
|
||||
action = 'findvideos'
|
||||
# debug=True
|
||||
@@ -82,7 +83,7 @@ def peliculas(item):
|
||||
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>'
|
||||
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+))?'
|
||||
def itemHook(item):
|
||||
if '/film/' in item.url:
|
||||
@@ -90,21 +91,21 @@ def peliculas(item):
|
||||
item.action = 'findvideos'
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
item.action = 'episodios'
|
||||
item.action = 'episodes'
|
||||
return item
|
||||
else:
|
||||
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}))?"[^>]*>'
|
||||
if item.contentType == 'tvshow':
|
||||
action = 'episodios'
|
||||
anime = True
|
||||
action = 'episodes'
|
||||
numerationEnabled = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
anime = True
|
||||
pagination = 50
|
||||
def episodes(item):
|
||||
numerationEnabled = True
|
||||
pagination = True
|
||||
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>'
|
||||
def itemHook(item):
|
||||
|
||||
11
channels/netfreex.json
Normal file
11
channels/netfreex.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "netfreex",
|
||||
"name": "Netfreex",
|
||||
"language": ["ita"],
|
||||
"active": false,
|
||||
"thumbnail": "netfreex.png",
|
||||
"banner": "netfreex.png",
|
||||
"categories": ["tvshow", "movie", "anime"],
|
||||
"not_active": ["include_in_newest_movie", "include_in_newest_anime", "include_in_newest_tvshow"],
|
||||
"settings": []
|
||||
}
|
||||
71
channels/netfreex.py
Normal file
71
channels/netfreex.py
Normal file
@@ -0,0 +1,71 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per netfreex
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import logger, config
|
||||
|
||||
# def findhost(url):
|
||||
# return 'https://' + support.match('https://netfreex.uno/', patron='value="site:([^"]+)"').match
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = ""
|
||||
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
list_language = IDIOMAS.values()
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
film = ['/film',
|
||||
('Generi', ['', 'menu', 'genres'])
|
||||
]
|
||||
tvshow = ['/serietv']
|
||||
anime = ['/genere/anime']
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.info('search', text)
|
||||
item.url = item.url + "/?s=" + text
|
||||
try:
|
||||
return support.dooplay_search(item)
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def movies(item):
|
||||
if 'anime' in item.url:
|
||||
return support.dooplay_movies(item, True)
|
||||
else:
|
||||
return support.dooplay_movies(item, False)
|
||||
|
||||
|
||||
def episodes(item):
|
||||
return support.dooplay_get_episodes(item)
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
from core import jsontools
|
||||
itemlist = []
|
||||
matches = support.match(item, patron=r'<li id="player-option-[0-9]".*?data-type="([^"]+)" data-post="([^"]+)" data-nume="([^"]+)".*?<span class="title".*?>([^<>]+)</span>(?:<span class="server">([^<>]+))?').matches
|
||||
for Type, Post, Nume, Quality, Server in matches:
|
||||
dataAdmin = support.match(host + '/wp-json/dooplayer/v1/post/%s?type=%s&source=%s' %(Post, Type, Nume)).data
|
||||
js = jsontools.load(dataAdmin)
|
||||
link = js['embed_url'] if 'embed_url' in js else ''
|
||||
itemlist.append( item.clone(server=Server, quality=Quality, url=link, action='play'))
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action = 'movies'
|
||||
data = support.match(item, patron=r'<a href="#">Genere<(.*?)</ul').match
|
||||
patronMenu= r'<a href="(?P<url>[^"]+)"[^>]*>(?P<title>[^<]+)<'
|
||||
return locals()
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "paramount",
|
||||
"name": "Paramount Network",
|
||||
"active": false,
|
||||
"active": true,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "paramount.png",
|
||||
"banner": "paramount.png",
|
||||
|
||||
@@ -7,8 +7,6 @@ from core import support, jsontools
|
||||
from platformcode import autorenumber, logger
|
||||
from collections import OrderedDict
|
||||
|
||||
from specials import videolibrary
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -22,7 +20,7 @@ def mainlist(item):
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action='peliculas'
|
||||
action='movies'
|
||||
blacklist=['Tutti']
|
||||
patronMenu = r'<a data-display-name="Link" href="(?P<url>[^"]+)" class="[^"]+">(?P<title>[^<]+)'
|
||||
return locals()
|
||||
@@ -33,7 +31,7 @@ def search(item, text):
|
||||
|
||||
item.text = text
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore .
|
||||
except:
|
||||
import sys
|
||||
@@ -66,11 +64,11 @@ def live(item):
|
||||
logger.debug()
|
||||
itemlist=[]
|
||||
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='findvideos', forcethumb=True, no_return=True))
|
||||
return support.thumb(itemlist, live=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, mode='live')
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
def load_more(url):
|
||||
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('\\u002F','/').replace('%5C','/')
|
||||
@@ -94,7 +92,7 @@ def peliculas(item):
|
||||
continue
|
||||
if item.text.lower() in title.lower():
|
||||
itemlist.append(
|
||||
item.clone(title=support.typo(title,'bold'),
|
||||
item.clone(title=title,
|
||||
fulltitle = title,
|
||||
show = title,
|
||||
contentTitle = title if item.contentType == 'movie' else '',
|
||||
@@ -103,13 +101,12 @@ def peliculas(item):
|
||||
thumbnail = it['media']['image']['url'],
|
||||
fanart = it['media']['image']['url'],
|
||||
plot = it['meta']['description'],
|
||||
action = 'findvideos' if item.contentType == 'movie' else 'episodios'))
|
||||
action = 'findvideos' if item.contentType == 'movie' else 'episodes'))
|
||||
return itemlist
|
||||
|
||||
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
reEp = r'"isEpisodes":[^,]+,"items":(.*?])'
|
||||
def load_more(url):
|
||||
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('%5C','/')
|
||||
new_data = support.match(host + second_url).data
|
||||
@@ -117,10 +114,11 @@ def episodios(item):
|
||||
return jsontools.load(match)
|
||||
|
||||
itemlist = []
|
||||
data = []
|
||||
page_data = support.match(item.url).data
|
||||
seasons = support.match(page_data, patron=r'href="([^"]+)"[^>]+>Stagione\s*\d+').matches
|
||||
more = support.match(page_data, patron=r'loadingTitle":[^,]+,"url":"([^"]+)"').match
|
||||
data = jsontools.load(support.scrapertools.decodeHtmlentities(support.match(page_data, patron=reEp).match))
|
||||
data = jsontools.load(support.scrapertools.decodeHtmlentities(support.match(page_data, patron=r'"isEpisodes":[^,]+,"items":(.*?),"isKidsUI"').match))
|
||||
|
||||
if data:
|
||||
if more:
|
||||
@@ -128,7 +126,7 @@ def episodios(item):
|
||||
if seasons:
|
||||
for url in seasons:
|
||||
new_data = support.match(host + url).data
|
||||
data += jsontools.load(support.scrapertools.decodeHtmlentities(support.match(new_data, patron=reEp).match.replace('\x01','l').replace('\x02','a')))
|
||||
data += jsontools.load(support.scrapertools.decodeHtmlentities(support.match(new_data, patron=r'isEpisodes":[^,]+,"items":(.*?),"isKidsUI"').match.replace('\x01','l').replace('\x02','a')))
|
||||
match = support.match(new_data, patron=r'loadingTitle":[^,]+,"url":"([^"]+)"').match
|
||||
if match and match != load_more:
|
||||
data += load_more(match)
|
||||
@@ -139,10 +137,10 @@ def episodios(item):
|
||||
s = support.match(se, patron=r'S\s*(?P<season>\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
|
||||
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:
|
||||
s = e = '0'
|
||||
title = support.typo(it['meta']['header']['title'],'bold')
|
||||
title = it['meta']['header']['title']
|
||||
itemlist.append(
|
||||
item.clone(title=title,
|
||||
season=int(s) if s else '',
|
||||
@@ -155,29 +153,21 @@ def episodios(item):
|
||||
action='findvideos'))
|
||||
|
||||
itemlist.sort(key=lambda item: (item.season, item.episode))
|
||||
if inspect.stack(0)[1][3] not in ['find_episodes']:
|
||||
if inspect.stack()[1][3] not in ['find_episodes']:
|
||||
autorenumber.start(itemlist, item)
|
||||
return support.videolibrary(itemlist, item)
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
return support.server(item, itemlist=[item.clone(title='Paramount', server='directo', action='play')], Download=False)
|
||||
|
||||
|
||||
def play(item):
|
||||
logger.debug()
|
||||
item.manifest = 'hls'
|
||||
mgid = support.match(item.url, patron=r'uri":"([^"]+)"').match
|
||||
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
|
||||
item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
||||
return support.server(item, itemlist=[item.clone(title='Paramount', server='directo', action='play')], Download=False, Videolibrary=False)
|
||||
|
||||
|
||||
# def play(item):
|
||||
# logger.debug()
|
||||
# item.manifest = 'hls'
|
||||
# mgid = support.match(item.url, patron=r'uri":"([^"]+)"').match
|
||||
# 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
|
||||
# item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
||||
|
||||
|
||||
# return [item]
|
||||
return [item]
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "piratestreaming",
|
||||
"name": "Pirate Streaming",
|
||||
"active": false,
|
||||
"active": true,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "piratestreaming.png",
|
||||
"bannermenu": "piratestreaming.png",
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
|
||||
from core import support
|
||||
from core.support import config, info
|
||||
from core.support import config
|
||||
from platformcode import logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -23,58 +24,58 @@ def mainlist(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
info(texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
logger.debug(texto)
|
||||
item.url = host + "/search/" + texto
|
||||
try:
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
support.info(categoria)
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
try:
|
||||
if categoria == "peliculas":
|
||||
if category == "movie":
|
||||
item.url = host + '/category/films'
|
||||
item.contentType = 'movies'
|
||||
return peliculas(item)
|
||||
if categoria == "series":
|
||||
return movies(item)
|
||||
if category == 'tvshow':
|
||||
item.url = host + '/category/serie'
|
||||
item.contentType = 'tvshow'
|
||||
return peliculas(item)
|
||||
if categoria == "anime":
|
||||
return movies(item)
|
||||
if category == "anime":
|
||||
item.url = host + '/category/anime-cartoni-animati'
|
||||
item.contentType = 'tvshow'
|
||||
return peliculas(item)
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("{0}".format(line))
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@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>[^"]+)"'
|
||||
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']}
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
if item.data: data = item.data
|
||||
# debug= True
|
||||
title = item.fulltitle
|
||||
@@ -93,5 +94,5 @@ def findvideos(item):
|
||||
data = support.match(item).data
|
||||
if 'link-episode' in data:
|
||||
item.data = data
|
||||
return episodios(item)
|
||||
return episodes(item)
|
||||
return support.server(item, data=data)
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"id": "plutotv",
|
||||
"name": "Pluto TV",
|
||||
"active": true,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "plutotv.png",
|
||||
"banner": "plutotv.png",
|
||||
"categories": ["movie", "tvshow", "documentary", "live"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"default_off": ["include_in_global_search"],
|
||||
"settings": []
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Pluto TV
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import uuid, datetime
|
||||
from platformcode import logger, config
|
||||
from core.item import Item
|
||||
from core import support, httptools
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
api = 'https://api.pluto.tv'
|
||||
UUID = 'sid={}&deviceId={}'.format(uuid.uuid1().hex, uuid.uuid4().hex)
|
||||
vod_url = '{}/v3/vod/categories?includeItems=true&deviceType=web&'.format(api, UUID)
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
top = [('Dirette {bold}', ['/it/live-tv/', 'live'])]
|
||||
|
||||
menu = sorted([(it['name'], ['/it/on-demand', 'peliculas', it['items']]) for it in httptools.downloadpage(vod_url).json['categories'][1:]])
|
||||
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def live(item):
|
||||
logger.debug()
|
||||
|
||||
now = datetime.datetime.now()
|
||||
start = (now.strftime('%Y-%m-%dT%H:00:00Z'))
|
||||
stop = (now + datetime.timedelta(hours=4)).strftime('%Y-%m-%dT%H:00:00Z')
|
||||
|
||||
|
||||
live_url = '{}/v2/channels.json?{}'.format(api, UUID)
|
||||
guide_url = '{}/v2/channels?start={}&stop={}&{}'.format(api, start, stop, UUID)
|
||||
|
||||
guide = {g['number']:[g['timelines'][0]['title'], g['timelines'][1]['title']] for g in httptools.downloadpage(guide_url).json}
|
||||
|
||||
itemlist = []
|
||||
|
||||
for it in httptools.downloadpage(live_url).json:
|
||||
itemlist.append(item.clone(title= '[B]{}[/B] | {}'.format(it['name'], guide[it['number']][0]),
|
||||
number=it['number'],
|
||||
contentTitle=it['name'],
|
||||
action='findvideos',
|
||||
thumbnail=it['solidLogoPNG']['path'],
|
||||
fanart=it['featuredImage']['path'],
|
||||
plot='{}\n\n[B]A seguire:[/B]\n{}'.format(it['summary'], guide[it['number']][1]),
|
||||
videourl= it['stitched']['urls'][0]['url'].split('?')[0],
|
||||
forcethumb=True))
|
||||
itemlist.sort(key=lambda it: it.number)
|
||||
return itemlist
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug('Search', text)
|
||||
try:
|
||||
item.search = text.lower()
|
||||
item.args = []
|
||||
for it in httptools.downloadpage(vod_url).json['categories'][1:]:
|
||||
item.args.extend(it['items'])
|
||||
return peliculas(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
recordlist = []
|
||||
for i, it in enumerate(item.args):
|
||||
if item.search in it['name'].lower():
|
||||
itm = Item(channel=item.channel,
|
||||
url=item.url,
|
||||
title=it['name'],
|
||||
contentTitle=it['name'],
|
||||
contentSerieName= it['name'] if it['type'] == 'series' else '',
|
||||
plot=it['description'],
|
||||
contentType='tvshow' if it['type'] == 'series' else 'movie',
|
||||
action='episodios' if it['type'] == 'series' else 'findvideos',
|
||||
thumbnail= it['covers'][0]['url'],
|
||||
fanart= it['covers'][2]['url'] if len(it['covers']) > 2 else '',
|
||||
id= it['_id'],
|
||||
videourl= it['stitched']['urls'][0]['url'].split('?')[0])
|
||||
|
||||
if i < 20 or item.search:
|
||||
itemlist.append(itm)
|
||||
else:
|
||||
recordlist.append(it)
|
||||
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
if recordlist and not item.search:
|
||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), args=recordlist))
|
||||
return itemlist
|
||||
|
||||
|
||||
def episodios(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
seasons = httptools.downloadpage('{}/v3/vod/series/{}/seasons?includeItems=true&deviceType=web&{}'.format(api, item.id, UUID)).json['seasons']
|
||||
for season in seasons:
|
||||
for episode in season['episodes']:
|
||||
itemlist.append(item.clone(title='{}x{:02d} - {}'.format(episode['season'], episode['number'], episode['name']),
|
||||
contrentTitle=episode['name'],
|
||||
contentSeason=episode['season'],
|
||||
contentEpisodeNumber=episode['number'],
|
||||
plot=episode['description'],
|
||||
thumbnail=episode['covers'][1]['url'],
|
||||
videourl=episode['stitched']['urls'][0]['url'].split('?')[0],
|
||||
action='findvideos'))
|
||||
|
||||
if config.get_setting('episode_info'):
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
support.videolibrary(itemlist,item)
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
item.server = 'directo'
|
||||
item.manifest='hls'
|
||||
params = '{}?deviceDNT=0&deviceVersion=unknow&appVersion=unknow&deviceType=web&deviceMake=firefox&deviceModel=firefox&appName=web&{}'
|
||||
item.url = params.format(item.videourl, UUID)
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
12
channels/polpotv.json
Normal file
12
channels/polpotv.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "polpotv",
|
||||
"name": "PolpoTV",
|
||||
"language": ["ita"],
|
||||
"active": false,
|
||||
"thumbnail": "polpotv.png",
|
||||
"banner": "polpotv.png",
|
||||
"categories": ["movie","tvshow"],
|
||||
"not_active":[],
|
||||
"default_off":["include_in_newest"],
|
||||
"settings": []
|
||||
}
|
||||
227
channels/polpotv.py
Normal file
227
channels/polpotv.py
Normal file
@@ -0,0 +1,227 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# KoD - XBMC Plugin
|
||||
# Canale polpotv
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support, jsontools
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
import datetime
|
||||
|
||||
host = config.get_channel_url()
|
||||
|
||||
headers = [['Accept', 'application/ld+json']]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
# menu = [
|
||||
# ('Ultimi Film aggiunti', ['/api/movies', 'movies', '']),
|
||||
# ('Ultime Serie TV aggiunte', ['/api/shows', 'movies', '']),
|
||||
# ('Generi', ['/api/genres', 'search_movie_by_genre', '']),
|
||||
# ('Anni {film}', ['', 'search_movie_by_year', '']),
|
||||
# ('Cerca... bold', ['', 'search', ''])
|
||||
# ]
|
||||
film = ['/api/movies',
|
||||
('Generi', ['/api/genres', 'search_movie_by_genre', '']),
|
||||
('Anni', ['', 'search_movie_by_year', '']),]
|
||||
|
||||
tvshow=['/api/shows']
|
||||
|
||||
search=''
|
||||
|
||||
return locals()
|
||||
|
||||
def newest(category):
|
||||
logger.debug()
|
||||
item = Item()
|
||||
if category == 'movie':
|
||||
item.contentType = 'movie'
|
||||
item.url = host + '/api/movies'
|
||||
elif category == 'tvshow':
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host+'/api/shows'
|
||||
return movies(item)
|
||||
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for element in json_object['hydra:member']:
|
||||
if 'shows' not in item.url:
|
||||
item.contentType='movie'
|
||||
else:
|
||||
item.contentType='tvshow'
|
||||
itemlist.append(get_itemlist_element(element, item))
|
||||
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
try:
|
||||
if support.inspect.stack()[1][3] not in ['newest']:
|
||||
support.nextPage(itemlist, item, next_page=json_object['hydra:view']['hydra:next'])
|
||||
except:
|
||||
pass
|
||||
|
||||
return itemlist
|
||||
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for season in json_object['seasons']:
|
||||
seas_url=host+season['@id']+'/releases'
|
||||
itemlist_season=get_season(item, seas_url, season['seasonNumber'])
|
||||
if(len(itemlist_season)>0):
|
||||
itemlist.extend(itemlist_season)
|
||||
|
||||
support.videolibrary(itemlist, item, 'color kod bold')
|
||||
support.download(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
|
||||
def get_season(item, seas_url, seasonNumber):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
data = support.match(seas_url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for episode in json_object['hydra:member']:
|
||||
itemlist.append(
|
||||
item.clone(action='findvideos',
|
||||
contentType='episode',
|
||||
title=support.typo(str(seasonNumber)+"x"+str("%02d"%episode['episodeNumber']), 'bold'),
|
||||
url=seas_url,
|
||||
extra=str(len(json_object['hydra:member'])-episode['episodeNumber'])))
|
||||
return itemlist[::-1]
|
||||
|
||||
def search(item, texto):
|
||||
logger.debug(item.url, "search", texto)
|
||||
itemlist=[]
|
||||
try:
|
||||
item.url = host + "/api/movies?originalTitle="+texto+"&translations.name=" +texto
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for movie in json_object['hydra:member']:
|
||||
item.contentType='movie'
|
||||
itemlist.append(get_itemlist_element(movie,item))
|
||||
item.url = host + "/api/shows?originalTitle="+texto+"&translations.name=" +texto
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for tvshow in json_object['hydra:member']:
|
||||
item.contentType='tvshow'
|
||||
itemlist.append(get_itemlist_element(tvshow,item))
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
return itemlist
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def search_movie_by_genre(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
for genre in json_object['hydra:member']:
|
||||
itemlist.append(
|
||||
item.clone(action="movies",
|
||||
title=support.typo(genre['name'],'bold'),
|
||||
contentType='movie',
|
||||
url="%s/api/movies?genres.id=%s" %(host,genre['id'])))
|
||||
return support.thumb(itemlist, True)
|
||||
|
||||
|
||||
def search_movie_by_year(item):
|
||||
logger.debug()
|
||||
now = datetime.datetime.now()
|
||||
year = int(now.year)
|
||||
itemlist = []
|
||||
for i in range(100):
|
||||
year_to_search = year - i
|
||||
itemlist.append(
|
||||
item.clone(channel=item.channel,url="%s/api/movies?releaseDate=%s" %(host,year_to_search),
|
||||
plot="1",
|
||||
type="movie",
|
||||
title=support.typo(year_to_search,'bold'),
|
||||
action="movies"))
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
try:
|
||||
data = support.match(item.url, headers=headers).data
|
||||
json_object = jsontools.load(data)
|
||||
array_index=0
|
||||
if item.contentType!='movie':
|
||||
array_index=int(item.extra)
|
||||
for video in json_object['hydra:member'][array_index]['playlist']['videos']:
|
||||
itemlist.append(
|
||||
item.clone(action="play",
|
||||
title='Direct',
|
||||
url=video['src'],
|
||||
server='directo',
|
||||
quality=str(video['size'])+ 'p',
|
||||
folder=False))
|
||||
except:
|
||||
pass
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
def get_itemlist_element(element,item):
|
||||
logger.debug()
|
||||
contentSerieName = ''
|
||||
contentTitle =''
|
||||
try:
|
||||
if element['originalLanguage']['id']=='it':
|
||||
scrapedtitle=element['originalTitle']
|
||||
else:
|
||||
scrapedtitle=element['translations'][1]['name']
|
||||
if scrapedtitle=='':
|
||||
scrapedtitle=element['originalTitle']
|
||||
except:
|
||||
scrapedtitle=element['originalTitle']
|
||||
try:
|
||||
scrapedplot=element['translations'][1]['overview']
|
||||
except:
|
||||
scrapedplot = ""
|
||||
try:
|
||||
scrapedthumbnail="https:"+element['bestPosters'].values()[0]
|
||||
except:
|
||||
scrapedthumbnail=""
|
||||
# try:
|
||||
# scrapedfanart="http:"+element['backdropPath']
|
||||
# except:
|
||||
# scrapedfanart=""
|
||||
|
||||
infoLabels = {}
|
||||
if item.contentType=='movie':
|
||||
contentTitle = scrapedtitle
|
||||
next_action='findvideos'
|
||||
quality=support.typo(element['lastQuality'].upper(), '_ [] color kod bold')
|
||||
url="%s%s/releases"
|
||||
infoLabels['tmdb_id']=element['tmdbId']
|
||||
else:
|
||||
contentSerieName = scrapedtitle
|
||||
next_action='episodes'
|
||||
quality=''
|
||||
url="%s%s"
|
||||
|
||||
return item.clone(action=next_action,
|
||||
title=support.typo(scrapedtitle, 'bold') + quality,
|
||||
fulltitle=scrapedtitle,
|
||||
show=scrapedtitle,
|
||||
plot=scrapedplot,
|
||||
# fanart=scrapedfanart,
|
||||
thumbnail=scrapedthumbnail,
|
||||
contentTitle=contentTitle,
|
||||
contentSerieName=contentSerieName,
|
||||
contentType=item.contentType,
|
||||
url=url % (host, element['@id']),
|
||||
infoLabels=infoLabels)
|
||||
10
channels/pufimovies.json
Normal file
10
channels/pufimovies.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "pufimovies",
|
||||
"name": "PufiMovies",
|
||||
"active": false,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "pufimovies.png",
|
||||
"banner": "pufimovies.png",
|
||||
"categories": ["movie","tvshow"],
|
||||
"settings": []
|
||||
}
|
||||
115
channels/pufimovies.py
Normal file
115
channels/pufimovies.py
Normal file
@@ -0,0 +1,115 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per PufiMovies
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
|
||||
|
||||
|
||||
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
film = [
|
||||
('Generi', ['', 'menu', 'Film']),
|
||||
('Più Visti', ['','movies', 'most'])
|
||||
]
|
||||
|
||||
tvshow = ['',
|
||||
('Generi', ['', 'menu', 'Serie Tv']),
|
||||
('Ultimi Episodi', ['','movies', 'last'])
|
||||
]
|
||||
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
action = 'movies'
|
||||
patronBlock = item.args + r' Categorie</a>\s*<ul(?P<block>.*?)</ul>'
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)"[^>]+>(?P<title>[^>]+)<'
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug('search', item)
|
||||
itemlist = []
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/search/keyword/' + text
|
||||
try:
|
||||
item.args = 'search'
|
||||
itemlist = movies(item)
|
||||
if itemlist[-1].action == 'movies':
|
||||
itemlist.pop()
|
||||
return itemlist
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.url = host
|
||||
item.action = 'movies'
|
||||
try:
|
||||
if category == 'movie':
|
||||
item.contentType = 'movie'
|
||||
itemlist = movies(item)
|
||||
else:
|
||||
item.args = 'last'
|
||||
item.contentType = 'tvshow'
|
||||
itemlist = movies(item)
|
||||
|
||||
if itemlist[-1].action == 'movies':
|
||||
itemlist.pop()
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
if item.contentType == 'tvshow' and not item.args:
|
||||
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+)'
|
||||
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>[^<]*)<'
|
||||
elif item.args == 'last':
|
||||
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+)'
|
||||
elif item.args == 'most':
|
||||
patron =r'div class="sm-113 item">\s*<a href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s<img src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*(?P<title>[^<]+)'
|
||||
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>[^<]*)<'
|
||||
typeActionDict = {'findvideos':['movie'], 'episodes':['tvshow']}
|
||||
typeContentDict = {'movie':['movie'], 'tvshow':['tvshow']}
|
||||
patronNext = r'<a href="([^"]+)"[^>]+>»'
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
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+)'
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
# match = support.match(item, patron='wstream', debug=True)
|
||||
return support.server(item)
|
||||
@@ -7,7 +7,7 @@ from core.item import Item
|
||||
import datetime, xbmc
|
||||
import requests, sys
|
||||
|
||||
from core import jsontools, scrapertools, support
|
||||
from core import jsontools, support
|
||||
from platformcode import logger
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
@@ -19,8 +19,8 @@ host = support.config.get_channel_url()
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
top = [('Dirette {bold}', ['/dirette', 'live', '/palinsesto/onAir.json']),
|
||||
('Replay {bold}', ['/guidatv', 'replayMenu', '/guidatv.json'])]
|
||||
top = [('Dirette {bullet bold}', ['/dirette', 'live', '/palinsesto/onAir.json']),
|
||||
('Replay {bullet bold}', ['/guidatv', 'replayMenu', '/guidatv.json'])]
|
||||
|
||||
menu = [('Film {bullet bold}', ['/film', 'menu', '/tipologia/film/index.json']),
|
||||
('Serie TV {bullet bold}', ['/serietv', 'menu', '/tipologia/serietv/index.json']),
|
||||
@@ -43,14 +43,14 @@ def menu(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
item.disable_videolibrary = True
|
||||
action = 'peliculas'
|
||||
action = 'movies'
|
||||
|
||||
if item.data:
|
||||
for it in item.data:
|
||||
url = getUrl(it['path_id'])
|
||||
action = 'genres'
|
||||
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:
|
||||
items = item.data if item.data else requests.get(host + item.args).json()['contents']
|
||||
for it in items:
|
||||
@@ -58,7 +58,7 @@ def menu(item):
|
||||
thumb = item.thumbnail
|
||||
if 'RaiPlay Slider Generi Block' in it['type']:
|
||||
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))
|
||||
|
||||
return itemlist
|
||||
@@ -68,7 +68,7 @@ def genres(item):
|
||||
itemlist = []
|
||||
items = requests.get(getUrl(item.genre_url)).json()['contents']
|
||||
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
|
||||
|
||||
|
||||
@@ -78,21 +78,21 @@ def search(item, text):
|
||||
|
||||
try:
|
||||
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
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def peliculas(item):
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
return addinfo(item.data, item)
|
||||
|
||||
|
||||
def episodios(item):
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
itemlist = []
|
||||
|
||||
@@ -100,8 +100,8 @@ def episodios(item):
|
||||
items = item.data
|
||||
elif item.season_url:
|
||||
items = requests.get(item.season_url).json()['items']
|
||||
elif item.video_url:
|
||||
items = requests.get(item.video_url).json()['blocks']
|
||||
elif item.videoUrl:
|
||||
items = requests.get(item.videoUrl).json()['blocks']
|
||||
|
||||
if 'sets' in items[0]:
|
||||
if len(items) > 1:
|
||||
@@ -114,19 +114,18 @@ def episodios(item):
|
||||
|
||||
if not itemlist:
|
||||
itemlist = addinfo(items, item)
|
||||
# itemlist.sort(key=lambda it: (it.season, it.episode))
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def epMenu(item):
|
||||
video_url = ''
|
||||
videoUrl = ''
|
||||
itemlist = []
|
||||
for it in item.data:
|
||||
if 'sets' in it:
|
||||
itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), data=[it]))
|
||||
else:
|
||||
itemlist.append(item.clone(title=support.typo(it['name'], 'bold'), season_url=getUrl(it['path_id']), data=''))
|
||||
# itemlist.sort(key=lambda it: it.title)
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -142,9 +141,9 @@ def live(item):
|
||||
current = it['currentItem']
|
||||
next = it['nextItem']
|
||||
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='findvideos'))
|
||||
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))
|
||||
support.thumb(itemlist, live=True)
|
||||
support.thumb(itemlist, mode='live')
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -193,10 +192,9 @@ def replayChannels(item):
|
||||
channel_url=channel_url,
|
||||
action='replay'))
|
||||
itemlist.sort(key=lambda it: support.channels_order.get(it.fulltitle, 999))
|
||||
support.thumb(itemlist, live=True)
|
||||
support.thumb(itemlist, mode='live')
|
||||
return itemlist
|
||||
|
||||
|
||||
def replay(item):
|
||||
logger.debug()
|
||||
|
||||
@@ -208,7 +206,7 @@ def replay(item):
|
||||
fanart = image,
|
||||
plot = info['description'],
|
||||
url = getUrl(it['weblink']),
|
||||
video_url = getUrl(it['path_id']),
|
||||
videoUrl = getUrl(it['path_id']),
|
||||
action = 'findvideos',
|
||||
forcethumb = True)
|
||||
|
||||
@@ -217,22 +215,20 @@ def replay(item):
|
||||
items = requests.get(item.channel_url).json().get('events', {})
|
||||
now = datetime.datetime.now()
|
||||
h = int('{}{:02d}'.format(now.hour, now.minute))
|
||||
today = now.strftime('%d-%m-%Y')
|
||||
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
itlist = [executor.submit(itInfo, it) for it in items if it['has_video'] and (int(it['hour'].replace(':','')) <= h or item.date != today)]
|
||||
itlist = [executor.submit(itInfo, it) for it in items if it['has_video'] and int(it['hour'].replace(':','')) <= h]
|
||||
for res in futures.as_completed(itlist):
|
||||
if res.result():
|
||||
itemlist.append(res.result())
|
||||
if not itemlist:
|
||||
return [Item(title='Non ci sono Replay per questo Canale')]
|
||||
itemlist.sort(key=lambda it: it.title)
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
|
||||
res = requests.get(item.video_url).json()
|
||||
res = requests.get(item.videoUrl).json()
|
||||
|
||||
if 'first_item_path' in res:
|
||||
res = requests.get(getUrl(res['first_item_path'])).json()
|
||||
@@ -243,9 +239,9 @@ def findvideos(item):
|
||||
item.drm = 'com.widevine.alpha'
|
||||
item.license = lic + '|' + host + '|R{SSM}|'
|
||||
|
||||
item = item.clone(server='directo', url=url, no_return=True) # , manifest='hls')
|
||||
item = item.clone(server='directo', url=url, no_return=True, manifest='hls')
|
||||
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
return [item]
|
||||
|
||||
|
||||
def getUrl(url):
|
||||
@@ -261,36 +257,20 @@ def getUrl(url):
|
||||
|
||||
|
||||
def addinfo(items, item):
|
||||
def itInfo(n, key, item):
|
||||
logger.debug()
|
||||
def itInfo(key, item):
|
||||
# logger.debug(jsontools.dump(key))
|
||||
item.forcethumb = True
|
||||
episode = 0
|
||||
season = 0
|
||||
if key.get('titolo', ''):
|
||||
key = requests.get(getUrl(key['path_id'])).json()['program_info']
|
||||
|
||||
|
||||
info = requests.get(getUrl(key['info_url'])).json() if 'info_url' in key else {}
|
||||
details = info.get('details',{})
|
||||
for detail in details:
|
||||
if detail['key'] == 'season':
|
||||
s = scrapertools.find_single_match(detail['value'], '(\d+)')
|
||||
if s: season = int(s)
|
||||
if detail['key'] == 'episode':
|
||||
e = scrapertools.find_single_match(detail['value'], '(\d+)')
|
||||
if e: episode = int(e)
|
||||
|
||||
images = info.get('images', {})
|
||||
fanart = images.get('landscape', '')
|
||||
thumb = images.get('portrait_logo', '')
|
||||
if not thumb: thumb = fanart
|
||||
title = key.get('name', '')
|
||||
if key.get('episode_title'):
|
||||
title = key.get('episode_title')
|
||||
if episode:
|
||||
title = '{:02d}. {}'.format(episode, title)
|
||||
if season:
|
||||
title = '{}x{}'.format(season, title)
|
||||
|
||||
it = item.clone(title=support.typo(title, 'bold'),
|
||||
data='',
|
||||
@@ -299,25 +279,21 @@ def addinfo(items, item):
|
||||
thumbnail= getUrl(thumb),
|
||||
fanart=getUrl(fanart),
|
||||
url=getUrl(key.get('weblink', '')),
|
||||
video_url=getUrl(key['path_id']),
|
||||
season=season,
|
||||
episode=episode,
|
||||
plot=info.get('description', ''),
|
||||
order=n)
|
||||
videoUrl=getUrl(key['path_id']),
|
||||
plot=info.get('description', ''))
|
||||
|
||||
if 'Genere' not in key.get('sub_type', '') and ('layout' not in key or key['layout'] == 'single'):
|
||||
it.action = 'findvideos'
|
||||
it.contentTitle = it.fulltitle
|
||||
else:
|
||||
it.action = 'episodios'
|
||||
it.action = 'episodes'
|
||||
it.contentSerieName = it.fulltitle
|
||||
return it
|
||||
|
||||
itemlist = []
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
itlist = [executor.submit(itInfo, n, it, item) for n, it in enumerate(items)]
|
||||
itlist = [executor.submit(itInfo, it, item) for it in items]
|
||||
for res in futures.as_completed(itlist):
|
||||
if res.result():
|
||||
itemlist.append(res.result())
|
||||
itemlist.sort(key=lambda it: it.order)
|
||||
return itemlist
|
||||
11
channels/seriehd.json
Normal file
11
channels/seriehd.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "seriehd",
|
||||
"name": "SerieHD",
|
||||
"active": false,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "seriehd.png",
|
||||
"banner": "seriehd.png",
|
||||
"categories": ["tvshow"],
|
||||
"settings": [],
|
||||
"cloudflare": true
|
||||
}
|
||||
157
channels/seriehd.py
Normal file
157
channels/seriehd.py
Normal file
@@ -0,0 +1,157 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per SerieHD
|
||||
# ------------------------------------------------------------
|
||||
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
# def findhost(url):
|
||||
# return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
tvshow = [('Genere', ['', 'menu', 'genre']),
|
||||
('A-Z', ['', 'menu', 'a-z']),
|
||||
('In Corso', ['/category/serie-tv-streaming/serie-in-corso', 'movies']),
|
||||
('Complete', ['/category/serie-tv-streaming/serie-complete', 'movies']),
|
||||
('Americane', ['/category/serie-tv-streaming/serie-tv-americane', 'movies']),
|
||||
('Italiane', ['/category/serie-tv-streaming/serie-tv-italiane', 'movies']),
|
||||
('Ultimi Episodi', ['/aggiornamenti', 'movies', 'last']),
|
||||
('Evidenza', ['', 'movies', 'best'])]
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.debug(texto)
|
||||
|
||||
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore .
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.url = host + '/aggiornamenti'
|
||||
item.args = 'last'
|
||||
try:
|
||||
if category == 'tvshow':
|
||||
item.contentType = 'tvshow'
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
# debug = True
|
||||
|
||||
if item.args == 'last':
|
||||
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>[^\)]+)?(?:\))?'
|
||||
elif item.args == 'best':
|
||||
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>[^"]+)"'
|
||||
else:
|
||||
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>[^<]+?)(?:\[(?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="([^"]+)"'
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodes(item):
|
||||
def get_season(pageData, seas_url, season):
|
||||
data = ''
|
||||
episodes = support.match(pageData if pageData else seas_url, patronBlock=patron_episode, patron=patron_option).matches
|
||||
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
|
||||
data += title + '|' + episode_url + '\n'
|
||||
return data
|
||||
|
||||
patron_season = '<div class="[^"]+" id="seasonsModal"[^>]+>(.*?)</ul>'
|
||||
patron_episode = '<div class="[^"]+" id="episodesModal"[^>]+>(.*?)</ul>'
|
||||
patron_option = r'<a href="([^"]+?)".*?>(?:Stagione |Episodio )([^<]+?)</a>'
|
||||
|
||||
url = support.match(item, patron=r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
|
||||
seasons = support.match(url, patronBlock=patron_season, patron=patron_option)
|
||||
|
||||
data = ''
|
||||
|
||||
# debugging
|
||||
# logger.dbg()
|
||||
# for i, season in enumerate(seasons.matches):
|
||||
# data += get_season(seasons.data if i == 0 else '', season[0], season[1])
|
||||
import sys
|
||||
if sys.version_info[0] >= 3: from concurrent import futures
|
||||
else: from concurrent_py2 import futures
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
thL = []
|
||||
for i, season in enumerate(seasons.matches):
|
||||
thL.append(executor.submit(get_season, seasons.data if i == 0 else '', season[0], season[1]))
|
||||
for res in futures.as_completed(thL):
|
||||
if res.result():
|
||||
data += res.result()
|
||||
# debug = True
|
||||
patron = r'(?P<season>\d+)x(?P<episode>\d+)\s*-\s*(?P<title>[^\|]+)\|(?P<url>[^ ]+)'
|
||||
action = 'findvideos'
|
||||
|
||||
def itemlistHook(itemlist):
|
||||
itemlist.sort(key=lambda item: (item.infoLabels['season'], item.infoLabels['episode']))
|
||||
return itemlist
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
if item.args == 'genre':
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a>'
|
||||
else:
|
||||
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']
|
||||
action = 'movies'
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
item.url = item.url.replace('&', '&')
|
||||
logger.debug(item)
|
||||
if item.args == 'last':
|
||||
url = support.match(item, patron = r'<iframe id="iframeVid" width="[^"]+" height="[^"]+" src="([^"]+)" allowfullscreen').match
|
||||
matches = support.match(url,patron=r'<a href="([^"]+)">(\d+)<', patronBlock=r'<h3>EPISODIO</h3><ul>(.*?)</ul>').matches
|
||||
if matches: item.url = support.urlparse.urljoin(url, matches[-1][0])
|
||||
return support.hdpass_get_servers(item)
|
||||
|
||||
|
||||
def play(item):
|
||||
if 'hdpass' in item.url:
|
||||
return support.hdpass_get_url(item)
|
||||
return [item]
|
||||
11
channels/serietvonline.json
Normal file
11
channels/serietvonline.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "serietvonline",
|
||||
"name": "SerieTvOnline",
|
||||
"active": false,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "serietvonline.png",
|
||||
"bannermenu": "serietvonline.png",
|
||||
"categories": ["anime","tvshow","movie","documentary"],
|
||||
"not_active": ["include_in_newest_anime"],
|
||||
"settings": []
|
||||
}
|
||||
184
channels/serietvonline.py
Normal file
184
channels/serietvonline.py
Normal file
@@ -0,0 +1,184 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per serietvonline.py
|
||||
# ----------------------------------------------------------
|
||||
"""
|
||||
Novità. Indicare in quale/i sezione/i è presente il canale:
|
||||
- film, serie
|
||||
|
||||
Avvisi:
|
||||
- Al massimo 25 titoli per le sezioni: Film
|
||||
- Al massimo 35 titoli per le sezioni: Tutte le altre
|
||||
Per aggiungere in videoteca le Anime:
|
||||
Se hanno la forma 1x01:
|
||||
-si posso aggiungere direttamente dalla pagina della serie, sulla voce in fondo "aggiungi in videoteca".
|
||||
Altrimenti:
|
||||
- Prima fare la 'Rinumerazione' dal menu contestuale dal titolo della serie
|
||||
"""
|
||||
|
||||
from core import support, scrapertools
|
||||
from platformcode import config, logger
|
||||
from core.item import Item
|
||||
|
||||
|
||||
# def findhost(url):
|
||||
# host = support.match(url, patron=r'href="([^"]+)">\s*cliccando qui').matches[-1]
|
||||
# return host
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
logger.debug()
|
||||
|
||||
|
||||
film = ['/ultimi-film-aggiunti/',
|
||||
('A-Z', ['/lista-film/', 'movies', 'lista'])
|
||||
]
|
||||
|
||||
tvshow = ['',
|
||||
('Aggiornamenti', ['/ultimi-episodi-aggiunti/', 'movies', 'update']),
|
||||
('Tutte', ['/lista-serie-tv/', 'movies', 'qualcosa']),
|
||||
('Italiane', ['/lista-serie-tv-italiane/', 'movies', 'qualcosa']),
|
||||
('Anni 50-60-70-80', ['/lista-serie-tv-anni-60-70-80/', 'movies', 'qualcosa']),
|
||||
('HD', ['/lista-serie-tv-in-altadefinizione/', 'movies', 'qualcosa'])
|
||||
]
|
||||
|
||||
anime = ['/lista-cartoni-animati-e-anime/']
|
||||
|
||||
documentari = [('Documentari {bullet bold}', ['/lista-documentari/' , 'movies' , 'doc', 'tvshow'])]
|
||||
|
||||
search = ''
|
||||
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def movies(item):
|
||||
logger.debug()
|
||||
numerationEnabled = True
|
||||
|
||||
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Cartoni Animati e Anime']
|
||||
patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
patronNext = r'<div class="siguiente"><a href="([^"]+)" >'
|
||||
# debug = True
|
||||
|
||||
if item.args == 'search':
|
||||
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>[^"]+)'
|
||||
elif item.contentType == 'episode':
|
||||
pagination = True
|
||||
action = 'findvideos'
|
||||
patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>.*?)(?P<episode>\d+x\d+)[ ]?(?P<title2>[^<]+)?<'
|
||||
|
||||
elif item.contentType == 'tvshow':
|
||||
# SEZIONE Serie TV- Anime - Documentari
|
||||
pagination = True
|
||||
|
||||
if not item.args and 'anime' not in item.url:
|
||||
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+? href="(?P<url>[^"]+)">.*?<h2>(?P<title>[^"]+)</h2>\s?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
|
||||
else:
|
||||
numerationEnabled = True
|
||||
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
|
||||
else:
|
||||
# SEZIONE FILM
|
||||
pagination = True
|
||||
|
||||
if item.args == 'lista':
|
||||
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)(?:\s(?P<year>\d{4})|<)'
|
||||
patronBlock = r'Lista dei film disponibili in streaming e anche in download\.</p>(?P<block>.*?)<div class="footer_c">'
|
||||
else:
|
||||
patron = r'<tr><td><a href="(?P<url>[^"]+)"(?:|.+?)?>(?: )?[ ]?(?P<title>.*?)[ ]?(?P<quality>HD)?[ ]?(?P<year>\d+)?(?: | HD[^<]*| Streaming[^<]*| MD(?: iSTANCE)? [^<]*)?</a>'
|
||||
|
||||
def itemHook(item):
|
||||
if 'film' in item.url:
|
||||
item.action = 'findvideos'
|
||||
item.contentType = 'movie'
|
||||
elif item.args == 'update':
|
||||
pass
|
||||
else:
|
||||
item.contentType = 'tvshow'
|
||||
item.action = 'episodes'
|
||||
return item
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodes(item):
|
||||
logger.debug()
|
||||
numerationEnabled = True
|
||||
action = 'findvideos'
|
||||
patronBlock = r'<table>(?P<block>.*)<\/table>'
|
||||
patron = r'<tr><td>(?P<title>.*?)?[ ](?:Parte)?(?P<episode>\d+x\d+|\d+)(?:|[ ]?(?P<title2>.+?)?(?:avi)?)<(?P<data>.*?)<\/td><tr>'
|
||||
def itemlistHook(itemlist):
|
||||
for i, item in enumerate(itemlist):
|
||||
ep = support.match(item.title, patron=r'\d+x(\d+)').match
|
||||
if ep == '00':
|
||||
item.title = item.title.replace('x00', 'x' + str(i+1).zfill(2)).replace('- ..','')
|
||||
return itemlist
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
logger.debug("CERCA :" ,text, item)
|
||||
|
||||
item.url = "%s/?s=%s" % (host, text)
|
||||
|
||||
try:
|
||||
item.args = 'search'
|
||||
return movies(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
def newest(category):
|
||||
logger.debug(category)
|
||||
|
||||
itemlist = []
|
||||
item = Item()
|
||||
|
||||
if category == 'movie':
|
||||
item.contentType = 'movie'
|
||||
item.url = host + '/ultimi-film-aggiunti/'
|
||||
elif category == 'tvshow':
|
||||
item.args = 'update'
|
||||
item.contentType = 'episode'
|
||||
item.url = host +'/ultimi-episodi-aggiunti/'
|
||||
try:
|
||||
item.action = 'movies'
|
||||
itemlist = movies(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
if item.contentType == 'movie':
|
||||
return support.server(item, headers=headers)
|
||||
else:
|
||||
|
||||
if item.args != 'update':
|
||||
return support.server(item, item.data)
|
||||
else:
|
||||
itemlist = []
|
||||
item.infoLabels['mediatype'] = 'episode'
|
||||
|
||||
data = support.match(item.url, headers=headers).data
|
||||
url_video = scrapertools.find_single_match(data, r'<tr><td>(.+?)</td><tr>', -1)
|
||||
url_serie = scrapertools.find_single_match(data, r'<link rel="canonical" href="([^"]+)"\s?/>')
|
||||
goseries = support.typo("Vai alla Serie:", ' bold')
|
||||
series = support.typo(item.contentSerieName, ' bold color kod')
|
||||
itemlist = support.server(item, data=url_video)
|
||||
|
||||
itemlist.append(item.clone(title=goseries + series, contentType='tvshow', url=url_serie, action='episodes', plot = goseries + series + "con tutte le puntate", args=''))
|
||||
|
||||
return itemlist
|
||||
53
channels/serietvsubita.json
Normal file
53
channels/serietvsubita.json
Normal file
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"id": "serietvsubita",
|
||||
"name": "Serie TV Sub ITA",
|
||||
"active": false,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "serietvsubita.png",
|
||||
"banner": "serietvsubita.png",
|
||||
"categories": ["tvshow"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_global_search",
|
||||
"type": "bool",
|
||||
"label": "Includi ricerca globale",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_tvshow",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Serie TV",
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "checklinks",
|
||||
"type": "bool",
|
||||
"label": "Verifica se i link esistono",
|
||||
"default": false,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "checklinks_number",
|
||||
"type": "list",
|
||||
"label": "Numero de link da verificare",
|
||||
"default": 1,
|
||||
"enabled": true,
|
||||
"visible": "eq(-1,true)",
|
||||
"lvalues": [ "1", "3", "5", "10" ]
|
||||
},
|
||||
{
|
||||
"id": "filter_languages",
|
||||
"type": "list",
|
||||
"label": "Mostra link in lingua...",
|
||||
"default": 0,
|
||||
"enabled": true,
|
||||
"visible": true,
|
||||
"lvalues": ["Non filtrare","IT"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user