-
Notifications
You must be signed in to change notification settings - Fork 26
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
DownloadSections option #157
Conversation
but it requires |
Hey, looks good and i think ffmpeg is more or less required anyway. Wonder if we want some kind if test? Also fixes #151 i think |
Hey @wader, check this one out. if ydlResult.Options.DownloadSections != "*0:0-0:5" {
t.Errorf("failed to setup --download-sections")
} is required? |
Probably good idea to check that the option "round-trips" so leave it i think. I guess one could check the duration of the output but would require ffmpeg etc. ...but i notice now that ffmpeg is not installed in the Dockerfile when running tests, so how does this work? ffmpeg not needed by yt-dlp for this or it behaves differently? |
Hi again, took a deeper look and found some issues:
root@44453646f6dd:/Users/wader/src/goutubedl# yt-dlp -o - -f sb2 --download-sections '*0:0-0:5' 'https://www.youtube.com/watch?v=OyuL5biOQ94' > test
[youtube] Extracting URL: https://www.youtube.com/watch?v=OyuL5biOQ94
[youtube] OyuL5biOQ94: Downloading webpage
WARNING: [youtube] unable to extract initial player response; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
[youtube] OyuL5biOQ94: Downloading ios player API JSON
[youtube] OyuL5biOQ94: Downloading android player API JSON
[youtube] OyuL5biOQ94: Downloading iframe API JS
[youtube] OyuL5biOQ94: Downloading player c153b631
[youtube] OyuL5biOQ94: Downloading web player API JSON
[youtube] OyuL5biOQ94: Downloading m3u8 information
WARNING: [youtube] unable to extract yt initial data; please report this issue on https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
WARNING: [youtube] Incomplete data received in embedded initial data; re-fetching using API.
[youtube] OyuL5biOQ94: Downloading initial data API JSON
[info] OyuL5biOQ94: Downloading 1 format(s): sb2
[info] OyuL5biOQ94: Downloading 1 time ranges: 0.0-5.0
ERROR: You have requested downloading the video partially, but ffmpeg is not installed. Aborting I tried installing ffmpeg and change format then |
added ffmpeg to the Dockerfile |
ci fails on installing ffmpeg, missing |
thanks that was helpful, i think it is good to go? |
if err != nil { | ||
t.Fatal(err) | ||
} | ||
dr.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking it would be great to somehow check that DownloadSections
works, maybe can ffprobe the result?
$ yt-dlp --download-sections '*0:0-0:5' 'https://www.youtube.com/watch?v=OyuL5biOQ94'
...
$ ffprobe -v quiet -show_entries format=duration Paradise\ -\ Coldplay\ \(Fingerstyle\ Guitar\)\ \[OyuL5biOQ94\].webm
[FORMAT]
duration=5.004000
[/FORMAT]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being picky with tests, reason is i really want to be able to trust the tests to catch breakage when auto updating yt-dlp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do,
but this gonna work with the sections that specified as a time range, not then chapter name specified:
yt-dlp --download-sections 'Intro'
Is there a way to get information on the length of the chapter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe its in the Info.json but not sure. But just testing time range is fine with me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, got stuck on checking duration?
looks very messy, what do you think? |
f, err := os.Create(fileName) | ||
if err != nil { | ||
t.Fatal(err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want a defer f.Close()
to make sure things are written
yeah a bit messy but maybe ok? |
how can I improve it? |
I guess it could be refactored to some kind of ffprobe/get value function but maybe can wait until another test needs it |
Thanks! |
Thanks for your support) |
--download-sections support