-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[youtube] Options for begin and end of recording live streams #5822
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
Conversation
Don't add new switches. Instead, make the feature obey |
I was thinking about using that one but as it's explicitly prohibited to be used when live I thought it was better to not try to attempt that. |
This is because we don't have an implementation for it |
I assume you have a totally different implementation in mind as I can't see it possible to utilize |
So I can see
imo making these stipulations makes a totally separate function than what we currently have. |
Extend `--live-from-start` with two options `-live-from-start-begin`and `-live-from-start-end` which will limit the recording to between these values. `--live-from-start-end` is optional and if omitted will continously record as normal.
adadd3d
to
7a8a226
Compare
You can already provide
Is there no way around this? If we can determine the current length of the stream (or the start time), we can translate b/w the two systems. This will also allow to implement #4554 and #5608 in future
Chapter to timestamp translation is done by core code. You don't need to be concerned about it. Besides, I believe live streams cannot have chapters anyway (maybe premiers can have it?)
This is a problem only if we cannot solve (2) |
While it would be possible to count from start of live stream, I think that would be impractical for most usecases as it would require the user to know exactly when the live stream started. I can think of two compromises:
|
Allowing negative values is trivial and I can add it in core code. Just make the downloader handle positive values, and make sure the extractor returns correct |
Can you explain what you mean by "+ive values"? I must confess I've problem navigate the code; And I'm not sure what you want me to accomplish :/ |
Could "+ive" mean "positive"? |
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
This comment was marked as spam.
Working for me as well, installed using:
There seems to be a variable offset between the time requested and the time downloaded, I tried 3 different livestreams, each had a different offset (-0h32m15s, -3h12m16s, +2h52m53s). This offset may drift slowly as well, still testing. The "Starting download from the last 120 hours of the live stream since YouTube does not have data before that" warning should probably be suppressed when using these flags. See extractor/youtube.py#L2763-L2765. Would be nice to have an accurate It would be great to have the option to specify the start & end using either:
But more importantly, it would be great to get this "good enough" and merged. @pukkandan, what do you need to see addressed at this point? |
The PR is on my radar, but so is many others. I believe I have explained the changes needed in above comments (mainly #5822 (comment)). If OP (or anyone else) cannot address them, I plan to get around to make the changes myself eventually. But it will take time - like I said, so many stuff on my plate and only so much time I can spare. If you want to expedite the process, try and help with making the changes, or even spin up your own PR. |
I see I missed this comment #5822 (comment)
positive values. As opposed to the negative ones discussed here - #5822 (comment). I'm saying if you can make positive values work in download code, I'll make the necessary changes in core code to also make negative values work. The downloader does not need to worry about it.
Which part is unclear? Instead of adding two new switches for this extremely specific use case, I just want the downloader code to look at |
Thanks @pukkandan, appreciate the response! @azatoth, any thoughts on how to proceed? I've started poking around to try to figure out how to proceed, but I'm new to this codebase. |
#6498 is a nicer implementation and superseeds this |
Fair enough, should I close this one? |
@azatoth, if you close this, I'd appreciate it if you could delay deleting your branch until #6498 has been merged. Otherwise I'd be unable to return to using your branch after testing #6498 (assuming I do so again), which would mean no way to download stream segments! ... Well, I guess I can just download the archive -- done! -- but still, might be nice to have your work as a reference while #6498 is still in the oven. |
ee280c7
to
7aeda6c
Compare
Closed bc superseeded |
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
Options for begin and end of recording live streams
Extend
--live-from-start
with two options-live-from-start-begin
and-live-from-start-end
which will limit the recording to between these values.--live-from-start-end
is optional and if omitted will continously record as normal.While as generic as the existing
--live-from-start
option, it's limited to youtube for now.Example:
yt-dlp https://www.youtube.com/watch?v=nbBeoReu12E --live-from-start --live-from-start-begin 2022-12-18T10:35:00+01:00 --live-from-start-end 2022-12-18T10:35:16+01:00
Fixes #3451
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check one of the following options:
What is the purpose of your pull request?