findhost in channels.json
This commit is contained in:
101
channels.json
101
channels.json
@@ -1,48 +1,57 @@
|
||||
{
|
||||
"altadefinizione01": "https://www.altadefinizione01.green",
|
||||
"altadefinizione01_link": "https://altadefinizione01.energy",
|
||||
"altadefinizioneclick": "https://altadefinizione.vote",
|
||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||
"animeforce": "https://ww1.animeforce.org",
|
||||
"animeleggendari": "https://animeora.com",
|
||||
"animesaturn": "https://www.animesaturn.it",
|
||||
"animestream": "https://www.animeworld.tv",
|
||||
"animesubita": "http://www.animesubita.org",
|
||||
"animetubeita": "http://www.animetubeita.com",
|
||||
"animeunity": "https://www.animeunity.it",
|
||||
"animeuniverse": "https://www.animeuniverse.it/",
|
||||
"animeworld": "https://www.animeworld.tv",
|
||||
"casacinema": "https://www.casacinema.page",
|
||||
"cb01anime": "https://www.cineblog01.red",
|
||||
"cinemalibero": "https://www.cinemalibero.space",
|
||||
"cinetecadibologna": "http://cinestore.cinetecadibologna.it",
|
||||
"dreamsub": "https://dreamsub.stream",
|
||||
"dsda": "https://www.dsda.press",
|
||||
"fastsubita": "https://fastsubita.online",
|
||||
"filmgratis": "https://www.filmaltadefinizione.tv",
|
||||
"filmigratis": "https://filmigratis.org",
|
||||
"filmpertutti": "https://www.filmpertutti.fun",
|
||||
"filmsenzalimiticc": "https://www.filmsenzalimiti01.casa",
|
||||
"filmstreaming01": "https://filmstreaming01.com",
|
||||
"guardaserie_stream": "https://guardaserie.host",
|
||||
"guardaseriecam": "https://guardaserie.cam",
|
||||
"guardaserieclick": "https://www.guardaserie.blue",
|
||||
"guardaserieicu": "https://guardaserie.us",
|
||||
"hd4me": "https://hd4me.net",
|
||||
"ilgeniodellostreaming": "https://ilgeniodellostreaming.fi",
|
||||
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.tel",
|
||||
"italiaserie": "https://italiaserie.org",
|
||||
"mondoserietv": "https://mondoserietv.fun",
|
||||
"piratestreaming": "https://www.piratestreaming.buzz",
|
||||
"polpotv": "https://polpotv.life",
|
||||
"raiplay": "https://www.raiplay.it",
|
||||
"seriehd": "https://seriehd.group",
|
||||
"serietvonline": "https://serietvonline.biz",
|
||||
"serietvsubita": "http://serietvsubita.xyz",
|
||||
"serietvu": "https://www.serietvu.link",
|
||||
"streamingcommunity": "https://streamingcommunity.to",
|
||||
"streamtime": "https://t.me/s/StreamTime",
|
||||
"tantifilm": "https://www.tantifilm.tel",
|
||||
"toonitalia": "https://toonitalia.org",
|
||||
"vvvvid": "https://www.vvvvid.it"
|
||||
"findhost": {
|
||||
"altadefinizione01": "https://altadefinizione01-nuovo.info",
|
||||
"altadefinizioneclick": "https://altadefinizione-nuovo.me",
|
||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||
"cineblog01": "https://cb01.uno",
|
||||
"eurostreaming": "https://eurostreaming.link",
|
||||
"ilcorsaronero": "https://lagazzettadelcorsaro.com",
|
||||
"seriehd": "https://nuovoindirizzo.info/seriehd",
|
||||
"serietvonline": "https://serietvonline.online",
|
||||
"tantifilm": "https://www.tantifilm.wiki",
|
||||
"film4k": "https://film4k-nuovo.link"
|
||||
},
|
||||
"direct": {
|
||||
"altadefinizione01_link": "https://altadefinizione01.energy",
|
||||
"animealtadefinizione": "https://www.animealtadefinizione.it",
|
||||
"animeforce": "https://ww1.animeforce.org",
|
||||
"animeleggendari": "https://animeora.com",
|
||||
"animesaturn": "https://www.animesaturn.it",
|
||||
"animestream": "https://www.animeworld.tv",
|
||||
"animesubita": "http://www.animesubita.org",
|
||||
"animetubeita": "http://www.animetubeita.com",
|
||||
"animeunity": "https://www.animeunity.it",
|
||||
"animeuniverse": "https://www.animeuniverse.it/",
|
||||
"animeworld": "https://www.animeworld.tv",
|
||||
"casacinema": "https://www.casacinema.page",
|
||||
"cb01anime": "https://www.cineblog01.red",
|
||||
"cinemalibero": "https://www.cinemalibero.space",
|
||||
"cinetecadibologna": "http://cinestore.cinetecadibologna.it",
|
||||
"dreamsub": "https://dreamsub.stream",
|
||||
"dsda": "https://www.dsda.press",
|
||||
"fastsubita": "https://fastsubita.online",
|
||||
"filmgratis": "https://www.filmaltadefinizione.tv",
|
||||
"filmigratis": "https://filmigratis.org",
|
||||
"filmpertutti": "https://www.filmpertutti.fun",
|
||||
"filmsenzalimiticc": "https://www.filmsenzalimiti01.casa",
|
||||
"filmstreaming01": "https://filmstreaming01.com",
|
||||
"guardaserie_stream": "https://guardaserie.host",
|
||||
"guardaseriecam": "https://guardaserie.cam",
|
||||
"guardaserieclick": "https://www.guardaserie.blue",
|
||||
"guardaserieicu": "https://guardaserie.us",
|
||||
"hd4me": "https://hd4me.net",
|
||||
"ilgeniodellostreaming": "https://ilgeniodellostreaming.fi",
|
||||
"ilgeniodellostreaming_cam": "https://ilgeniodellostreaming.tel",
|
||||
"italiaserie": "https://italiaserie.org",
|
||||
"mondoserietv": "https://mondoserietv.fun",
|
||||
"piratestreaming": "https://www.piratestreaming.buzz",
|
||||
"polpotv": "https://polpotv.life",
|
||||
"raiplay": "https://www.raiplay.it",
|
||||
"serietvsubita": "http://serietvsubita.xyz",
|
||||
"serietvu": "https://www.serietvu.link",
|
||||
"streamingcommunity": "https://streamingcommunity.to",
|
||||
"streamtime": "https://t.me/s/StreamTime",
|
||||
"toonitalia": "https://toonitalia.org",
|
||||
"vvvvid": "https://www.vvvvid.it"
|
||||
}
|
||||
}
|
||||
@@ -54,18 +54,17 @@ from core.item import Item # per newest
|
||||
|
||||
# se il sito ha un link per ottenere l'url corretto in caso di oscuramenti
|
||||
# la funzione deve ritornare l'indirizzo corretto, verrà chiamata solo se necessario (link primario irraggiungibile)
|
||||
def findhost():
|
||||
def findhost():
|
||||
permUrl = httptools.downloadpage('https://www.cb01.uno/', follow_redirects=False).headers
|
||||
def findhost(url):
|
||||
permUrl = httptools.downloadpage(url, follow_redirects=False).headers
|
||||
if 'google' in permUrl['location']:
|
||||
host = permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
else:
|
||||
host = permUrl['location']
|
||||
return host
|
||||
|
||||
# se si usa findhost
|
||||
# se si usa findhost metti in channels.json l'url del sito che contiene sempre l'ultimo dominio
|
||||
host = config.get_channel_url(findhost)
|
||||
# se non si usa (metti l'url in channels.json)
|
||||
# se non si usa metti direttamente l'url finale in channels.json
|
||||
host = config.get_channel_url()
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
@@ -17,10 +17,9 @@ from core import scrapertools, httptools, support
|
||||
from core.item import Item
|
||||
from platformcode import config, logger
|
||||
|
||||
#impostati dinamicamente da findhost()
|
||||
|
||||
def findhost():
|
||||
data = httptools.downloadpage('https://altadefinizione01-nuovo.info/').data
|
||||
def findhost(url):
|
||||
data = httptools.downloadpage(url).data
|
||||
host = scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||
return host
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
|
||||
def findhost():
|
||||
data = support.httptools.downloadpage('https://altadefinizione-nuovo.me/').data
|
||||
def findhost(url):
|
||||
data = support.httptools.downloadpage(url).data
|
||||
host = support.scrapertools.find_single_match(data, '<div class="elementor-button-wrapper"> <a href="([^"]+)"')
|
||||
return host
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ from lib import unshortenit
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def findhost():
|
||||
host = httptools.downloadpage('https://cb01.uno/', follow_redirect=True).url
|
||||
def findhost(url):
|
||||
host = httptools.downloadpage(url, follow_redirect=True).url
|
||||
if host == 'https://cb01.uno/':
|
||||
host = support.match(host, patron=r'<a href="([^"]+)', debug=True).match
|
||||
return host
|
||||
|
||||
@@ -11,7 +11,7 @@ from platformcode import config
|
||||
|
||||
|
||||
# rimanda a .today che contiene tutti link a .plus
|
||||
# def findhost():
|
||||
# def findhost(url):
|
||||
# permUrl = httptools.downloadpage('https://www.cinemalibero.online/', follow_redirects=False).headers
|
||||
# try:
|
||||
# import urlparse
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
from core import httptools, support
|
||||
from core.item import Item
|
||||
|
||||
def findhost():
|
||||
permUrl = httptools.downloadpage('https://eurostreaming.link/', follow_redirects=False, only_headers=True).headers
|
||||
def findhost(url):
|
||||
permUrl = httptools.downloadpage(url, follow_redirects=False, only_headers=True).headers
|
||||
host = 'https://'+permUrl['location'].replace('https://www.google.it/search?q=site:', '')
|
||||
return host
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ from core import support
|
||||
from platformcode import logger, config
|
||||
|
||||
|
||||
def findhost():
|
||||
return support.httptools.downloadpage('https://film4k-nuovo.link').url
|
||||
def findhost(url):
|
||||
return support.httptools.downloadpage(url).url
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from core import httptools, support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
|
||||
# def findhost():
|
||||
# def findhost(url):
|
||||
# page = httptools.downloadpage("https://filmpertutti.nuovo.live/").data
|
||||
# url = scrapertools.find_single_match(page, 'Il nuovo indirizzo di FILMPERTUTTI è <a href="([^"]+)')
|
||||
# return url
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
from core import support
|
||||
|
||||
def findhost():
|
||||
data = support.httptools.downloadpage('https://lagazzettadelcorsaro.com/').data
|
||||
def findhost(url):
|
||||
data = support.httptools.downloadpage(url).data
|
||||
url = support.scrapertools.find_single_match(data, '<li><a href="([^"]+)')
|
||||
return url[:-1] if url.endswith('/') else url
|
||||
|
||||
|
||||
@@ -4,17 +4,9 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from xml.dom import minidom
|
||||
|
||||
#impostati dinamicamente da findhost()
|
||||
|
||||
|
||||
host = 'https://metalvideo.com'
|
||||
headers={'X-Requested-With': 'XMLHttpRequest'}
|
||||
|
||||
|
||||
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
||||
|
||||
|
||||
@support.scrape
|
||||
|
||||
@@ -7,7 +7,7 @@ from core import support
|
||||
from core.item import Item
|
||||
from platformcode import logger, config
|
||||
|
||||
# def findhost():
|
||||
# def findhost(url):
|
||||
# return 'https://' + support.match('https://netfreex.uno/', patron='value="site:([^"]+)"').match
|
||||
|
||||
host = config.get_channel_url()
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
|
||||
from core import support
|
||||
def findhost():
|
||||
return support.match('https://nuovoindirizzo.info/seriehd/', patron=r'<h2[^>]+><a href="([^"]+)"').match
|
||||
def findhost(url):
|
||||
return support.match(url, patron=r'<h2[^>]+><a href="([^"]+)"').match
|
||||
|
||||
host = support.config.get_channel_url(findhost)
|
||||
headers = [['Referer', host]]
|
||||
|
||||
@@ -21,8 +21,8 @@ from platformcode import config
|
||||
from core.item import Item
|
||||
|
||||
|
||||
def findhost():
|
||||
host = support.match('https://serietvonline.online', patron=r'href="([^"]+)">\s*cliccando qui').matches[-1]
|
||||
def findhost(url):
|
||||
host = support.match(url, patron=r'href="([^"]+)">\s*cliccando qui').matches[-1]
|
||||
return host
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
|
||||
@@ -13,8 +13,8 @@ else:
|
||||
from urllib import unquote
|
||||
|
||||
|
||||
def findhost():
|
||||
data = httptools.downloadpage('https://www.popcornstream-nuovo-indirizzo.online/').data
|
||||
def findhost(url):
|
||||
data = httptools.downloadpage(url).data
|
||||
return support.scrapertools.find_single_match(data, '<a href="([^"]+)')
|
||||
|
||||
host = config.get_channel_url(findhost)
|
||||
|
||||
@@ -12,8 +12,8 @@ from platformcode import logger
|
||||
from platformcode import config, unify
|
||||
|
||||
|
||||
def findhost():
|
||||
permUrl = httptools.downloadpage('https://www.tantifilm.wiki/').data
|
||||
def findhost(url):
|
||||
permUrl = httptools.downloadpage(url).data
|
||||
host = scrapertools.find_single_match(permUrl, r'Nuovo indirizzo: <a href="([^"]+)')
|
||||
return host
|
||||
|
||||
|
||||
@@ -4,18 +4,11 @@
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core.item import Item
|
||||
from platformcode import config
|
||||
from xml.dom import minidom
|
||||
|
||||
#impostati dinamicamente da findhost()
|
||||
|
||||
|
||||
host = 'http://api.radiotime.com'
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
@support.scrape
|
||||
def mainlist(item):
|
||||
item.url = host
|
||||
|
||||
@@ -82,7 +82,6 @@ def color(text, color):
|
||||
|
||||
def search(channel, item, texto):
|
||||
info(item.url + " search " + texto)
|
||||
if 'findhost' in dir(channel): channel.findhost()
|
||||
item.url = channel.host + "/?s=" + texto
|
||||
try:
|
||||
return channel.peliculas(item)
|
||||
@@ -479,10 +478,10 @@ def scrape(func):
|
||||
# if url may be changed and channel has findhost to update
|
||||
if 'findhost' in func.__globals__ and not itemlist:
|
||||
info('running findhost ' + func.__module__)
|
||||
host = func.__globals__['findhost']()
|
||||
ch = func.__module__.split('.')[-1]
|
||||
host = config.get_channel_url(func.__globals__['findhost'], ch, True)
|
||||
|
||||
parse = list(urlparse.urlparse(item.url))
|
||||
from core import jsontools
|
||||
jsontools.update_node(host, func.__module__.split('.')[-1], 'url')
|
||||
parse[1] = scrapertools.get_domain_from_url(host)
|
||||
item.url = urlparse.urlunparse(parse)
|
||||
data = None
|
||||
|
||||
@@ -258,10 +258,10 @@ def check_channels(inutile=''):
|
||||
|
||||
risultato = {}
|
||||
|
||||
for chann, host in sorted(data.items()):
|
||||
for chann, host in sorted(data['direct'].items()):
|
||||
|
||||
ris = []
|
||||
# to get an idea of the timing
|
||||
# to get an idea of the timing
|
||||
# useful only if you control all channels
|
||||
# for channels with error 522 about 40 seconds are lost ...
|
||||
logger.info("check #### INIZIO #### channel - host :%s - %s " % (chann, host))
|
||||
@@ -290,6 +290,7 @@ def check_channels(inutile=''):
|
||||
|
||||
logger.info("check #### FINE #### rslt :%s " % (rslt))
|
||||
|
||||
risultato = {'findhost': data['findhost'], 'direct': risultato}
|
||||
fileJson_test = 'channels-test.json'
|
||||
# I write the updated file
|
||||
with open(folderJson+'/'+fileJson_test, 'w') as f:
|
||||
|
||||
@@ -15,7 +15,7 @@ __language__ = __settings__.getLocalizedString
|
||||
__version_fix = None
|
||||
__dev_mode = None
|
||||
|
||||
channels_data = list()
|
||||
channels_data = dict()
|
||||
|
||||
def get_addon_core():
|
||||
return __settings__
|
||||
@@ -101,27 +101,29 @@ def is_xbmc():
|
||||
def get_videolibrary_support():
|
||||
return True
|
||||
|
||||
def get_channel_url(findhostMethod=None, name=None):
|
||||
|
||||
def get_channel_url(findhostMethod=None, name=None, forceFindhost=False):
|
||||
from core import jsontools
|
||||
import inspect
|
||||
|
||||
LOCAL_FILE = os.path.join(get_runtime_path(), "channels.json")
|
||||
global channels_data
|
||||
if not channels_data:
|
||||
with open(LOCAL_FILE) as f:
|
||||
channels_data = jsontools.load(f.read())
|
||||
|
||||
frame = inspect.stack()[1]
|
||||
if not name:
|
||||
name = os.path.basename(frame[0].f_code.co_filename).replace('.py', '')
|
||||
if findhostMethod:
|
||||
url = jsontools.get_node_from_file(name, 'url')
|
||||
if not url or 'web.archive.org' in url: # per eliminare tutti i webarchive salvati causa bug httptools CF, eliminare in futuro
|
||||
url = findhostMethod()
|
||||
if not url or 'web.archive.org' in url or forceFindhost: # per eliminare tutti i webarchive salvati causa bug httptools CF, eliminare in futuro
|
||||
url = findhostMethod(channels_data['findhost'][name])
|
||||
jsontools.update_node(url, name, 'url')
|
||||
return url
|
||||
else:
|
||||
ROOT_DIR = xbmc.translatePath(__settings__.getAddonInfo('Path'))
|
||||
LOCAL_FILE = os.path.join(ROOT_DIR, "channels.json")
|
||||
global channels_data
|
||||
if not channels_data:
|
||||
with open(LOCAL_FILE) as f:
|
||||
channels_data = jsontools.load(f.read())
|
||||
return channels_data[name]
|
||||
return channels_data['direct'][name]
|
||||
|
||||
|
||||
def get_system_platform():
|
||||
""" function: to recover the platform that xbmc is running """
|
||||
|
||||
Reference in New Issue
Block a user