show youtube playlist
If i play a youtube playlist with mpv how can i see all the different videos? I do:
mpv https://www.youtube.com/watch?v=DamuE8TM3xo&list=PLGLfVvz_LVvQ9S8YSV0iDsuEU8v11yP9M
this gives me only the first video as can be seen with
CTRL+p script-message osc-playlist
Either:
mpv --ytdl-raw-options="yes-playlist=" https://www.youtube.com/watch?v=DamuE8TM3xo&list=PLGLfVvz_LVvQ9S8YSV0iDsuEU8v11yP9M
Or:
Feed mpv the the actual playlist link from youtube in the form of https://www.youtube.com/playlist?list=<id>
Relevant issue for IINA (which uses mpv): https://github.com/iina/iina/issues/2328
This is working as intended, it's not a bug.
... Hi garoto. I use F2 script-message osc-playlist 3. This show me the playlist 3 seconds when I press F2. I would like to press again the same F2 key to disappear the playlist instead the time in seconds. I tried some commands but I couldn't. I used combinations with toggle and cycle but nothing worked. Some help?
You can use this script:
local duration = 3
local time
mp.add_key_binding('F2', function ()
if time and mp.get_time() - time < duration then
mp.command('script-message osc-playlist 0')
time = nil
else
mp.commandv('script-message', 'osc-playlist', duration)
time = mp.get_time()
end
end)
It should be placed in ~~/scripts with a .lua extension.
You can use this script:
local duration = 3 local time mp.add_key_binding('F2', function () if time and mp.get_time() - time < duration then mp.command('script-message osc-playlist 0') time = nil else mp.commandv('script-message', 'osc-playlist', duration) time = mp.get_time() end end)It should be placed in
~~/scriptswith a.luaextension.
Thanks but sadly it doesn't have what I looking for. This script has the same function that F2 script-message osc-playlist 3. I want to press F2 to show playlist and press F2 again to quit from such playlist (no timer)
That's literally what this script does. Did you remove F2 from input.conf?
That's literally what this script does. Did you remove F2 from input.conf?
Yes, even I edited your lua and changed the key binding to another, for example "a" key and the result is the same, the playlist last 3 seconds and quit.
local enabled = false
mp.add_key_binding('F2', function ()
mp.commandv('script-message', 'osc-playlist', enabled and 0 or 999)
enabled = not enabled
end)
Damn, this version is super neat.
What's the purpose of and 0 or 999?
local enabled = false mp.add_key_binding('F2', function () mp.commandv('script-message', 'osc-playlist', enabled and 0 or 999) enabled = not enabled end)
Thanks! This works perfect 👌 Oh I need to learn Lua language.
What's the purpose of
and 0 or 999?
It evaluates to a playlist duration or 999 seconds if it's not enabled, or 0 if it's already enabled, thus hiding it.