Merge branch 'master' of https://github.com/kodiondemand/addon
update with upstream
This commit is contained in:
+2
-1
@@ -43,7 +43,8 @@
|
|||||||
"streamingcommunity": "https://streamingcommunity.net",
|
"streamingcommunity": "https://streamingcommunity.net",
|
||||||
"streamtime": "https://t.me/s/StreamTime",
|
"streamtime": "https://t.me/s/StreamTime",
|
||||||
"toonitalia": "https://toonitalia.pro",
|
"toonitalia": "https://toonitalia.pro",
|
||||||
"vvvvid": "https://www.vvvvid.it"
|
"vvvvid": "https://www.vvvvid.it",
|
||||||
|
"paramount": "https://www.paramountnetwork.it"
|
||||||
},
|
},
|
||||||
"findhost": {
|
"findhost": {
|
||||||
"altadefinizione01": "https://altadefinizione01-nuovo.info",
|
"altadefinizione01": "https://altadefinizione01-nuovo.info",
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ def newest(categoria):
|
|||||||
def submenu(item):
|
def submenu(item):
|
||||||
data = support.match(item.url + item.args).data
|
data = support.match(item.url + item.args).data
|
||||||
action = 'filter'
|
action = 'filter'
|
||||||
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<url>.*?)</select>'
|
patronMenu = r'<h5 class="[^"]+">(?P<title>[^<]+)[^>]+>[^>]+>\s*<select id="(?P<parameter>[^"]+)"[^>]+>(?P<data>.*?)</select>'
|
||||||
def itemlistHook(itemlist):
|
def itemlistHook(itemlist):
|
||||||
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='peliculas'))
|
itemlist.insert(0, item.clone(title=support.typo('Tutti','bold'), url=item.url + item.args, action='peliculas'))
|
||||||
return itemlist[:-1]
|
return itemlist[:-1]
|
||||||
@@ -69,7 +69,7 @@ def submenu(item):
|
|||||||
|
|
||||||
def filter(item):
|
def filter(item):
|
||||||
itemlist = []
|
itemlist = []
|
||||||
matches = support.match(item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches
|
matches = support.match(item.data if item.data else item.url, patron=r'<option value="(?P<value>[^"]+)"[^>]*>(?P<title>[^<]+)').matches
|
||||||
for value, title in matches:
|
for value, title in matches:
|
||||||
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter'))
|
itemlist.append(item.clone(title= support.typo(title,'bold'), url='{}{}&{}%5B0%5D={}'.format(host, item.args, item.parameter, value), action='peliculas', args='filter'))
|
||||||
support.thumb(itemlist, genre=True)
|
support.thumb(itemlist, genre=True)
|
||||||
@@ -95,7 +95,7 @@ def peliculas(item):
|
|||||||
deflang= 'Sub-ITA'
|
deflang= 'Sub-ITA'
|
||||||
action = 'check'
|
action = 'check'
|
||||||
page = None
|
page = None
|
||||||
post = "page=" + str(item.page if item.page else 1) if item.page and item.page > 1 else None
|
post = "page=" + str(item.page if item.page else 1) if item.page and int(item.page) > 1 else None
|
||||||
|
|
||||||
if item.args == 'top':
|
if item.args == 'top':
|
||||||
data = item.other
|
data = item.other
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import inspect
|
|||||||
from core import support, jsontools
|
from core import support, jsontools
|
||||||
from platformcode import autorenumber, logger
|
from platformcode import autorenumber, logger
|
||||||
|
|
||||||
# host = support.config.get_channel_url()
|
host = support.config.get_channel_url()
|
||||||
host = 'https://www.paramountnetwork.it'
|
|
||||||
headers = [['Referer', host]]
|
headers = [['Referer', host]]
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +63,7 @@ def live(item):
|
|||||||
def peliculas(item):
|
def peliculas(item):
|
||||||
logger.debug()
|
logger.debug()
|
||||||
def load_more(url):
|
def load_more(url):
|
||||||
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('%5C','/')
|
second_url = host if url.startswith('/') else '' + url.replace('\u002F','/').replace('\\u002F','/').replace('%5C','/')
|
||||||
new_data = support.match(host + second_url).data.replace('\x01','l').replace('\x02','a')
|
new_data = support.match(host + second_url).data.replace('\x01','l').replace('\x02','a')
|
||||||
return jsontools.load(new_data)['items']
|
return jsontools.load(new_data)['items']
|
||||||
|
|
||||||
|
|||||||
+11
-6
@@ -53,7 +53,7 @@ def learning(item):
|
|||||||
json = current_session.get(item.url).json()['contents']
|
json = current_session.get(item.url).json()['contents']
|
||||||
for key in json:
|
for key in json:
|
||||||
itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'],
|
itemlist.append(item.clone(title = support.typo(key['name'],'bold'), fulltitle = key['name'],
|
||||||
show = key['name'], url = key['contents'], action = 'peliculas'))
|
show = key['name'], data = key['contents'], action = 'peliculas'))
|
||||||
return itemlist
|
return itemlist
|
||||||
|
|
||||||
|
|
||||||
@@ -82,9 +82,14 @@ def replay_menu(item):
|
|||||||
# create day and month list
|
# create day and month list
|
||||||
days = []
|
days = []
|
||||||
months = []
|
months = []
|
||||||
days.append(xbmc.getLocalizedString(17))
|
try:
|
||||||
for day in range(11, 17): days.append(xbmc.getLocalizedString(day))
|
days.append(xbmc.getLocalizedString(17))
|
||||||
for month in range(21, 33): months.append(xbmc.getLocalizedString(month))
|
for day in range(11, 17): days.append(xbmc.getLocalizedString(day))
|
||||||
|
for month in range(21, 33): months.append(xbmc.getLocalizedString(month))
|
||||||
|
except: # per i test, xbmc.getLocalizedString non è supportato
|
||||||
|
days.append('dummy')
|
||||||
|
for day in range(11, 17): days.append('dummy')
|
||||||
|
for month in range(21, 33): months.append('dummy')
|
||||||
|
|
||||||
# make menu
|
# make menu
|
||||||
itemlist = []
|
itemlist = []
|
||||||
@@ -184,8 +189,8 @@ def peliculas(item):
|
|||||||
pagination = 40 if not item.search else ''
|
pagination = 40 if not item.search else ''
|
||||||
|
|
||||||
# load json
|
# load json
|
||||||
if type(item.url) in [dict, list]:
|
if item.data:
|
||||||
json = item.url
|
json = item.data
|
||||||
for key in json:
|
for key in json:
|
||||||
if item.search.lower() in key['name'].lower():
|
if item.search.lower() in key['name'].lower():
|
||||||
keys.append(key)
|
keys.append(key)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "serietvsubita",
|
"id": "serietvsubita",
|
||||||
"name": "Serie TV Sub ITA",
|
"name": "Serie TV Sub ITA",
|
||||||
"active": true,
|
"active": false,
|
||||||
"language": ["ita"],
|
"language": ["ita"],
|
||||||
"thumbnail": "serietvsubita.png",
|
"thumbnail": "serietvsubita.png",
|
||||||
"banner": "serietvsubita.png",
|
"banner": "serietvsubita.png",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|
||||||
import json, requests, sys
|
import json, requests, sys
|
||||||
from core import support
|
from core import support, channeltools
|
||||||
from platformcode import logger
|
from platformcode import logger
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
from concurrent import futures
|
from concurrent import futures
|
||||||
@@ -190,5 +190,21 @@ def episodios(item):
|
|||||||
|
|
||||||
|
|
||||||
def findvideos(item):
|
def findvideos(item):
|
||||||
itemlist = [item.clone(title = 'StreamingCommunity', server='streamingcommunity_server')]
|
video_urls = []
|
||||||
return support.server(item, item.url)
|
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
|
||||||
|
'content-type': 'application/json;charset=UTF-8',
|
||||||
|
'Referer': 'https://streamingcommunity.net'}
|
||||||
|
data = support.match(item, headers=headers).data.replace('"','"').replace('\\','')
|
||||||
|
url = support.match(data, patron=r'video_url"\s*:\s*"([^"]+)"').match
|
||||||
|
def videourls(res):
|
||||||
|
newurl = '{}/{}'.format(url, res)
|
||||||
|
if requests.head(newurl, headers=headers).status_code == 200:
|
||||||
|
video_urls.append(["m3u8 {} [StreamingCommunity]".format(res), newurl])
|
||||||
|
|
||||||
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
|
for res in ['480p', '720p', '1080p']:
|
||||||
|
executor.submit(videourls, res)
|
||||||
|
if not video_urls: video_urls = [["m3u8 [StreamingCommunity]", url]]
|
||||||
|
else: video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match))
|
||||||
|
itemlist = [item.clone(title = channeltools.get_channel_parameters(item.channel)['title'], server='directo', video_urls=video_urls, thumbnail=channeltools.get_channel_parameters(item.channel)["thumbnail"], forcethumb=True)]
|
||||||
|
return support.server(item, itemlist=itemlist)
|
||||||
+3
-1
@@ -153,11 +153,13 @@ def start(itemlist, item):
|
|||||||
autoplay_list.append(autoplay_elem)
|
autoplay_list.append(autoplay_elem)
|
||||||
|
|
||||||
# We order according to priority
|
# We order according to priority
|
||||||
if priority == 0: autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) # Servers and qualities
|
if priority == 0: autoplay_list.sort(key=lambda orden: ((orden['indice_server'], orden['indice_quality']))) # Servers and qualities
|
||||||
elif priority == 1: autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) # Qualities and servers
|
elif priority == 1: autoplay_list.sort(key=lambda orden: (orden['indice_quality'], orden['indice_server'])) # Qualities and servers
|
||||||
elif priority == 2: autoplay_list.sort(key=lambda orden: (orden['indice_server'])) # Servers only
|
elif priority == 2: autoplay_list.sort(key=lambda orden: (orden['indice_server'])) # Servers only
|
||||||
elif priority == 3: autoplay_list.sort(key=lambda orden: (orden['indice_quality'])) # Only qualities
|
elif priority == 3: autoplay_list.sort(key=lambda orden: (orden['indice_quality'])) # Only qualities
|
||||||
|
|
||||||
|
logger.debug('PRIORITY',priority, autoplay_list)
|
||||||
|
|
||||||
# if quality priority is active
|
# if quality priority is active
|
||||||
if priority == 0 and config.get_setting('quality_priority'):
|
if priority == 0 and config.get_setting('quality_priority'):
|
||||||
max_quality = autoplay_list[0]["indice_quality"] if autoplay_list and "indice_quality" in autoplay_list[0] else 0
|
max_quality = autoplay_list[0]["indice_quality"] if autoplay_list and "indice_quality" in autoplay_list[0] else 0
|
||||||
|
|||||||
+26
-23
@@ -320,16 +320,18 @@ def scrapeBlock(item, args, block, patron, headers, action, pagination, debug, t
|
|||||||
|
|
||||||
if type(parsedTitle.get('season')) == list:
|
if type(parsedTitle.get('season')) == list:
|
||||||
longtitle += str(parsedTitle.get('season')[0]) + '-' + str(parsedTitle.get('season')[-1])
|
longtitle += str(parsedTitle.get('season')[0]) + '-' + str(parsedTitle.get('season')[-1])
|
||||||
|
infolabels['season'] = parsedTitle.get('season')[0]
|
||||||
else:
|
else:
|
||||||
longtitle += str(parsedTitle.get('season'))
|
longtitle += str(parsedTitle.get('season'))
|
||||||
|
infolabels['season'] = parsedTitle.get('season')
|
||||||
|
|
||||||
if type(parsedTitle.get('episode')) == list:
|
if type(parsedTitle.get('episode')) == list:
|
||||||
longtitle += 'x' + str(parsedTitle.get('episode')[0]).zfill(2) + '-' + str(parsedTitle.get('episode')[-1]).zfill(2)
|
longtitle += 'x' + str(parsedTitle.get('episode')[0]).zfill(2) + '-' + str(parsedTitle.get('episode')[-1]).zfill(2)
|
||||||
|
infolabels['episode'] = parsedTitle.get('episode')[0]
|
||||||
else:
|
else:
|
||||||
longtitle += 'x' + str(parsedTitle.get('episode')).zfill(2)
|
longtitle += 'x' + str(parsedTitle.get('episode')).zfill(2)
|
||||||
|
infolabels['episode'] = parsedTitle.get('episode')
|
||||||
|
|
||||||
infolabels['season'] = parsedTitle.get('season')
|
|
||||||
infolabels['episode'] = parsedTitle.get('episode')
|
|
||||||
elif parsedTitle.get('season') and type(parsedTitle.get('season')) == list:
|
elif parsedTitle.get('season') and type(parsedTitle.get('season')) == list:
|
||||||
longtitle += s + config.get_localized_string(30140) + " " +str(parsedTitle.get('season')[0]) + '-' + str(parsedTitle.get('season')[-1])
|
longtitle += s + config.get_localized_string(30140) + " " +str(parsedTitle.get('season')[0]) + '-' + str(parsedTitle.get('season')[-1])
|
||||||
elif parsedTitle.get('season'):
|
elif parsedTitle.get('season'):
|
||||||
@@ -1161,25 +1163,26 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
|||||||
# s = servertools.get_server_from_url(videoitem.url)
|
# s = servertools.get_server_from_url(videoitem.url)
|
||||||
# videoitem.server = s[2] if s else 'directo'
|
# videoitem.server = s[2] if s else 'directo'
|
||||||
# videoitem.title = s[0] if s else config.get_localized_string(30137)
|
# videoitem.title = s[0] if s else config.get_localized_string(30137)
|
||||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
if not videoitem.video_urls:
|
||||||
if not srv_param: # do not exists or it's empty
|
|
||||||
findS = servertools.get_server_from_url(videoitem.url)
|
|
||||||
info(findS)
|
|
||||||
if not findS:
|
|
||||||
if item.channel == 'community':
|
|
||||||
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
|
||||||
else:
|
|
||||||
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
|
||||||
findS = servertools.get_server_from_url(videoitem.url)
|
|
||||||
if not findS:
|
|
||||||
info(videoitem, 'Non supportato')
|
|
||||||
return
|
|
||||||
videoitem.server = findS[2]
|
|
||||||
videoitem.title = findS[0]
|
|
||||||
videoitem.url = findS[1]
|
|
||||||
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||||
|
if not srv_param: # do not exists or it's empty
|
||||||
|
findS = servertools.get_server_from_url(videoitem.url)
|
||||||
|
info(findS)
|
||||||
|
if not findS:
|
||||||
|
if item.channel == 'community':
|
||||||
|
findS= (config.get_localized_string(30137), videoitem.url, 'directo')
|
||||||
|
else:
|
||||||
|
videoitem.url = unshortenit.unshorten_only(videoitem.url)[0]
|
||||||
|
findS = servertools.get_server_from_url(videoitem.url)
|
||||||
|
if not findS:
|
||||||
|
info(videoitem, 'Non supportato')
|
||||||
|
return
|
||||||
|
videoitem.server = findS[2]
|
||||||
|
videoitem.title = findS[0]
|
||||||
|
videoitem.url = findS[1]
|
||||||
|
srv_param = servertools.get_server_parameters(videoitem.server.lower())
|
||||||
|
|
||||||
if srv_param.get('active', False):
|
if videoitem.video_urls or srv_param.get('active', False):
|
||||||
item.title = typo(item.contentTitle.strip(), 'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
|
item.title = typo(item.contentTitle.strip(), 'bold') if item.contentType == 'movie' or (config.get_localized_string(30161) in item.title) else item.title
|
||||||
|
|
||||||
quality = videoitem.quality if videoitem.quality else item.quality if item.quality else ''
|
quality = videoitem.quality if videoitem.quality else item.quality if item.quality else ''
|
||||||
@@ -1188,7 +1191,7 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
|||||||
videoitem.channel = item.channel
|
videoitem.channel = item.channel
|
||||||
videoitem.fulltitle = item.fulltitle
|
videoitem.fulltitle = item.fulltitle
|
||||||
videoitem.show = item.show
|
videoitem.show = item.show
|
||||||
videoitem.thumbnail = item.thumbnail
|
if not videoitem.video_urls: videoitem.thumbnail = item.thumbnail
|
||||||
videoitem.contentType = item.contentType
|
videoitem.contentType = item.contentType
|
||||||
videoitem.infoLabels = item.infoLabels
|
videoitem.infoLabels = item.infoLabels
|
||||||
videoitem.quality = quality
|
videoitem.quality = quality
|
||||||
@@ -1200,13 +1203,13 @@ def server(item, data='', itemlist=[], headers='', AutoPlay=True, CheckLinks=Tru
|
|||||||
|
|
||||||
# non threaded for webpdb
|
# non threaded for webpdb
|
||||||
# dbg()
|
# dbg()
|
||||||
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url]
|
# thL = [getItem(videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||||
# for it in thL:
|
# for it in thL:
|
||||||
# if it and not config.get_setting("black_list", server=it.server.lower()):
|
# if it and not config.get_setting("black_list", server=it.server.lower()):
|
||||||
# verifiedItemlist.append(it)
|
# verifiedItemlist.append(it)
|
||||||
#
|
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
with futures.ThreadPoolExecutor() as executor:
|
||||||
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url]
|
thL = [executor.submit(getItem, videoitem) for videoitem in itemlist if videoitem.url or videoitem.video_urls]
|
||||||
for it in futures.as_completed(thL):
|
for it in futures.as_completed(thL):
|
||||||
if it.result() and not config.get_setting("black_list", server=it.result().server.lower()):
|
if it.result() and not config.get_setting("black_list", server=it.result().server.lower()):
|
||||||
verifiedItemlist.append(it.result())
|
verifiedItemlist.append(it.result())
|
||||||
|
|||||||
+38
-36
@@ -31,7 +31,7 @@ class UnshortenIt(object):
|
|||||||
_linkbucks_regex = r'linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co'
|
_linkbucks_regex = r'linkbucks\.com|any\.gs|cash4links\.co|cash4files\.co|dyo\.gs|filesonthe\.net|goneviral\.com|megaline\.co|miniurls\.co|qqc\.co|seriousdeals\.net|theseblogs\.com|theseforums\.com|tinylinks\.co|tubeviral\.com|ultrafiles\.net|urlbeat\.net|whackyvidz\.com|yyv\.co'
|
||||||
_adfocus_regex = r'adfoc\.us'
|
_adfocus_regex = r'adfoc\.us'
|
||||||
_lnxlu_regex = r'lnx\.lu'
|
_lnxlu_regex = r'lnx\.lu'
|
||||||
_shst_regex = r'sh\.st|festyy\.com|ceesty\.com'
|
_shst_regex = r'sh\.st|shorte\.st|sh\.st|clkmein\.com|viid\.me|xiw34\.com|corneey\.com|gestyy\.com|cllkme\.com|festyy\.com|destyy\.com|ceesty\.com'
|
||||||
_hrefli_regex = r'href\.li'
|
_hrefli_regex = r'href\.li'
|
||||||
_anonymz_regex = r'anonymz\.com'
|
_anonymz_regex = r'anonymz\.com'
|
||||||
_shrink_service_regex = r'shrink-service\.it'
|
_shrink_service_regex = r'shrink-service\.it'
|
||||||
@@ -381,41 +381,43 @@ class UnshortenIt(object):
|
|||||||
|
|
||||||
def _unshorten_shst(self, uri):
|
def _unshorten_shst(self, uri):
|
||||||
try:
|
try:
|
||||||
r = httptools.downloadpage(uri, timeout=self._timeout)
|
# act like a crawler
|
||||||
html = r.data
|
r = httptools.downloadpage(uri, timeout=self._timeout, headers=[['User-Agent', '']])
|
||||||
session_id = re.findall(r'sessionId\:(.*?)\"\,', html)
|
uri = r.url
|
||||||
if len(session_id) > 0:
|
# html = r.data
|
||||||
session_id = re.sub(r'\s\"', '', session_id[0])
|
# session_id = re.findall(r'sessionId\:(.*?)\"\,', html)
|
||||||
|
# if len(session_id) > 0:
|
||||||
http_header = dict()
|
# session_id = re.sub(r'\s\"', '', session_id[0])
|
||||||
http_header["Content-Type"] = "application/x-www-form-urlencoded"
|
#
|
||||||
http_header["Host"] = "sh.st"
|
# http_header = dict()
|
||||||
http_header["Referer"] = uri
|
# http_header["Content-Type"] = "application/x-www-form-urlencoded"
|
||||||
http_header["Origin"] = "http://sh.st"
|
# http_header["Host"] = "sh.st"
|
||||||
http_header["X-Requested-With"] = "XMLHttpRequest"
|
# http_header["Referer"] = uri
|
||||||
|
# http_header["Origin"] = "http://sh.st"
|
||||||
if config.is_xbmc():
|
# http_header["X-Requested-With"] = "XMLHttpRequest"
|
||||||
import xbmc
|
#
|
||||||
xbmc.sleep(5 * 1000)
|
# if config.is_xbmc():
|
||||||
else:
|
# import xbmc
|
||||||
time.sleep(5 * 1000)
|
# xbmc.sleep(5 * 1000)
|
||||||
|
# else:
|
||||||
payload = {'adSessionId': session_id, 'callback': 'c'}
|
# time.sleep(5 * 1000)
|
||||||
r = httptools.downloadpage(
|
#
|
||||||
'http://sh.st/shortest-url/end-adsession?' +
|
# payload = {'adSessionId': session_id, 'callback': 'c'}
|
||||||
urlencode(payload),
|
# r = httptools.downloadpage(
|
||||||
headers=http_header,
|
# 'http://sh.st/shortest-url/end-adsession?' +
|
||||||
timeout=self._timeout)
|
# urlencode(payload),
|
||||||
response = r.data[6:-2].decode('utf-8')
|
# headers=http_header,
|
||||||
|
# timeout=self._timeout)
|
||||||
if r.code == 200:
|
# response = r.data[6:-2].decode('utf-8')
|
||||||
resp_uri = json.loads(response)['destinationUrl']
|
#
|
||||||
if resp_uri is not None:
|
# if r.code == 200:
|
||||||
uri = resp_uri
|
# resp_uri = json.loads(response)['destinationUrl']
|
||||||
else:
|
# if resp_uri is not None:
|
||||||
return uri, 'Error extracting url'
|
# uri = resp_uri
|
||||||
else:
|
# else:
|
||||||
return uri, 'Error extracting url'
|
# return uri, 'Error extracting url'
|
||||||
|
# else:
|
||||||
|
# return uri, 'Error extracting url'
|
||||||
|
|
||||||
return uri, r.code
|
return uri, r.code
|
||||||
|
|
||||||
|
|||||||
@@ -468,4 +468,4 @@ def verify_directories_created():
|
|||||||
|
|
||||||
|
|
||||||
def get_online_server_thumb(server):
|
def get_online_server_thumb(server):
|
||||||
return "https://raw.github.com/kodiondemand/media/master/resources/servers/" + server.lower() + '.png'
|
return "https://raw.github.com/kodiondemand/media/master/resources/servers/" + server.lower().replace('_server','') + '.png'
|
||||||
@@ -450,14 +450,15 @@ def play_from_library(item):
|
|||||||
import xbmcgui, xbmcplugin, xbmc
|
import xbmcgui, xbmcplugin, xbmc
|
||||||
from time import sleep
|
from time import sleep
|
||||||
|
|
||||||
|
# logger.debug("item: \n" + item.tostring('\n'))
|
||||||
|
platformtools.prevent_busy(item)
|
||||||
|
|
||||||
itemlist=[]
|
itemlist=[]
|
||||||
item.fromLibrary = True
|
item.fromLibrary = True
|
||||||
item.window = True
|
item.window = True
|
||||||
logger.debug()
|
logger.debug()
|
||||||
# logger.debug("item: \n" + item.tostring('\n'))
|
|
||||||
platformtools.prevent_busy(item)
|
|
||||||
|
|
||||||
# Modify the action (currently the video library needs "findvideos" since this is where the sources are searched
|
# Modify the action (currently the video library needs "findvideos" since this is where the sources are searched
|
||||||
item.action = "findvideos"
|
item.action = "findvideos"
|
||||||
|
|
||||||
window_type = config.get_setting("window_type", "videolibrary")
|
window_type = config.get_setting("window_type", "videolibrary")
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ def dialog_yesno(heading, message, nolabel=config.get_localized_string(70170), y
|
|||||||
dialog = xbmcgui.Dialog()
|
dialog = xbmcgui.Dialog()
|
||||||
# customlabel only work on kodi 19
|
# customlabel only work on kodi 19
|
||||||
if PY3 and customlabel:
|
if PY3 and customlabel:
|
||||||
return dialog.yesno(heading, message, customlabel, nolabel=nolabel, yeslabel=yeslabel, autoclose=autoclose)
|
return dialog.yesnocustom(heading, message, customlabel=customlabel, nolabel=nolabel, yeslabel=yeslabel, autoclose=autoclose)
|
||||||
else:
|
else:
|
||||||
return dialog.yesno(heading, message, nolabel=nolabel, yeslabel=yeslabel, autoclose=autoclose)
|
return dialog.yesno(heading, message, nolabel=nolabel, yeslabel=yeslabel, autoclose=autoclose)
|
||||||
|
|
||||||
@@ -1433,6 +1433,9 @@ def prevent_busy(item):
|
|||||||
if not item.autoplay and not item.window:
|
if not item.autoplay and not item.window:
|
||||||
if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))
|
if item.globalsearch: xbmc.Player().play(os.path.join(config.get_runtime_path(), "resources", "kod.mp4"))
|
||||||
else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
|
else: xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, xbmcgui.ListItem(path=os.path.join(config.get_runtime_path(), "resources", "kod.mp4")))
|
||||||
xbmc.sleep(500)
|
xbmc.sleep(100)
|
||||||
xbmc.Player().stop()
|
xbmc.Player().stop()
|
||||||
xbmc.sleep(500)
|
# xbmc.executebuiltin('Action(Stop)')
|
||||||
|
# xbmc.sleep(500)
|
||||||
|
# xbmc.Player().stop()
|
||||||
|
# xbmc.sleep(500)
|
||||||
@@ -402,24 +402,17 @@ class SettingsWindow(xbmcgui.WindowXMLDialog):
|
|||||||
label=c["label"], font=self.font, textColor=c["color"],
|
label=c["label"], font=self.font, textColor=c["color"],
|
||||||
focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
|
focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
|
||||||
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'))
|
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'))
|
||||||
elif xbmcgui.__version__ in ["3.0", "3.0.0"]:
|
|
||||||
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20,
|
|
||||||
self.height_control, label=c["label"], font=self.font,
|
|
||||||
textColor=c["color"],
|
|
||||||
focusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
|
|
||||||
noFocusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
|
|
||||||
focusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'),
|
|
||||||
noFocusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'))
|
|
||||||
else:
|
else:
|
||||||
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20,
|
control = xbmcgui.ControlRadioButton(0, -100, self.controls_width + 20,
|
||||||
self.height_control, label=c["label"], font=self.font,
|
self.height_control, label=c["label"], font=self.font,
|
||||||
textColor=c["color"],
|
textColor=c["color"],
|
||||||
focusTexture='',
|
focusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'),
|
||||||
noFocusTexture='',
|
noFocusTexture=os.path.join(self.mediapath, 'Controls', 'MenuItemNF.png'),
|
||||||
focusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
|
focusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
|
||||||
noFocusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
|
noFocusOnTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-focus.png'),
|
||||||
focusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'),
|
focusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'),
|
||||||
noFocusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'))
|
noFocusOffTexture=os.path.join(self.mediapath, 'Controls', 'radiobutton-nofocus.png'))
|
||||||
|
|
||||||
image = xbmcgui.ControlImage(0, -100, self.controls_width + 10, self.height_control, os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'))
|
image = xbmcgui.ControlImage(0, -100, self.controls_width + 10, self.height_control, os.path.join(self.mediapath, 'Controls', 'MenuItemFO.png'))
|
||||||
self.addControl(image)
|
self.addControl(image)
|
||||||
self.addControl(control)
|
self.addControl(control)
|
||||||
|
|||||||
@@ -44,9 +44,9 @@
|
|||||||
<!-- CLOSE BUTTON -->
|
<!-- CLOSE BUTTON -->
|
||||||
<control type="button" id="10003">
|
<control type="button" id="10003">
|
||||||
<right>30</right>
|
<right>30</right>
|
||||||
<top>25</top>
|
<top>20</top>
|
||||||
<width>30</width>
|
<width>40</width>
|
||||||
<height>30</height>
|
<height>40</height>
|
||||||
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>
|
<texturefocus colordiffuse="FFFFFFFF">close.png</texturefocus>
|
||||||
<texturenofocus colordiffuse="55FFFFFF">close.png</texturenofocus>
|
<texturenofocus colordiffuse="55FFFFFF">close.png</texturenofocus>
|
||||||
</control>
|
</control>
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
{
|
|
||||||
"active": true,
|
|
||||||
"find_videos": {
|
|
||||||
"ignore_urls": [],
|
|
||||||
"patterns": [
|
|
||||||
{
|
|
||||||
"pattern": "https://streamingcommunity.net/[^/]+/([A-Za-z0-9]+)",
|
|
||||||
"url": "https://streamingcommunity.net/watch/\\1"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"free": true,
|
|
||||||
"id":"streamingcommunity_server",
|
|
||||||
"name": "StreamingCommunity",
|
|
||||||
"settings": [
|
|
||||||
{
|
|
||||||
"default": false,
|
|
||||||
"enabled": true,
|
|
||||||
"id": "black_list",
|
|
||||||
"label": "@70708",
|
|
||||||
"type": "bool",
|
|
||||||
"visible": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"default": 0,
|
|
||||||
"enabled": true,
|
|
||||||
"id": "favorites_servers_list",
|
|
||||||
"label": "@60655",
|
|
||||||
"lvalues": [
|
|
||||||
"No",
|
|
||||||
"1",
|
|
||||||
"2",
|
|
||||||
"3",
|
|
||||||
"4",
|
|
||||||
"5"
|
|
||||||
],
|
|
||||||
"type": "list",
|
|
||||||
"visible": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
import requests, sys
|
|
||||||
from core import httptools, support
|
|
||||||
from platformcode import config, logger
|
|
||||||
|
|
||||||
if sys.version_info[0] >= 3: from concurrent import futures
|
|
||||||
else: from concurrent_py2 import futures
|
|
||||||
|
|
||||||
headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14',
|
|
||||||
'content-type': 'application/json;charset=UTF-8',
|
|
||||||
'Referer': 'https://streamingcommunity.net'}
|
|
||||||
|
|
||||||
def test_video_exists(page_url):
|
|
||||||
global data
|
|
||||||
logger.debug('page url=', page_url)
|
|
||||||
response = httptools.downloadpage(page_url, headers=headers)
|
|
||||||
|
|
||||||
if response.code == 404:
|
|
||||||
return False, config.get_localized_string(70449) % 'StreamingCommunity'
|
|
||||||
else:
|
|
||||||
data = response.data
|
|
||||||
return True, ""
|
|
||||||
|
|
||||||
|
|
||||||
def get_video_url(page_url, premium=False, user="", password="", video_password=""):
|
|
||||||
logger.debug("url=" + page_url)
|
|
||||||
video_urls = []
|
|
||||||
url = support.match(data.replace('"','"').replace('\\',''), patron=r'video_url"\s*:\s*"([^"]+)"').match
|
|
||||||
def videourls(res):
|
|
||||||
newurl = '{}/{}'.format(url, res)
|
|
||||||
if requests.head(newurl, headers=headers).status_code == 200:
|
|
||||||
video_urls.append(["m3u8 {} [StreamingCommunity]".format(res), newurl])
|
|
||||||
|
|
||||||
with futures.ThreadPoolExecutor() as executor:
|
|
||||||
for res in ['480p', '720p', '1080p']:
|
|
||||||
executor.submit(videourls, res)
|
|
||||||
if not video_urls: video_urls = [["m3u8 [StreamingCommunity]", url]]
|
|
||||||
else: video_urls.sort(key=lambda url: int(support.match(url[0], patron=r'(\d+)p').match))
|
|
||||||
return video_urls
|
|
||||||
@@ -344,7 +344,7 @@ class SearchWindow(xbmcgui.WindowXML):
|
|||||||
if item.server:
|
if item.server:
|
||||||
color = scrapertools.find_single_match(item.alive, r'(FF[^\]]+)')
|
color = scrapertools.find_single_match(item.alive, r'(FF[^\]]+)')
|
||||||
it.setProperties({'channel': channeltools.get_channel_parameters(item.channel).get('title', ''),
|
it.setProperties({'channel': channeltools.get_channel_parameters(item.channel).get('title', ''),
|
||||||
'thumb': "https://raw.githubusercontent.com/kodiondemand/media/master/resources/servers/%s.png" % item.server.lower(),
|
'thumb': config.get_online_server_thumb(item.server),
|
||||||
'servername': servertools.get_server_parameters(item.server.lower()).get('name', item.server),
|
'servername': servertools.get_server_parameters(item.server.lower()).get('name', item.server),
|
||||||
'color': color if color else 'FF0082C2'})
|
'color': color if color else 'FF0082C2'})
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -349,7 +349,7 @@ def cb_servers_favorites(server_names, dict_values):
|
|||||||
dict_favorites[dict_name[server_parameters['name']]] = server
|
dict_favorites[dict_name[server_parameters['name']]] = server
|
||||||
config.set_setting("favorites_servers_list", dict_name[server_parameters['name']], server=server)
|
config.set_setting("favorites_servers_list", dict_name[server_parameters['name']], server=server)
|
||||||
else:
|
else:
|
||||||
config.set_setting("favorites_servers_list", 0, server=server)
|
config.set_setting("favorites_servers_list", 999, server=server)
|
||||||
progreso.update(old_div((i * 100), n), config.get_localized_string(60559) % server_parameters['name'])
|
progreso.update(old_div((i * 100), n), config.get_localized_string(60559) % server_parameters['name'])
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
|
|||||||
+13
-5
@@ -62,6 +62,7 @@ validUrlRegex = re.compile(
|
|||||||
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
|
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
|
||||||
|
|
||||||
chBlackList = ['url', 'mediasetplay']
|
chBlackList = ['url', 'mediasetplay']
|
||||||
|
srvBalcklist = ['mega', 'hdmario', 'torrent', 'youtube']
|
||||||
chNumRis = {
|
chNumRis = {
|
||||||
'altadefinizione01': {
|
'altadefinizione01': {
|
||||||
'Film': 20
|
'Film': 20
|
||||||
@@ -141,8 +142,7 @@ chNumRis = {
|
|||||||
servers = []
|
servers = []
|
||||||
channels = []
|
channels = []
|
||||||
|
|
||||||
# channel_list = channelselector.filterchannels("all") if 'KOD_TST_CH' not in os.environ else [Item(channel=os.environ['KOD_TST_CH'], action="mainlist")]
|
channel_list = channelselector.filterchannels("all") if 'KOD_TST_CH' not in os.environ else [Item(channel=os.environ['KOD_TST_CH'], action="mainlist")]
|
||||||
channel_list = [Item(channel='tantifilm', action="mainlist")]
|
|
||||||
logger.info([c.channel for c in channel_list])
|
logger.info([c.channel for c in channel_list])
|
||||||
ret = []
|
ret = []
|
||||||
|
|
||||||
@@ -198,8 +198,10 @@ for chItem in channel_list:
|
|||||||
if itPlay:
|
if itPlay:
|
||||||
tmp.append(itPlay[0])
|
tmp.append(itPlay[0])
|
||||||
serversFound[it.title] = tmp
|
serversFound[it.title] = tmp
|
||||||
servers.extend(
|
for srv in serversFound[it.title]:
|
||||||
{'name': srv.server.lower(), 'server': srv} for srv in serversFound[it.title] if srv.server)
|
if srv.server:
|
||||||
|
srv.foundOn = ch + ' --> ' + it.title + ' --> ' + resIt.title
|
||||||
|
servers.append({'name': srv.server.lower(), 'server': srv})
|
||||||
break
|
break
|
||||||
except:
|
except:
|
||||||
import traceback
|
import traceback
|
||||||
@@ -304,6 +306,9 @@ class GenericServerTest(unittest.TestCase):
|
|||||||
module = __import__('servers.%s' % self.name, fromlist=["servers.%s" % self.name])
|
module = __import__('servers.%s' % self.name, fromlist=["servers.%s" % self.name])
|
||||||
page_url = self.server.url
|
page_url = self.server.url
|
||||||
print('testing ' + page_url)
|
print('testing ' + page_url)
|
||||||
|
print('Found on ' + self.server.foundOn)
|
||||||
|
print()
|
||||||
|
|
||||||
self.assert_(hasattr(module, 'test_video_exists'), self.name + ' has no test_video_exists')
|
self.assert_(hasattr(module, 'test_video_exists'), self.name + ' has no test_video_exists')
|
||||||
|
|
||||||
if module.test_video_exists(page_url)[0]:
|
if module.test_video_exists(page_url)[0]:
|
||||||
@@ -327,7 +332,10 @@ class GenericServerTest(unittest.TestCase):
|
|||||||
print(headers)
|
print(headers)
|
||||||
if 'magnet:?' in directUrl: # check of magnet links not supported
|
if 'magnet:?' in directUrl: # check of magnet links not supported
|
||||||
continue
|
continue
|
||||||
page = downloadpage(directUrl, headers=headers, only_headers=True, use_requests=True, verify=False)
|
if directUrl.split('.')[-1] == 'm3u8': # m3u8 is a text file and HEAD may be forbidden
|
||||||
|
page = downloadpage(directUrl, headers=headers, use_requests=True, verify=False)
|
||||||
|
else:
|
||||||
|
page = downloadpage(directUrl, headers=headers, only_headers=True, use_requests=True, verify=False)
|
||||||
self.assertTrue(page.success, self.name + ' scraper returned an invalid link')
|
self.assertTrue(page.success, self.name + ' scraper returned an invalid link')
|
||||||
self.assertLess(page.code, 400, self.name + ' scraper returned a ' + str(page.code) + ' link')
|
self.assertLess(page.code, 400, self.name + ' scraper returned a ' + str(page.code) + ' link')
|
||||||
contentType = page.headers['Content-Type']
|
contentType = page.headers['Content-Type']
|
||||||
|
|||||||
Reference in New Issue
Block a user