playing youtube playlist in mpv

Post tutorials, HOWTO's and other useful resources here.
rych
Warlord
Warlord
Posts: 622
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

playing youtube playlist in mpv

Post#1 by rych » 27 Jul 2022, 10:09

1. Install youtube-dl as per http://ytdl-org.github.io/youtube-dl/download.html,

Code: Select all

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
2. Copy the link to the playlist, (close the web browser :) ), and run mpv with optional parameters:

Code: Select all

mpv https://www.youtube.com/playlist?list=BlaBLAbLaBla
mpv https://www.youtube.com/playlist?list=BlaBLAbLaBla --no-video
mpv https://www.youtube.com/playlist?list=BlaBLAbLaBla --no-video --shuffle
3. For a convenient forwarding of the link install the Open With extension to your web browser (Waterfox Classic), and add the /ust/bin/mpv entry to its menu

4. Things to investigate:
Where does mpv (and youtube-dl?) keeps its cache?
Parameters of mpv and/or youtube-dl controlling audio quality and volume normalization

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3933
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

playing youtube playlist in mpv

Post#2 by ncmprhnsbl » 27 Jul 2022, 12:48

rych wrote:
27 Jul 2022, 10:09
Install youtube-dl as per
menu>internet>"Browser Selection and Update Tool" has an option that will fetch and create a module of the latest version of youtube-dl for you ;)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3933
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

playing youtube playlist in mpv

Post#3 by ncmprhnsbl » 28 Jul 2022, 07:15

rych wrote:
27 Jul 2022, 10:09
Where does mpv (and youtube-dl?) keeps its cache?
afaics, it/they don't : https://github.com/mpv-player/mpv/wiki/ ... am-to-disk
"The mpv youtube-dl wrapper script calls youtube-dl --dump-single-json, -J on URLs that begin with http(s). This returns a direct media link from which mpv streams directly. Nothing is downloaded to disk. Once playback starts, youtube-dl has exited and is not active anymore."
rych wrote:
27 Jul 2022, 10:09
Parameters of mpv and/or youtube-dl controlling audio quality and volume normalization
partly this: https://github.com/mpv-player/mpv/wiki/ ... on-youtube
at least for video/audio format/quality..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

rych
Warlord
Warlord
Posts: 622
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

playing youtube playlist in mpv

Post#4 by rych » 28 Jul 2022, 10:55

ncmprhnsbl wrote:
28 Jul 2022, 07:15
Where does mpv (and youtube-dl?) keeps its cache?

afaics, it/they don't
I was interested because the video playback actually stuttered, and I was wondering whether they pre-buffer the stream on my congested/slow USB or buffer into RAM but not enough, so I'd allow them to use more RAM

rych
Warlord
Warlord
Posts: 622
Joined: 04 Jan 2014, 04:27
Distribution: Porteus 5.0 x64 OpenBox
Location: NZ
Contact:

playing youtube playlist in mpv

Post#5 by rych » 29 Jul 2022, 10:15

Apparently, we should use https://github.com/yt-dlp/yt-dlp instead. So:

Code: Select all

cd /usr/local/bin/
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o yt-dlp
sudo chmod a+rx yt-dlp
mv youtube-dl youtube-dlOLD
ln -s yt-dlp youtube-dl

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3933
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

playing youtube playlist in mpv

Post#6 by ncmprhnsbl » 30 Jul 2022, 03:55

mpv will detect and use either youtube-dl or yt-dlp ..
another method:
1. open mpv (from menu)
2. drag the desired video or playlist from the browser (the preview is fine) to the mpv window
3. watch :)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

Post Reply