def listVideos(): list = [] response = _utils.getUrl('http://clipsapi.sportschau.de/ARDX/36640243euro2016/3.0/channels/' + params['shortCode'] + '/publications.json') j = json.loads(response) for item in j: dict = {} dict['id'] = item['id'] dict['url'] = 'http://clipsapi.sportschau.de/ARDX/36640243euro2016/3.0/channels/' + params['shortCode'] + '/publications/' + item['id'] + '.json' if item['hidden']: print 'TODO' else: try: if 'title_translation_de' in item['metadata']: dict['name'] = item['metadata']['title_translation_de'] else: dict['name'] = item['metadata']['title'] dict['name'] += ' (' + str(item['videoAssetsCount']) + ')' dict['thumb'] = _fetchthumb(item) dict['fanart'] = fanart if item['videoAssetsCount'] == 1: dict['mode'] = 'playSingle' dict['type'] = 'video' else: dict['mode'] = 'listPersp' dict['type'] = 'dir' list.append(dict) except: xbmc.log(str(item)) libMediathek.addEntries(list)
def main(): a = {} list = [] response = _utils.getUrl(channels) j = json.loads(response) for item in j: if 'description' in item['metadata']: dict = {} dict['name'] = item['metadata']['description'] dict['shortCode'] = item['shortCode'] dict['thumb'] = icon dict['fanart'] = fanart dict['mode'] = 'listVideos' dict['type'] = 'dir' a[dict['shortCode']] = item['metadata']['description'] list.append(dict) list = sorted(list, key=itemgetter('name')) a['name'] = 'Ganze Spiele Live/Aufzeichnung' a['mode'] = 'listFull' a['type'] = 'dir' a['url'] = feed a['fanart'] = fanart a['thumb'] = icon libMediathek.addEntry(a) libMediathek.addEntries(list)
def listVideos(): list = [] response = _utils.getUrl(params['url']) j = json.loads(response) #xbmc.log(str(j)) for k in j: if k != 'myviewfilter': key = k for data in j[key]['data']: dict = {} dict['url'] = baseUrl + data["url"] dict['name'] = data["title"] + ' (' + str(data['video_count']) + ')' dict['nameclean'] = data["title"] dict['myview_id'] = data["myview_id"] dict['thumb'] = data["thumbnails"][0]["url"] if data['video_count'] == 1: dict['plot'] = '1 Kameraperspektive' dict['type'] = 'video' dict['mode'] = 'play' else: dict['plot'] = str(data['video_count']) + 'Kameraperspektiven' dict['type'] = 'dir' dict['mode'] = 'listViews' list.append(dict) libMediathek.addEntries(list)
def libWdrSearch(): import libWdrHtmlParser keyboard = xbmc.Keyboard('', translation(31039)) keyboard.doModal() if keyboard.isConfirmed() and keyboard.getText(): search_string = urllib.quote_plus(keyboard.getText()) libMediathek.addEntries(libWdrHtmlParser.parse("http://www1.wdr.de/mediathek/video/suche/avsuche100~suche_parentId-videosuche100.html?pageNumber=1&sort=date&q="+search_string))
def libSwrSearch(): keyboard = xbmc.Keyboard('', translation(31039)) keyboard.doModal() if keyboard.isConfirmed() and keyboard.getText(): search_string = urllib.quote_plus(keyboard.getText()) url = 'http://swrmediathek.de/app-2/suche/' + search_string libMediathek.addEntries( libSwrParser.getList(url, 'video', 'libSwrPlay'))
def lib3satListMain(): list = [] list.append({'name':translation(31030), 'mode':'lib3satListNew'}) list.append({'name':translation(31031), 'mode':'lib3satListMV'}) list.append({'name':translation(31032), 'mode':'lib3satListLetters'}) list.append({'name':translation(31033), 'mode':'lib3satListDate'}) #list.append({'name':translation(31034), 'mode':'lib3satListRubrics', 'url':'http://www.zdf.de/ZDFmediathek/xmlservice/web/rubriken'}) #list.append({'name':translation(31035), 'mode':'lib3satListTopics', 'url':'http://www.zdf.de/ZDFmediathek/xmlservice/web/themen'}) list.append({'name':translation(31039), 'mode':'lib3satSearch'}) libMediathek.addEntries(list)
def libWdrListDateVideos(): from datetime import date, timedelta day = date.today() - timedelta(int(params['datum'])) ddmmyyyy = day.strftime('%d%m%Y') yyyymmdd = day.strftime('%Y-%m-%d') url = 'http://www1.wdr.de/mediathek/video/sendungverpasst/sendung-verpasst-100~_tag-'+ddmmyyyy+'_format-mp111_type-rss.feed' urlEpg = 'http://www.wdr.de/programmvorschau/ajax/alle/uebersicht/'+yyyymmdd+'/' xbmc.log(url) xbmc.log(urlEpg) import libWdrJsonParser import time #listEpg = libWdrJsonParser.parseEpg(urlEpg) listVideos = libWdrRssParser.parseFeed(url,'date') libMediathek.addEntries(listVideos) """
def listPersp(): list = [] response = _utils.getUrl(params['url']) j = json.loads(response) for asset in j['videoAssets']: dict = {} dict['name'] = perspAlias.get(asset['recorderShortCode'],asset['recorderShortCode']) dict['duration'] = asset['duration'] #dict['url'] = 'http://clipassets-i.sportschau.de/' + asset['renditions']['multibitrate'] + '.m3u8'#http://clipassets-p.sportschau.de/59D085D7C0F398439DA19A77FE4DA512/59D085D7C0F398439DA19A77FE4DA512.m3u8 dict['url'] = 'http://clipassets-p.sportschau.de/' + asset['renditions']['digital'] + '.mp4'#http://clipassets-p.sportschau.de/59D085D7C0F398439DA19A77FE4DA512/59D085D7C0F398439DA19A77FE4DA512.m3u8 dict['thumb'] = params['thumb'] dict['fanart'] = fanart dict['mode'] = 'play' dict['type'] = 'video' #todo thumb list.append(dict) libMediathek.addEntries(list)
def listFull(): list = [] response = _utils.getUrl(feed) j = json.loads(response) for match in j: dict = {} dict['name'] = params.get(str(match['matchID']),str(match['matchID'])) if match['VideoStreaming'][0]['Status'] == 'Live': dict['name'] = 'Live: ' + dict['name'] dict['matchID'] = match['matchID'] dict['thumb'] = icon dict['fanart'] = fanart dict['mode'] = 'listFullPersp' dict['type'] = 'dir' list.append(dict) libMediathek.addEntries(list)
def listViews(): list = [] response = _utils.getUrl(params['url']) cameras = re.compile('<div class="cameras">(.+?)</div>', re.DOTALL).findall(response)[0] perspectives = re.compile('<a(.+?)</a>', re.DOTALL).findall(cameras) for persp in perspectives: dict = {} #dict['name'] = re.compile('title="(.+?)"', re.DOTALL).findall(persp)[0] dict['perspective'] = re.compile('<span>(.+?)</span>', re.DOTALL).findall(persp)[0].replace('tv','TV') dict['name'] = 'Perspektive "'+ dict['perspective'] + '"' dict['url'] = baseUrl + re.compile('href="(.+?)"', re.DOTALL).findall(persp)[0] dict['thumb'] = params['thumb'] dict['mode'] = 'play' dict['type'] = 'video' dict['orgName'] = params['nameclean'] list.append(dict) libMediathek.addEntries(list)
def listFilter(): list = [] response = _utils.getUrl(feed) j = json.loads(response) for filter in j['myviewfilter']['data']: if filter['type'] == params['filtertype'] and filter['enabled']: dict = {} if filter['type'] == 'match': dict['name'] = filter['round_name'] + ': ' + filter['home_team']['name'] + ' - ' + filter['away_team']['name'] dict['plot'] = filter['round_name'] + '\n' + time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(filter['start'])) dict['url'] = baseFeed + filter['value'] elif filter['type'] == 'team' or filter['type'] == 'player': dict['name'] = filter['name'] elif filter['type'] == 'action': dict['name'] = filter['action_title'] dict['url'] = baseFeed + filter['value'] dict['type'] = 'dir' dict['mode'] = 'listVideos' list.append(dict) libMediathek.addEntries(list)
def listFullPersp(): list = [] response = _utils.getUrl(feed) j = json.loads(response) for match in j: if str(match['matchID']) == params['matchID']: j2 = match for persp in j2['VideoStreaming']: if persp['Description'] == 'lsf': dict = {} dict['name'] = 'Hauptperspektive - englischer Kommentator' dict['url'] = persp['Url'] dict['thumb'] = icon dict['fanart'] = fanart dict['mode'] = 'play' dict['type'] = 'video' list.append(dict) dict = {} if persp['Url'].endswith('filter=english)'): dict['name'] = 'Hauptperspektive - ohne Kommentator' dict['url'] = persp['Url'].replace(',filter=english','').replace('format=m3u8-aapl-v3','format=m3u8-aapl') dict['thumb'] = icon dict['fanart'] = fanart dict['mode'] = 'play' dict['type'] = 'video' list.append(dict) else: dict = {} dict['name'] = perspAlias.get(persp['Description'],persp['Description']) dict['url'] = persp['Url'] dict['thumb'] = icon dict['fanart'] = fanart dict['mode'] = 'play' dict['type'] = 'video' list.append(dict) list = sorted(list, key=itemgetter('name')) libMediathek.addEntries(list)
def libWdrListVideos(): libMediathek.addEntries(libWdrRssParser.parseVideos(params['url']))
def libWdrListFeed(): libMediathek.addEntries(libWdrRssParser.parseFeed(params['url']))
def libSwrListShows(): xbmc.log('listshows') libMediathek.addEntries(libSwrParser.parseShows(params['name']))
def libSwrListDir(): libMediathek.addEntries( libSwrParser.getList(params['url'], 'dir', 'libSwrListVideos'))
def xmlListPage(): libMediathek.addEntries(xmlservice.getXML(params['url']))
def libArdListVideos(): page = params.get('page','1') items = getVideosJson(params['url'],params.get('page','1'))#,page) libMediathek.addEntries(items,int(params.get('page','1')))
def libWdrListShows(): xbmc.log('listshows') libMediathek.addEntries(libWdrParser.parseShows(params['name']))
def lib3satListDateVideos(): from datetime import date, timedelta day = date.today() - timedelta(int(params['datum'])) ddmmyy = day.strftime('%d%m%y') url = 'http://www.3sat.de/mediathek/xmlservice/web/sendungVerpasst?startdate='+ddmmyy+'&enddate='+ddmmyy+'&maxLength=50' libMediathek.addEntries(xmlservice.getXML(url,type='date')[::-1])
def lib3satListShows(): letter = params['name'].replace('#','0%2D9') libMediathek.addEntries(xmlservice.getXML('http://www.3sat.de/mediathek/xmlservice/web/sendungenAbisZ?characterRangeEnd='+letter+'&detailLevel=2&characterRangeStart='+letter))
def lib3satListMV(): libMediathek.addEntries(xmlservice.getMostViewed(baseXml))
def libWdrListSearch(): import libWdrHtmlParser libMediathek.addEntries(libWdrHtmlParser.parse(params['url']))
def libSwrListDateVideos(): libMediathek.addEntries( libSwrParser.getDate(params['datum'], 'date', 'libSwrPlay'))
def libArdListDateVideos(): libMediathek.addEntries(getDate(params['url']))
def libArdListShows(): libMediathek.addEntries(getAZ(params['name'].replace('#','0-9')))
def lib3satListTopics():#not supported by the mediathek libMediathek.addEntries(xmlservice.getTopics(baseXml))
def lib3satSearch(): keyboard = xbmc.Keyboard('', translation(31039)) keyboard.doModal() if keyboard.isConfirmed() and keyboard.getText(): search_string = urllib.quote_plus(keyboard.getText()) libMediathek.addEntries(xmlservice.getXML("http://www.zdf.de/ZDFmediathek/xmlservice/web/detailsSuche?maxLength=50&types=Video&properties=HD%2CUntertitel%2CRSS&searchString="+search_string))
def lib3satListNew(): libMediathek.addEntries(xmlservice.getNew(baseXml))
def libSwrListVideos(): libMediathek.addEntries( libSwrParser.getList(params['url'], 'video', 'libSwrPlay'))