Fix Altadefinizione Community
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per Altadefinizione Community
|
||||
|
||||
from core import support
|
||||
from lib.fakeMail import Gmailnator
|
||||
from platformcode import config, platformtools, logger
|
||||
@@ -18,22 +19,22 @@ headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'}
|
||||
|
||||
@support.menu
|
||||
def mainlist(item):
|
||||
support.info(item)
|
||||
logger.debug(item)
|
||||
|
||||
film = ['/load-more-film?anno=&order=&support_webp=1&type=movie&page=1',
|
||||
# Voce Menu,['url','action','args',contentType]
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Generi Film', ['', 'genres', 'genres']),
|
||||
]
|
||||
|
||||
tvshow = ['/load-more-film?type=tvshow&anno=&order=&support_webp=1&page=1',
|
||||
# Voce Menu,['url','action','args',contentType]
|
||||
('Generi', ['', 'genres', 'genres']),
|
||||
('Generi Serie TV', ['', 'genres', 'genres']),
|
||||
]
|
||||
|
||||
altri = [
|
||||
# ('Per Lettera', ['/lista-film', 'genres', 'letters']),
|
||||
# ('A-Z', ['/lista-film', 'genres', 'letters']),
|
||||
('Qualità', ['', 'genres', 'quality']),
|
||||
# ('Anni', ['/anno', 'genres', 'years'])
|
||||
('Anni', ['/anno', 'genres', 'years'])
|
||||
]
|
||||
search = ''
|
||||
|
||||
@@ -128,9 +129,8 @@ def registerOrLogin():
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
# debug = True
|
||||
json = {}
|
||||
support.info(item)
|
||||
action = 'check'
|
||||
if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto
|
||||
import ast
|
||||
ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match
|
||||
@@ -139,8 +139,8 @@ def peliculas(item):
|
||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
||||
data = "\n".join(json['data'])
|
||||
else:
|
||||
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
|
||||
data = "\n".join(json['data'])
|
||||
disabletmdb = True
|
||||
data = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).data
|
||||
patron = r'wrapFilm">\s*<a href="(?P<url>[^"]+)">\s*<span class="year">(?P<year>[0-9]{4})</span>\s*<span[^>]+>[^<]+</span>\s*<span class="qual">(?P<quality>[^<]+).*?<img src="(?P<thumbnail>[^"]+)[^>]+>\s*<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
|
||||
|
||||
# paginazione
|
||||
@@ -156,7 +156,7 @@ def peliculas(item):
|
||||
|
||||
|
||||
def search(item, texto):
|
||||
support.info("search ", texto)
|
||||
logger.debug("search ", texto)
|
||||
|
||||
item.args = 'search'
|
||||
item.url = host + "/search?s={}&page=1".format(texto)
|
||||
@@ -172,51 +172,55 @@ def search(item, texto):
|
||||
|
||||
@support.scrape
|
||||
def genres(item):
|
||||
support.info(item)
|
||||
logger.debug(item)
|
||||
data = support.httptools.downloadpage(item.url, cloudscraper=True).data
|
||||
|
||||
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)'
|
||||
if item.args == 'quality':
|
||||
patronBlock = 'Risoluzione(?P<block>.*?)</ul>'
|
||||
patronBlock = r'Risoluzione(?P<block>.*?)</ul>'
|
||||
elif item.args == 'years':
|
||||
patronBlock = r'ANNO(?P<block>.*?</section>)'
|
||||
else:
|
||||
patronBlock = ('Film' if item.contentType == 'movie' else 'Serie TV') + r'<span></span></a>\s+<ul class="dropdown-menu(?P<block>.*?)active-parent-menu'
|
||||
action = 'peliculas'
|
||||
|
||||
# debug = True
|
||||
return locals()
|
||||
|
||||
|
||||
@support.scrape
|
||||
def episodios(item):
|
||||
support.info(item)
|
||||
logger.debug(item)
|
||||
data = item.data
|
||||
patron = r'class="playtvshow " data-href="(?P<url>[^"]+)'
|
||||
|
||||
# debug = True
|
||||
def itemHook(it):
|
||||
spl = it.url.split('/')[-2:]
|
||||
it.contentSeason = int(spl[0])+1
|
||||
it.contentEpisodeNumber = int(spl[1])+1
|
||||
it.title = str(it.contentSeason) + 'x' + str(it.contentEpisodeNumber)
|
||||
it.infoLabels['season'] = int(spl[0])+1
|
||||
it.infoLabels['episode'] = int(spl[1])+1
|
||||
it.url = it.url.replace('/watch-unsubscribed', '/watch-external')
|
||||
it.title = '{}x{:02d} - {}'.format(it.contentSeason, it.contentEpisodeNumber, it.contentTitle)
|
||||
return it
|
||||
|
||||
return locals()
|
||||
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
video_url = item.url
|
||||
if '/watch-unsubscribed' not in video_url:
|
||||
def check(item):
|
||||
if '/watch-unsubscribed' not in item.url:
|
||||
playWindow = support.match(support.httptools.downloadpage(item.url, cloudscraper=True).data, patron='playWindow" href="([^"]+)')
|
||||
video_url = playWindow.match
|
||||
if '/tvshow' in video_url:
|
||||
item.data = playWindow.data
|
||||
item.contentType = 'tvshow'
|
||||
return episodios(item)
|
||||
else:
|
||||
item.url = video_url.replace('/watch-unsubscribed', '/watch-external')
|
||||
item.contentType = 'movie'
|
||||
itemlist.append(item.clone(action='play', url=support.match(video_url.replace('/watch-unsubscribed', '/watch-external'),
|
||||
patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality=''))
|
||||
# itemlist.append(item.clone(action='play', server='directo', title=support.config.get_localized_string(30137),
|
||||
# url=video_url.replace('/watch-unsubscribed', '/watch')))
|
||||
return findvideos(item)
|
||||
|
||||
def findvideos(item):
|
||||
itemlist = []
|
||||
|
||||
itemlist.append(item.clone(action='play', url=support.match(item.url, patron='allowfullscreen[^<]+src="([^"]+)"', cloudscraper=True).match, quality=''))
|
||||
|
||||
return support.server(item, itemlist=itemlist)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user