2024-04-26
use invidious to look for videos
Edit: I just learned about IdiotBox from continue:
Idiotbox
Get the url and play it locally through mpv. That's the general idea.
the invidious way:
The G often pounds invidious instances, making it impossible to play videos through the service. However, searching for videos in most cases still works. This is all you need to get a url of the video and then stream it locally through yt-dlp (mpv).
Copy the 'youtube' url, play it in mpv.
$ mpv https://youtube.com/watch?v=Hfth8-TOTL8
reserpico
yt-dlp works with invidious urls only if it can find the youtube url somewhere on the actual page. If the invidious url leads to an error page, yt-dlp can't find the youtube url.
If you use an invidious instance with links2, or other text browsers, the youtube url is not immediately visible. Instead, just copy the invidious url (ie: https://yewtu.be/watch?v=Hfth8-TOTL8) and parse it with something like this:
Put this in your ~/bin/yt (in your $PATH, and make it executable)
#!/bin/sh inp=$(printf $1 | cut -d"?" -f2-) printf "https://youtube.com/watch?$inp"
Now use mpv with the invidious url like so:
$ mpv $(yt https://yewtu.be/watch?v=Hfth8-TOTL8)
Similarly you can use the 'yt' parser with yt-dlp:
$ yt-dlp -x $(yt https://yewtu.be/watch?v=Hfth8-TOTL8)
Cool.