Youtube-dl integration #196
base: develop
Are you sure you want to change the base?
Conversation
…t implementation.
I've noticed that you didn't include checker for 'short' links provided by youtube. On the other hand, i can't properly test it being that i'm always getting "Calling youtube-dl" -> "Opening..." -> "Failed to render the file". Note that i'm not a coder so i can't comment on code quality and reviewing it. |
This needs proper integration of youtube-dl. Usage of API they provide instead of parsing stdout. Support for all sites they support, youtube is very small subset of what they capable of. Quality selection dialog, this can be done later, but often "best"stream is not the best. Generally we need to have integration that can be extended in the future, current design would be hard to maintain. |
@vBm That video works for me. Try running "youtube-dl -g -f best https://youtu.be/L3dtIyt6U1E" on command line and open the https stream it gives you in mpc-hc. If that works, I'm guessing it's a string encoding issue. @kasper93 Is it worth dragging python as a runtime dependency to use the API? It might make most sense to do what mpv does, which is use the -J option and parse the JSON output, that would still be pretty flexible. |
@nparkanyi yes, using decoded, direct url does work. |
@vBm Do all youtube videos fail? In any case, the current approach will never work since when printing Unicode to stdout, it seems Windows garbles it in a locale-dependent way before piping it. |
Here's an implementation which reads the JSON output from youtube-dl with rapidjson (very similar to how mpv does it). This also now works with non-youtube sites. It passes any http url through youtube-dl, and if youtube-dl is unavailable or fails, it falls back on the built-in behaviour to open the url directly. |
@nparkanyi I can't even compile it.
Please provide test builds, both x86 and x64. |
@vBm oops, that's not surprising, I forgot to commit the updated project file. |
@nparkanyi Yes, it works lovely now. |
Can it play drag & dropped links? If it can, that would make better than the other DirectShow based options. |
@Skibicki It does now. |
Hi @nparkanyi ! First of all, thank you for your hard work! Maybe you also know that - unfortunately - this project development became dead. |
Does this also support high resolution (4k) videos? YouTube uses separate audio and video files for such streams. |
I haven't tested an 4K videos, but YouTube also uses separate audio and video streams for 1080p content, which are handled here. |
Good. I think it would be useful to have some options to control which streams are selected. For example to restrict resolution to max 1080p. And an option to only load the audio stream, for people who only want to use it for music. These could be added as boolean values in Options > Advanced. Can you also test if Add to Favorites works? It might be needed to store the original URL there? |
Yes I plan to implement setting maximum quality. Audio stream should work too, though afaik only Youtube actually separates audio and video streams (vidme did too, RIP). I'll look into Add to Favorites. |
…ams; added copyright header
I'm sorry for my not quite smart question but where could it be possible to download already compiled mpc-hc64.exe with integrated youtube-dl support? |
@Adyel Thank you for the answer. It would be more convenient for ordinary users to download already compiled files. Author and other pro users somehow check their commits by compiling MPC_HC with youtube-dl integration into and running executable files - maybe they wouldn't reject to release this files? |
Can anyone build it following the https://trac.mpc-hc.org/wiki/How_to_compile_the_MPC
|
So what happened to this? Seems it was passed over for another solution. |
@Pentaphon The youtube-dl integration and further MPC-HC maintenance can be found at https://github.com/clsid2/mpc-hc |
This enables streaming Youtube videos with youtube-dl by giving a Youtube URL in the Open File dialogue or on the command line. Supports individual videos and playlists. Requires youtube-dl to be present in PATH variable.