Improvements channel Guardaserie.click, Fastsubita and support (#41)
This commit is contained in:
@@ -10,6 +10,7 @@ import channelselector
|
||||
from core import httptools, scrapertools, servertools, support
|
||||
from core import tmdb
|
||||
from core.item import Item
|
||||
from core.support import log
|
||||
from platformcode import logger, config
|
||||
from specials import autoplay
|
||||
|
||||
@@ -19,7 +20,7 @@ headers = [['Referer', host]]
|
||||
|
||||
IDIOMAS = {'Italiano': 'IT'}
|
||||
list_language = IDIOMAS.values()
|
||||
list_servers = ['speedvideo','openload']
|
||||
list_servers = ['speedvideo', 'openload']
|
||||
list_quality = ['default']
|
||||
|
||||
headers = [['Referer', host]]
|
||||
@@ -27,30 +28,20 @@ headers = [['Referer', host]]
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def mainlist(item):
|
||||
support.log(item.channel+" mainlist")
|
||||
log()
|
||||
|
||||
itemlist = []
|
||||
# support.menu(itemlist, 'Serie TV bold')
|
||||
support.menu(itemlist, 'Novità bold', 'serietvaggiornate', "%s/lista-serie-tv" % host,'tvshow')
|
||||
support.menu(itemlist, 'Nuove serie', 'nuoveserie', "%s/lista-serie-tv" % host,'tvshow')
|
||||
support.menu(itemlist, 'Serie inedite Sub-ITA', 'nuoveserie', "%s/lista-serie-tv" % host,'tvshow',args=['inedite'])
|
||||
support.menu(itemlist, 'Da non perdere bold', 'nuoveserie', "%s/lista-serie-tv" % host,'tvshow',args=['tv','da non perdere'])
|
||||
support.menu(itemlist, 'Classiche bold', 'nuoveserie', "%s/lista-serie-tv" % host,'tvshow',args=['tv','classiche'])
|
||||
support.menu(itemlist, 'Anime', 'lista_serie', "%s/category/animazione/" % host,'tvshow')
|
||||
support.menu(itemlist, 'Categorie', 'categorie', host,'tvshow',args=['serie'])
|
||||
support.menu(itemlist, 'Cerca', 'search', host,'tvshow',args=['serie'])
|
||||
|
||||
autoplay.init(item.channel, list_servers, list_quality)
|
||||
autoplay.show_option(item.channel, itemlist)
|
||||
|
||||
itemlist.append(
|
||||
Item(channel='setting',
|
||||
action="channel_config",
|
||||
title=support.typo("Configurazione Canale color lime"),
|
||||
config=item.channel,
|
||||
folder=False,
|
||||
thumbnail=channelselector.get_thumb('setting_0.png'))
|
||||
)
|
||||
support.menu(itemlist, 'Novità bold', 'serietvaggiornate', "%s/lista-serie-tv" % host, 'tvshow')
|
||||
support.menu(itemlist, 'Nuove serie', 'nuoveserie', "%s/lista-serie-tv" % host, 'tvshow')
|
||||
support.menu(itemlist, 'Serie inedite Sub-ITA', 'nuoveserie', "%s/lista-serie-tv" % host, 'tvshow', args=['inedite'])
|
||||
support.menu(itemlist, 'Da non perdere bold', 'nuoveserie', "%s/lista-serie-tv" % host, 'tvshow', args=['tv', 'da non perdere'])
|
||||
support.menu(itemlist, 'Classiche bold', 'nuoveserie', "%s/lista-serie-tv" % host, 'tvshow', args=['tv', 'classiche'])
|
||||
support.menu(itemlist, 'Anime', 'lista_serie', "%s/category/animazione/" % host, 'tvshow')
|
||||
support.menu(itemlist, 'Categorie', 'categorie', host, 'tvshow', args=['serie'])
|
||||
support.menu(itemlist, 'Cerca', 'search', host, 'tvshow', args=['serie'])
|
||||
support.aplay(item, itemlist, list_servers, list_quality)
|
||||
support.channel_config(item, itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -59,7 +50,7 @@ def mainlist(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def newest(categoria):
|
||||
support.log(__channel__+" newest" + categoria)
|
||||
log()
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -85,7 +76,7 @@ def newest(categoria):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def search(item, texto):
|
||||
support.log(item.channel+" search")
|
||||
log(texto)
|
||||
item.url = host + "/?s=" + texto
|
||||
try:
|
||||
return lista_serie(item)
|
||||
@@ -100,28 +91,27 @@ def search(item, texto):
|
||||
# ================================================================================================================
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def cleantitle(scrapedtitle):
|
||||
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.strip()).replace('"',"'")
|
||||
|
||||
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.strip()).replace('"', "'")
|
||||
return scrapedtitle.strip()
|
||||
|
||||
|
||||
# ================================================================================================================
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def nuoveserie(item):
|
||||
support.log(item.channel+" nuoveserie")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
patron_block = ''
|
||||
if 'inedite' in item.args:
|
||||
patron_block = r'<div\s*class="container container-title-serie-ined container-scheda" meta-slug="ined">(.*?)</div></div><div'
|
||||
elif 'da non perder' in item.args:
|
||||
patron_block = r'<div\s*class="container container-title-serie-danonperd container-scheda" meta-slug="danonperd">(.*?)</div></div><div'
|
||||
patron_block = r'<div\sclass="container container-title-serie-ined container-scheda" meta-slug="ined">(.*?)</div></div><div'
|
||||
elif 'da non perdere' in item.args:
|
||||
patron_block = r'<div\sclass="container container-title-serie-danonperd container-scheda" meta-slug="danonperd">(.*?)</div></div><div'
|
||||
elif 'classiche' in item.args:
|
||||
patron_block = r'<div\s*class="container container-title-serie-classiche container-scheda" meta-slug="classiche">(.*?)</div></div><div'
|
||||
patron_block = r'<div\sclass="container container-title-serie-classiche container-scheda" meta-slug="classiche">(.*?)</div></div><div'
|
||||
else:
|
||||
patron_block = r'<div\s*class="container container-title-serie-new container-scheda" meta-slug="new">(.*?)</div></div><div'
|
||||
patron_block = r'<div\sclass="container container-title-serie-new container-scheda" meta-slug="new">(.*?)</div></div><div'
|
||||
|
||||
patron = r'<a\s*href="([^"]+)".*?>\s*<img\s*.*?src="([^"]+)" />[^>]+>[^>]+>[^>]+>[^>]+>'
|
||||
patron = r'<a\shref="([^"]+)".*?>\s<img\s.*?src="([^"]+)" />[^>]+>[^>]+>[^>]+>[^>]+>'
|
||||
patron += r'[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)</p>'
|
||||
|
||||
matches = support.match(item, patron, patron_block, headers)[0]
|
||||
@@ -148,14 +138,14 @@ def nuoveserie(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def serietvaggiornate(item):
|
||||
support.log(item.channel+" serietvaggiornate")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
patron_block = r'<div\s*class="container container-title-serie-lastep container-scheda" meta-slug="lastep">(.*?)</div></div><div'
|
||||
patron = r'<a\s*rel="nofollow" href="([^"]+)"[^>]+> <img\s*.*?src="([^"]+)"[^>]+>[^>]+>'
|
||||
patron_block = r'<div\sclass="container container-title-serie-lastep container-scheda" meta-slug="lastep">(.*?)</div></div><div'
|
||||
patron = r'<a\srel="nofollow" href="([^"]+)"[^>]+> <img\s*.*?src="([^"]+)"[^>]+>[^>]+>'
|
||||
patron += r'[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)<[^>]+>'
|
||||
|
||||
matches = support.match(item,patron, patron_block, headers)[0]
|
||||
matches = support.match(item, patron, patron_block, headers)[0]
|
||||
|
||||
for scrapedurl, scrapedthumbnail, scrapedep, scrapedtitle in matches:
|
||||
episode = re.compile(r'^(\d+)x(\d+)', re.DOTALL).findall(scrapedep) # Prendo stagione ed episodioso
|
||||
@@ -165,14 +155,15 @@ def serietvaggiornate(item):
|
||||
if 'sub-ita' in scrapedep.strip().lower():
|
||||
contentlanguage = 'Sub-ITA'
|
||||
|
||||
extra = r'<span\s*.*?meta-stag="%s" meta-ep="%s" meta-embed="([^"]+)"\s*.*?embed2="([^"]+)?"\s*.*?embed3="([^"]+)?"[^>]*>' % (
|
||||
extra = r'<span\s.*?meta-stag="%s" meta-ep="%s" meta-embed="([^"]+)"\s.*?embed2="([^"]+)?"\s.*?embed3="([^"]+)?"[^>]*>' % (
|
||||
episode[0][0], episode[0][1].lstrip("0"))
|
||||
|
||||
infoLabels = {}
|
||||
infoLabels['episode'] = episode[0][1].lstrip("0")
|
||||
infoLabels['episode'] = episode[0][1].zfill(2)
|
||||
infoLabels['season'] = episode[0][0]
|
||||
|
||||
title = str("%s - %sx%s %s" % (scrapedtitle,infoLabels['season'],infoLabels['episode'],contentlanguage)).strip()
|
||||
title = str(
|
||||
"%s - %sx%s %s" % (scrapedtitle, infoLabels['season'], infoLabels['episode'], contentlanguage)).strip()
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
@@ -197,49 +188,26 @@ def serietvaggiornate(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def categorie(item):
|
||||
support.log(item.channel+" categorie")
|
||||
itemlist = []
|
||||
|
||||
matches = support.match(item, r'<li>\s*<a\s*href="([^"]+)"[^>]+>([^<]+)</a></li>', r'<ul\s*class="dropdown-menu category">(.*?)</ul>', headers)[0]
|
||||
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="lista_serie",
|
||||
title=scrapedtitle,
|
||||
contentType="tvshow",
|
||||
url="".join([host, scrapedurl]),
|
||||
thumbnail=item.thumbnail,
|
||||
extra="tv",
|
||||
folder=True))
|
||||
|
||||
return itemlist
|
||||
log()
|
||||
return support.scrape(item, r'<li>\s<a\shref="([^"]+)"[^>]+>([^<]+)</a></li>', ['url', 'title'], patron_block=r'<ul\sclass="dropdown-menu category">(.*?)</ul>', headers=headers, action="lista_serie")
|
||||
|
||||
|
||||
# ================================================================================================================
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def lista_serie(item):
|
||||
support.log(item.channel+" lista_serie")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
# data = httptools.downloadpage(item.url, headers=headers).data
|
||||
#
|
||||
# patron = r'<a\s*href="([^"]+)".*?>\s*<img\s*.*?src="([^"]+)" />[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)</p></div>'
|
||||
# blocco = scrapertools.find_single_match(data,
|
||||
# r'<div\s*class="col-xs-\d+ col-sm-\d+-\d+">(.*?)<div\s*class="container-fluid whitebg" style="">')
|
||||
# matches = re.compile(patron, re.DOTALL).findall(blocco)
|
||||
|
||||
patron_block = r'<div\s*class="col-xs-\d+ col-sm-\d+-\d+">(.*?)<div\s*class="container-fluid whitebg" style="">'
|
||||
patron = r'<a\s*href="([^"]+)".*?>\s*<img\s*.*?src="([^"]+)" />[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)</p></div>'
|
||||
patron_block = r'<div\sclass="col-xs-\d+ col-sm-\d+-\d+">(.*?)<div\sclass="container-fluid whitebg" style="">'
|
||||
patron = r'<a\shref="([^"]+)".*?>\s<img\s.*?src="([^"]+)" />[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)</p></div>'
|
||||
|
||||
matches, data = support.match(item, patron, patron_block, headers)
|
||||
|
||||
|
||||
for scrapedurl, scrapedimg, scrapedtitle in matches:
|
||||
scrapedtitle = cleantitle(scrapedtitle)
|
||||
|
||||
if scrapedtitle not in ['DMCA','Contatti','Lista di tutte le serie tv']:
|
||||
if scrapedtitle not in ['DMCA', 'Contatti', 'Lista di tutte le serie tv']:
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="episodios",
|
||||
@@ -254,7 +222,7 @@ def lista_serie(item):
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
support.nextPage(itemlist,item,data,r"<link\s.*?rel='next'\shref='([^']*)'")
|
||||
support.nextPage(itemlist, item, data, r"<link\s.*?rel='next'\shref='([^']*)'")
|
||||
|
||||
return itemlist
|
||||
|
||||
@@ -263,46 +231,40 @@ def lista_serie(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def episodios(item):
|
||||
support.log(item.channel+" episodios")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
# data = httptools.downloadpage(item.url, headers=headers).data
|
||||
|
||||
patron = r'<div\s*class="[^"]+">\s*([^<]+)<\/div>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><p[^>]+>([^<]+)<[^>]+>[^>]+>[^>]+>'
|
||||
patron += r'[^<]+[^"]+".*?serie="([^"]+)".*?stag="([0-9]*)".*?ep="([0-9]*)"\s*'
|
||||
patron += r'.*?embed="([^"]+)"\s*.*?embed2="([^"]+)?"\s*.*?embed3="([^"]+)?"?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s*'
|
||||
patron += r'(?:<img\s*class="[^"]+" meta-src="([^"]+)"[^>]+>|<img\s*class="[^"]+" src="" data-original="([^"]+)"[^>]+>)?'
|
||||
# matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
|
||||
# logger.debug(matches)
|
||||
patron = r'<div\sclass="[^"]+">\s([^<]+)<\/div>[^>]+>[^>]+>[^>]+>[^>]+>([^<]+)?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+><p[^>]+>([^<]+)<[^>]+>[^>]+>[^>]+>'
|
||||
patron += r'[^<]+[^"]+".*?serie="([^"]+)".*?stag="([0-9]*)".*?ep="([0-9]*)"\s'
|
||||
patron += r'.*?embed="([^"]+)"\s.*?embed2="([^"]+)?"\s.*?embed3="([^"]+)?"?[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>\s?'
|
||||
patron += r'(?:<img\sclass="[^"]+" meta-src="([^"]+)"[^>]+>|<img\sclass="[^"]+" src="" data-original="([^"]+)"[^>]+>)?'
|
||||
|
||||
matches = support.match(item, patron, headers=headers)[0]
|
||||
|
||||
|
||||
for scrapedtitle, scrapedepisodetitle, scrapedplot, scrapedserie, scrapedseason, scrapedepisode, scrapedurl, scrapedurl2,scrapedurl3,scrapedthumbnail,scrapedthumbnail2 in matches:
|
||||
for scrapedtitle, scrapedepisodetitle, scrapedplot, scrapedserie, scrapedseason, scrapedepisode, scrapedurl, scrapedurl2, scrapedurl3, scrapedthumbnail, scrapedthumbnail2 in matches:
|
||||
scrapedtitle = cleantitle(scrapedtitle)
|
||||
scrapedepisode = scrapedepisode.zfill(2)
|
||||
scrapedepisodetitle = cleantitle(scrapedepisodetitle)
|
||||
title = str("%sx%s %s" % (scrapedseason, scrapedepisode, scrapedepisodetitle)).strip()
|
||||
if 'SUB-ITA' in scrapedtitle:
|
||||
title +=" Sub-ITA"
|
||||
title += " Sub-ITA"
|
||||
|
||||
infoLabels = {}
|
||||
infoLabels['season'] = scrapedseason
|
||||
infoLabels['episode'] = scrapedepisode
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
title=title,
|
||||
fulltitle=scrapedtitle,
|
||||
url=scrapedurl+"\r\n"+scrapedurl2+"\r\n"+scrapedurl3,
|
||||
contentType="episode",
|
||||
plot=scrapedplot,
|
||||
contentSerieName=scrapedserie,
|
||||
contentLanguage='Sub-ITA' if 'Sub-ITA' in title else '',
|
||||
infoLabels=infoLabels,
|
||||
thumbnail=scrapedthumbnail2 if scrapedthumbnail2 != '' else scrapedthumbnail,
|
||||
folder=True))
|
||||
Item(channel=item.channel,
|
||||
action="findvideos",
|
||||
title=title,
|
||||
fulltitle=scrapedtitle,
|
||||
url=scrapedurl + "\r\n" + scrapedurl2 + "\r\n" + scrapedurl3,
|
||||
contentType="episode",
|
||||
plot=scrapedplot,
|
||||
contentSerieName=scrapedserie,
|
||||
contentLanguage='Sub-ITA' if 'Sub-ITA' in title else '',
|
||||
infoLabels=infoLabels,
|
||||
thumbnail=scrapedthumbnail2 if scrapedthumbnail2 != '' else scrapedthumbnail,
|
||||
folder=True))
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
@@ -315,22 +277,18 @@ def episodios(item):
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def findepvideos(item):
|
||||
support.log(item.channel+" findepvideos")
|
||||
log()
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
matches = scrapertools.find_multiple_matches(data, item.extra)
|
||||
data = "\r\n".join(matches[0])
|
||||
item.contentType = 'movie'
|
||||
itemlist = support.server(item, data=data)
|
||||
|
||||
return itemlist
|
||||
return support.server(item, data=data)
|
||||
|
||||
|
||||
# ================================================================================================================
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def findvideos(item):
|
||||
support.log(item.channel+" findvideos")
|
||||
log()
|
||||
logger.debug(item.url)
|
||||
itemlist = support.server(item, data=item.url)
|
||||
|
||||
return itemlist
|
||||
return support.server(item, data=item.url)
|
||||
|
||||
Reference in New Issue
Block a user