Skip to content

Instantly share code, notes, and snippets.

@ChrisK2
Last active August 29, 2015 14:07
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisK2/3d47be94beaa368965d9 to your computer and use it in GitHub Desktop.
Save ChrisK2/3d47be94beaa368965d9 to your computer and use it in GitHub Desktop.
ytdl_hook.lua

youtube-dl hook script for mpv

Now part of mpv

As of 079ecd7 (2014-11-19), the hook script is now integrated into mpv and will be avaiblable when compiled with LUA support. It is (currently) disabled by default, to enable it add --ytdl=yes to your command-line or ytdl=yes to your mpv.conf.

Open Issues

@mc4man
Copy link

mc4man commented Oct 27, 2014

Works quite well here as long as youtube-dl is quite recent
(the -J & --flat-playlist options are new

@shdown
Copy link

shdown commented Oct 27, 2014

not (json["_type"] == nil)
not (entry["webpage_url"] == nil)
not (json.subtitles == nil)
not (json.play_path == nil)

Did you hear of ~= operator?

@ChrisK2
Copy link
Author

ChrisK2 commented Oct 27, 2014

Yes, but I always forget about it because I'm used to !=.

@ghedo
Copy link

ghedo commented Oct 29, 2014

So, what's the plan here? Is this gonna get merged into mpv like osc.lua? If so, do you have any ETA?

@ChrisK2
Copy link
Author

ChrisK2 commented Oct 29, 2014

First we have to do a lot more field-testing. It will probably be baked in like osc.lua. ETA is "before 0.7".

@ghedo
Copy link

ghedo commented Oct 30, 2014

Ok, thanks. Note that the plan for 0.7 would be to release in ~2-3 weeks or so. Also, I think this would get more testing if it got merged in mpv early on, so more people could easily access it (though you may want to disable it by default for now).

Anyway, I implemented the youtube-dl version check at https://gist.github.com/ghedo/edf582ec6db7732e0694/revisions: it's really simple but seems to work fine, feel free to merge it (or not if you have different plans).

@RunningDroid
Copy link

Can I report bugs for this here, or is there a specific place for that?

@ChrisK2
Copy link
Author

ChrisK2 commented Nov 2, 2014

Here or directly to me on IRC (ChrisK3 in #mpv-player on freenode).

Copy link

ghost commented Nov 19, 2014

Merged, but disabled by default. Use --ytdl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment