Skip to content
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

[ie/soundcloud] Fix download format extraction #10125

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

bashonly
Copy link
Member

@bashonly bashonly commented Jun 6, 2024

The original download formats are now only available when logged in. This patch adds auth headers to the API request for them and warns when the download formats exist but login is required.

Resulting changes:

  • The redefined _download_json() was causing problems with error handling, and it's cleaner/more obvious to just define a _call_api() method instead.

  • The original download format API call now also counts towards the API rate-limit, so moved the 429 retry loop code into a method so it could be used in multiple places during extraction. EDIT: The original download format API call does not count towards the API rate-limit, so this change was reverted.

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 all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense

What is the purpose of your pull request?

  • Fix or improvement to an extractor (Make sure to add/update tests)

@bashonly bashonly added the site-bug Issue with a specific website label Jun 6, 2024
Copy link
Contributor

@tntmod54321 tntmod54321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behaves as expected.
When downloads are available they will succeed or raise a warning depending on whether auth has been passed.

download format api calls do NOT count towards rate-limit

Authored by: bashonly
Copy link
Contributor

@tntmod54321 tntmod54321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and behaves as expected:
extraction without auth: gives warning
extraction with auth: download format is available and works
extraction with auth while ratelimited: download format still works (expected)

@bashonly bashonly merged commit e53e56b into yt-dlp:master Jun 13, 2024
6 checks passed
@bashonly bashonly deleted the fix/soundcloud-download branch June 13, 2024 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants