Support YouTube frontends (Invidious, Piped)
I wouldn't say it's critical for me, but there are definitely some users who are concerned about their privacy, so they don't use YouTube at all. Instead, they use third-party frontends like invidious and piped. The main problem is that there are many instances of such frontends, anyone can create them. so you will have to give the possibility to add your own links or somehow detect that the current site is an instance of the frontend.
Invidious
Docs — https://docs.invidious.io/ Instances — https://api.invidious.io/
I don't think it would be hard to do that for invidiuos, cause it gives you the option to download subtitles for the video, but as usual for auto subtitles there are duplicate lines there.
Piped
Docs — https://docs.piped.video/docs/ Instances — https://github.com/TeamPiped/Piped/wiki/Instances
Piped doesn't give a direct way to download subtitles, but no one prevents you from extracting them from the same invidious. Issue about downloading
I've been doing a little more research on the subject, especially invidious, and I found out a few things.
- Subtitles are easily downloaded via api. First we get the subtitle title via
https://{instance-link}/api/v1/captions/{video-id}and then the subtitles themselves invttformathttps://{instance-link}/api/v1/captions/{video-id}?label={label} - Subtitles are already fixed and do not have repeated lines.
- Not all instances have subtitles and as a user there is nothing we can do about it. https://github.com/iv-org/invidious/issues/4660. So you have to make several attempts to get subtitles from different instances.
they are almost dead, so i think it's no longer relevant