Skip to content

Commit

Permalink
fix: sometimes video_data doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
itsHenry35 committed Jan 21, 2025
1 parent 1f15fa2 commit 35078a6
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions gui/download2.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ def get_download_url(lecture, user_id, access_token):
url = 'https://classroom-api-online.saasp.vdyoo.com/playback/v1/video/init'
response = requests.get(url, headers=headers)
video_data = response.json()
for url in video_data["videoUrls"]:
if ".mp4" in url:
video_url = url
success = True
break
if success is False:
error_message = video_data['message']
if "videoUrls" not in video_data:
success = False
else:
for url in video_data["videoUrls"]:
if ".mp4" in url:
video_url = url
success = True
break
if success is False:
error_message = video_data['message']
if live_type == 'RECORD_MODE':
url = 'https://classroom-api-online.saasp.vdyoo.com/classroom-ai/record/v1/resources'
response = requests.get(url, headers=headers)
Expand Down

0 comments on commit 35078a6

Please sign in to comment.