diff --git a/channels/altadefinizione01_link.json b/channels/altadefinizione01_link.json index 05fa3498..1f945ec8 100644 --- a/channels/altadefinizione01_link.json +++ b/channels/altadefinizione01_link.json @@ -1,1527 +1,51 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - addon/altadefinizione01_link.json at master · greko17/addon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content -
- - - - - - - - - - -
- -
- - -
- -
- - - -
-
-
- - - - - - - - - - -
-
- -
    - - - - -
  • - -
    - -
    - - - Watch - - -
    - Notifications -
    -
    - - - - - - - -
    -
    -
    - -
    -
  • - -
  • -
    -
    - - -
    -
    - - -
    - -
  • - -
  • - - - Fork - - -
  • -
- -

- - /addon - - - - forked from kodiondemand/addon - -

- -
- - - - - - -
-
-
- - - - - - - - Permalink - - - - -
- - -
- - Branch: - master - - - - - - - -
- -
- - Find file - - - Copy path - -
-
- - -
- - Find file - - - Copy path - -
-
- - - - -
-
- - - - - Update altadefinizione01_link.json - - - - da333e3 - May 23, 2019 - -
- -
-
- - 1 contributor - - -
- -

- Users who have contributed to this file -

-
- -
-
-
-
- - - - - - -
- -
- -
- 95 lines (94 sloc) - - 2.03 KB -
- -
- -
- Raw - Blame - History -
- - -
- -
- -
-
- -
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{
"id": "altadefinizione01_link",
"name": "Altadefinizione01 L",
"active": true,
"adult": false,
"language": ["ita"],
"fanart": "",
"thumbnail": "",
"banner": "http://altadefinizione01.link/templates/Dark/img/logonyy.png",
"fix" : "reimpostato url e modificato file per KOD",
"change_date": "2019-30-04",
"categories": [
"movie"
],
"settings": [
{
"id": "modo_grafico",
"type": "bool",
"label": "Cerca informazioni extra",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_film",
"type": "bool",
"label": "Includi in Novità",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_newest_italiano",
"type": "bool",
"label": "Includi in Novità - Italiano",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "include_in_global_search",
"type": "bool",
"label": "Includi ricerca globale",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "comprueba_enlaces",
"type": "bool",
"label": "Verifica se i link esistono",
"default": true,
"enabled": true,
"visible": true
},
{
"id": "comprueba_enlaces_num",
"type": "list",
"label": "Numero de link da verificare",
"default": 1,
"enabled": true,
"visible": "eq(-1,true)",
"lvalues": [ "5", "10", "15", "20" ]
},
{
"id": "filter_languages",
"type": "list",
"label": "Mostra link in lingua...",
"default": 0,
"enabled": true,
"visible": true,
"lvalues": [
"Non filtrare",
"IT"
]
},
{
"id": "perfil",
"type": "list",
"label": "profilo dei colori",
"default": 0,
"enabled": true,
"visible": true,
"lvalues": [
"Sin color",
"Perfil 5",
"Perfil 4",
"Perfil 3",
"Perfil 2",
"Perfil 1"
]
}
]
}
- - - -
- -
- - - -
- - -
- - -
-
- - - -
- -
- -
-
- - -
- - - - - - -
- - - You can’t perform that action at this time. -
- - - - - - - - - - - - - - -
- - - - +{ + "id": "altadefinizione01_link", + "name": "Altadefinizione01 L", + "active": true, + "adult": false, + "language": ["ita"], + "fanart": "https://altadefinizione01.estate/templates/Dark/img/logo2.png", + "thumbnail": "https://altadefinizione01.estate/templates/Dark/img/logo2.png", + "banner": "https://altadefinizione01.estate/templates/Dark/img/logo2.png", + "categories": [ + "movie" + ], + "settings": [ + { + "id": "include_in_global_search", + "type": "bool", + "label": "Includi in Ricerca Globale", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_peliculas", + "type": "bool", + "label": "Includi in Novità - Film", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "include_in_newest_italiano", + "type": "bool", + "label": "Includi in Novità - Italiano", + "default": true, + "enabled": true, + "visible": true + }, + { + "id": "filter_languages", + "type": "list", + "label": "Mostra link in lingua...", + "default": 0, + "enabled": true, + "visible": true, + "lvalues": [ + "No filtrar", + "Italiano" + ] + } + ] +} diff --git a/channels/altadefinizione01_link.py b/channels/altadefinizione01_link.py index 275c32d4..bde381ee 100644 --- a/channels/altadefinizione01_link.py +++ b/channels/altadefinizione01_link.py @@ -1,2295 +1,159 @@ +# -*- coding: utf-8 -*- +# -*- Channel Altadefinizione01L Film - Serie -*- +# -*- Creato per Alfa-addon -*- +# -*- e adattato for KOD -*- +# -*- By Greko -*- +# -*- last change: 23/05/2019 +""" +modificati: + core/servertools.py + core/support.py + +problemi noti: + - non ordina le categorie + - titolo nella pagina server + - autoplay + - videoteca nella pagina dei server + +Questi "problemi" secondo me vanno risolti in altri file, non ho modificato ulteriori file +perchè non so se si vanno queste modifiche. +Che portano le seguenti : + + 1. scheletro dei canali simile, se non uguale per tutti, cambiano naturalmente gli host e le regex + 2. con una modifica si cambiano tutti i canali + +""" + +from specials import autoplay +from core import support +from platformcode import config, logger + +__channel__ = "altadefinizione01_link" + +#host = "https://altadefinizione01.link/" #riaggiornato al 29 aprile 2019 +#host = "http://altadefinizione01.art/" # aggiornato al 22 marzo 2019 +#host = "https://altadefinizione01.network/" #aggiornato al 22 marzo 2019 +#host = "http://altadefinizione01.date/" #aggiornato al 3 maggio 2019 +#host = "https://altadefinizione01.voto/" #aggiornato al 3 maggio 2019 +host = "https://altadefinizione01.estate/" # aggiornato al 23 maggio 2019 + +# ======== def per utility INIZIO ============================ +headers = [['Referer', host]] +list_servers = ['supervideo', 'streamcherry','rapidvideo', 'streamango', 'openload'] +list_quality = ['default'] +# =========== home menu =================== +def mainlist(item): + """ + Creo il menu principale del canale + :param item: + :return: itemlist [] + """ + support.log() + itemlist = [] - - - - - - - - - - - + # Menu Principale + support.menu(itemlist, 'Novità bold', 'peliculas', host) + support.menu(itemlist, 'Film per Genere', 'genres', host, args='genres') + support.menu(itemlist, 'Film per Anno submenu', 'genres', host, args='years') + support.menu(itemlist, 'Film per Qualità submenu', 'genres', host, args='quality') + support.menu(itemlist, 'Al Cinema bold', 'peliculas', host+'film-del-cinema') + support.menu(itemlist, 'Popolari bold', 'peliculas', host+'piu-visti.html') + support.menu(itemlist, 'Mi sento fortunato bold', 'genres', host, args='lucky') + support.menu(itemlist, 'Sub-ITA bold', 'peliculas', host+'film-sub-ita/') + support.menu(itemlist, 'Cerca film submenu', 'search', host) - - - - - + # per autoplay + autoplay.init(item.channel, list_servers, list_quality) + autoplay.show_option(item.channel, itemlist) + return itemlist + +# ======== def in ordine di action dal menu =========================== + +def peliculas(item): + support.log + itemlist = [] + + patron = r'class="innerImage">.*?href="([^"]+)".*?src="([^"]+)"'\ + '.*?class="ml-item-title">([^"]+)(.*?)'\ + '<.*?class="ml-item-label">.*?class="ml-item-label ml-item-label-.*?">'\ + '(.*?).*?class="ml-item-label">(.*?)\d ' + itemlist = support.scrape(item, patron=patron, listGroups=listGroups, + headers= headers, patronNext=patronNext, + action='findvideos') - - - - - addon/altadefinizione01_link.py at master · greko17/addon - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Skip to content -
- - - - - - - - - - -
- -
- - -
- -
- - - -
-
-
- - - - - - - - - - -
-
- -
    - - - - -
  • - -
    - -
    - - - Watch - - -
    - Notifications -
    -
    - - - - - - - -
    -
    -
    - -
    -
  • - -
  • -
    -
    - - -
    -
    - - -
    - -
  • - -
  • - - - Fork - - -
  • -
- -

- - /addon - - - - forked from kodiondemand/addon - -

- -
- - - - - - -
-
-
- - - - - - - - Permalink - - - - -
- - -
- - Branch: - master - - - - - - - -
- -
- - Find file - - - Copy path - -
-
- - -
- - Find file - - - Copy path - -
-
- - - - -
-
- - - - - Update altadefinizione01_link.py - - - - 3486dd8 - May 23, 2019 - -
- -
-
- - 2 contributors - - -
- -

- Users who have contributed to this file -

-
- -
-
- - - @greko17 - - @mac12m99 - - - -
-
- - - - - - -
- -
- -
- 273 lines (221 sloc) - - 10.5 KB -
- -
- -
- Raw - Blame - History -
- - -
- -
- -
-
- -
-
-
- - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# -*- coding: utf-8 -*-
# -*- Channel Altadefinizione01C Film -*-
# -*- Riscritto per KOD -*-
# -*- By Greko -*-
# -*- last change: 04/05/2019
-
-
from specials import autoplay, filtertools
from channelselector import get_thumb
from core import httptools, channeltools, scrapertools, servertools, tmdb, support
from core.item import Item
from platformcode import config, logger
-
__channel__ = "altadefinizione01_club"
-
#host = "https://www.altadefinizione01.club/" # host da cambiare
#host = "https://www.altadefinizione01.team/" #aggiornato al 22 marzo 2019
host = "https://www.altadefinizione01.vision/" #aggiornato al 30-04-209
-
# ======== Funzionalità =============================
-
__comprueba_enlaces__ = config.get_setting('comprueba_enlaces', __channel__)
__comprueba_enlaces_num__ = config.get_setting('comprueba_enlaces_num', __channel__)
-
headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
['Referer', host]]
-
parameters = channeltools.get_channel_parameters(__channel__)
fanart_host = parameters['fanart']
thumbnail_host = parameters['thumbnail']
-
IDIOMAS = {'Italiano': 'IT'}
list_language = IDIOMAS.values()
list_servers = ['verystream','openload','rapidvideo','streamango'] # per l'autoplay
list_quality = ['default'] #'rapidvideo', 'streamango', 'openload', 'streamcherry'] # per l'autoplay
-
-
# =========== home menu ===================
-
def mainlist(item):
"""
Creo il menu principale del canale
:param item:
:return: itemlist []
"""
logger.info("%s mainlist log: %s" % (__channel__, item))
itemlist = []
-
autoplay.init(item.channel, list_servers, list_quality)
-
# Menu Principale
support.menu(itemlist, 'Film Ultimi Arrivi bold', 'peliculas', host, args='pellicola')
support.menu(itemlist, 'Genere', 'categorie', host, args='genres')
support.menu(itemlist, 'Per anno submenu', 'categorie', host, args=['Film per Anno','years'])
support.menu(itemlist, 'Per lettera', 'categorie', host+'catalog/a/', args=['Film per Lettera','orderalf'])
support.menu(itemlist, 'Al Cinema bold', 'peliculas', host+'cinema/', args='pellicola')
support.menu(itemlist, 'Sub-ITA bold', 'peliculas', host+'sub-ita/', args='pellicola')
support.menu(itemlist, 'Cerca film submenu', 'search', host)
-
autoplay.show_option(item.channel, itemlist)
return itemlist
-
# ======== def in ordine di menu ===========================
# =========== def per vedere la lista dei film =============
-
def peliculas(item):
logger.info("%s mainlist peliculas log: %s" % (__channel__, item))
itemlist = []
# scarico la pagina
data = httptools.downloadpage(item.url, headers=headers).data
# da qui fare le opportuni modifiche
if item.args != 'orderalf':
if item.args == 'pellicola' or item.args == 'years':
bloque = scrapertools.find_single_match(data, '<div class="cover boxcaption">(.*?)<div id="right_bar">')
elif item.args == "search":
bloque = scrapertools.find_single_match(data, '<div class="cover boxcaption">(.*?)</a>')
else:
bloque = scrapertools.find_single_match(data, '<div class="cover boxcaption">(.*?)<div class="page_nav">')
patron = '<h2>.<a href="(.*?)".*?src="(.*?)".*?class="trdublaj">(.*?)<div class="ml-item-hiden".*?class="h4">(.*?)<.*?label">(.*?)</span'
matches = scrapertools.find_multiple_matches(data, patron)
for scrapedurl, scrapedimg, scrapedqualang, scrapedtitle, scrapedyear in matches:
-
if 'sub ita' in scrapedqualang.lower():
scrapedlang = 'Sub-Ita'
else:
scrapedlang = 'ITA'
itemlist.append(Item(
channel=item.channel,
action="findvideos",
contentTitle=scrapedtitle,
fulltitle=scrapedtitle,
url=scrapedurl,
infoLabels={'year': scrapedyear},
contenType="movie",
thumbnail=host+scrapedimg,
title= "%s [%s]" % (scrapedtitle, scrapedlang),
language=scrapedlang
))
-
# poichè il sito ha l'anno del film con TMDB la ricerca titolo-anno è esatta quindi inutile fare lo scrap delle locandine
# e della trama dal sito che a volte toppano
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
-
# Paginazione
support.nextPage(itemlist,item,data,'<span>[^<]+</span>[^<]+<a href="(.*?)">')
return itemlist
-
# =========== def pagina categorie ======================================
-
def categorie(item):
logger.info("%s mainlist categorie log: %s" % (__channel__, item))
itemlist = []
# scarico la pagina
data = httptools.downloadpage(item.url, headers=headers).data
-
# da qui fare le opportuni modifiche
if item.args == 'genres':
bloque = scrapertools.find_single_match(data, '<ul class="kategori_list">(.*?)</ul>')
patron = '<li><a href="/(.*?)">(.*?)</a>'
elif item.args[1] == 'years':
bloque = scrapertools.find_single_match(data, '<ul class="anno_list">(.*?)</ul>')
patron = '<li><a href="/(.*?)">(.*?)</a>'
elif item.args[1] == 'orderalf':
bloque = scrapertools.find_single_match(data, '<div class="movies-letter">(.*)<div class="clearfix">')
patron = '<a title=.*?href="(.*?)"><span>(.*?)</span>'
-
matches = scrapertools.find_multiple_matches(bloque, patron)
-
for scrapurl, scraptitle in sorted(matches):
-
if "01" in scraptitle:
continue
else:
scrapurl = host+scrapurl
-
if item.args[1] != 'orderalf': action = "peliculas"
else: action = 'orderalf'
itemlist.append(Item(
channel=item.channel,
action= action,
title = scraptitle,
url= scrapurl,
thumbnail = get_thumb(scraptitle, auto = True),
extra = item.extra,
))
-
return itemlist
-
# =========== def pagina lista alfabetica ===============================
-
def orderalf(item):
logger.info("%s mainlist orderalf log: %s" % (__channel__, item))
itemlist = []
# scarico la pagina
data = httptools.downloadpage(item.url, headers=headers).data
# da qui fare le opportuni modifiche
patron = '<td class="mlnh-thumb"><a href="(.*?)".title="(.*?)".*?src="(.*?)".*?mlnh-3">(.*?)<.*?"mlnh-5">.<(.*?)<td' #scrapertools.find_single_match(data, '<td class="mlnh-thumb"><a href="(.*?)".title="(.*?)".*?src="(.*?)".*?mlnh-3">(.*?)<.*?"mlnh-5">.<(.*?)<td')
matches = scrapertools.find_multiple_matches(data, patron)
for scrapedurl, scrapedtitle, scrapedimg, scrapedyear, scrapedqualang in matches:
-
if 'sub ita' in scrapedqualang.lower():
scrapedlang = 'Sub-ita'
else:
scrapedlang = 'ITA'
itemlist.append(Item(
channel=item.channel,
action="findvideos_film",
contentTitle=scrapedtitle,
fulltitle=scrapedtitle,
url=scrapedurl,
infoLabels={'year': scrapedyear},
contenType="movie",
thumbnail=host+scrapedimg,
title = "%s [%s]" % (scrapedtitle, scrapedlang),
language=scrapedlang,
context="buscar_trailer"
))
-
# se il sito permette l'estrazione dell'anno del film aggiungere la riga seguente
tmdb.set_infoLabels_itemlist(itemlist, seekTmdb=True)
-
# Paginazione
support.nextPage(itemlist,item,data,'<span>[^<]+</span>[^<]+<a href="(.*?)">')
-
return itemlist
-
# =========== def pagina del film con i server per verderlo =============
-
def findvideos(item):
logger.info("%s mainlist findvideos_film log: %s" % (__channel__, item))
itemlist = []
-
# scarico la pagina
data = httptools.downloadpage(item.url, headers=headers).data
# da qui fare le opportuni modifiche
patron = '<a href="#" data-link="(.*?)">'
matches = scrapertools.find_multiple_matches(data, patron)
-
for scrapedurl in matches:
logger.info("altadefinizione01_club scrapedurl log: %s" % scrapedurl)
try:
itemlist = servertools.find_video_items(data=data)
-
for videoitem in itemlist:
logger.info("Videoitemlist2: %s" % videoitem)
videoitem.title = "%s [%s]" % (item.contentTitle, videoitem.title)
videoitem.show = item.show
videoitem.contentTitle = item.contentTitle
videoitem.contentType = item.contentType
videoitem.channel = item.channel
videoitem.year = item.infoLabels['year']
videoitem.infoLabels['plot'] = item.infoLabels['plot']
except AttributeError:
logger.error("data doesn't contain expected URL")
-
# Controlla se i link sono validi
if __comprueba_enlaces__:
itemlist = servertools.check_list_links(itemlist, __comprueba_enlaces_num__)
-
# Requerido para FilterTools
itemlist = filtertools.get_links(itemlist, item, list_language)
-
# Requerido para AutoPlay
autoplay.start(itemlist, item)
-
# Aggiunge alla videoteca
if item.extra != 'findvideos' and item.extra != "library" and config.get_videolibrary_support() and len(itemlist) != 0 :
support.videolibrary(itemlist, item)
return itemlist
-
# =========== def per cercare film/serietv =============
#http://altadefinizione01.link/index.php?do=search&story=avatar&subaction=search
def search(item, text):
logger.info("%s mainlist search log: %s %s" % (__channel__, item, text))
itemlist = []
text = text.replace(" ", "+")
item.url = host+"index.php?do=search&story=%s&subaction=search" % (text)
#item.extra = "search"
try:
return peliculas(item)
# Cattura la eccezione così non interrompe la ricerca globle se il canale si rompe!
except:
import sys
for line in sys.exc_info():
logger.error("%s Sono qua: %s" % (__channel__, line))
return []
-
# =========== def per le novità nel menu principale =============
-
def newest(categoria):
logger.info("%s mainlist newest log: %s %s %s" % (__channel__, categoria))
itemlist = []
item = Item()
try:
if categoria == "film":
item.url = host
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():
logger.error("{0}".format(line))
return []
-
return itemlist
- - - -
- -
- - - -
- - -
- - -
-
- - - -
- -
- -
-
- - -
- - - - - - -
- - - You can’t perform that action at this time. -
- - - - - - - - - - - - - - -
- - - - + return itemlist + +# =========== def pagina categorie ====================================== + +def genres(item): + support.log + itemlist = [] + #data = httptools.downloadpage(item.url, headers=headers).data + action = 'peliculas' + if item.args == 'genres': + bloque = r'' + elif item.args == 'years': + bloque = r'' + elif item.args == 'quality': + bloque = r'' + elif item.args == 'lucky': # sono i titoli random nella pagina, cambiano 1 volta al dì + bloque = r'FILM RANDOM.*?class="listSubCat">(.*?)' + action = 'findvideos' + + patron = r'
  • (.*?)<' + + listGroups = ['url','title'] + itemlist = support.scrape(item, patron=patron, listGroups=listGroups, + headers= headers, patron_block = bloque, + action=action) + + return itemlist + +# =========== def per cercare film/serietv ============= +#host+/index.php?do=search&story=avatar&subaction=search +def search(item, text): + support.log(categoria) + itemlist = [] + text = text.replace(" ", "+") + item.url = host+"/index.php?do=search&story=%s&subaction=search" % (text) + try: + return peliculas(item) + # Se captura la excepciÛn, para no interrumpir al buscador global si un canal falla + except: + import sys + for line in sys.exc_info(): + logger.info("%s mainlist search log: %s" % (__channel__, line)) + return [] + +# =========== def per le novità nel menu principale ============= + +def newest(categoria): + support.log(categoria) + itemlist = [] + item = Item() + try: + if categoria == "peliculas": + item.url = host + 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(): + logger.error("{0}".format(line)) + return [] + + return itemlist diff --git a/core/support.py b/core/support.py index bff31475..cf991056 100644 --- a/core/support.py +++ b/core/support.py @@ -128,7 +128,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="" blocks = scrapertoolsV2.find_multiple_matches(block, regex) block = "" for b in blocks: - block += "\n" + b + block += "\n" + str(b) # by greko log('BLOCK ', n, '=', block) else: block = data @@ -136,7 +136,7 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="" matches = scrapertoolsV2.find_multiple_matches(block, patron) log('MATCHES =', matches) - known_keys = ['url', 'title', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating'] #by greko aggiunto episode + known_keys = ['url', 'title', 'episode', 'thumb', 'quality', 'year', 'plot', 'duration', 'genere', 'rating', 'lang'] #by greko aggiunto episode + lang for match in matches: if len(listGroups) > len(match): # to fix a bug match = list(match) @@ -152,12 +152,19 @@ def scrape(item, patron = '', listGroups = [], headers="", blacklist="", data="" title = scrapertoolsV2.decodeHtmlentities(scraped["title"]).strip() plot = scrapertoolsV2.htmlclean(scrapertoolsV2.decodeHtmlentities(scraped["plot"])) - if scraped["quality"] and scraped["episode"]: # by greko aggiunto episode - longtitle = '[B]' + title + '[/B] - [B]' + scraped["episode"] + '[/B][COLOR blue][' + scraped["quality"] + '][/COLOR]' # by greko aggiunto episode - elif scraped["episode"]: # by greko aggiunto episode - longtitle = '[B]' + title + '[/B] - [B]' + scraped["episode"] + '[/B]' # by greko aggiunto episode - else: - longtitle = '[B]' + title + '[/B]' + # modificato by Greko inizio + longtitle = '[B]' + title + '[/B] ' + if scraped["quality"]: + longtitle += '[COLOR blue][' + scraped["quality"] + '][/COLOR]'#'[B]' + title + '[/B] - [B]' + scraped["episode"] + '[/B][COLOR blue][' + scraped["quality"] + '][/COLOR]' # by greko aggiunto episode + if scraped["episode"]: + longtitle += '[B]' + scraped["episode"] + '[/B]'#'[B]' + title + '[/B] - [B]' + scraped["episode"] + '[/B]' + if scraped["lang"]: + if 'sub' in scraped["lang"].lower(): + lang = 'Sub-ITA' + else: + lang = 'ITA' + longtitle += '[COLOR blue][ ' + lang + ' ][/COLOR]' + # modificato by Greko fine if item.infoLabels["title"] or item.fulltitle: # if title is set, probably this is a list of episodes or video sources infolabels = item.infoLabels