Merge branch 'master' of github.com:kodiondemand/plugin.video.alfa
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"id": "animeleggendari",
|
||||
"name": "AnimeLeggendari",
|
||||
"name": "AnimePerTutti",
|
||||
"active": true,
|
||||
"adult": false,
|
||||
"language": ["ita"],
|
||||
"thumbnail": "https://animeleggendari.com/wp-content/uploads/2018/01/123header.jpg",
|
||||
"bannermenu": "https://animeleggendari.com/wp-content/uploads/2018/01/123header.jpg",
|
||||
"thumbnail": "animepertutti.png",
|
||||
"bannermenu": "animepertutti.png",
|
||||
"categories": ["anime"],
|
||||
"settings": [
|
||||
{
|
||||
@@ -20,9 +20,9 @@
|
||||
"id": "include_in_newest_anime",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Anime",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
"default": true,
|
||||
"enabled": true,
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_italiano",
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Ringraziamo Icarus crew
|
||||
# Canale per animeleggendari
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import re
|
||||
|
||||
from channels import autoplay
|
||||
from channels import filtertools, support
|
||||
from core import servertools, httptools, scrapertools, tmdb
|
||||
from channels import filtertools, autoplay, support, autorenumber
|
||||
from channels.support import log, menu
|
||||
from core import servertools, httptools, scrapertoolsV2, scrapertools, tmdb
|
||||
from platformcode import logger, config
|
||||
from core.item import Item
|
||||
from lib.js2py.host import jsfunctions
|
||||
|
||||
host = "https://animeleggendari.com"
|
||||
host = "https://animepertutti.com"
|
||||
|
||||
# Richiesto per Autoplay
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
@@ -24,57 +24,29 @@ __comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'animeleggendari
|
||||
__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'animeleggendari')
|
||||
|
||||
def mainlist(item):
|
||||
logger.info('[animeleggendari.py] mainlist')
|
||||
|
||||
# Richiesto per Autoplay
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
|
||||
itemlist = [Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title="[B]Anime Leggendari[/B]",
|
||||
url="%s/category/anime-leggendari/" % host,
|
||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
||||
Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title="Anime [B]ITA[/B]",
|
||||
url="%s/category/anime-ita/" % host,
|
||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
||||
Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title="Anime [B]SUB ITA[/B]",
|
||||
url="%s/category/anime-sub-ita/" % host,
|
||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
||||
Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title="Conclusi",
|
||||
url="%s/category/serie-anime-concluse/" % host,
|
||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
||||
Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title="In Corso",
|
||||
url="%s/category/anime-in-corso/" % host,
|
||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
||||
Item(channel=item.channel,
|
||||
action="generi",
|
||||
title="Generi >",
|
||||
url=host,
|
||||
thumbnail="http://orig03.deviantart.net/6889/f/2014/079/7/b/movies_and_popcorn_folder_icon_by_matheusgrilo-d7ay4tw.png"),
|
||||
Item(channel=item.channel,
|
||||
action="search",
|
||||
title="[B]Cerca...[/B]",
|
||||
thumbnail="http://dc467.4shared.com/img/fEbJqOum/s7/13feaf0c8c0/Search")]
|
||||
log()
|
||||
|
||||
itemlist = []
|
||||
menu(itemlist, 'Anime Leggendari', 'peliculas', host + '/category/anime-leggendari/')
|
||||
menu(itemlist, 'Anime ITA', 'peliculas', host + '/category/anime-ita/')
|
||||
menu(itemlist, 'Anime SUB-ITA', 'peliculas', host + '/category/anime-sub-ita/')
|
||||
menu(itemlist, 'Anime Conclusi', 'peliculas', host + '/category/serie-anime-concluse/')
|
||||
menu(itemlist, 'Anime in Corso', 'peliculas', host + '/category/anime-in-corso/')
|
||||
menu(itemlist, 'Genere', 'genres', host)
|
||||
menu(itemlist, 'Cerca...', 'search')
|
||||
menu(itemlist, 'novita', 'newest')
|
||||
|
||||
# Autoplay visualizza voce menu
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
def search(item, texto):
|
||||
logger.info('[animeleggendari.py] search')
|
||||
log(texto)
|
||||
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return lista_anime(item)
|
||||
return peliculas(item)
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
@@ -83,139 +55,131 @@ def search(item, texto):
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
def generi(item):
|
||||
logger.info('[animeleggendari.py] generi')
|
||||
def last_ep(item):
|
||||
log('ANIME PER TUTTI')
|
||||
return support.scrape(item, '<a href="([^"]+)">([^<]+)<', ['url','title'],patron_block='<ul class="mh-tab-content-posts">(.*?)<\/ul>', action='findvideos')
|
||||
|
||||
def newest(categoria):
|
||||
log('ANIME PER TUTTI')
|
||||
log(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
if categoria == "anime":
|
||||
item.url = host
|
||||
item.action = "last_ep"
|
||||
itemlist = last_ep(item)
|
||||
|
||||
data = httptools.downloadpage(item.url).data.replace('\n','').replace('\t','')
|
||||
logger.info("[animeleggendari.py] generi= "+data)
|
||||
|
||||
blocco =scrapertools.find_single_match(data, r'Generi.*?<ul.*?>(.*?)<\/ul>')
|
||||
logger.info("[animeleggendari.py] blocco= "+blocco)
|
||||
patron = '<a href="([^"]+)">([^<]+)<'
|
||||
|
||||
matches = re.compile(patron, re.DOTALL).findall(blocco)
|
||||
logger.info("[animeleggendari.py] matches= "+str(matches))
|
||||
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
title = scrapedtitle.replace('Anime ','')
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title=title,
|
||||
url=scrapedurl))
|
||||
if itemlist[-1].action == "last_ep":
|
||||
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 lista_anime(item):
|
||||
logger.info('[animeleggendari.py] lista_anime')
|
||||
def genres(item):
|
||||
itemlist = support.scrape(item, '<a href="([^"]+)">([^<]+)<', ['url', 'title'], action='peliculas', patron_block=r'Generi.*?<ul.*?>(.*?)<\/ul>', blacklist=['Contattaci','Privacy Policy', 'DMCA'])
|
||||
return support.thumb(itemlist)
|
||||
|
||||
def peliculas(item):
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
patron = r'<a class="[^"]+" href="([^"]+)" title="([^"]+)"><img[^s]+src="([^"]+)"[^>]+'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
blacklist = ['top 10 anime da vedere']
|
||||
matches, data = support.match(item, r'<a class="[^"]+" href="([^"]+)" title="([^"]+)"><img[^s]+src="([^"]+)"[^>]+')
|
||||
|
||||
for scrapedurl, scrapedtitle, scrapedthumbnail in matches:
|
||||
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.strip()).replace("streaming", "")
|
||||
if 'top 10 anime da vedere' in scrapedtitle.lower(): continue
|
||||
for url, title, thumb in matches:
|
||||
title = scrapertoolsV2.decodeHtmlentities(title.strip()).replace("streaming", "")
|
||||
lang = scrapertoolsV2.find_single_match(title, r"((?:SUB ITA|ITA))")
|
||||
videoType = ''
|
||||
if 'movie' in title.lower():
|
||||
videoType = ' - (MOVIE)'
|
||||
if 'ova' in title.lower():
|
||||
videoType = ' - (OAV)'
|
||||
|
||||
cleantitle = title.replace(lang, "").replace('(Streaming & Download)', '').replace('( Streaming & Download )', '').replace('OAV', '').replace('OVA', '').replace('MOVIE', '').strip()
|
||||
|
||||
if not videoType :
|
||||
contentType="tvshow"
|
||||
action="episodios"
|
||||
else:
|
||||
contentType="movie"
|
||||
action="findvideos"
|
||||
|
||||
if not title.lower() in blacklist:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action=action,
|
||||
contentType=contentType,
|
||||
title=support.typo(cleantitle + videoType, 'bold') + support.typo(lang,'_ [] color kod'),
|
||||
fulltitle=cleantitle,
|
||||
show=cleantitle,
|
||||
url=url,
|
||||
thumbnail=thumb))
|
||||
|
||||
lang = scrapertools.find_single_match(scrapedtitle, r"((?:SUB ITA|ITA))")
|
||||
cleantitle = scrapedtitle.replace(lang, "").replace('(Streaming & Download)', '')
|
||||
cleantitle = cleantitle.replace('OAV', '').replace('OVA', '').replace('MOVIE', '')
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="episodios",
|
||||
contentType="tvshow" if 'movie' not in scrapedtitle.lower() and 'ova' not in scrapedtitle.lower() else "movie",
|
||||
text_color="azure",
|
||||
title=scrapedtitle.replace('(Streaming & Download)', '').replace(lang, '[B][' + lang + '][/B]'),
|
||||
fulltitle=cleantitle,
|
||||
url=scrapedurl,
|
||||
show=cleantitle,
|
||||
thumbnail=scrapedthumbnail,
|
||||
folder=True))
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
patronvideos = r'<a class="next page-numbers" href="([^"]+)">'
|
||||
matches = re.compile(patronvideos, re.DOTALL).findall(data)
|
||||
|
||||
if len(matches) > 0:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="lista_anime",
|
||||
title="[COLOR lightgreen]" + config.get_localized_string(30992) + "[/COLOR]",
|
||||
url=scrapedurl,
|
||||
thumbnail="http://2.bp.blogspot.com/-fE9tzwmjaeQ/UcM2apxDtjI/AAAAAAAAeeg/WKSGM2TADLM/s1600/pager+old.png",
|
||||
folder=True))
|
||||
autorenumber.renumber(itemlist)
|
||||
support.nextPage(itemlist, item, data, r'<a class="next page-numbers" href="([^"]+)">')
|
||||
|
||||
return itemlist
|
||||
|
||||
def episodios(item):
|
||||
logger.info('[animeleggendari.py] episodios')
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
blocco = scrapertools.find_single_match(data, r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(.*?)</span></a></div>')
|
||||
block = scrapertoolsV2.find_single_match(data, r'(?:<p style="text-align: left;">|<div class="pagination clearfix">\s*)(.*?)</span></a></div>')
|
||||
|
||||
# Il primo episodio è la pagina stessa
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
action='findvideos',
|
||||
contentType=item.contentType,
|
||||
title="Episodio: 1",
|
||||
text_color="azure",
|
||||
fulltitle="%s %s %s " % (support.color(item.title, "deepskyblue"), support.color("|", "azure"), support.color("1", "orange")),
|
||||
title=support.typo('Episodio 1 bold'),
|
||||
fulltitle=item.title,
|
||||
url=item.url,
|
||||
thumbnail=item.thumbnail,
|
||||
folder=True))
|
||||
if blocco != "":
|
||||
patron = r'<a href="([^"]+)".*?><span class="pagelink">(\d+)</span></a>'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
for scrapedurl, scrapednumber in matches:
|
||||
thumbnail=item.thumbnail))
|
||||
|
||||
if block:
|
||||
matches = re.compile(r'<a href="([^"]+)".*?><span class="pagelink">(\d+)</span></a>', re.DOTALL).findall(data)
|
||||
for url, number in matches:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
action='findvideos',
|
||||
contentType=item.contentType,
|
||||
title="Episodio: %s" % scrapednumber,
|
||||
text_color="azure",
|
||||
fulltitle="%s %s %s " % (support.color(item.title, "deepskyblue"), support.color("|", "azure"), support.color(scrapednumber, "orange")),
|
||||
url=scrapedurl,
|
||||
thumbnail=item.thumbnail,
|
||||
folder=True))
|
||||
|
||||
if config.get_videolibrary_support() and len(itemlist) != 0:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
title="[COLOR lightblue]%s[/COLOR]" % config.get_localized_string(30161),
|
||||
url=item.url,
|
||||
action="add_serie_to_library",
|
||||
extra="episodi",
|
||||
show=item.show))
|
||||
|
||||
title=support.typo('Episodio ' + number,'bold'),
|
||||
fulltitle=item.title,
|
||||
url=url,
|
||||
thumbnail=item.thumbnail))
|
||||
|
||||
autorenumber.renumber(itemlist, item)
|
||||
support.videolibrary
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
logger.info('[animeleggendari.py] findvideos')
|
||||
log()
|
||||
data = ''
|
||||
matches = support.match(item, 'str="([^"]+)"')[0]
|
||||
if matches:
|
||||
for match in matches:
|
||||
data += str(jsfunctions.unescape(re.sub('@|g','%', match)))
|
||||
data += str(match)
|
||||
log('DATA',data)
|
||||
if 'animepertutti' in data:
|
||||
log('ANIMEPERTUTTI!')
|
||||
|
||||
else:
|
||||
data = ''
|
||||
|
||||
data = httptools.downloadpage(item.url).data
|
||||
itemlist = servertools.find_video_items(data=data)
|
||||
|
||||
for videoitem in itemlist:
|
||||
server = re.sub(r'[-\[\]\s]+', '', videoitem.title)
|
||||
videoitem.title = "".join(["[%s] " % support.color(server.capitalize(), 'orange'), item.title])
|
||||
videoitem.fulltitle = item.fulltitle
|
||||
videoitem.show = item.show
|
||||
videoitem.thumbnail = item.thumbnail
|
||||
videoitem.channel = item.channel
|
||||
itemlist = support.server(item,data)
|
||||
|
||||
# Richiesto per Verifica se i link esistono
|
||||
if __comprueba_enlaces__:
|
||||
itemlist = servertools.check_list_links(itemlist, __comprueba_enlaces_num__)
|
||||
|
||||
# Richiesto per FilterTools
|
||||
|
||||
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||
|
||||
# Autoplay
|
||||
autoplay.start(itemlist, item)
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -59,8 +59,12 @@ def add_season(data=None):
|
||||
if season != "":
|
||||
heading = config.get_localized_string(70687)
|
||||
episode = platformtools.dialog_numeric(0, heading)
|
||||
if episode != "":
|
||||
return [int(season), int(episode)]
|
||||
if episode == "0":
|
||||
heading = config.get_localized_string(70688)
|
||||
special = platformtools.dialog_numeric(0, heading)
|
||||
return [int(season), int(episode), int(special)]
|
||||
elif episode != '':
|
||||
return [int(season), int(episode), '']
|
||||
|
||||
|
||||
def write_data(channel, show, data):
|
||||
@@ -94,10 +98,11 @@ def renumber(itemlist, item='', typography=''):
|
||||
if item:
|
||||
try:
|
||||
dict_series = jsontools.get_node_from_file(item.channel, TAG_TVSHOW_RENUMERATE)
|
||||
SERIES = dict_series[item.show]['season_episode']
|
||||
SERIES = dict_series[item.show.rstrip()]['season_episode']
|
||||
S = SERIES[0]
|
||||
E = SERIES[1]
|
||||
ID = SERIES[2]
|
||||
SP = SERIES[2]
|
||||
ID = SERIES[3]
|
||||
|
||||
page = 1
|
||||
epList = []
|
||||
@@ -111,18 +116,23 @@ def renumber(itemlist, item='', typography=''):
|
||||
for episodes in data['data']:
|
||||
if episodes['airedSeason'] >= S:
|
||||
if E == 0:
|
||||
epList.append(str(episodes['airedSeason']) + 'x0')
|
||||
epList.append([0, SP])
|
||||
E = 1
|
||||
if episodes['airedEpisodeNumber'] >= E:
|
||||
epList.append(str(episodes['airedSeason']) + 'x' + str(episodes['airedEpisodeNumber']))
|
||||
epList.append([episodes['airedSeason'], episodes['airedEpisodeNumber']])
|
||||
page = page + 1
|
||||
else:
|
||||
exist = False
|
||||
|
||||
|
||||
epList.sort()
|
||||
ep = 0
|
||||
|
||||
for item in itemlist:
|
||||
item.title = typo(epList[ep] + ' - ', typography) + item.title
|
||||
s = str(epList[ep][0])
|
||||
e = str(epList[ep][1])
|
||||
item.title = typo(s + 'x'+ e + ' - ', typography) + item.title
|
||||
ep = ep + 1
|
||||
|
||||
except:
|
||||
return itemlist
|
||||
else:
|
||||
|
||||
@@ -10020,7 +10020,7 @@ msgid "Do you want to update Quasar to avoid errors?"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70585"
|
||||
msgid "RENUMBERING"
|
||||
msgid "[B]Renumbering[/B] (beta)"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70586"
|
||||
@@ -10435,4 +10435,8 @@ msgstr ""
|
||||
|
||||
msgctxt "#70687"
|
||||
msgid "Enter the number of the starting episode"
|
||||
msgstr ""
|
||||
|
||||
msgctxt "#70688"
|
||||
msgid "Episode 0 is a special episode, enter the number of this episode"
|
||||
msgstr ""
|
||||
@@ -5004,8 +5004,8 @@ msgid "Do you want to update Quasar to avoid errors?"
|
||||
msgstr "Vuoi aggiornare Quasar per evitare errori?"
|
||||
|
||||
msgctxt "#70585"
|
||||
msgid "RENUMBERING"
|
||||
msgstr "RINUMERAZIONE"
|
||||
msgid "[B]Renumbering[/B] (beta)"
|
||||
msgstr "[B]Rinumerazione[/B] (beta)"
|
||||
|
||||
msgctxt "#70586"
|
||||
msgid "Set up series number..."
|
||||
@@ -5424,4 +5424,8 @@ msgstr "Inserisci il numero della stagione di partenza"
|
||||
|
||||
msgctxt "#70687"
|
||||
msgid "Enter the number of the starting episode"
|
||||
msgstr "Inserisci il numero dell'episodio di partenza"
|
||||
msgstr "Inserisci il numero dell'episodio di partenza"
|
||||
|
||||
msgctxt "#70688"
|
||||
msgid "Episode 0 is a special episode, enter the number of this episode"
|
||||
msgstr "L'episodio 0 è un episodio speciale, inserisci il numero di questo episodio"
|
||||
BIN
resources/media/channels/banner/animepertutti.png
Normal file
BIN
resources/media/channels/banner/animepertutti.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
resources/media/channels/thumb/animepertutti.png
Normal file
BIN
resources/media/channels/thumb/animepertutti.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user