altadefinizione community:

- divisione per anno (per Film e Serie TV)
 - disabilitata divisione per qualità (inutile)
 - preferenze di ordinamento (da configurazione canale)
This commit is contained in:
Alhaziel01
2021-09-23 10:49:31 +02:00
parent 40841e6435
commit e5d6d71017
3 changed files with 62 additions and 46 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
"direct": { "direct": {
"altadefinizione01": "https://www.altadefinizione01.plus", "altadefinizione01": "https://www.altadefinizione01.plus",
"altadefinizione01_link": "https://altadefinizione01.travel", "altadefinizione01_link": "https://altadefinizione01.travel",
"altadefinizionecommunity": "https://altaregistrazione.net", "altadefinizionecommunity": "https://altadefinizionecommunity.me",
"animealtadefinizione": "https://www.animealtadefinizione.it", "animealtadefinizione": "https://www.animealtadefinizione.it",
"animeforce": "https://www.animeforce.it", "animeforce": "https://www.animeforce.it",
"animeleggendari": "https://animezeus.com", "animeleggendari": "https://animezeus.com",
+11 -1
View File
@@ -23,5 +23,15 @@
"label": "password", "label": "password",
"type": "text", "type": "text",
"visible": true "visible": true
}] },
{
"id": "order",
"type": "list",
"label": "Ordine di Visualizzazione",
"default": 0,
"enabled": true,
"visible": true,
"lvalues": [ "Nessuno", "I più visti", "I più votati", "I più votati dell'ultimo mese", "Titolo A-Z", "Voto IMDB più alto"]
}
]
} }
+50 -44
View File
@@ -13,29 +13,34 @@ from core import scrapertools, httptools
host = config.get_channel_url() host = config.get_channel_url()
register_url = 'https://altaregistrazione.com' register_url = 'https://altaregistrazione.net'
headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'} headers = {'Referer': host, 'x-requested-with': 'XMLHttpRequest'}
order = ['', 'i_piu_visti', 'i_piu_votati', 'i_piu_votati_dellultimo_mese', 'titolo_az', 'voto_imdb_piu_alto'][config.get_setting('order', 'altadefinizionecommunity')]
@support.menu @support.menu
def mainlist(item): def mainlist(item):
logger.debug(item) logger.debug(item)
film = ['/load-more-film?anno=&order=&support_webp=1&type=movie&page=1', film = ['/type/movie',
# Voce Menu,['url','action','args',contentType] # Voce Menu,['url','action','args',contentType]
('Generi', ['/film/movie', 'genres', 'genres']), ('Generi', ['/type/movie', 'genres', 'genres']),
('Anni', ['/type/movie', 'genres', 'year']),
# ('Qualità', ['', 'genres', 'quality']),
] ]
tvshow = ['/load-more-film?type=tvshow&anno=&order=&support_webp=1&page=1', tvshow = ['/serie-tv/tvshow',
# Voce Menu,['url','action','args',contentType] # Voce Menu,['url','action','args',contentType]
('Generi', ['/film/movie', 'genres', 'genres']), ('Generi', ['/serie-tv/tvshow', 'genres', 'genres']),
('Anni', ['/serie-tv/tvshow', 'genres', 'year']),
# ('Qualità', ['', 'genres', 'quality']),
] ]
altri = [ # altri = [
# ('A-Z', ['/lista-film', 'genres', 'letters']), # # ('A-Z', ['/lista-film', 'genres', 'letters']),
('Qualità', ['/film/movie', 'genres', 'quality']), # ('Qualità', ['', 'genres', 'quality']),
('Anni', ['/anno', 'genres', 'years']) # ('Anni', ['/anno', 'genres', 'years'])
] # ]
return locals() return locals()
@@ -128,38 +133,35 @@ def registerOrLogin():
@support.scrape @support.scrape
def peliculas(item): def peliculas(item):
import ast
json = {} json = {}
# debug = True params ={'type':item.contentType, 'anno':item.year_id, 'quality':item.quality_id, 'order':order}
if item.contentType == 'undefined': # if item.contentType == 'undefined':
disabletmdb = True # action = 'check'
action = 'check' if item.contentType == 'movie':
elif item.contentType == 'movie':
action = 'findvideos' action = 'findvideos'
else: else:
action = 'episodios' action = 'episodios'
if not item.page: item.page = 1
if '/load-more-film' not in item.url and '/search' not in item.url: # generi o altri menu, converto if item.args == 'search':
ajax = support.match(item.url, patron='ajax_data\s*=\s*"?\s*([^;]+)', cloudscraper=True).match
item.url = host + '/load-more-film?' + support.urlencode(ast.literal_eval(ajax)) + '&page=1'
if '/search' not in item.url:
json = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True).json
data = "\n".join(json['data'])
else:
page = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True) page = support.httptools.downloadpage(item.url, headers=headers, cloudscraper=True)
if page.json: if page.json:
data = "\n".join(page.json['data']) data = "\n".join(page.json['data'])
else: else:
data = page.data data = page.data
else:
params['page'] = item.page
url = '{}/load-more-film?{}'.format(host, support.urlencode(params))
json = support.httptools.downloadpage(url, headers=headers, cloudscraper=True).json
data = "\n".join(json['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>[^"]+)[^>]+>.*?<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>[^"]+)[^>]+>.*?<h3>(?P<title>[^<[]+)(?:\[(?P<lang>[sSuUbBiItTaA-]+))?'
# paginazione # paginazione
if json.get('have_next'): if json.get('have_next'):
def fullItemlistHook(itemlist): def fullItemlistHook(itemlist):
spl = item.url.split('=') item.page += 1
url = '='.join(spl[:-1]) support.nextPage(itemlist, item, function_or_level='peliculas')
page = str(int(spl[-1])+1)
support.nextPage(itemlist, item, next_page='='.join((url, page)), function_or_level='peliculas')
return itemlist return itemlist
return locals() return locals()
@@ -184,16 +186,20 @@ def search(item, texto):
def genres(item): def genres(item):
logger.debug(item) logger.debug(item)
data = support.httptools.downloadpage(item.url, cloudscraper=True).data data = support.httptools.downloadpage(item.url, cloudscraper=True).data
debugBlock=True
patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)' patronMenu = r'<a href="(?P<url>[^"]+)">(?P<title>[^<]+)'
if item.args == 'quality':
item.contentType = 'undefined' if item.args == 'year':
patron = r'value="(?P<year_id>[^"]+)">(?P<title>\d+)'
patronBlock = r'Anno</option>(?P<block>.*?</select>)'
elif item.args == 'quality':
patronMenu = r'quality/(?P<quality_id>[^"]+)">(?P<title>[^<]+)'
patronBlock = r'Risoluzione(?P<block>.*?)</ul>' patronBlock = r'Risoluzione(?P<block>.*?)</ul>'
elif item.args == 'years': # elif item.args == 'years':
item.contentType = 'undefined' # item.contentType = 'undefined'
patronBlock = r'ANNO(?P<block>.*?</section>)' # 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'
return locals() return locals()
@@ -216,14 +222,14 @@ def episodios(item):
return locals() return locals()
def check(item): # def check(item):
resolve_url(item) # resolve_url(item)
if '/tvshow' in item.url: # if '/tvshow' in item.url:
item.contentType = 'tvshow' # item.contentType = 'tvshow'
return episodios(item) # return episodios(item)
else: # else:
item.contentType = 'movie' # item.contentType = 'movie'
return findvideos(item) # return findvideos(item)
def findvideos(item): def findvideos(item):