This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
# ----------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from platformcode import logger
|
||||
import pyaes
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
__channel__ = 'animesaturn'
|
||||
@@ -13,25 +15,30 @@ headers = {'X-Requested-With': 'XMLHttpRequest', 'Cookie': cookie}
|
||||
|
||||
def get_cookie(data):
|
||||
global cookie, headers
|
||||
cookie = support.match(data, patron=r'document.cookie="([^\s]+)').match
|
||||
a = support.match(data, patron=r'a=toNumbers\("([^"]+?)"\)').match
|
||||
b = support.match(data, patron=r'b=toNumbers\("([^"]+?)"\)').match
|
||||
c = support.match(data, patron=r'c=toNumbers\("([^"]+?)"\)').match
|
||||
|
||||
aes = pyaes.AESModeOfOperationCBC(bytes.fromhex(a), iv = bytes.fromhex(b))
|
||||
|
||||
cookie = "ASNew-9v=" + aes.decrypt(bytes.fromhex(c)).hex()
|
||||
logger.debug("cookie = " + cookie)
|
||||
support.config.set_setting('cookie', cookie, __channel__)
|
||||
headers = [['Cookie', cookie]]
|
||||
|
||||
|
||||
def get_data(item):
|
||||
# support.dbg()
|
||||
# url = support.match(item.url, headers=headers, follow_redirects=True, only_headers=True).url
|
||||
data = support.match(item.url, headers=headers, follow_redirects=True).data
|
||||
if 'ASCookie' in data:
|
||||
def get_data(url):
|
||||
data = support.match(url, headers=headers, follow_redirects=True).data
|
||||
if 'ASNew-9v' in data:
|
||||
get_cookie(data)
|
||||
data = get_data(item)
|
||||
data = get_data(url)
|
||||
return data
|
||||
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
anime = ['/animelist?load_all=1&d=1',
|
||||
anime = ['/animelist',
|
||||
('ITA',['', 'submenu', '/filter?language%5B0%5D=1']),
|
||||
('SUB-ITA',['', 'submenu', '/filter?language%5B0%5D=0']),
|
||||
('Più Votati',['/toplist','menu', 'top']),
|
||||
@@ -76,7 +83,7 @@ def newest(categoria):
|
||||
|
||||
@support.scrape
|
||||
def submenu(item):
|
||||
data = support.match(item.url + item.args).data
|
||||
data = get_data(item.url + item.args) #support.match(item.url + item.args).data
|
||||
action = 'filter'
|
||||
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<data>.*?)</select>'
|
||||
def itemlistHook(itemlist):
|
||||
@@ -87,7 +94,8 @@ def submenu(item):
|
||||
|
||||
def filter(item):
|
||||
itemlist = []
|
||||
matches = support.match(item.data if item.data else item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches
|
||||
data = item.data if item.data else get_data(item.url)
|
||||
matches = support.match(data, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)', headers=headers).matches
|
||||
for value, title in matches:
|
||||
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter'))
|
||||
support.thumb(itemlist, genre=True)
|
||||
@@ -96,12 +104,9 @@ def filter(item):
|
||||
|
||||
@support.scrape
|
||||
def menu(item):
|
||||
patronMenu = r'<div class="col-md-13 bg-dark-as-box-shadow p-2 text-white text-center">(?P<title>[^"<]+)<(?P<other>.*?)(?:"lista-top"|"clearfix")'
|
||||
action = 'peliculas'
|
||||
item.args = 'top'
|
||||
def itemHook(item2):
|
||||
item2.url = item.url
|
||||
return item2
|
||||
data = item.data if item.data else get_data(item.url)
|
||||
patronMenu = r'<div class="col-md-9 pl-0 mobile-padding margin-top-anime-page float-left pr-0">.*?href="(?P<url>[^"]+)".*?</div>(?P<title>.*?)<'
|
||||
action = 'check'
|
||||
|
||||
return locals()
|
||||
|
||||
@@ -114,9 +119,7 @@ def peliculas(item):
|
||||
action = 'check'
|
||||
page = None
|
||||
post = "page=" + str(item.page if item.page else 1) if item.page and int(item.page) > 1 else None
|
||||
data = get_data(item)
|
||||
|
||||
# debug = True
|
||||
data = get_data(item.url)
|
||||
|
||||
if item.args == 'top':
|
||||
data = item.other
|
||||
@@ -154,7 +157,7 @@ def peliculas(item):
|
||||
|
||||
|
||||
def check(item):
|
||||
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie')
|
||||
movie = support.match(item, patron=r'Episodi:</b> (\d*) Movie', headers=headers)
|
||||
if movie.match:
|
||||
episodes = episodios(item)
|
||||
if len(episodes) > 0:
|
||||
@@ -177,10 +180,10 @@ def findvideos(item):
|
||||
itemlist = []
|
||||
links = []
|
||||
|
||||
main_url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G').match
|
||||
main_url = support.match(item, patron=r'<a href="([^"]+)">[^>]+>[^>]+>G', headers=headers).match
|
||||
urls = support.match(support.match(main_url, headers=headers).data, patron=r'<a class="dropdown-item"\s*href="([^"]+)', headers=headers).matches
|
||||
itemlist.append(item.clone(action="play", title='Primario', url=main_url, server='directo'))
|
||||
itemlist.append(item.clone(action="play", title='Secondario', url=main_url + '&s=alt', server='directo'))
|
||||
#itemlist.append(item.clone(action="play", title='Secondario', url=main_url + '&s=alt', server='directo'))
|
||||
for url in urls:
|
||||
link = support.match(url, patron=r'<a href="([^"]+)"[^>]+><button', headers=headers).match
|
||||
if link:
|
||||
@@ -190,5 +193,5 @@ def findvideos(item):
|
||||
|
||||
def play(item):
|
||||
if item.server == 'directo':
|
||||
item.url = support.match(item.url, patron=r'(?:source type="[^"]+"\s*src=|file:[^"]+)"([^"]+)').match
|
||||
item.url = support.match(item.url, patron=r'(?:source type="[^"]+"\s*src=|file:[^"]+)"([^"]+)', headers=headers).match
|
||||
return[item]
|
||||
|
||||
@@ -265,4 +265,4 @@ def findvideos(item):
|
||||
# if info:
|
||||
# for url, res in info:
|
||||
# urls.append(['hls [{}]'.format(res), url])
|
||||
# return urls
|
||||
# return urls
|
||||
12
channels/bt4g.json
Executable file
12
channels/bt4g.json
Executable file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"id": "bt4g",
|
||||
"name": "BT4G",
|
||||
"active": false,
|
||||
"language": ["ita", "sub-ita", "eng"],
|
||||
"thumbnail": "bt4g.png",
|
||||
"banner": "bt4g.png",
|
||||
"categories": ["movie", "tvshow", "torrent"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"default_off": ["include_in_global_search"],
|
||||
"settings": []
|
||||
}
|
||||
59
channels/bt4g.py
Executable file
59
channels/bt4g.py
Executable file
@@ -0,0 +1,59 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per ilcorsaronero
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support, httptools
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
debug = False
|
||||
action = 'findvideos'
|
||||
sceneTitle = True
|
||||
|
||||
def itemHook(item):
|
||||
item.title = support.scrapertools.decodeHtmlentities(support.urlparse.unquote(item.title))
|
||||
|
||||
return item
|
||||
|
||||
if not item.nextpage:
|
||||
item.page = 1
|
||||
else:
|
||||
item.page = item.nextpage
|
||||
|
||||
if not item.parent_url:
|
||||
item.parent_url = item.url
|
||||
|
||||
item.nextpage = item.page + 1
|
||||
nextPageUrl = "{}/search?{}".format(host, support.urlencode({'q': item.args,'category': 'movie', 'page': 'rss', 'orderby' : 'seeders', 'p' : item.nextpage}))
|
||||
resp = httptools.downloadpage(nextPageUrl)
|
||||
if ('item' not in resp.data.lower()): # no more elements
|
||||
nextPageUrl = ''
|
||||
|
||||
patron = r'<item>.*?<title>(?P<title>.*?)</title><link>(?P<url>.*?)</link>'
|
||||
return locals()
|
||||
|
||||
def search(item, text):
|
||||
item.url = "{}/search?{}".format(host, support.urlencode({'q': text,'category': 'movie', 'page': 'rss', 'orderby' : 'seeders'}))
|
||||
item.args = text
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
def findvideos(item):
|
||||
return support.server(item, item.url)
|
||||
@@ -2,10 +2,11 @@
|
||||
"id": "casacinema",
|
||||
"name": "Casacinema",
|
||||
"language": ["ita", "sub-ita"],
|
||||
"active": false,
|
||||
"active": true,
|
||||
"thumbnail": "casacinema.png",
|
||||
"banner": "casacinema.png",
|
||||
"categories": ["tvshow", "movie","vos"],
|
||||
"categories": ["tvshow", "movie"],
|
||||
"not_active": ["include_in_newest"],
|
||||
"settings": [
|
||||
]
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
|
||||
from core import support
|
||||
from core import support,httptools
|
||||
from platformcode import logger
|
||||
|
||||
host = support.config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
@@ -12,13 +13,12 @@ headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
film = ['/category/film',
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
]
|
||||
|
||||
tvshow = ['/category/serie-tv',
|
||||
('Novità', ['/aggiornamenti-serie-tv', 'peliculas', '']),
|
||||
]
|
||||
top = [('Generi', ['', 'genres'])]
|
||||
film = ['/film']
|
||||
|
||||
tvshow = ['/serie-tv',
|
||||
('Miniserie ', ['/miniserie-tv', 'peliculas', ''])]
|
||||
|
||||
search = ''
|
||||
|
||||
@@ -28,87 +28,40 @@ def mainlist(item):
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
action = 'peliculas'
|
||||
blacklist = ['PRIME VISIONI', 'ULTIME SERIE TV', 'ULTIMI FILM']
|
||||
blacklist = ['Serie TV', 'Miniserie TV']
|
||||
patronMenu = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<>]+)</a></li>'
|
||||
patronBlock = r'<div class="container home-cats">(?P<block>.*?)<div class="clear">'
|
||||
patronBlock = r'<a href="#">Categorie</a>(?P<block>.*?)<a href="#"'
|
||||
return locals()
|
||||
|
||||
|
||||
def check(item):
|
||||
item.data = support.match(item).data
|
||||
if 'episodi e stagioni' in item.data.lower():
|
||||
support.info('select = ### è una serie ###')
|
||||
item.data = httptools.downloadpage(item.url).data
|
||||
if 'stagione' in item.data.lower():
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
else:
|
||||
support.info('select = ### è un film ###')
|
||||
item.contentType = 'movie'
|
||||
return findvideos(item)
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
text = text.replace(' ', '+')
|
||||
item.url = host + '/?a=b&s=' + text
|
||||
item.args = 'search'
|
||||
def search(item, text):
|
||||
item.url = "{}/?{}".format(host, support.urlencode({'story': text,'do':'search', 'subaction':'search'}))
|
||||
try:
|
||||
item.args = 'search'
|
||||
return peliculas(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info('search log:', line)
|
||||
return []
|
||||
|
||||
|
||||
def newest(categoria):
|
||||
itemlist = []
|
||||
item = support.Item()
|
||||
item.args = 'newest'
|
||||
|
||||
try:
|
||||
if categoria == 'series':
|
||||
item.contentType = 'tvshow'
|
||||
item.url = host+'/aggiornamenti-serie-tv'
|
||||
|
||||
else:
|
||||
item.contentType = 'movie'
|
||||
item.url = host+'/category/film'
|
||||
|
||||
item.action = 'peliculas'
|
||||
itemlist = peliculas(item)
|
||||
|
||||
if itemlist[-1].action == 'peliculas':
|
||||
itemlist.pop()
|
||||
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.info("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
if item.contentType == 'movie':
|
||||
action = 'findvideos'
|
||||
elif item.contentType == 'tvshow':
|
||||
action = 'episodios'
|
||||
pagination = ''
|
||||
else:
|
||||
action = 'check'
|
||||
|
||||
if item.args == 'newest':
|
||||
patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?[ ]?(?:\(|\[)?(?P<lang>[sS]ub-[iI][tT][aA])?(?:\)|\])?[ ]?(?:\[(?P<quality>.+?)\])?[ ]?(?:\((?P<year>\d+)\))?<(?:[^>]+>.+?(?:title="Nuovi episodi">(?P<episode>\d+x\d+)[ ]?(?P<lang2>Sub-Ita)?|title="IMDb">(?P<rating>[^<]+)))?'
|
||||
else:
|
||||
patron = r'<li><a href="(?P<url>[^"]+)"[^=]+="(?P<thumb>[^"]+)"><div>\s*?<div[^>]+>(?P<title>[^\(\[<]+)(?P<title2>\([\D*]+\))?(?:\[(?P<quality1>HD)\])?\s?(?:[\(\[])?(?P<lang>[sS]ub-[iI][tT][aA])?(?:[\)\]])?\s?(?:\[(?P<quality>.+?)\])?\s?(?:\((?P<year>\d+)\))?(?:\(\D{2}\s\d{4}\))?<'
|
||||
|
||||
action = 'check'
|
||||
patron = r'<div class="posts".*?<a href="(?P<url>[^"]+)[^>]+>[^>]+>[^>]+>(?P<title>[^\(\[<]+)(?:\[(?P<quality1>HD)\])?'
|
||||
patronNext = r'<a href="([^"]+)"\s*>Pagina'
|
||||
|
||||
|
||||
def itemHook(item):
|
||||
if item.quality1:
|
||||
item.quality = item.quality1
|
||||
@@ -125,21 +78,20 @@ def peliculas(item):
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
if item.data:
|
||||
data = item.data
|
||||
patron = r'data-num="(?P<season>.*?)x(?P<episode>.*?)"\s*data-title="(?P<title>[^"]+)(?P<lang>[sS][uU][bB]\-[iI][tT][aA]+)?".*?<div class="mirrors"(?P<server_links>.*?)<!---'
|
||||
action = 'findvideos'
|
||||
item.contentType = 'tvshow'
|
||||
blacklist = ['']
|
||||
patron = r'"season-no">(?P<season>\d+)x(?P<episode>\d+)(?:[^>]+>){5}\s*(?P<title>[^<]+)(?P<data>.*?)</table>'
|
||||
patronBlock = r'<span>(?:.+?Stagione*.+?(?P<lang>[Ii][Tt][Aa]|[Ss][Uu][Bb][\-]?[iI][tT][aA]))?.*?</span>.*?class="content(?P<block>.*?)(?:"accordion-item|<script>)'
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
if item.contentType != 'movie':
|
||||
links = support.match(item.data, patron=r'href="([^"]+)"').matches
|
||||
else:
|
||||
matchData = item.data if item.data else support.match(item.url, headers=headers).data
|
||||
links = support.match(matchData, patron=r'data-id="([^"]+)"').matches
|
||||
if item.server_links:
|
||||
return support.server(item, data = item.server_links)
|
||||
|
||||
return support.server(item, links)
|
||||
video_url = support.match(item.url, patron=r'player[^>]+>[^>]+>.*?src="([^"]+)"').match
|
||||
|
||||
if (video_url == ''):
|
||||
return []
|
||||
|
||||
itemlist = [item.clone(action="play", url=srv) for srv in support.match(video_url, patron='<li class="(?:active)?" data-link=\"([^"]+)').matches]
|
||||
itemlist = support.server(item,itemlist=itemlist)
|
||||
return itemlist
|
||||
|
||||
@@ -109,7 +109,7 @@ def peliculas(item):
|
||||
patron = r'src="?(?P<thumb>[^ "]+)"? alt="?(?P<title>.*?)(?:\[(?P<quality>[a-zA-Z]+(?:[/]?3D)?)\]\s*)?(?:\[(?P<lang>Sub-ITA|ITA)\]\s*)?(?:\[(?P<quality2>[a-zA-Z]+(?:[/]?3D)?)\]\s*)?\((?P<year>\d{4})[^\)]*\)[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>\w+) [^ ]+ DURATA (?P<duration>[0-9]+)[^ ]+ [^ ]+ [A-Z ]+ (?P<plot>[^<]+)<'
|
||||
action = 'findvideos'
|
||||
else:
|
||||
patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")? alt=(?:")?(?P<title>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
||||
patron = r'src=(?:")?(?P<thumb>[^ "]+)(?:")?.*?alt=(?:")?(?P<title>.*?)(?: – \d+×\d+)?(?:>|"| – )(?:(?P<lang>Sub-ITA|ITA))?[^>]*>.*?<a href=(?:")?(?P<url>[^" ]+)(?:")?.*?rpwe-summary[^>]*>(?P<genre>[^\(]*)\((?P<year>\d{4})[^\)]*\) (?P<plot>[^<]+)<'
|
||||
action = 'episodios'
|
||||
|
||||
elif '/serietv/' not in item.url:
|
||||
|
||||
219
channels/la7.py
219
channels/la7.py
@@ -3,9 +3,20 @@
|
||||
# Canale per La7
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import sys
|
||||
import requests
|
||||
from core import support, httptools
|
||||
from platformcode import logger
|
||||
from datetime import datetime, timezone, timedelta
|
||||
import html
|
||||
import re
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
from concurrent import futures
|
||||
from urllib.parse import urlencode
|
||||
else:
|
||||
from concurrent_py2 import futures
|
||||
from urllib import urlencode
|
||||
|
||||
DRM = 'com.widevine.alpha'
|
||||
key_widevine = "https://la7.prod.conax.cloud/widevine/license"
|
||||
@@ -33,10 +44,38 @@ def mainlist(item):
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
|
||||
def live(item):
|
||||
itemlist = [item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='findvideos', forcethumb = True, no_return=True),
|
||||
item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='findvideos', forcethumb = True, no_return=True)]
|
||||
la7live_item = item.clone(title=support.typo('La7', 'bold'), fulltitle='La7', url= host + '/dirette-tv', action='findvideos', forcethumb = True, no_return=True)
|
||||
html_content = requests.get(la7live_item.url).text
|
||||
|
||||
patron = r'"name":\s*"([^"]+)",\s*"description":\s*"([^"]+)",.*?"url":\s*"([^"]+)"'
|
||||
titolo, plot, image_url = re.findall(patron, html_content, re.DOTALL)[0]
|
||||
la7live_item.plot = support.typo(titolo, 'bold') + " - " + plot
|
||||
la7live_item.fanart = image_url
|
||||
|
||||
la7dlive_item = item.clone(title=support.typo('La7d', 'bold'), fulltitle='La7d', url= host + '/live-la7d', action='findvideos', forcethumb = True, no_return=True)
|
||||
html_content = requests.get(la7dlive_item.url).text
|
||||
|
||||
patron = r'<div class="orario">\s*(.*?)\s*</div>.*?<span class="dsk">\s*(.*?)\s*</span>'
|
||||
schedule = {k:v for k,v in re.findall(patron, html_content)}
|
||||
italy_tz = timezone(timedelta(hours=1)) # CET (Central European Time, UTC+1)
|
||||
|
||||
current_time_utc = datetime.now(timezone.utc) # Get current time in UTC
|
||||
italian_time = current_time_utc.astimezone(italy_tz).time() # Convert to Italy time zone
|
||||
|
||||
current_show = next((show for (t1, show), (t2, _) in zip(
|
||||
sorted((datetime.strptime(t, "%H:%M").time(), show) for t, show in schedule.items()),
|
||||
sorted((datetime.strptime(t, "%H:%M").time(), show) for t, show in schedule.items())[1:] +
|
||||
sorted((datetime.strptime(t, "%H:%M").time(), show) for t, show in schedule.items())[:1]
|
||||
) if t1 <= italian_time < t2), "No show currently playing.")
|
||||
|
||||
la7dlive_item.plot = support.typo(current_show, 'bold')
|
||||
patron = r"(?<!//)\bposter:\s*['\"](.*?)['\"]"
|
||||
la7dlive_item.fanart = f'{host}{re.findall(patron, html_content)[0]}'
|
||||
|
||||
|
||||
itemlist = [la7live_item,
|
||||
la7dlive_item]
|
||||
return support.thumb(itemlist, live=True)
|
||||
|
||||
|
||||
@@ -81,42 +120,164 @@ def search(item, text):
|
||||
return []
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
search = item.search
|
||||
action = 'episodios'
|
||||
pagination = 20
|
||||
disabletmdb = True
|
||||
addVideolibrary = False
|
||||
downloadEnabled = False
|
||||
page_size = 20
|
||||
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<t>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
|
||||
"""Split a list into chunks of size page_size."""
|
||||
def chunk_list(lst):
|
||||
return [lst[i:i + page_size] for i in range(0, len(lst), page_size)]
|
||||
|
||||
html_content = requests.get(item.url).text
|
||||
|
||||
if 'la7teche' in item.url:
|
||||
patron = r'<a href="(?P<url>[^"]+)" title="(?P<title>[^"]+)" class="teche-i-img".*?url\(\'(?P<thumb>[^\']+)'
|
||||
else:
|
||||
patron = r'<a href="(?P<url>[^"]+)"[^>]+><div class="[^"]+" data-background-image="(?P<thumb>[^"]+)"></div><div class="titolo">\s*(?P<title>[^<]+)<'
|
||||
|
||||
matches = chunk_list(re.findall(patron, html_content))
|
||||
url_splits = item.url.split('?')
|
||||
page = 0 if len(url_splits)==1 else int(url_splits[1])
|
||||
|
||||
def itemHook(item):
|
||||
item.fanart = item.thumb
|
||||
return item
|
||||
return locals()
|
||||
def itInfo(n, key, item):
|
||||
if 'la7teche' in item.url:
|
||||
programma_url, titolo, thumb = key
|
||||
else:
|
||||
programma_url, thumb, titolo = key
|
||||
programma_url = f'{host}{programma_url}'
|
||||
titolo = html.unescape(titolo)
|
||||
|
||||
html_content = requests.get(programma_url).text
|
||||
plot = re.search(r'<div class="testo">.*?</div>', html_content, re.DOTALL)[0]
|
||||
if plot:
|
||||
text = re.sub(r'<[^>]+>', '\n', plot) # Replace tags with newline
|
||||
plot = re.sub(r'\n+', '\n', text).strip('\n') # Collapse multiple newlines and remove leading/trailing ones
|
||||
else:
|
||||
plot = ""
|
||||
|
||||
regex = r'background-image:url\((\'|")([^\'"]+)(\'|")\);'
|
||||
match = re.findall(regex, html_content)
|
||||
if match:
|
||||
fanart = match[0][1]
|
||||
else:
|
||||
fanart = ""
|
||||
|
||||
it = item.clone(title=support.typo(titolo, 'bold'),
|
||||
data='',
|
||||
fulltitle=titolo,
|
||||
show=titolo,
|
||||
thumbnail= thumb,
|
||||
fanart=fanart,
|
||||
url=programma_url,
|
||||
video_url=programma_url,
|
||||
plot=plot,
|
||||
order=n)
|
||||
it.action = 'episodios'
|
||||
it.contentSerieName = it.fulltitle
|
||||
|
||||
return it
|
||||
|
||||
itemlist = []
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
itlist = [executor.submit(itInfo, n, it, item) for n, it in enumerate(matches[page])]
|
||||
for res in futures.as_completed(itlist):
|
||||
if res.result():
|
||||
itemlist.append(res.result())
|
||||
itemlist.sort(key=lambda it: it.order)
|
||||
|
||||
if page < len(matches)-1:
|
||||
itemlist.append(
|
||||
item.clone(title=support.typo('Next', 'bold'),
|
||||
url=f'{url_splits[0]}?{page+1}',
|
||||
order=len(itemlist)
|
||||
)
|
||||
)
|
||||
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
action = 'findvideos'
|
||||
addVideolibrary = False
|
||||
downloadEnabled = False
|
||||
html_content = requests.get(item.url).text
|
||||
|
||||
url_splits = item.url.split("=")
|
||||
page = -1 if len(url_splits) == 1 else int(url_splits[-1])
|
||||
|
||||
if 'la7teche' in item.url:
|
||||
patron = r'<a href="(?P<url>[^"]+)">\s*<div class="holder-bg">.*?data-background-image="(?P<thumb>[^"]+)(?:[^>]+>){4}\s*(?P<title>[^<]+)(?:(?:[^>]+>){2}\s*(?P<plot>[^<]+))?'
|
||||
# patron = r'<a href="(?P<url>[^"]+)">\s*<div class="holder-bg">.*?data-background-image="(?P<thumb>[^"]+)(?:[^>]+>){4}\s*(?P<title>[^<]+)(?:(?:[^>]+>){2}\s*(?P<plot>[^<]+))?'
|
||||
patron = r'[^>]+>\s*<a href="(?P<url>[^"]+)">.*?image="(?P<thumb>[^"]+)(?:[^>]+>){4,5}\s*(?P<title>[\d\w][^<]+)(?:(?:[^>]+>){7}\s*(?P<title2>[\d\w][^<]+))?'
|
||||
else:
|
||||
data = str(support.match(item.url, patron=r'"home-block home-block--oggi(.*?)</section>').matches)
|
||||
data += httptools.downloadpage(item.url + '/video').data
|
||||
if page == -1:
|
||||
patron = r'<li class="voce_menu">\s*<a href="([^"]+)"[^>]*>\s*([^<]+)\s*</a>\s*</li>'
|
||||
matches = re.findall(patron, html_content)
|
||||
result_dict = {text.strip().lower(): href for href, text in matches}
|
||||
if 'puntate' in result_dict:
|
||||
html_content = requests.get(f'{host}{result_dict["puntate"]}').text
|
||||
elif 'rivedila7' in result_dict:
|
||||
html_content = requests.get(f'{host}{result_dict["rivedila7"]}').text
|
||||
else:
|
||||
html_content = requests.get(f'{host}{[*result_dict.values()][0]}').text
|
||||
page = 0
|
||||
# patron = r'item[^>]+>\s*<a href="(?P<url>[^"]+)">.*?image="(?P<thumb>[^"]+)(?:[^>]+>){4,5}\s*(?P<title>[\d\w][^<]+)(?:(?:[^>]+>){7}\s*(?P<title2>[\d\w][^<]+))?'
|
||||
patron = r'<div class="[^"]*">.*?<a href="(?P<url>[^"]+)">.*?data-background-image="(?P<image>//[^"]+)"[^>]*>.*?<div class="title[^"]*">\s*(?P<title>[^<]+)\s*</div>'
|
||||
|
||||
patron = r'item[^>]+>\s*<a href="(?P<url>[^"]+)">.*?image="(?P<thumb>[^"]+)(?:[^>]+>){4,5}\s*(?P<title>[\d\w][^<]+)(?:(?:[^>]+>){7}\s*(?P<title2>[\d\w][^<]+))?'
|
||||
patronNext = r'<a href="([^"]+)">›'
|
||||
return locals()
|
||||
matches = re.findall(patron, html_content)
|
||||
|
||||
visited = set()
|
||||
def itInfo(n, key, item):
|
||||
if 'la7teche' in item.url:
|
||||
programma_url, thumb, titolo, plot = key
|
||||
|
||||
else:
|
||||
programma_url, thumb, titolo = key
|
||||
|
||||
if programma_url in visited: return None
|
||||
|
||||
visited.add(programma_url)
|
||||
programma_url = f'{host}{programma_url}'
|
||||
thumb = 'https://'+thumb[2:] if thumb.startswith("//") else thumb
|
||||
|
||||
plot_page = requests.get(programma_url).text
|
||||
match = re.search(r'<div[^>]*class="[^"]*occhiello[^"]*"[^>]*>(.*?)</div>', plot_page)
|
||||
if match:
|
||||
plot = match.group(1)
|
||||
else:
|
||||
plot = ""
|
||||
|
||||
it = item.clone(title=support.typo(titolo, 'bold'),
|
||||
data='',
|
||||
fulltitle=titolo,
|
||||
show=titolo,
|
||||
thumbnail= thumb,
|
||||
url=programma_url,
|
||||
video_url=programma_url,
|
||||
plot=plot,
|
||||
order=n)
|
||||
it.action = 'findvideos'
|
||||
|
||||
return it
|
||||
|
||||
itemlist = []
|
||||
with futures.ThreadPoolExecutor() as executor:
|
||||
itlist = [executor.submit(itInfo, n, it, item) for n, it in enumerate(matches)]
|
||||
for res in futures.as_completed(itlist):
|
||||
if res.result():
|
||||
itemlist.append(res.result())
|
||||
itemlist.sort(key=lambda it: it.order)
|
||||
|
||||
|
||||
pattern = r'<li class="pager-next"><a href="(.*?)">›</a></li>'
|
||||
match = re.search(pattern, html_content)
|
||||
if match:
|
||||
next_page_link = match.group(1)
|
||||
itemlist.append(
|
||||
item.clone(title=support.typo('Next', 'bold'),
|
||||
url= f'{host}{match.group(1)}',
|
||||
order=len(itemlist),
|
||||
video_url='',
|
||||
thumbnail=''
|
||||
)
|
||||
)
|
||||
|
||||
return itemlist
|
||||
|
||||
def findvideos(item):
|
||||
support.info()
|
||||
@@ -128,6 +289,7 @@ def findvideos(item):
|
||||
data = support.match(item).data
|
||||
|
||||
url = support.match(data, patron=r'''["]?dash["]?\s*:\s*["']([^"']+)["']''').match
|
||||
|
||||
if url:
|
||||
preurl = support.match(data, patron=r'preTokenUrl = "(.+?)"').match
|
||||
tokenHeader = {
|
||||
@@ -157,9 +319,12 @@ def findvideos(item):
|
||||
item.drm = DRM
|
||||
item.license = lic_url
|
||||
else:
|
||||
match = support.match(data, patron='/content/entry/data/(.*?).mp4').match
|
||||
match = support.match(data, patron=r'''["]?m3u8["]?\s*:\s*["']([^"']+)["']''').match
|
||||
if match:
|
||||
url = 'https://awsvodpkg.iltrovatore.it/local/hls/,/content/entry/data/' + support.match(item, patron='/content/entry/data/(.*?).mp4').match + '.mp4.urlset/master.m3u8'
|
||||
url = match.replace("http://la7-vh.akamaihd.net/i/", "https://awsvodpkg.iltrovatore.it/local/hls/").replace("csmil/master.m3u8", "urlset/master.m3u8");
|
||||
|
||||
if url=="":
|
||||
url = support.match(data, patron=r'''["]?mp4["]?\s*:\s*["']([^"']+)["']''').match
|
||||
|
||||
item = item.clone(title='Direct', server='directo', url=url, action='play')
|
||||
return support.server(item, itemlist=[item], Download=False, Videolibrary=False)
|
||||
|
||||
10
channels/lordchannel.json
Executable file
10
channels/lordchannel.json
Executable file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "lordchannel",
|
||||
"name": "LordChannel",
|
||||
"active": false,
|
||||
"language": ["ita", "sub-ita"],
|
||||
"thumbnail": "lordchannel.png",
|
||||
"banner": "lordchannel.png",
|
||||
"categories": ["anime", "tvshow", "movie"],
|
||||
"settings": []
|
||||
}
|
||||
95
channels/lordchannel.py
Executable file
95
channels/lordchannel.py
Executable file
@@ -0,0 +1,95 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per lordchannel.py
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import httptools, support, scrapertools
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
|
||||
film = ['/film/',
|
||||
('Generi', ['/film/', 'genres', 'film']),
|
||||
]
|
||||
tvshow = ['/serietv/',
|
||||
('Generi', ['/serietv/', 'genres', 'serietv']),
|
||||
]
|
||||
|
||||
anime = ['/anime/anime-ita/',
|
||||
('Generi', ['/anime/anime-ita/', 'genres', 'anime']),
|
||||
('Anime SUB-Ita', ['/anime/anime-sub-ita/','peliculas']),
|
||||
]
|
||||
search = ''
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
patronBlock = r'<ul class=\"filter(?P<block>.*?)</ul>'
|
||||
patronMenu = r'<li>(?P<url>.*?)</li>'
|
||||
action = 'peliculas'
|
||||
|
||||
def itemHook(item):
|
||||
item.title = support.typo(item.url, 'bold')
|
||||
item.url = host + '/'+ item.args + '/genere/' + item.url
|
||||
return item
|
||||
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
#if item.args == 'search':
|
||||
action = 'check'
|
||||
pagination = 100 #come il portale
|
||||
patron= r'<div class="col-6.*?<img\s.*?src="(?P<thumb>[^"]+).*?<h3.*?<a\shref="(?P<url>[^"]+).*?>(?P<title>.*?)</a'
|
||||
patronNext = r'<li class="paginator__item paginator__item--next">.*?href="(?P<url>[^"]+)'
|
||||
return locals()
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
patronBlock=r'<div class="accordion__card.*?<span>.*?:\s*(?P<season>\d*?)\s*</span>(?P<block>.*?)</table>'
|
||||
patron=r'<tr>\s<th class="episode-link".*?href="(?P<url>[^"]+).*?>(?P<episode>\d+).*?_blank">(?P<title>.*?)</a>'
|
||||
downloadEnabled = False
|
||||
return locals()
|
||||
|
||||
def check(item):
|
||||
item.data = httptools.downloadpage(item.url).data
|
||||
if 'episode-link' in item.data.lower():
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
else:
|
||||
item.contentType = 'movie'
|
||||
return findvideos(item)
|
||||
|
||||
|
||||
def search(item, text):
|
||||
item.url = "{}/cerca/?{}".format(host, support.urlencode({'q': text}))
|
||||
item.args = 'search'
|
||||
|
||||
try:
|
||||
return peliculas(item)
|
||||
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("search except: %s" % line)
|
||||
return []
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
video_url = item.url
|
||||
|
||||
if item.contentType == 'movie':
|
||||
video_url = support.match(video_url, patron=r'<a\shref="(?P<url>[^"]+)"\sclass="btn-streaming streaming_btn">').match
|
||||
|
||||
video_url = support.match(video_url, patron=r'<video-js.*?src="?(?P<url>.*?)"?\s.*?</video-js>').match
|
||||
|
||||
if (video_url == ''):
|
||||
return []
|
||||
|
||||
item = item.clone(server='directo', url=video_url, no_return=True) # , manifest='hls')
|
||||
return support.server(item,itemlist=[item], Download=False, Videolibrary=False)
|
||||
@@ -54,6 +54,16 @@ def mainlist(item):
|
||||
('Aggiunti di recente', ['/serie-tv', 'peliculas', 1]),
|
||||
('Top 10 serie TV di oggi', ['/serie-tv', 'peliculas', 2])]
|
||||
generi = [('Generi', ['','genres'])]
|
||||
menu = [
|
||||
('Archivio', ['/archivio', 'peliculas', -1]),
|
||||
('Archivio Film {submenu}', ['/archivio?type=movie', 'peliculas', -1]),
|
||||
('Archivio Serie TV {submenu}', ['/archivio?type=tv', 'peliculas', -1]),
|
||||
('Archivio per data aggiornamento {submenu}', ['/archivio?sort=last_air_date', 'peliculas', -1]),
|
||||
('Archivio per data aggiunta {submenu}', ['/archivio?sort=created_at', 'peliculas', -1]),
|
||||
('Archivio per valutazione {submenu}', ['/archivio?sort=score', 'peliculas', -1]),
|
||||
('Archivio per numero visioni {submenu}', ['/archivio?sort=views', 'peliculas', -1]),
|
||||
('Archivio per nome {submenu}', ['/archivio?sort=name', 'peliculas', -1])
|
||||
]
|
||||
search=''
|
||||
return locals()
|
||||
|
||||
@@ -130,7 +140,7 @@ def peliculas(item):
|
||||
|
||||
if item.records:
|
||||
records = item.records
|
||||
elif item.genre or item.search:
|
||||
elif item.genre or item.search or (item.args and item.args == -1):
|
||||
records = data_page['props']['titles']
|
||||
else:
|
||||
if not item.args:
|
||||
@@ -162,9 +172,9 @@ def peliculas(item):
|
||||
if not item.newest:
|
||||
item.mainThumb = item.thumbnail
|
||||
if recordlist:
|
||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page, records=recordlist))
|
||||
itemlist.append(item.clone(action='peliculas',title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), page=page, records=recordlist))
|
||||
elif len(itemlist) >= 20:
|
||||
itemlist.append(item.clone(title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), records=[], page=page + 1))
|
||||
itemlist.append(item.clone(action='peliculas',title=support.typo(support.config.get_localized_string(30992), 'color kod bold'), thumbnail=support.thumb(), records=[], page=page + 1))
|
||||
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
support.check_trakt(itemlist)
|
||||
@@ -233,7 +243,7 @@ def episodios(item):
|
||||
support.tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
|
||||
support.check_trakt(itemlist)
|
||||
support.videolibrary(itemlist, item)
|
||||
support.download(itemlist, item)
|
||||
#support.download(itemlist, item)
|
||||
return itemlist
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user