KoD 1.6.2
- Migliorata funzione cerca trailer\n- Episodio successivo: è ora disponibile la modalità playlist (puoi usare il tasto riproduci successivo di kodi)\n- aggiunto www.accuradio.com\n- migliorie varie\n
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"id": "accuradio",
|
||||
"name": "AccuRadio",
|
||||
"active": true,
|
||||
"language": ["*"],
|
||||
"thumbnail": "accuradio.png",
|
||||
"banner": "accuradio.png",
|
||||
"categories": ["music"],
|
||||
"not_active":["include_in_global_search"],
|
||||
"settings" :[]
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per accuradio
|
||||
# ------------------------------------------------------------
|
||||
|
||||
import random
|
||||
from core import httptools, support
|
||||
from platformcode import logger
|
||||
|
||||
host = 'https://www.accuradio.com'
|
||||
api_url = host + '/c/m/json/{}/'
|
||||
headers = [['Referer', host]]
|
||||
|
||||
|
||||
|
||||
def mainlist(item):
|
||||
itemlist = []
|
||||
item.action = 'peliculas'
|
||||
js = httptools.downloadpage(api_url.format('brands')).json
|
||||
for it in js.get('features',[]):
|
||||
itemlist.append(
|
||||
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
||||
title=support.typo(it['name'],'italic') + support.typo(it.get('channels',''),'_ [] color kod')
|
||||
))
|
||||
for it in js.get('brands',[]):
|
||||
itemlist.append(
|
||||
item.clone(url= '{}/{}'.format(host,it.get('canonical_url','')),
|
||||
title=support.typo(it['name'],'bullet bold') + support.typo(it.get('channels',''),'_ [] color kod')
|
||||
))
|
||||
|
||||
itemlist.append(item.clone(title=support.typo('Cerca...', 'bold color kod'), action='search', thumbnail=support.thumb('search')))
|
||||
support.channel_config(item, itemlist)
|
||||
return itemlist
|
||||
|
||||
|
||||
@support.scrape
|
||||
def peliculas(item):
|
||||
action = 'playradio'
|
||||
patron = r'data-id="(?P<id>[^"]+)"\s*data-oldid="(?P<oldid>[^"]+)".*?data-name="(?P<title>[^"]+)(?:[^>]+>){5}<img class="[^"]+"\s*src="(?P<thumb>[^"]+)(?:[^>]+>){6}\s*(?P<plot>[^<]+)'
|
||||
return locals()
|
||||
|
||||
|
||||
def playradio(item):
|
||||
import xbmcgui, xbmc
|
||||
items = httptools.downloadpage('{}/playlist/json/{}/?ando={}&rand={}'.format(host, item.id, item.oldid, random.random())).json
|
||||
playlist = xbmc.PlayList(xbmc.PLAYLIST_MUSIC)
|
||||
playlist.clear()
|
||||
for i in items:
|
||||
if 'id' in i:
|
||||
url = i['primary'] + i['fn'] + '.m4a'
|
||||
title = i['title']
|
||||
artist = i['track_artist']
|
||||
album = i['album']['title']
|
||||
year = i['album']['year']
|
||||
thumb = 'https://www.accuradio.com/static/images/covers300' + i['album']['cdcover']
|
||||
duration = i.get('duration',0)
|
||||
info = {'duration':duration,
|
||||
'album':album,
|
||||
'artist':artist,
|
||||
'title':title,
|
||||
'year':year,
|
||||
'mediatype':'music'}
|
||||
item = xbmcgui.ListItem(title, path=url)
|
||||
item.setArt({'thumb':thumb, 'poster':thumb, 'icon':thumb})
|
||||
item.setInfo('music',info)
|
||||
playlist.add(url, item)
|
||||
xbmc.Player().play(playlist)
|
||||
|
||||
|
||||
def search(item, text):
|
||||
support.info(text)
|
||||
item.url = host + '/search/' + text
|
||||
itemlist = []
|
||||
try:
|
||||
data = support.match(item.url).data
|
||||
artists = support.match(data, patronBlock=r'artistResults(.*?)</ul', patron=r'href="(?P<url>[^"]+)"\s*>(?P<title>[^<]+)').matches
|
||||
if artists:
|
||||
for url, artist in artists:
|
||||
itemlist.append(item.clone(title=support.typo(artist,'bullet bold'), thumbnail=support.thumb('music'), url=host+url, action='peliculas'))
|
||||
item.data = data
|
||||
itemlist += peliculas(item)
|
||||
# Continua la ricerca in caso di errore
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
logger.error("%s" % line)
|
||||
return itemlist
|
||||
@@ -77,8 +77,8 @@ def peliculas(item):
|
||||
item.title += support.typo(item.lang2, '_ [] color kod')
|
||||
if item.args == 'update':
|
||||
item.title = item.title.replace('-', ' ')
|
||||
if item.args == 'search':
|
||||
item.contentType = 'tvshow' if 'serie-' in item.url else 'movie'
|
||||
# if item.args == 'search':
|
||||
# item.contentType = 'tvshow' if 'serie-' in item.url else 'movie'
|
||||
|
||||
return item
|
||||
|
||||
|
||||
@@ -186,9 +186,10 @@ def play(item):
|
||||
if item.contentType == 'episode': data = session.get('{}/playback/v2/videoPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
||||
else: data = session.get('{}/playback/v2/channelPlaybackInfo/{}?usePreAuth=true'.format(api, item.id), headers=headers).json().get('data',{}).get('attributes',{})
|
||||
if data.get('protection', {}).get('drm_enabled',True):
|
||||
url = data['streaming']['dash']['url']
|
||||
item.url = data['streaming']['dash']['url']
|
||||
item.drm = 'com.widevine.alpha'
|
||||
item.license = data['protection']['schemes']['widevine']['licenseUrl'] + '|PreAuthorization=' + data['protection']['drmToken'] + '|R{SSM}|'
|
||||
else:
|
||||
url = data['streaming']['hls']['url']
|
||||
return support.servertools.find_video_items(item, data=url)
|
||||
item.url = data['streaming']['hls']['url']
|
||||
item.manifest = 'hls'
|
||||
return [item]
|
||||
@@ -115,7 +115,6 @@ def select(item):
|
||||
def search(item, texto):
|
||||
support.info()
|
||||
item.url = host + "/?s=" + texto
|
||||
item.contentType = 'episode'
|
||||
item.args = 'search'
|
||||
try:
|
||||
return peliculas(item)
|
||||
|
||||
@@ -157,12 +157,17 @@ def episodios(item):
|
||||
|
||||
def findvideos(item):
|
||||
logger.debug()
|
||||
return support.server(item, item.url, Download=False)
|
||||
return support.server(item, itemlist=[item.clone(title='Paramount', server='directo', action='play')], Download=False)
|
||||
|
||||
|
||||
def play(item):
|
||||
logger.debug()
|
||||
item.server = 'paramount_server'
|
||||
item.manifest = 'hls'
|
||||
mgid = support.match(item.url, patron=r'uri":"([^"]+)"').match
|
||||
url = 'https://media.mtvnservices.com/pmt/e1/access/index.html?uri=' + mgid + '&configtype=edge&ref=' + item.url
|
||||
ID, rootUrl = support.match(url, patron=[r'"id":"([^"]+)",',r'brightcove_mediagenRootURL":"([^"]+)"']).matches
|
||||
item.url = jsontools.load(support.match(rootUrl.replace('&device={device}','').format(uri = ID)).data)['package']['video']['item'][0]['rendition'][0]['src']
|
||||
|
||||
if item.livefilter:
|
||||
d = liveDict()[item.livefilter]
|
||||
item = item.clone(title=support.typo(item.livefilter, 'bold'), fulltitle=item.livefilter, url=d['url'], plot=d['plot'], action='play', forcethumb=True, no_return=True)
|
||||
|
||||
+8
-3
@@ -1,9 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# ------------------------------------------------------------
|
||||
# Canale per altadefinizione01
|
||||
# Canale per tunein
|
||||
# ------------------------------------------------------------
|
||||
|
||||
from core import support
|
||||
from core import scrapertools, support
|
||||
from platformcode import logger
|
||||
|
||||
host = 'http://api.radiotime.com'
|
||||
headers = [['Referer', host]]
|
||||
@@ -32,6 +33,7 @@ def radio(item):
|
||||
data = support.match(item, patron= r'text="(?P<title>[^\("]+)(?:\((?P<location>[^\)]+)\))?" URL="(?P<url>[^"]+)" bitrate="(?P<quality>[^"]+)" reliability="[^"]+" guide_id="[^"]+" subtext="(?P<song>[^"]+)" genre_id="[^"]+" formats="(?P<type>[^"]+)" (?:playing="[^"]+" )?(?:playing_image="[^"]+" )?(?:show_id="[^"]+" )?(?:item="[^"]+" )?image="(?P<thumb>[^"]+)"')
|
||||
if data.matches:
|
||||
for title, location, url, quality, song, type, thumbnail in data.matches:
|
||||
title = scrapertools.unescape(title)
|
||||
itemlist.append(
|
||||
item.clone(title = support.typo(title, 'bold') + support.typo(quality + ' kbps','_ [] bold color kod'),
|
||||
thumbnail = thumbnail,
|
||||
@@ -43,6 +45,7 @@ def radio(item):
|
||||
matches = support.match(data.data, patron= r'text="(?P<title>[^\("]+)(?:\([^\)]+\))?" URL="(?P<url>[^"]+)" (?:guide_id="[^"]+" )?(?:stream_type="[^"]+" )?topic_duration="(?P<duration>[^"]+)" subtext="(?P<plot>[^"]+)" item="[^"]+" image="(?P<thumb>[^"]+)"').matches
|
||||
if matches:
|
||||
for title, url, duration, plot, thumbnail in matches:
|
||||
title = scrapertools.unescape(title)
|
||||
infoLabels={}
|
||||
infoLabels['duration'] = duration
|
||||
itemlist.append(
|
||||
@@ -56,12 +59,14 @@ def radio(item):
|
||||
else:
|
||||
matches = support.match(data.data, patron= r'text="(?P<title>[^"]+)" URL="(?P<url>[^"]+)"').matches
|
||||
for title, url in matches:
|
||||
title = scrapertools.unescape(title)
|
||||
itemlist.append(
|
||||
item.clone(channel = item.channel,
|
||||
title = support.typo(title, 'bold'),
|
||||
thumbnail = item.thumbnail,
|
||||
url = url,
|
||||
action = 'radio'))
|
||||
support.nextPage(itemlist, item, data.data, r'(?P<url>[^"]+)" key="nextStations')
|
||||
return itemlist
|
||||
|
||||
|
||||
@@ -86,5 +91,5 @@ def search(item, text):
|
||||
except:
|
||||
import sys
|
||||
for line in sys.exc_info():
|
||||
support.logger.error("%s" % line)
|
||||
logger.error("%s" % line)
|
||||
return []
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ except:
|
||||
conn_id = ''
|
||||
|
||||
|
||||
main_host = host + '/vvvvid/ondemand/'
|
||||
main_host = host + '/vvvvid/ondemand/'
|
||||
|
||||
|
||||
@support.menu
|
||||
|
||||
Reference in New Issue
Block a user