fix: serietvonline.py
canale finito, da testare.
This commit is contained in:
@@ -6,31 +6,7 @@
|
||||
"language": ["ita"],
|
||||
"thumbnail": "https:\/\/serietvonline.com\/wp-content\/uploads\/2016\/08\/logo2016-1.png",
|
||||
"bannermenu": "https:\/\/serietvonline.com\/wp-content\/uploads\/2016\/08\/logo2016-1.png",
|
||||
"categories": ["anime","tvshow","movie", "documentary"],
|
||||
"settings": [
|
||||
{
|
||||
"id": "include_in_newest_series",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Serie TV",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_anime",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Anime",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
},
|
||||
{
|
||||
"id": "include_in_newest_italiano",
|
||||
"type": "bool",
|
||||
"label": "Includi in Novità - Italiano",
|
||||
"default": false,
|
||||
"enabled": false,
|
||||
"visible": false
|
||||
}
|
||||
]
|
||||
"categories": ["anime","tvshow","movie","documentary"],
|
||||
"not_active": ["include_in_newest_anime"],
|
||||
"settings": []
|
||||
}
|
||||
|
||||
@@ -4,26 +4,31 @@
|
||||
# ----------------------------------------------------------
|
||||
"""
|
||||
|
||||
Problemi noti che non superano il test del canale:
|
||||
- il solo film .45, nella lista titoli, ha come titolo nel canale '.'
|
||||
- la ricerca dei titoli potrebbe non essere uguale ( da sistemare le regex )
|
||||
indicate i titoli, con cui avete avuto problemi, e se sono film o serie.
|
||||
Novità. Indicare in quale/i sezione/i è presente il canale:
|
||||
- film, serie
|
||||
|
||||
Avvisi:
|
||||
- Nelle pagine di liste avrete un elenco di 24 titoli per pagina,
|
||||
invece della singola del sito
|
||||
- Il Canale è incluso nella sola ricerca globale.
|
||||
- Al massimo 25 titoli per le sezioni: Film
|
||||
- Al massimo 35 titoli per le sezioni: Tutte le altre
|
||||
|
||||
Le pagine di liste sono lente a caricarsi in quanto scaricano anche le info...
|
||||
|
||||
"""
|
||||
|
||||
from core import support
|
||||
from platformcode import logger, config
|
||||
import re
|
||||
from core import support, httptools, scrapertoolsV2
|
||||
from platformcode import config
|
||||
from core.item import Item
|
||||
|
||||
__channel__ = "serietvonline"
|
||||
host = config.get_channel_url(__channel__)
|
||||
headers = [['Referer', host]]
|
||||
|
||||
host = ""
|
||||
headers = ""
|
||||
|
||||
def findhost():
|
||||
global host, headers
|
||||
data = httptools.downloadpage('https://serietvonline.me/').data
|
||||
host = scrapertoolsV2.find_single_match(data, r'<a class="pure-button pure-button-primary" title=\'serie tv online\' href="([^"]+)">')
|
||||
headers = [['Referer', host]]
|
||||
findhost()
|
||||
|
||||
list_servers = ['akvideo', 'wstream', 'backin', 'vidtome', 'nowvideo']
|
||||
list_quality = ['default']
|
||||
@@ -33,12 +38,16 @@ list_quality = ['default']
|
||||
def mainlist(item):
|
||||
support.log()
|
||||
|
||||
film = ['/lista-film/',
|
||||
('Ultimi Aggiunti', ['/ultimi-film-aggiunti/', 'peliculas', 'latest'])
|
||||
film = ['/ultimi-film-aggiunti/',
|
||||
('Lista', ['/lista-film/', 'peliculas', 'lista'])
|
||||
]
|
||||
|
||||
tvshow = ['',
|
||||
('HD', ['/lista-serie-tv-in-altadefinizione/', 'peliculas', 'hd'])
|
||||
('Aggiornamenti', ['/ultimi-episodi-aggiunti/', 'peliculas', 'update']),
|
||||
('Tutte', ['/lista-serie-tv/', 'peliculas', 'qualcosa']),
|
||||
('Italiane', ['/lista-serie-tv-italiane/', 'peliculas', 'qualcosa']),
|
||||
('Anni 50-60-70-80-90', ['/lista-serie-tv-anni-60-70-80/', 'peliculas', 'qualcosa']),
|
||||
('HD', ['/lista-serie-tv-in-altadefinizione/', 'peliculas', 'qualcosa'])
|
||||
]
|
||||
|
||||
anime = ['/lista-cartoni-animati-e-anime/']
|
||||
@@ -54,106 +63,152 @@ def peliculas(item):
|
||||
support.log()
|
||||
|
||||
blacklist = ['DMCA', 'Contatti', 'Attenzione NON FARTI OSCURARE', 'Lista Ccartoni Animati e Anime']
|
||||
|
||||
if item.action == 'search':
|
||||
|
||||
patronBlock = r'>Lista Serie Tv</a></li></ul></div><div id="box_movies">'\
|
||||
'(?P<block>.*?)<div id="paginador">'
|
||||
patron = r'<div class="movie"><div class="imagen"> <img src="(?P<thumb>[^"]+)" '\
|
||||
'alt="(?:(?P<title>.+?)[ ]?(?:\d+)?)?" /> <a href="(?P<url>[^"]+)">'\
|
||||
'.+?<h2>(?:.+?(?P<year>\d+)?)</h2>(?: <span class="year">'\
|
||||
'(\d+)(?:–|â|-\d+)?</span>)?</div>'
|
||||
|
||||
def itemHook(item):
|
||||
support.log("ITEMHOOK PRIMA: ", item)
|
||||
if 'film' in item.url:
|
||||
item.action = 'findvideos'
|
||||
item.contentType = 'movie'
|
||||
item.infoLabels['mediatype'] = 'movie'
|
||||
else:
|
||||
item.action = 'episodios'
|
||||
item.contentType = 'tvshow'
|
||||
item.infoLabels['mediatype'] = 'tvshow'
|
||||
support.log("ITEMHOOK DOPO: ", item)
|
||||
|
||||
return item
|
||||
|
||||
elif item.extra == 'tvshow' or item.contentType == 'tvshow':
|
||||
# SEZIONE Serie TV- Anime!
|
||||
action = 'episodios'
|
||||
|
||||
if 'anime' in item.url:
|
||||
patronBlock = r'<h1>Lista Cartoni Animati e Anime</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)">.+?</a>'
|
||||
|
||||
else:
|
||||
if item.args == 'hd':
|
||||
patronBlock = r'<h1>Lista Serie Tv in AltaDefinizione</h1>(?P<block>.*?)'\
|
||||
'<div class="footer_c">'
|
||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)">.+?</a>'
|
||||
|
||||
elif item.args == 'doc':
|
||||
patronBlock = r'<h1>Lista Documentari</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)">.+?</a>'
|
||||
|
||||
else:
|
||||
patronBlock = r'<div id="box_movies">(?P<block>.*?)<div id="paginador">'
|
||||
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+"'\
|
||||
'.+?href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[ ]'\
|
||||
'(?P<rating>\d+.\d+|\d+)<[^>]+>[^>]+><h2>(?P<title>[^"]+)</h2>[ ]?'\
|
||||
'(?:<span class="year">(?P<year>\d+|\-\d+))?<'
|
||||
else:
|
||||
# SEZIONE FILM
|
||||
action = 'findvideos'
|
||||
pagination = 24
|
||||
|
||||
if not item.args:
|
||||
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.*?)[ ]?(?P<year>\d+)?'\
|
||||
'(?: Streaming | MD iSTANCE )?<'
|
||||
patronBlock = r'Lista dei film disponibili in streaming e anche in download\.'\
|
||||
'</p>(?P<block>.*?)<div class="footer_c">'
|
||||
|
||||
elif item.args == 'latest':
|
||||
patronBlock = r'<h1>Ultimi film aggiunti</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
patron = r'<tr><td><a href="(?P<url>[^"]+)"(?:|.+?)?>(?: )?[ ]?'\
|
||||
'(?P<title>.*?)[ ]?(?:HD)?[ ]?(?P<year>\d+)?'\
|
||||
'(?: | HD | Streaming | MD(?: iSTANCE)? )?</a>'
|
||||
|
||||
patronBlock = r'<h1>.+?</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
patronNext = r'<div class="siguiente"><a href="([^"]+)" >'
|
||||
|
||||
## debug = True
|
||||
## if 'film' in item.url:
|
||||
## contentType = 'movie'
|
||||
## action = 'findvideos'
|
||||
## else:
|
||||
## contentType = 'tvshow'
|
||||
## action = 'episodios'
|
||||
|
||||
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>.+?)\s?(?P<year>[\d\-]+)?"[^>]+>\s?<a href="(?P<url>[^"]+)">'
|
||||
|
||||
## def itemHook(item):
|
||||
## if 'film' in item.url:
|
||||
## item.action = 'findvideos'
|
||||
## item.contentType = 'movie'
|
||||
## else:
|
||||
## item.contentType = 'tvshow'
|
||||
## item.action = 'episodios'
|
||||
## return item
|
||||
|
||||
elif item.contentType == 'tvshow':
|
||||
# SEZIONE Serie TV- Anime - Documentari
|
||||
pagination = 35
|
||||
|
||||
if not item.args and 'anime' not in item.url:
|
||||
patron = r'<div class="movie">[^>]+>.+?src="(?P<thumb>[^"]+)" alt="[^"]+".+?href="(?P<url>[^"]+)">[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[^>]+>[ ](?P<rating>\d+.\d+|\d+)<[^>]+>[^>]+><h2>(?P<title>[^"]+)</h2>[ ]?(?:<span class="year">(?P<year>\d+|\-\d+))?<'
|
||||
else:
|
||||
patron = r'(?:<td>)?<a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
|
||||
if item.args == 'update':
|
||||
action = 'findvideos'
|
||||
patron = r'<td><a href="(?P<url>[^"]+)"(?:[^>]+)?>\s?(?P<title>[^<]+)(?P<episode>[\d\-x]+)?(?P<title2>[^<]+)?<'
|
||||
|
||||
else:
|
||||
# SEZIONE FILM
|
||||
pagination = 25
|
||||
|
||||
if item.args == 'lista':
|
||||
patron = r'href="(?P<url>[^"]+)"[^>]+>(?P<title>.*?)[ ]?(?P<year>\d+)?(?: Streaming | MD iSTANCE )?<'
|
||||
patronBlock = r'Lista dei film disponibili in streaming e anche in download\.</p>(?P<block>.*?)<div class="footer_c">'
|
||||
|
||||
else:
|
||||
#patronBlock = r'<h1>Ultimi film aggiunti</h1>(?P<block>.*?)<div class="footer_c">'
|
||||
patron = r'<tr><td><a href="(?P<url>[^"]+)"(?:|.+?)?>(?: )?[ ]?(?P<title>.*?)[ ]?(?: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 = 'episodios'
|
||||
return item
|
||||
|
||||
#support.regexDbg(item, patronBlock, headers)
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.log()
|
||||
|
||||
action = 'findvideos'
|
||||
patronBlock = r'<table>(?P<block>.*?)<\/table>'
|
||||
patron = r'<tr><td>(?:[^<]+)[ ](?:Parte)?(?P<episode>\d+x\d+)(?:|[ ]?(?P<title2>.+?)?(?:avi)?)<(?P<url>.*?)</td><tr>'
|
||||
|
||||
patron = r'<tr><td>(?:[^<]+)[ ](?:Parte)?(?P<episode>\d+x\d+|\d+)(?:|[ ]?'\
|
||||
'(?P<title2>.+?)?)<(?P<url>.*?)</td><tr>'
|
||||
|
||||
## debug = True
|
||||
#debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.log("CERCA :" ,text, item)
|
||||
item.url = "%s/?s=%s" % (host, text)
|
||||
|
||||
try:
|
||||
item.args = 'search'
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("%s" % line)
|
||||
return []
|
||||
|
||||
def newest(categoria):
|
||||
support.log(categoria)
|
||||
itemlist = []
|
||||
item = Item()
|
||||
|
||||
if categoria == 'peliculas':
|
||||
item.contentType = 'movie'
|
||||
item.url = host + '/ultimi-film-aggiunti/'
|
||||
elif categoria == 'series':
|
||||
item.args = 'update'
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host +'/ultimi-episodi-aggiunti/'
|
||||
try:
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.log("{0}".format(line))
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.log()
|
||||
if item.contentType == 'movie':
|
||||
return support.server(item, headers=headers)
|
||||
else:
|
||||
return support.server(item, item.url)
|
||||
|
||||
if item.args != 'update':
|
||||
return support.server(item, item.url)
|
||||
else:
|
||||
itemlist = []
|
||||
item.infoLabels['mediatype'] = 'episode'
|
||||
|
||||
def search(item, texto):
|
||||
support.log("CERCA :" ,texto, item)
|
||||
item.url = "%s/?s=%s" % (host, texto)
|
||||
data = httptools.downloadpage(item.url, headers=headers).data
|
||||
data = re.sub('\n|\t', ' ', data)
|
||||
data = re.sub(r'>\s+<', '> <', data)
|
||||
support.log("DATA - HTML:\n", data)
|
||||
url_video = scrapertoolsV2.find_single_match(data, r'<tr><td>(.+?)</td><tr>', -1)
|
||||
url_serie = scrapertoolsV2.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)
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
itemlist.append(
|
||||
Item(channel=item.channel,
|
||||
title=goseries + series,
|
||||
fulltitle=item.fulltitle,
|
||||
show=item.show,
|
||||
contentType='tvshow',
|
||||
contentSerieName=item.contentSerieName,
|
||||
url=url_serie,
|
||||
action='episodios',
|
||||
contentTitle=item.contentSerieName,
|
||||
plot = goseries + series + "con tutte le puntate",
|
||||
))
|
||||
|
||||
return itemlist
|
||||
|
||||
Reference in New Issue
Block a user