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