Files
addon/channels/eurostreaming.py
T
Alhaziel01 5348eebe19 - Riscritto News
- Finzioni peliculas -> movies, episodios -> episodes
 - Aggiornato sqlitedict
 - fix minori
2021-09-30 19:41:46 +02:00

102 lines
3.2 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
# ------------------------------------------------------------
# Canale per Eurostreaming
# by Greko
# ------------------------------------------------------------
from core import support
from core.item import Item
from platformcode import logger
# def findhost(url):
# permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
# host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
# return host
host = support.config.get_channel_url()
headers = [['Referer', host]]
@support.menu
def mainlist(item):
tvshow = []
anime = ['/category/anime-cartoni-animati/']
mix = [('Aggiornamenti {bullet bold} {TV}', ['/aggiornamento-episodi/', 'movies', 'newest']),
('Archivio {bullet bold} {TV}', ['/category/serie-tv-archive/', 'movies'])]
search = ''
return locals()
@support.scrape
def movies(item):
# debug = True
action = 'episodes'
if item.args == 'newest':
item.contentType = 'episode'
patron = r'<span class="serieTitle" style="font-size:20px">(?P<title>[^<]+) \s*<a href="(?P<url>[^"]+)"[^>]*>\s+?(?P<episode>\d+[×x]\d+-\d+|\d+[×x]\d+) (?P<title2>[^<\(]+)\s?\(?(?P<lang>SUB ITA)?\)?</a>'
pagination = True
else:
patron = r'<div class="post-thumb">.*?<img src="(?P<thumb>[^"]+)".*?><a href="(?P<url>[^"]+)"[^>]+>(?P<title>.+?)\s?(?: Serie Tv)?\s?\(?(?P<year>\d{4})?\)?<\/a><\/h2>'
patronNext=r'a class="next page-numbers" href="?([^>"]+)">Avanti &raquo;</a>'
return locals()
@support.scrape
def episodes(item):
# debug = True
data = support.match(item, headers=headers).data
if 'clicca qui per aprire' in data.lower(): data = support.match(support.match(data, patron=r'"go_to":"([^"]+)"').match.replace('\\',''), headers=headers).data
elif 'clicca qui</span>' in data.lower(): data = support.match(support.match(data, patron=r'<h2 style="text-align: center;"><a href="([^"]+)">').match, headers=headers).data
patronBlock = r'</span>(?P<block>[a-zA-Z\s]+\d+(.+?)?(?:\()?(?P<lang>ITA|SUB ITA)(?:\))?.*?)</div></div>'
patron = r'(?P<season>\d+)&#\d+;(?P<episode>\d+(?:-\d+)?)\s*(?:</strong>|<em>)?\s*(?P<title>.*?)(?:–|-.+?-|–.+?–|–|em|.)?(?:/em.*?)?(?:<a (?P<data>.*?))<br />'
def itemHook(i):
i.url = item.url
return i
return locals()
def search(item, text):
logger.debug(text)
item.url = "%s/?s=%s" % (host, text)
item.contentType = 'tvshow'
try:
return movies(item)
# Continua la ricerca in caso di errore
except:
import sys
for line in sys.exc_info():
logger.error(line)
return []
def newest(category):
logger.debug()
itemlist = []
item = Item()
item.contentType = 'tvshow'
item.args = 'newest'
try:
item.url = "%s/aggiornamento-episodi/" % host
item.action = "movies"
itemlist = movies(item)
# 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 findvideos(item):
logger.debug()
return support.server(item, item.data)