feat: checkhost e alcuni canali
checkhost stampa sul file di log ip e dns anche se non sono attivi i log di kodi e di kod riscritti i canali con le nuove guide e funzionalita', support.scrape ed eliminazione dei campi di settings
This commit is contained in:
@@ -2,13 +2,11 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
# Canale per altadefinizione01
|
# Canale per altadefinizione01
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
import xbmc
|
|
||||||
from core import scrapertoolsV2, httptools, support
|
from core import scrapertoolsV2, httptools, support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config, logger
|
||||||
|
|
||||||
__channel__ = "altadefinizione01"
|
|
||||||
|
|
||||||
#impostati dinamicamente da findhost()
|
#impostati dinamicamente da findhost()
|
||||||
host = ""
|
host = ""
|
||||||
headers = ""
|
headers = ""
|
||||||
@@ -17,11 +15,8 @@ def findhost():
|
|||||||
global host, headers
|
global host, headers
|
||||||
data = httptools.downloadpage('https://altadefinizione01-nuovo.link/').data
|
data = httptools.downloadpage('https://altadefinizione01-nuovo.link/').data
|
||||||
host = scrapertoolsV2.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
host = scrapertoolsV2.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||||
xbmc.log("host vale: %s" % host, level=xbmc.LOGNOTICE)
|
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
#host = config.get_channel_url(__channel__)
|
|
||||||
|
|
||||||
#headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
#headers = [['User-Agent', 'Mozilla/50.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0'],
|
||||||
# ['Referer', host]]
|
# ['Referer', host]]
|
||||||
|
|
||||||
@@ -66,7 +61,7 @@ def peliculas(item):
|
|||||||
'[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+).+?>.*?<p>(?P<plot>[^<]+)<'
|
'[^>]+>[^>]+>(?P<year>\d{4})[^>]+>[^>]+> [^>]+>[^>]+>(?P<duration>\d+).+?>.*?<p>(?P<plot>[^<]+)<'
|
||||||
|
|
||||||
patronNext = '<span>\d</span> <a href="([^"]+)">'
|
patronNext = '<span>\d</span> <a href="([^"]+)">'
|
||||||
debug = True
|
#debug = True
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
@@ -108,7 +103,8 @@ def findvideos(item):
|
|||||||
return support.server(item, headers=headers)
|
return support.server(item, headers=headers)
|
||||||
|
|
||||||
def search(item, text):
|
def search(item, text):
|
||||||
logger.info("%s mainlist search log: %s %s" % (__channel__, item, text))
|
support.log(item, text)
|
||||||
|
findhost()
|
||||||
itemlist = []
|
itemlist = []
|
||||||
text = text.replace(" ", "+")
|
text = text.replace(" ", "+")
|
||||||
item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text)
|
item.url = host + "/index.php?do=search&story=%s&subaction=search" % (text)
|
||||||
@@ -119,7 +115,7 @@ def search(item, text):
|
|||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
for line in sys.exc_info():
|
for line in sys.exc_info():
|
||||||
logger.error("search except %s: %s" % (__channel__, line))
|
logger.error("search except: %s" % line)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def newest(categoria):
|
def newest(categoria):
|
||||||
@@ -131,7 +127,6 @@ def newest(categoria):
|
|||||||
item.url = host
|
item.url = host
|
||||||
item.action = "peliculas"
|
item.action = "peliculas"
|
||||||
itemlist = peliculas(item)
|
itemlist = peliculas(item)
|
||||||
|
|
||||||
if itemlist[-1].action == "peliculas":
|
if itemlist[-1].action == "peliculas":
|
||||||
itemlist.pop()
|
itemlist.pop()
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
|
|||||||
@@ -49,16 +49,19 @@ def genres(item):
|
|||||||
|
|
||||||
action = 'peliculas'
|
action = 'peliculas'
|
||||||
if item.args == 'genres':
|
if item.args == 'genres':
|
||||||
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)</ul>'
|
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
||||||
|
#pass
|
||||||
elif item.args == 'years':
|
elif item.args == 'years':
|
||||||
patronBlock = r'<ul class="listSubCat" id="Anno">(?P<block>.*)</ul>'
|
patronBlock = r'<ul class="listSubCat" id="Anno">(?P<block>.*)<ul class="listSubCat" id="Qualita">'
|
||||||
elif item.args == 'quality':
|
elif item.args == 'quality':
|
||||||
patronBlock = r'<ul class="listSubCat" id="Qualita">(?P<block>.*)</ul>'
|
patronBlock = r'<ul class="listSubCat" id="Qualita">(?P<block>.*)<blockquote'
|
||||||
elif item.args == 'lucky': # sono i titoli random nella pagina, cambiano 1 volta al dì
|
elif item.args == 'lucky': # sono i titoli random nella pagina
|
||||||
patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>'
|
patronBlock = r'FILM RANDOM.*?class="listSubCat">(?P<block>.*)</ul>'
|
||||||
action = 'findvideos'
|
action = 'findvideos'
|
||||||
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
|
||||||
|
debug = True
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
# =========== def per cercare film/serietv =============
|
# =========== def per cercare film/serietv =============
|
||||||
|
|||||||
@@ -3,76 +3,9 @@
|
|||||||
"name": "AltadefinizioneClick",
|
"name": "AltadefinizioneClick",
|
||||||
"active": true,
|
"active": true,
|
||||||
"adult": false,
|
"adult": false,
|
||||||
"language": ["ita"],
|
"language": ["ita","vos"],
|
||||||
"thumbnail": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneclick.png",
|
"thumbnail": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneclick.png",
|
||||||
"bannermenu": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneciclk.png",
|
"bannermenu": "https:\/\/raw.githubusercontent.com\/Zanzibar82\/images\/master\/posters\/altadefinizioneciclk.png",
|
||||||
"categories": ["movie","vosi"],
|
"categories": ["movie","vos"],
|
||||||
"settings": [
|
"settings": []
|
||||||
{
|
|
||||||
"id": "channel_host",
|
|
||||||
"type": "text",
|
|
||||||
"label": "Host del canale",
|
|
||||||
"default": "https://altadefinizione.cloud",
|
|
||||||
"enabled": true,
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "include_in_global_search",
|
|
||||||
"type": "bool",
|
|
||||||
"label": "Includi 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_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": "checklinks",
|
|
||||||
"type": "bool",
|
|
||||||
"label": "Verifica se i link esistono",
|
|
||||||
"default": false,
|
|
||||||
"enabled": true,
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "checklinks_number",
|
|
||||||
"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"]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,9 @@
|
|||||||
# Canale per altadefinizioneclick
|
# Canale per altadefinizioneclick
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
|
|
||||||
from specials import autoplay
|
|
||||||
from core import servertools, support
|
from core import servertools, support
|
||||||
from core.item import Item
|
from core.item import Item
|
||||||
from platformcode import config, logger
|
from platformcode import config#, logger
|
||||||
|
|
||||||
__channel__ = 'altadefinizioneclick'
|
__channel__ = 'altadefinizioneclick'
|
||||||
|
|
||||||
@@ -18,55 +17,83 @@ list_quality = ['1080p']
|
|||||||
@support.menu
|
@support.menu
|
||||||
def mainlist(item):
|
def mainlist(item):
|
||||||
support.log()
|
support.log()
|
||||||
|
film = ['',
|
||||||
film = '' #'/nuove-uscite/'
|
('Novità', ['/nuove-uscite/', 'peliculas', 'news']),
|
||||||
filmSub = [
|
('Al Cinema', ['/al-cinema/', 'peliculas', 'cinema']),
|
||||||
('Novità', ['/nuove-uscite/', 'peliculas']),
|
('Generi', ['', 'genres', 'genres']),
|
||||||
('Al Cinema', ['/film-del-cinema', 'peliculas']),
|
('Anni', ['', 'genres', 'years']),
|
||||||
('Generi', ['', 'menu', 'Film']),
|
('Qualità', ['', 'genres', 'quality']),
|
||||||
('Anni', ['', 'menu', 'Anno']),
|
('Mi sento Fortunato',[ '', 'genres', 'lucky']),
|
||||||
('Qualità', ['', 'menu', 'Qualita']),
|
('Sub-ITA', ['/sub-ita/', 'peliculas', 'vos'])
|
||||||
('Sub-ITA', ['/sub-ita/', 'peliculas'])
|
|
||||||
]
|
]
|
||||||
|
|
||||||
return locals()
|
|
||||||
|
|
||||||
@support.scrape
|
|
||||||
def menu(item):
|
|
||||||
support.log()
|
|
||||||
|
|
||||||
action='peliculas'
|
|
||||||
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)</a></li>'
|
|
||||||
patronBlock= r'<ul class="listSubCat" id="'+ str(item.args) + '">(?P<block>.*)</ul>'
|
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
@support.scrape
|
@support.scrape
|
||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
support.log()
|
support.log()
|
||||||
if item.extra == 'search':
|
#debug = True
|
||||||
|
patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">(?P<quality>[^<>]+))?.+?'\
|
||||||
|
'href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)".+?<h2 class="titleFilm">[^>]+>'\
|
||||||
|
'(?P<title>.+?)[ ]?(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\
|
||||||
|
'(?:IMDB\:</strong>[ ](?P<rating>.+?)<|</h2> )'
|
||||||
|
patronBlock = r'<h1 class="titleSection titleLastIns">(?P<block>.*?)<div class="row ismobile">'
|
||||||
|
|
||||||
|
if item.args == 'news':
|
||||||
|
patronBlock = r'Nuove uscite</h1>(?P<block>.*?)<div class="row ismobile">'
|
||||||
|
elif item.args == 'cinema':
|
||||||
|
patronBlock = r'<h1 class="titleSection titleLastIns">Al cinema</h1>(?P<block>.*?)<div class="row ismobile">'
|
||||||
|
elif item.args == 'vos':
|
||||||
|
patronBlock = r'<h1 class="titleSection titleLastIns">SUB-ITA</h1>(?P<block>.*?)<div class="row ismobile">'
|
||||||
|
elif item.args == 'genres':
|
||||||
|
patronBlock = '<h1 class="titleSection titleLastIns">(?P<block>.*?)<div class="row ismobile">'
|
||||||
|
patron = r'<div class="wrapperImage">[ ]?(?:<span class="hd">'\
|
||||||
|
'(?P<quality>[^<>]+))?.+?href="(?P<url>[^"]+)".+?src="(?P<thumb>[^"]+)"'\
|
||||||
|
'.+?<h2 class="titleFilm(?:Mobile)?">[^>]+>(?P<title>.+?)[ ]?'\
|
||||||
|
'(?:|\[(?P<lang>[^\]]+)\])?(?:\((?P<year>\d{4})\))?</a>.*?'\
|
||||||
|
'(IMDB\:[ ](?P<rating>.+?))<'
|
||||||
|
elif item.args == 'search':
|
||||||
|
patronBlock = r'<section id="lastUpdate">(?P<block>.*?)<div class="row ismobile">'
|
||||||
patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="hd">(?P<quality>[^<]+)'\
|
patron = r'<a href="(?P<url>[^"]+)">\s*<div class="wrapperImage">(?:<span class="hd">(?P<quality>[^<]+)'\
|
||||||
'<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>'\
|
'<\/span>)?<img[^s]+src="(?P<thumb>[^"]+)"[^>]+>[^>]+>[^>]+>(?P<title>[^<]+)<[^<]+>'\
|
||||||
'(?:.*?IMDB:\s(\2[^<]+)<\/div>)?'
|
'(?:.*?IMDB:\s(\2[^<]+)<\/div>)?'
|
||||||
else:
|
else:
|
||||||
patron = r'<img width[^s]+src="(?P<thumb>[^"]+)[^>]+><\/a>.*?<a href="(?P<url>[^"]+)">(?P<title>[^(?:\]|<)]+)'\
|
patronBlock = r'ULTIMI INSERITI(?P<block>.*?)<div class="sliderLastUpdate ismobile ">'
|
||||||
'(?:\[(?P<lang>[^\]]+)\])?<\/a>[^>]+>[^>]+>[^>]+>(?:\sIMDB\:\s(?P<rating>[^<]+)<)?'\
|
|
||||||
'(?:.*?<span class="hd">(?P<quality>[^<]+)<\/span>)?\s*<a'
|
|
||||||
|
|
||||||
# in caso di CERCA si apre la maschera di inserimento dati
|
# in caso di CERCA si apre la maschera di inserimento dati
|
||||||
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
patronNext = r'<a class="next page-numbers" href="([^"]+)">'
|
||||||
|
|
||||||
|
return locals()
|
||||||
|
|
||||||
|
@support.scrape
|
||||||
|
def genres(item):
|
||||||
|
support.log('genres', item)
|
||||||
|
#debug = True
|
||||||
|
|
||||||
|
action = 'peliculas'
|
||||||
|
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<]+)<'
|
||||||
|
|
||||||
|
if item.args == 'genres':
|
||||||
|
patronBlock = r'<ul class="listSubCat" id="Film">(?P<block>.*)<ul class="listSubCat" id="Anno">'
|
||||||
|
elif item.args == 'years':
|
||||||
|
patronBlock = r'<ul class="listSubCat" id="Anno">(?P<block>.*)<ul class="listSubCat" id="Qualita">'
|
||||||
|
elif item.args == 'quality':
|
||||||
|
patronBlock = r'<ul class="listSubCat" id="Qualita">(?P<block>.*)</li> </ul> </div> </div> </div> <a'
|
||||||
|
elif item.args == 'lucky': # sono i titoli random nella pagina
|
||||||
|
patronBlock = r'<h3 class="titleSidebox dado">FILM RANDOM</h3>(?P<block>.*)</section>'
|
||||||
|
patron = r'<li><a href="(?P<url>[^"]+)">(?P<title>[^<[]+)(?:\[(?P<lang>.+?)\])?<'
|
||||||
|
action = 'findvideos'
|
||||||
|
|
||||||
|
item.args = 'genres'
|
||||||
|
|
||||||
return locals()
|
return locals()
|
||||||
|
|
||||||
def search(item, texto):
|
def search(item, texto):
|
||||||
support.log("search ", texto)
|
support.log("search ", texto)
|
||||||
|
|
||||||
item.extra = 'search'
|
item.args = 'search'
|
||||||
item.url = host + "/?s=" + texto
|
item.url = host + "/?s=" + texto
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return peliculas(item)
|
return peliculas(item)
|
||||||
|
|
||||||
# Continua la ricerca in caso di errore
|
# Continua la ricerca in caso di errore
|
||||||
except:
|
except:
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -219,6 +219,10 @@ def test_conn(is_exit, check_dns, view_msg,
|
|||||||
if view_msg == True:
|
if view_msg == True:
|
||||||
ktest.view_Advise(config.get_localized_string(70722))
|
ktest.view_Advise(config.get_localized_string(70722))
|
||||||
|
|
||||||
|
xbmc.log("############ Inizio Check DNS ############", level=xbmc.LOGNOTICE)
|
||||||
|
xbmc.log("IP: %s" % (ktest.ip_addr), level=xbmc.LOGNOTICE)
|
||||||
|
xbmc.log("DNS: %s" % (ktest.dns), level=xbmc.LOGNOTICE)
|
||||||
|
xbmc.log("############ Fine Check DNS ############", level=xbmc.LOGNOTICE)
|
||||||
if ktest.check_Ip() and ktest.check_Adsl() and ktest.check_Dns():
|
if ktest.check_Ip() and ktest.check_Adsl() and ktest.check_Dns():
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user