Opened 7 years ago

Closed 4 years ago

#55533 closed defect (worksforme)

mpv @0.26: can't playback youtube playlist

Reported by: mrkapqa Owned by: Ionic (Mihai Moldovan)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc:
Port: mpv

Description (last modified by ryandesign (Ryan Carsten Schmidt))

richs-Mac-mini:~ rich$ mpv --version
mpv 0.26.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
 built on Sat Dec 16 21:56:17 CET 2017
ffmpeg library versions:
   libavutil       55.78.100
   libavcodec      57.107.100
   libavformat     57.83.100
   libswscale      4.8.100
   libavfilter     6.107.100
   libswresample   2.9.100
ffmpeg version: 3.4.1

built on yosemite 10.10 with youtube-dl installed with

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

can' playback youtube playlist

eg.

mpv https://www.youtube.com/watch?v=Vn7kB0f16jg&list=PL-2mqY82TEri1eOFZmhfwuLxX11V1TkcI

[1] 12138
richs-Mac-mini:~ rich$ Playing: https://www.youtube.com/watch?v=Vn7kB0f16jg
[ytdl_hook] 
[ytdl_hook] stack traceback:
[ytdl_hook] 	[C]: in function 'len'
[ytdl_hook] 	@ytdl_hook.lua:71: in function 'edl_escape'
[ytdl_hook] 	@ytdl_hook.lua:139: in function 'edl_track_joined'
[ytdl_hook] 	@ytdl_hook.lua:171: in function 'add_single_video'
[ytdl_hook] 	@ytdl_hook.lua:454: in function 'fn'
[ytdl_hook] 	mp.defaults:518: in function 'handler'
[ytdl_hook] 	mp.defaults:339: in function 'handler'
[ytdl_hook] 	mp.defaults:458: in function 'call_event_handlers'
[ytdl_hook] 	mp.defaults:495: in function 'dispatch_events'
[ytdl_hook] 	mp.defaults:451: in function <mp.defaults:450>
[ytdl_hook] 	[C]: in ?
[ytdl_hook] 	[C]: in ?
[ytdl_hook] Lua error: @ytdl_hook.lua:71: bad argument #1 to 'len' (string expected, got nil)
[ffmpeg] tls: IO Error: -9806
Failed to recognize file format.

Change History (5)

comment:1 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: mpv yosemite youtube-dl removed
Owner: set to Ionic
Status: newassigned
Summary: mpv(0.26@yosemite): can't playback youtube playlistmpv @0.26: can't playback youtube playlist
Type: enhancementdefect

I don't know if this is the entire reason why it fails for you, but it looks like you forgot to escape special characters from the shell. Specifically, the & in the URL is a special character to the shell: it means "run the preceding command in the background instead of the foreground." Which means that you ran the command mpv https://www.youtube.com/watch?v=Vn7kB0f16jg in the background (which, as shown in your output, was assigned the process id 12138), and the command list=PL-2mqY82TEri1eOFZmhfwuLxX11V1TkcI in the foreground, which isn't what you meant to do.

Enclose the URL in quotes so that the shell doesn't interpret the & in a special way:

mpv 'https://www.youtube.com/watch?v=Vn7kB0f16jg&list=PL-2mqY82TEri1eOFZmhfwuLxX11V1TkcI'

I also wanted to point out that we do have a port for youtube-dl, and that if you installed the mpv port, it already declares a dependency on the youtube-dl port, so you don't need to (and shouldn't) install youtube-dl manually in /usr/local since MacPorts already installed it for you in /opt/local.

comment:2 Changed 7 years ago by mrkapqa

thank you very much, i will try that out, however, regarding youtube-dl , i tried that installing on a powerbook g4 1,67 running tiger with macports, and it really took ages , so i had wanted to stop it. on newer osx maybe it easier. that command from youtube-dl site seems most easy, although on earlier machines it fails because of missing ssl-handshake or soemthing like that, and on newer osx like lion sometimes it fails because of missing directory (can be overcome by "sudo mkdir -p /usr/local/lib")

comment:3 Changed 7 years ago by Ionic (Mihai Moldovan)

The SSL handshake error is caused by outdated root certificates on these older machine. There are workarounds, but none is perfect.

Quoting is often a problem, and in that case even more so.

Certainly possible that the version you fetched from upstream is in some way breaking behavior and is now incompatible. Since we cannot expect the youtube-dl port to be updated to the newest version on-spot (because, quite frankly, upstream's release schedule is opaque at best and versions may be updated any odd day), maybe the port is still working fine.

I'd have to check on my machine, but I'm currently not up-to-date.

From the backtrace, it seems that youtube-dl itself is not returning any useful URL for the link passed in.

comment:4 in reply to:  3 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to mrkapqa:

however, regarding youtube-dl , i tried that installing on a powerbook g4 1,67 running tiger with macports, and it really took ages , so i had wanted to stop it.

It is true that youtube-dl has hundreds of dependencies, and that this can take time to install, more so on older OS versions like Tiger for which we do not have precompiled binaries. If you want to use youtube-dl, you'll need those dependencies, so they'll have to be installed one way or another. And if you've already installed the mpv port with its +network variant (which is a default variant), it already includes a dependency on youtube-dl, so you've already installed it and all of its dependencies using MacPorts.

Replying to Ionic:

Certainly possible that the version you fetched from upstream is in some way breaking behavior and is now incompatible. Since we cannot expect the youtube-dl port to be updated to the newest version on-spot (because, quite frankly, upstream's release schedule is opaque at best and versions may be updated any odd day), maybe the port is still working fine.

Right now, the youtube-dl port is up to date. I check livecheck every few days and update youtube-dl if it's out of date, if Zero King doesn't beat me to it.

I get the same error on my system, with proper shell quoting, so there is some other issue still happening, but I can't help figure out what it is.

comment:5 Changed 4 years ago by kencu (Ken)

Resolution: worksforme
Status: assignedclosed

there's nothing to be fixed in this ticket

Note: See TracTickets for help on using tickets.