[ie/soundcloud] Add formats
extractor-arg
#10004
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Soundcloud extractor needs to make an API call for every format available in order to extract the actual format URL (and other format metadata such as bitrate).
This is already a problem since this format endpoint has a rate-limit, and users frequently hit the rate-limit when extracting a playlist/batch of songs.
Ideally, lazy info dict would solve this problem. But now Soundcloud has introduced
encrypted-hls
(AES-128 HLS) formats, which are just dupes of thehls
formats we already extract, so now every song makes almost double the requests to the rate-limited API endpoint.Since lazy info dict still has a ways to go before merge, and since the
hls-aes
formats have severely compounded the problem, the best solution is to implement an extractor-arg to allow the user to configure which formats should actually be extracted.hls-aes
formats are excluded by default since they are dupes, but now users will be to request them if Soundcloud stops offering the unencryptedhls
formats in the future.Note: extracting the original/source quality
download
formats does not count towards the API rate-limit (it doesn't use the problematic endpoint) and therefore is not imapcted by this extractor-argTemplate
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 all of the following options that apply:
What is the purpose of your pull request?