def entries( self): json = http.fetchJSON( SRF.IL + "/tv/assetGroup/editorialPlayerAlphabetical.json") shows = json["AssetGroups"]["Show"] for show in shows: title = show["title"] vid = show["id"] image = SRF.extractImage( show) yield( MenuEntry( MenuEntry.FOLDER, title, (menu2key( MenuAssetSet), { "id": vid }), image))
def entries( self): json = http.fetchJSON( SRF.IL + "/video/editorialPlayerPicks.json") videos = json["Videos"]["Video"] for video in videos: metadata = video["AssetMetadatas"]["AssetMetadata"][0] myid = metadata["id"] title = metadata["title"] image = SRF.extractImage( video) yield( MenuEntry( MenuEntry.VIDEO, title, myid, image))
def videoForBroadcast( id): json = http.fetchJSON( SRF.IL + "/video/play/" + id + ".json") playlists = json["Video"]["Playlists"]["Playlist"] for playlist in playlists: if playlist["@protocol"] == "HTTP-HLS": return getUserStream( playlist["url"]) elif playlist["@protocol"] == "RTMP": for quali in { "HQ", "MQ", "LQ"}: for url in playlist["url"]: if url["@quality"] == quali: return url["text"] return None;
def entries( self): json = http.fetchJSON( SRF.IL + "/assetSet/listByAssetGroup/" + self.id + ".json") assetset = json["AssetSets"]["AssetSet"] for asset in assetset: if not "Video" in asset["Assets"]: continue video = asset["Assets"]["Video"][0] vid = video["id"] title = asset["title"] image = SRF.extractImage( video) metadata = video["AssetMetadatas"]["AssetMetadata"][0] info = { "title": metadata["title"] } if "description" in metadata: info["plot"] = metadata["description"] yield( MenuEntry( MenuEntry.VIDEO, title, vid, image, info=info))
def entries( self): json = http.fetchJSON( SRF.IL + "/video/episodesByDate.json", { "day": self.day}) videos = json["Videos"]["Video"] for video in videos: id = video["id"] assetSet = video["AssetSet"] metadata = video["AssetMetadatas"]["AssetMetadata"][0] time = assetSet["publishedDate"][11:16] title = "%s - %s" % (time, assetSet["Show"]["title"]) image = SRF.extractImage( video) info = { "title": metadata["title"] } if "description" in metadata: info["plot"] = metadata["description"] yield( MenuEntry( MenuEntry.VIDEO, title, id, image, info=info))