Skip to content

Commit

Permalink
feat: new url place support and support for "无回放"courses
Browse files Browse the repository at this point in the history
  • Loading branch information
itsHenry35 committed Feb 7, 2024
1 parent 6b0e3ec commit 149f762
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions gui/download2.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,24 @@ def get_download_url(lecture, user_id, access_token):
"version": "3.21.0.84",
"Referer": "https://speiyou.cn/",
}
video_url = ""
error_message = ""
success = 'False'
if live_type == 'SMALL_GROUPS_V2_MODE':
url = 'https://classroom-api-online.saasp.vdyoo.com/playback/v1/video/init'
response = requests.get(url, headers=headers)
video_data = response.json()
video_url = ""
error_message = ""
try:
video_url = video_data['videoUrls'][2]
success = 'True'
except:
for url in video_data["videoUrls"]:
if ".mp4" in url:
video_url = url
success = 'True'
break
if success == 'False':
error_message = video_data['message']
success = 'False'
if live_type == 'RECORD_MODE':
url = 'https://classroom-api-online.saasp.vdyoo.com/classroom-ai/record/v1/resources'
response = requests.get(url, headers=headers)
video_data = response.json()
video_url = ""
error_message = ""
try:
definitions = video_data['definitions']
values = list(definitions.values())
Expand All @@ -105,6 +105,8 @@ def get_download_url(lecture, user_id, access_token):
except:
error_message = video_data['message']
success = 'False'
if success == 'False' and error_message == "":
error_message = "未找到回放"
return {
"url": video_url,
"success": success,
Expand Down

0 comments on commit 149f762

Please sign in to comment.