test
This commit is contained in:
parent
3151f9fcdc
commit
c0c95f3909
@ -18,14 +18,17 @@ class OriginChannels():
|
||||
api_json = self.fhdhr.web.session.get(channel_json_url).json()
|
||||
|
||||
for channel_dict in api_json['channel']['item']:
|
||||
clean_station_item = {
|
||||
"name": channel_dict["title"],
|
||||
"callsign": channel_dict["callsign"],
|
||||
"number": str(channel_dict["number"]),
|
||||
"id": str(channel_dict["guid"]["value"]),
|
||||
"thumbnail": "https://image.xumo.com/v1/channels/channel/%s/512x512.png?type=color_onBlack" % str(channel_dict["guid"]["value"])
|
||||
}
|
||||
channel_list.append(clean_station_item)
|
||||
if "is_simulcast" in list(channel_dict["properties"].keys()):
|
||||
if channel_dict["properties"]["is_simulcast"]:
|
||||
|
||||
clean_station_item = {
|
||||
"name": channel_dict["title"],
|
||||
"callsign": channel_dict["callsign"],
|
||||
"number": str(channel_dict["number"]),
|
||||
"id": str(channel_dict["guid"]["value"]),
|
||||
"thumbnail": "https://image.xumo.com/v1/channels/channel/%s/512x512.png?type=color_onBlack" % str(channel_dict["guid"]["value"])
|
||||
}
|
||||
channel_list.append(clean_station_item)
|
||||
|
||||
return channel_list
|
||||
|
||||
@ -63,3 +66,55 @@ class OriginChannels():
|
||||
return bestStream.absolute_uri
|
||||
else:
|
||||
return m3u8_url
|
||||
|
||||
|
||||
"""
|
||||
{
|
||||
"title": "GameSpot",
|
||||
"description": "GameSpot is the world's leading source for gaming.",
|
||||
"guid": {
|
||||
"value": "9999216",
|
||||
"isPermaLink": false
|
||||
},
|
||||
"number": 300,
|
||||
"callsign": "XGAME",
|
||||
"genre": [
|
||||
{
|
||||
"value": "Entertainment",
|
||||
"genreId": 1
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"hybrid_type": "popular",
|
||||
"is_live": "true",
|
||||
"brand_color": "rgba(238,64,53,1)",
|
||||
"has_vod": "true"
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
"title": "CBS News",
|
||||
"description": "",
|
||||
"guid": {
|
||||
"value": "9999158",
|
||||
"isPermaLink": false
|
||||
},
|
||||
"number": 125,
|
||||
"callsign": "XCBSNWS",
|
||||
"genre": [
|
||||
{
|
||||
"value": "News",
|
||||
"genreId": 13
|
||||
}
|
||||
],
|
||||
"properties": {
|
||||
"simulcast_only": "true",
|
||||
"hybrid_type": "promoted",
|
||||
"is_live": "true",
|
||||
"brand_color": "rgba(48,129,180,1)",
|
||||
"has_vod": "false",
|
||||
"is_simulcast": "true",
|
||||
"has_discontinuity": "true"
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user