Crash when YouTube video ID doesn't exist: `YouTubeDataAPIError: getting the video title failed`
- Dominant language
- Python
- Stars
- 29
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
Sentry Issue: [LMS-VIA-59](https://hypothesis.sentry.io/issues/4328968239/?referrer=github_integration)
```
IndexError: list index out of range
File "via/services/youtube.py", line 66, in get_video_title
return self._http_service.get(
YouTubeDataAPIError: getting the video title failed
(7 additional frame(s) were not displayed)
...
File "via/views/view_video.py", line 25, in youtube
video_title = youtube_service.get_video_title(video_id)
File "via/services/youtube.py", line 76, in get_video_title
raise YouTubeDataAPIError("getting the video title failed") from exc
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with via/services/youtube.py around get_video_title and trace its use from via/views/view_video.py. Reproduce the behavior for a nonexistent YouTube video ID and determine the expected handling for that case. Done means the view no longer crashes with an IndexError when the ID does not exist.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100