Posted: . At: 11:38 AM. This was 4 years ago. Post ID: 14569
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.



Sponsored



Make a playlist of Youtube videos and play it with MPV.


It is possible with MPV to play a playlist, which is a list of URL`s one on each line, and this will be played in order by MPV. This is very easy to do.

Make a playlist in VIM. This example works just fine. You do not need any special characters, just one URL on each line.

playlist.txt
1
2
3
4
5
https://www.youtube.com/watch?v=W2QIlGorKUg
https://www.youtube.com/watch?v=C5YkVhk-LZk
https://www.youtube.com/watch?v=hg2YtRDdiIo
https://www.youtube.com/watch?v=CyBQIRvESE0
https://www.youtube.com/watch?v=2on6lf5T6I0

Then play the MPV playlist like this. It works just fine for playing a collection of your favorite music.

jason@jason-desktop:~/Documents$ mpv --playlist=playlist.txt 
[playlist] Reading plaintext playlist.
Playing: https://www.youtube.com/watch?v=W2QIlGorKUg
 (+) Video --vid=1 (*) (vp9 1920x1080 11.988fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1920x1080 yuv420p
AV: 00:02:05 / 00:05:17 (39%) A-V:  0.000 Cache: 157s/20MB
[ffmpeg] tls: Error in the pull function.
[ffmpeg] https: Will reconnect at 5062624 in 0 second(s), error=Input/output error.
AV: 00:05:16 / 00:05:17 (99%) A-V:  0.000 Cache: 0.0s
 
Playing: https://www.youtube.com/watch?v=C5YkVhk-LZk
AV: 00:05:16 / 00:05:17 (99%) A-V:  0.000 Cache: 0.0s
 (+) Video --vid=1 (*) (vp9 1920x1080 11.988fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AV: 00:06:15 / 00:06:15 (99%) A-V:  0.000 Cache: 0.0s
 
Playing: https://www.youtube.com/watch?v=hg2YtRDdiIo
AV: 00:06:15 / 00:06:15 (99%) A-V:  0.000 Cache: 0.0s
 (+) Video --vid=1 (*) (h264 1920x1080 11.987fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AV: 00:04:06 / 00:04:07 (99%) A-V:  0.000 Cache: 0.0s
 
Playing: https://www.youtube.com/watch?v=CyBQIRvESE0
AV: 00:04:06 / 00:04:07 (99%) A-V:  0.000 Cache: 0.0s
 (+) Video --vid=1 (*) (vp9 1080x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AV: 00:04:06 / 00:04:07 (99%) A-V:  0.000 Cache: 0.0s
VO: [gpu] 1080x1080 yuv420p
AV: 00:00:22 / 00:05:13 (7%) A-V:  0.000 Cache: 290s/21MB
 
 
Exiting... (Quit)

I have tried playing Youtube playlists with MPV directly and it stops after the first video, so this is a good way to get around this. It works perfectly for playing a playlist of music with MPV easily.


3 thoughts on “Make a playlist of Youtube videos and play it with MPV.”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.