Watch YouTube w/o browser - with mpv, yt-dlp and newsboat (for subsciptions).
# Install mpv, newsboat and yt-dlp with your package manager
$ sudo pacman -S mpv newsboat yt-dlp
# Clone repo
$ git clone https://github.com/qzdn/yt.sh.git
$ cd yt.sh/
$ chmod +x channel2nb.sh csv2nb.sh search2mpv.shAdd channel to newsboat manually by username (https://www.youtube.com/@username):
$ ./channel2nb.sh usernameCheck it in .config/newsboat/urls.
Imports your subscriptions to newsboat from csv file.
- Go to Google Takeout and export your YouTube subscriptions to
csvfile. - Download it to the folder with scripts.
- Run
./csv2nb.sh filename.csv.
Check .config/newsboat/urls for imported entries.
Watch videos by search requests:
$ ./search2mpv.sh rick rollYou can set up quantity of search results or video quality in the script itself.
- Add this macros to your
newsboatconfig (.config/newsboat/config):
macro y ; set browser "mpv --volume=80 --no-cache --vo=gpu --hwdec=auto --ytdl-format='bestvideo[vcodec^=avc1][height<=720][fps<=30]+bestaudio/bestvideo+bestaudio/best'" ; open-in-browser ; set browser "links %u"
macro Y ; set browser "mpv --volume=80 --no-cache --ytdl-format='bestaudio'" ; open-in-browser ; set browser "links %u"
You can edit mpv launch parameters for your needs.
- Open
newsboat, refresh your feeds, open "YouTube" feed, select any video and press,yor,Yfor audio only.