Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions resources/lib/comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ 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:
utils.log('Failed to load JSON. Data is: {0}'.format(data))
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')
Expand Down
2 changes: 2 additions & 0 deletions resources/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'