-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for downloading youtube-videos #55
Conversation
Another thing that maybe should be implemented is that the output-title could be changed to the youtube-title, because currently it's just the video-id from YouTube. This has now been implemented |
Hello, |
I think the intern youtube-dl method would be better too. This is rather a workaround, because I don't know much about lua and mpv |
Thanks for a solutions,
|
I wrote a function data = parse_edl(mp.get_property("stream-path"))
for _, v in pairs(data) do
print(v)
end (e.g. in @dardo82 what exactly do you mean by sanitizing filenames? Do you mean something like only allowing ASCII with restricting some chars as |
Using the video title as the file name |
I suppose you mean stream instead of steam... |
Yes.
As you wrote audio and video can be separated. Mpv seems to typically use an own edl format for this case. This function partly parses the edl format, gets all URLs and puts them into a table. With |
Maybe we should delegate yt-dlp to clip the video, |
Thanks for being so active on these issues... |
I think that's a great idea. Since that would allow only YouTube videos matching the pattern I'm going to add an option. |
I haven't tried these new features yet,I'll do it soon... |
I now implemented the 2 options. Please note, that things like filter aren't added when using |
The filter can be added to the individual clips. |
I found a bug: often ffmpeg fails with an error "-to value smaller than -ss; aborting" Log
Thank you for working on this patch, though : ) |
It could be that |
yep lines 203 and 270 |
Glad to hear that,it's already happened to me before. |
Looking back at this I didn't create the best commit history/good code. I think I will try to re-implement this via the |
Thanks for your efforts,do you need help? |
I should be good since I can copy some code from this PR |
I created the new PR #71. Please feel free to test it |
d9f1998
to
f0426bd
Compare
This is done by using regex to look if the path is in the mpv-googlevideo format.
If this is the case, youtube-dl is used to get a normal googlevideo.com
url that ffmpeg can handle.
This is currently only tested a few times under Linux, but should close #32 and #46
Currently working formats:
youtu.be/ID
youtu.be/ID?t=123
youtube.com/watch?v=ID
youtube.com/watch?v=ID&t=123
Currently not working:
youtu.be/ID?list=...
youtu.be/ID?list=...&t=123