Soundcloud extractor web auth + aac hq #26265
Open
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.
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])Before submitting a pull request make sure you have:
In order to be accepted and merged into youtube-dl 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?
Description of your pull request and other information
I added authorization/login so you can use -u/-p now. A signature is needed (generation was reverse engineered from SC libray) to send login payload to the auth api in order to get an access token. Previous workaround was: User had to intercept access token manually from Soundcloud (developer console) and then add extra authorization headers.
You are now able to download all (non Go+) tracks in HQ if that is available for a song.
Flake8 will moan about these 5 local variables. However in my opinion they should stay the way they are right now. I could add a noqa comment to suppress the warning but this is probably not wanted. Alternatively I could comment the meanings of the variables.
I will try to add support for Go+ and personalized sets/playlists as well in a future PR.
I tested this code for the last 2 days now. But the authentification process is a bit strange. For instance I had to generate random Device IDs. Otherwise the api would send back 'error: action_denied'.
Let me know if there is something wrong and needs to be edited.
Edit: Here is a Gist with a python file to retrieve the access_token if someone needs that.