Skip to content

Commit

Permalink
Catch error caused by audio-only recordings
Browse files Browse the repository at this point in the history
  • Loading branch information
gteufelberger committed Nov 27, 2022
1 parent da6a757 commit 5809a37
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vo-scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,12 @@ def vo_scrapper(vo_link, video_quality, user, passw):
video_json_data = json.loads(r.text)

# Get video src url from json based on resolution
video_src_link, available_video_quality = get_video_src_link_for_resolution(video_json_data, video_quality)
try:
video_src_link, available_video_quality = get_video_src_link_for_resolution(video_json_data, video_quality)
except IndexError:
# Audio only lectures error out, skip them
print_information(f"Couldn't get download link for recording {item_nr}. Skipping", type='warning')
continue

lecture_title = vo_json_data['title']
episode_title = vo_json_data["episodes"][item_nr]["title"]
Expand Down

0 comments on commit 5809a37

Please sign in to comment.