youtube-transcript-api
youtube-transcript-api copied to clipboard
Error checks on network calls, try/catch, etc
Related to #429 but happened to me in a few other situations (accessing from a VPS without a proxy)
I think it would be helpful to add checks and catches to any network calls:
- Bad response code
- Empty reply (this was the case for "no element found")
- Response contents start with
<!DOCTYPE html>when the expected reply is JSON (this is likely in the case of a text/HTML warning from YT when they make assumptions that it's someone writing a script) - Parsing response body fails due to invalid structure
If it's welcome, can I create a long-running feature branch for network error handling? I'll wrap the calls one at a time, keep it synced with main, and you can merge my progress incrementally.