From cdc5441e869572f15d15bfd5ba55eb20f17db2a6 Mon Sep 17 00:00:00 2001 From: Pointybirds Date: Sat, 10 Oct 2020 13:26:17 +1000 Subject: [PATCH] Updated API URL for livestreams --- resources/lib/comm.py | 4 ++-- resources/lib/config.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/lib/comm.py b/resources/lib/comm.py index 85d8fea..54e5961 100644 --- a/resources/lib/comm.py +++ b/resources/lib/comm.py @@ -22,7 +22,7 @@ def fetch_url(url, headers=None): def get_matches(): video_list = [] - data = fetch_url(config.MATCHES_URL) + data = fetch_url(config.LIVETV_URL) try: video_data = json.loads(data) except ValueError: @@ -30,7 +30,7 @@ def get_matches(): raise Exception('Failed to retrieve video data. Service may be ' 'currently unavailable.') - for match in video_data['matchList']['matches']: + for match in video_data['liveMatches']: live_streams = match.get('liveStreams') if not live_streams: live_stream = match.get('liveStream') diff --git a/resources/lib/config.py b/resources/lib/config.py index c1b75bc..55b337f 100644 --- a/resources/lib/config.py +++ b/resources/lib/config.py @@ -5,6 +5,8 @@ MATCHES_URL = 'https://apinew.cricket.com.au/matches?inProgressLimit=15&completedLimit=0&upcomingLimit=0&format=json' +LIVETV_URL = 'https://apinew.cricket.com.au/matches/livetv' + MATCH_STREAM_URL = 'https://edge.api.brightcove.com/playback/v1/accounts/807051129001/videos/' BRIGHTCOVE_PK = 'BCpkADawqM17uKWqEHlBulux385QZ_BoC6x04LRDmsykNRb4uwwRJ8x38iHNk-7kxEqJUu3qZGMFCiKA4d8SeUB0c40Z46CutsbR219abTqUHi82DqCZMUJo36s'