animeshd: fix
This commit is contained in:
@@ -10,6 +10,8 @@ from channelselector import get_thumb
|
|||||||
from core import tmdb
|
from core import tmdb
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import logger, config
|
from platformcode import logger, config
|
||||||
|
from channels import autoplay
|
||||||
|
from channels import filtertools
|
||||||
|
|
||||||
tgenero = {"Comedia": "https://s7.postimg.cc/ne9g9zgwb/comedia.png",
|
tgenero = {"Comedia": "https://s7.postimg.cc/ne9g9zgwb/comedia.png",
|
||||||
"Drama": "https://s16.postimg.cc/94sia332d/drama.png",
|
"Drama": "https://s16.postimg.cc/94sia332d/drama.png",
|
||||||
@@ -31,42 +33,60 @@ tgenero = {"Comedia": "https://s7.postimg.cc/ne9g9zgwb/comedia.png",
|
|||||||
|
|
||||||
host = "http://www.animeshd.tv"
|
host = "http://www.animeshd.tv"
|
||||||
|
|
||||||
headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', 'poseidonhd')
|
||||||
['Referer', host]]
|
__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', 'poseidonhd')
|
||||||
|
|
||||||
|
|
||||||
|
IDIOMAS = {'Castellano':'CAST','Latino': 'LAT', 'Subtitulado': 'VOSE'}
|
||||||
|
list_language = IDIOMAS.values()
|
||||||
|
list_quality = []
|
||||||
|
list_servers = ['rapidvideo', 'openload', 'gvideo', 'streamango']
|
||||||
|
|
||||||
|
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
logger.info()
|
logger.info()
|
||||||
|
|
||||||
|
autoplay.init(item.channel, list_servers, list_quality)
|
||||||
|
|
||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Ultimas",
|
|
||||||
|
itemlist.append(item.clone(title="Castellano",
|
||||||
action="lista",
|
action="lista",
|
||||||
thumbnail=get_thumb('last', auto=True),
|
thumbnail=get_thumb('channels_spanish.png'),
|
||||||
fanart='https://s22.postimg.cc/cb7nmhwv5/ultimas.png',
|
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
||||||
url=host + '/ultimos'
|
url=host + '/castellano'))
|
||||||
))
|
|
||||||
|
itemlist.append(item.clone(title="Latino",
|
||||||
|
action="lista",
|
||||||
|
thumbnail=get_thumb('channels_latino.png'),
|
||||||
|
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
||||||
|
url=host + '/latino'))
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Todas",
|
itemlist.append(item.clone(title="Todas",
|
||||||
action="lista",
|
action="lista",
|
||||||
thumbnail=get_thumb('all', auto=True),
|
thumbnail=get_thumb('all', auto=True),
|
||||||
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
fanart='https://s18.postimg.cc/fwvaeo6qh/todas.png',
|
||||||
url=host + '/buscar?t=todos&q='
|
url=host + '/buscar?t=todo&q='))
|
||||||
))
|
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Generos",
|
itemlist.append(item.clone(title="Generos",
|
||||||
action="generos",
|
action="generos",
|
||||||
url=host,
|
url=host,
|
||||||
thumbnail=get_thumb('genres', auto=True),
|
thumbnail=get_thumb('genres', auto=True),
|
||||||
fanart='https://s3.postimg.cc/5s9jg2wtf/generos.png'
|
fanart='https://s3.postimg.cc/5s9jg2wtf/generos.png'))
|
||||||
))
|
|
||||||
|
|
||||||
itemlist.append(item.clone(title="Buscar",
|
itemlist.append(item.clone(title="Buscar",
|
||||||
action="search",
|
action="search",
|
||||||
url=host + '/buscar?t=todos&q=',
|
url=host + '/buscar?t=todo&q=',
|
||||||
thumbnail=get_thumb('search', auto=True),
|
thumbnail=get_thumb('search', auto=True),
|
||||||
fanart='https://s30.postimg.cc/pei7txpa9/buscar.png'
|
fanart='https://s30.postimg.cc/pei7txpa9/buscar.png'
|
||||||
))
|
))
|
||||||
|
|
||||||
|
itemlist = filtertools.show_option(itemlist, item.channel, list_language, list_quality)
|
||||||
|
|
||||||
|
autoplay.show_option(item.channel, itemlist)
|
||||||
|
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -98,21 +118,22 @@ def lista(item):
|
|||||||
title=title,
|
title=title,
|
||||||
url=url,
|
url=url,
|
||||||
thumbnail=thumbnail,
|
thumbnail=thumbnail,
|
||||||
contentSerieName=title
|
contentSerieName=title,
|
||||||
|
context=filtertools.context(item, list_language, list_quality)
|
||||||
))
|
))
|
||||||
|
|
||||||
# Paginacion
|
# Paginacion
|
||||||
next_page = scrapertools.find_single_match(data,
|
next_page = scrapertools.find_single_match(data,
|
||||||
'<li class=active><span>.*?<\/span><\/li><li><a href=(.*?)>.*?<\/a><\/li>')
|
'<a href=([^ ]+) rel=next>»</a>')
|
||||||
next_page_url = scrapertools.decodeHtmlentities(next_page)
|
next_page_url = scrapertools.decodeHtmlentities(next_page)
|
||||||
if next_page_url != "":
|
if next_page_url != "":
|
||||||
itemlist.append(Item(channel=item.channel,
|
itemlist.append(Item(channel=item.channel,
|
||||||
action="lista",
|
action="lista",
|
||||||
title=">> Página siguiente",
|
title=">> Página siguiente",
|
||||||
url=next_page_url,
|
url=host+next_page_url,
|
||||||
thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png'
|
thumbnail='https://s16.postimg.cc/9okdu7hhx/siguiente.png'
|
||||||
))
|
))
|
||||||
tmdb.set_infoLabels(itemlist)
|
tmdb.set_infoLabels(itemlist, seekTmdb=True)
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -137,7 +158,7 @@ def generos(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = get_source(item.url)
|
data = get_source(item.url)
|
||||||
patron = '<li class=><a href=http:\/\/www\.animeshd\.tv\/genero\/(.*?)>(.*?)<\/a><\/li>'
|
patron = '<li class=><a href=https:\/\/www\.animeshd\.tv\/genero\/(.*?)>(.*?)<\/a><\/li>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
for scrapedurl, scrapedtitle in matches:
|
for scrapedurl, scrapedtitle in matches:
|
||||||
@@ -159,16 +180,59 @@ def episodios(item):
|
|||||||
itemlist = []
|
itemlist = []
|
||||||
|
|
||||||
data = get_source(item.url)
|
data = get_source(item.url)
|
||||||
patron = '<li id=epi-.*? class=list-group-item ><a href=(.*?) class=badge.*?width=25 title=(.*?)> <\/span>(.*?) (\d+)<\/li>'
|
patron = '<li id=epi-.*? class=list-group-item.*?><a href=(.*?) class=badge.*?width=25 title=(.*?)>.*?<\/span>(' \
|
||||||
|
'.*?) (\d+)<\/li>'
|
||||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
infoLabels = item.infoLabels
|
||||||
for scrapedurl, scrapedlang, scrapedtitle, episode in matches:
|
for scrapedurl, scrapedlang, scrapedtitle, episode in matches:
|
||||||
language = scrapedlang
|
language = scrapedlang
|
||||||
title = scrapedtitle + " " + "1x" + episode
|
title = scrapedtitle + " " + "1x" + episode
|
||||||
url = scrapedurl
|
url = scrapedurl
|
||||||
itemlist.append(item.clone(title=title, url=url, action='findvideos', language=language))
|
infoLabels['season'] ='1'
|
||||||
|
infoLabels['episode'] = episode
|
||||||
|
|
||||||
|
itemlist.append(Item(channel=item.channel, title=title, contentSerieName=item.contentSerieName, url=url,
|
||||||
|
action='findvideos', language=IDIOMAS[language], infoLabels=infoLabels))
|
||||||
|
|
||||||
if config.get_videolibrary_support():
|
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||||
itemlist.append(Item(channel=item.channel, title="Añadir serie a la biblioteca", url=item.url, action="add_serie_to_library", extra="episodios", fanart=item.thumbnail, thumbnail=item.thumbnail, contentTitle=item.show, show=item.show))
|
|
||||||
|
if config.get_videolibrary_support() and len(itemlist) > 0:
|
||||||
|
itemlist.append(
|
||||||
|
Item(channel=item.channel, title='[COLOR yellow]Añadir esta serie a la videoteca[/COLOR]', url=item.url,
|
||||||
|
action="add_serie_to_library", extra="episodios", contentSerieName=item.contentSerieName,
|
||||||
|
extra1='library'))
|
||||||
|
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
def findvideos(item):
|
||||||
|
logger.info()
|
||||||
|
|
||||||
|
itemlist = []
|
||||||
|
|
||||||
|
data = get_source(item.url)
|
||||||
|
patron = "<option value=(.*?) data-content=.*?width='16'> (.*?) <span class='text-muted'>"
|
||||||
|
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||||
|
|
||||||
|
for scrapedurl, language in matches:
|
||||||
|
if 'jpg' in scrapedurl:
|
||||||
|
vip_data = httptools.downloadpage(scrapedurl, follow_redirects=False)
|
||||||
|
scrapedurl = vip_data.headers['location']
|
||||||
|
title = '%s [%s]'
|
||||||
|
itemlist.append(item.clone(title=title, url=scrapedurl.strip(), action='play',
|
||||||
|
language=IDIOMAS[language]))
|
||||||
|
|
||||||
|
itemlist = servertools.get_servers_itemlist(itemlist, lambda x: x.title % (x.server.capitalize(), x.language))
|
||||||
|
|
||||||
|
if __comprueba_enlaces__:
|
||||||
|
itemlist = servertools.check_list_links(itemlist, __comprueba_enlaces_num__)
|
||||||
|
|
||||||
|
# Requerido para FilterTools
|
||||||
|
|
||||||
|
itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||||
|
|
||||||
|
# Requerido para AutoPlay
|
||||||
|
|
||||||
|
autoplay.start(itemlist, item)
|
||||||
|
|
||||||
|
return itemlist
|
||||||
|
|||||||
Reference in New Issue
Block a user