-
Notifications
You must be signed in to change notification settings - Fork 272
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
Fix VOD download trimming and quality selection #936
Conversation
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.
Good thinking with the creation of BestQualityStream
Here's a bit more detail on the second fix. The usual response from Twitch for the playlist with video qualities in it looks like this: The best-quality stream is named Twitch sometimes returns this response, however: Note that the name is different, and there's no framerate info. |
Yeah, I ran into this myself at some point when writing M3U8Extensions. If possible, the framerate is assumed via the name when this happens: TwitchDownloader/TwitchDownloaderCore/Tools/M3U8.cs Lines 619 to 628 in e48a04b
Edit: I realize now that this code has the possibility to throw if twitch's M3U8 response changes in the future, but even if that was fixed I think M3U8Extensions.GetStreamofQuality would also throw... |
Co-authored-by: Scrub <[email protected]>
Awesome, thank you for the fix! |
is update coming soon tho, its really hard to use it properly rn |
I want to release an update tomorrow at the very latest (north america), but I want to give @lay295 time to decide if he wants to implement the temporary solution for #934 first. In the meantime, you can download the workflow build from here: https://github.com/lay295/TwitchDownloader/actions/runs/7434637911 Alternatively, if you only crop on 10-second intervals, you will not experience the bad crop issue. |
Fixes #935, see that for a more detailed discussion.
This also fixes a separate bug with stream quality selection when downloading VODs. Twitch's Usher endpoint to list stream qualities sometimes returns a
1080p60
stream quality with full framerate info, but sometimes that stream is returned asSource
with no framerate info. Because there was no exact match for the stream name between the quality dropdown and the response when downloading, the logic would fall through to this:TwitchDownloader/TwitchDownloaderCore/Extensions/M3U8Extensions.cs
Line 77 in e48a04b
However, in this case the framerate is 0 for the
Source
stream, which breaks this calculation. The other streams in the response do have framerate info when this happens, so the second-best quality would be chosen instead (720p60 in my case). This adds a manual override for theseSource
streams so they're always selected as the best quality.