hypothesis / hypothesis/via

Change description, details and HTTP status for `TranscriptDisabled` and other errors fetching YouTube transcripts

Open
#1,044 0 comments 0 reactions 0 assignees View on GitHub
Backend project: video annotations
Dominant language
Python
Stars
29
Forks
13
PR merge metrics
No merged PRs in 30d

Description

There are several issues with the error messages for YouTube transcripts that the backend returns to the frontend.

- We have seen that the Python library we are using to fetch transcripts can report a `TranscriptDisabled` error in cases where this error code is misleading. For example we've seen it for long videos for which a transcript has not yet been generated, and videos with no sound.
- The backend reports an HTTP 500 status, which parts of our monitoring will interpret as a backend failure, even though this is a "normal" failure.
- The "details" message is the one from the underlying library, which tells users to file bug reports on the library's GitHub project. We don't want to send our users there. Instead the reports should go to us initially.

From a discussion [on Slack](https://hypothes-is.slack.com/archives/C1MA4E9B9/p1688386752495669?thread_ts=1688120133.798219&cid=C1MA4E9B9) we agreed to:

- Change the status code for these errors from 500 to 4xx (TBD: Also apply to other errors? I suggest we do.)
- Replace the error response's title with something generic for TranscriptDisabled's. I suggest "Transcript not available"
- Replace the error response's detail with something generic or just remove it

So far the errors we've seen have all had a `TranscriptDisabled` code, but see https://github.com/jdepoix/youtube-transcript-api/blob/master/youtube_transcript_api/_errors.py for other error codes we may encounter.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.