Improvements channel Guardaserie.click, Fastsubita and support (#41)
This commit is contained in:
@@ -4,13 +4,10 @@
|
||||
# Canale per fastsubita
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import re
|
||||
|
||||
import channelselector
|
||||
from core import scrapertools, httptools, tmdb, support
|
||||
from core.item import Item
|
||||
from core.support import log
|
||||
from platformcode import config, logger
|
||||
from specials import autoplay
|
||||
|
||||
__channel__ = 'fastsubita'
|
||||
host = config.get_setting("channel_host", __channel__)
|
||||
@@ -19,9 +16,6 @@ list_language = IDIOMAS.values()
|
||||
list_servers = ['verystream', 'openload', 'speedvideo', 'wstream', 'flashx', 'vidoza', 'vidtome']
|
||||
list_quality = ['default']
|
||||
|
||||
# checklinks = config.get_setting('checklinks', 'fastsubita')
|
||||
# checklinks_number = config.get_setting('checklinks_number', 'fastsubita')
|
||||
|
||||
headers = [
|
||||
['Host', 'fastsubita.com'],
|
||||
['User-Agent', 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0'],
|
||||
@@ -39,32 +33,23 @@ PERPAGE = 15
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
logger.info(item.channel+" mainlist")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
support.menu(itemlist, 'Serie TV bold', 'lista_serie', host,'tvshow')
|
||||
support.menu(itemlist, 'Novità submenu', 'pelicuals_tv', host,'tvshow')
|
||||
support.menu(itemlist, 'Archivio A-Z submenu', 'list_az', host,'tvshow',args=['serie'])
|
||||
support.menu(itemlist, 'Cerca', 'search', host,'tvshow')
|
||||
|
||||
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', 'pelicuals_tv', host, 'tvshow')
|
||||
support.menu(itemlist, 'Serie TV bold', 'lista_serie', host, 'tvshow')
|
||||
support.menu(itemlist, 'Archivio A-Z submenu', 'list_az', host, 'tvshow', args=['serie'])
|
||||
support.menu(itemlist, 'Cerca', 'search', host, 'tvshow')
|
||||
support.aplay(item, itemlist, list_servers, list_quality)
|
||||
support.channel_config(item, itemlist)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def cleantitle(scrapedtitle):
|
||||
scrapedtitle = scrapertools.decodeHtmlentities(scrapedtitle.strip())
|
||||
scrapedtitle = scrapedtitle.replace('’', '\'').replace('×','x').replace('×','x')
|
||||
scrapedtitle = scrapedtitle.replace('’', '\'').replace('×', 'x').replace('×', 'x').replace('"', "'")
|
||||
|
||||
return scrapedtitle.strip()
|
||||
|
||||
@@ -73,7 +58,7 @@ def cleantitle(scrapedtitle):
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
logger.info(__channel__+" newest" + categoria)
|
||||
log()
|
||||
itemlist = []
|
||||
item = Item()
|
||||
try:
|
||||
@@ -96,15 +81,11 @@ def newest(categoria):
|
||||
|
||||
|
||||
def pelicuals_tv(item):
|
||||
logger.info(item.channel+" pelicuals_tv")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
# Carica la pagina
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
|
||||
# Estrae i contenuti
|
||||
patron = r'<h3 class="entry-title title-font"><a href="([^"]+)" rel="bookmark">(.*?)<'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
matches, data = support.match(item, r'<h3 class="entry-title title-font"><a href="([^"]+)" rel="bookmark">(.*?)<',
|
||||
headers=headers)
|
||||
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
scrapedplot = ""
|
||||
@@ -123,7 +104,7 @@ def pelicuals_tv(item):
|
||||
else:
|
||||
scrapedurl = "http:" + scrapedurl
|
||||
|
||||
title = scraped_1+" - "+infoLabels['season']+"x"+infoLabels['episode']+" Sub-ITA"
|
||||
title = scraped_1 + " - " + infoLabels['season'] + "x" + infoLabels['episode'] + " Sub-ITA"
|
||||
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
@@ -144,35 +125,20 @@ def pelicuals_tv(item):
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
# Paginazione
|
||||
support.nextPage(itemlist,item,data,'<a class="next page-numbers" href="(.*?)">Successivi')
|
||||
support.nextPage(itemlist, item, data, '<a class="next page-numbers" href="(.*?)">Successivi')
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def serietv():
|
||||
logger.info(__channel__+" serietv")
|
||||
log()
|
||||
|
||||
itemlist = []
|
||||
data = httptools.downloadpage("%s/" % host, headers=headers).data
|
||||
# block = scrapertools.find_single_match(data, r'<div class="entry-content">(.*?)</div>')
|
||||
block = scrapertools.find_single_match(data, r"<select\s*?name='cat'\s*?id='cat'\s*?class='postform'\s*?>(.*?)</select>")
|
||||
# block = data
|
||||
# Estrae i contenuti
|
||||
# patron = r'<a style.*?href="([^"]+)">([^<]+)<\/a>'
|
||||
# patron = r'<a.*?href="([^"]+)">([^<]+)<\/a>'
|
||||
# matches = re.compile(patron, re.DOTALL).findall(block)
|
||||
matches = re.compile(r'<option class="level-([0-9]?)" value="([^"]+)">([^<]+)</option>', re.DOTALL).findall(block)
|
||||
matches = support.match(Item(), r'<option class="level-([0-9]?)" value="([^"]+)">([^<]+)</option>',
|
||||
r'<select\s*?name="cat"\s*?id="cat"\s*?class="postform"\s*?>(.*?)</select>', headers,
|
||||
url="%s/" % host)[0]
|
||||
index = 0
|
||||
# for scrapedurl, scrapedtitle in matches:
|
||||
# scrapedtitle = cleantitle(scrapedtitle)
|
||||
# if "http:" not in scrapedurl:
|
||||
# scrapedurl = "http:" + scrapedurl
|
||||
#
|
||||
# if ('S' in scrapedtitle.strip().upper()[0] and len(scrapedtitle.strip()) == 3) or '02' == scrapedtitle:
|
||||
# # itemlist[index -1][0]+='{|}'+scrapedurl
|
||||
# continue
|
||||
#
|
||||
# itemlist.append([scrapedurl,scrapedtitle])
|
||||
# index += 1
|
||||
|
||||
for level, cat, title in matches:
|
||||
title = cleantitle(title)
|
||||
url = '%s?cat=%s' % (host, cat)
|
||||
@@ -183,12 +149,11 @@ def serietv():
|
||||
itemlist.append([url, title])
|
||||
|
||||
index += 1
|
||||
|
||||
logger.debug(itemlist)
|
||||
return itemlist
|
||||
|
||||
|
||||
def lista_serie(item):
|
||||
logger.info(item.channel+" lista_serie")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
p = 1
|
||||
@@ -196,16 +161,6 @@ def lista_serie(item):
|
||||
item.url, p = item.url.split('{}')
|
||||
p = int(p)
|
||||
|
||||
# logger.debug(p)
|
||||
# Carica la pagina
|
||||
# data = httptools.downloadpage(item.url, headers=headers).data
|
||||
#
|
||||
# block = scrapertools.find_single_match(data,r'<div class="entry-content">(.*?)</div>')
|
||||
#
|
||||
# # Estrae i contenuti
|
||||
# # patron = r'<a style.*?href="([^"]+)">([^<]+)<\/a>'
|
||||
# patron = r'<a.*?href="([^"]+)">([^<]+)<\/a>'
|
||||
# matches = re.compile(patron, re.DOTALL).findall(block)
|
||||
if '||' in item.url:
|
||||
series = item.url.split('\n\n')
|
||||
matches = []
|
||||
@@ -235,76 +190,41 @@ def lista_serie(item):
|
||||
contentType='episode',
|
||||
originalUrl=scrapedurl,
|
||||
folder=True))
|
||||
# ii += 1
|
||||
|
||||
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
|
||||
if len(series) >= p * PERPAGE:
|
||||
scrapedurl = item.url + '{}' + str(p + 1)
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
action='lista_serie',
|
||||
contentType=item.contentType,
|
||||
title=support.typo(config.get_localized_string(30992), 'color kod bold'),
|
||||
url=scrapedurl,
|
||||
args=item.args,
|
||||
extra=item.extra,
|
||||
thumbnail=support.thumb()))
|
||||
next_page = item.url + '{}' + str(p + 1)
|
||||
support.nextPage(itemlist, item, next_page=next_page)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
logger.info(item.channel+" findvideos")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
bloque = scrapertools.find_single_match(data, '<div class="entry-content">(.*?)<footer class="entry-footer">')
|
||||
# data = httptools.downloadpage(item.url, headers=headers).data
|
||||
patron_block = '<div class="entry-content">(.*?)<footer class="entry-footer">'
|
||||
# bloque = scrapertools.find_single_match(data, patron_block)
|
||||
|
||||
patron = r'<a href="([^"]+)">'
|
||||
matches = re.compile(patron, re.DOTALL).findall(bloque)
|
||||
# matches = re.compile(patron, re.DOTALL).findall(bloque)
|
||||
|
||||
matches, data = support.match(item, patron, patron_block, headers)
|
||||
|
||||
for scrapedurl in matches:
|
||||
if 'is.gd' in scrapedurl:
|
||||
resp = httptools.downloadpage(
|
||||
scrapedurl, follow_redirects=False)
|
||||
scrapedurl, follow_redirects=False)
|
||||
data += resp.headers.get("location", "") + '\n'
|
||||
|
||||
|
||||
itemlist = support.server(item,data)
|
||||
|
||||
# itemlist = servertools.find_video_items(data=data)
|
||||
#
|
||||
# for videoitem in itemlist:
|
||||
# videoitem.title = item.title + videoitem.title
|
||||
# videoitem.fulltitle = item.fulltitle
|
||||
# videoitem.thumbnail = item.thumbnail
|
||||
# videoitem.show = item.show
|
||||
# videoitem.plot = item.plot
|
||||
# videoitem.channel = item.channel
|
||||
# videoitem.contentType = item.contentType
|
||||
# videoitem.language = IDIOMAS['Italiano']
|
||||
#
|
||||
# # Requerido para Filtrar enlaces
|
||||
#
|
||||
# if checklinks:
|
||||
# itemlist = servertools.check_list_links(itemlist, checklinks_number)
|
||||
#
|
||||
# # Requerido para FilterTools
|
||||
#
|
||||
# # itemlist = filtertools.get_links(itemlist, item, list_language)
|
||||
#
|
||||
# # Requerido para AutoPlay
|
||||
#
|
||||
# autoplay.start(itemlist, item)
|
||||
|
||||
|
||||
|
||||
return itemlist
|
||||
return support.server(item, data)
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
logger.info(item.channel + " " + item.url + " search " + texto)
|
||||
# item.url = "%s/?s=%s" % (host, texto)
|
||||
# item.url = "%s/elenco-serie-tv/" % host
|
||||
log(texto)
|
||||
|
||||
itemlist = []
|
||||
try:
|
||||
series = serietv()
|
||||
@@ -333,15 +253,15 @@ def search(item, texto):
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
def list_az(item):
|
||||
support.log(item.channel + " list_az")
|
||||
log()
|
||||
itemlist = []
|
||||
|
||||
alphabet = dict()
|
||||
|
||||
|
||||
for i, (scrapedurl, scrapedtitle) in enumerate(serietv()):
|
||||
letter = scrapedtitle[0].upper()
|
||||
if letter not in alphabet:
|
||||
@@ -358,37 +278,29 @@ def list_az(item):
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
# ================================================================================================================
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------
|
||||
def episodios(item,itemlist = []):
|
||||
support.log(item.channel + " episodios")
|
||||
def episodios(item, itemlist=[]):
|
||||
log()
|
||||
urls = item.url.split('{|}')
|
||||
# logger.debug(urls)
|
||||
# Carica la pagina
|
||||
data = httptools.downloadpage(urls[0], headers=headers).data
|
||||
urls.pop(0)
|
||||
# Estrae i contenuti
|
||||
patron = r'<h3 class="entry-title title-font"><a href="([^"]+)" rel="bookmark">(.*?)<'
|
||||
matches = re.compile(patron, re.DOTALL).findall(data)
|
||||
matches, data = support.match(item, patron, headers=headers, url=urls[0])
|
||||
urls.pop(0)
|
||||
|
||||
# logger.debug(matches)
|
||||
for scrapedurl, scrapedtitle in matches:
|
||||
scrapedplot = ""
|
||||
scrapedthumbnail = ""
|
||||
scrapedtitle = cleantitle(scrapedtitle)
|
||||
episode = scrapertools.find_multiple_matches(scrapedtitle,r'((\d*)x(\d*))')[0]
|
||||
episode = scrapertools.find_multiple_matches(scrapedtitle, r'((\d*)x(\d*))')[0]
|
||||
|
||||
season = episode[1].lstrip('0')
|
||||
# if season in seasons and '/page/' not in item.url: break
|
||||
# logger.debug(scrapedtitle)
|
||||
# logger.debug(episode)
|
||||
# return False
|
||||
season = episode[1].lstrip('0').zfill(2)
|
||||
|
||||
infoLabels = {}
|
||||
infoLabels['season'] = season
|
||||
infoLabels['episode'] = episode[2]
|
||||
title = infoLabels['season']+'x'+infoLabels['episode']+" Sub-ITA"
|
||||
title = infoLabels['season'] + 'x' + infoLabels['episode'] + " Sub-ITA"
|
||||
|
||||
if "http:" not in scrapedurl:
|
||||
scrapedurl = "http:" + scrapedurl
|
||||
@@ -407,14 +319,11 @@ def episodios(item,itemlist = []):
|
||||
infoLabels=infoLabels,
|
||||
folder=True))
|
||||
|
||||
|
||||
next_page = scrapertools.find_single_match(data,r'<a class="next page-numbers" href="(.*?)">Successivi')
|
||||
next_page = scrapertools.find_single_match(data, r'<a class="next page-numbers" href="(.*?)">Successivi')
|
||||
if next_page != "":
|
||||
urls.insert(0,next_page)
|
||||
urls.insert(0, next_page)
|
||||
|
||||
# logger.debug(urls)
|
||||
|
||||
if(len(urls) > 0):
|
||||
if len(urls) > 0:
|
||||
item.url = '{|}'.join(urls)
|
||||
itemlist = episodios(item, itemlist)
|
||||
else:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -452,7 +452,7 @@ def match(item, patron='', patron_block='', headers='', url=''):
|
||||
matches = []
|
||||
url = url if url else item.url
|
||||
data = httptools.downloadpage(url, headers=headers, ignore_response_code=True).data.replace("'", '"')
|
||||
data = re.sub(r'\n|\t|\s\s', '', data)
|
||||
data = re.sub(r'\n|\t|\s\s', ' ', data)
|
||||
log('DATA= ', data)
|
||||
|
||||
if patron_block:
|
||||
@@ -500,11 +500,11 @@ def videolibrary(itemlist, item, typography='', function_level=1):
|
||||
|
||||
return itemlist
|
||||
|
||||
def nextPage(itemlist, item, data, patron, function_level=1):
|
||||
def nextPage(itemlist, item, data='', patron='', function_level=1, next_page=''):
|
||||
# Function_level is useful if the function is called by another function.
|
||||
# If the call is direct, leave it blank
|
||||
|
||||
next_page = scrapertoolsV2.find_single_match(data, patron)
|
||||
if next_page == '':
|
||||
next_page = scrapertoolsV2.find_single_match(data, patron)
|
||||
|
||||
if next_page != "":
|
||||
if 'http' not in next_page:
|
||||
|
||||
Reference in New Issue
Block a user