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

Soundcloud extractor web auth + aac hq #26265

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

blackjack4494
Copy link

@blackjack4494 blackjack4494 commented Aug 6, 2020

Please follow the guide below

  • You will be asked some questions, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your pull request (like that [x])
  • Use Preview tab to see how your pull request will actually look like

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:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

  • Bug fix
  • Improvement
  • New extractor
  • New feature

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.

theidel@DESKTOP-S2JEM09:/mnt/d/gitkraken/youtube-dl$ ./youtube-dl -u USER -p PASS https://soundcloud.com/wandw/the-chainsmokers-ft-daya-dont-let-me-down-ww-remix-1 -F
[soundcloud] Downloading JSON metadata
[soundcloud] wandw/the-chainsmokers-ft-daya-dont-let-me-down-ww-remix-1: Downloading info JSON
[soundcloud] 257939729: Downloading JSON metadata
[soundcloud] 257939729: Downloading JSON metadata
[info] Available formats for 257939729:
format code extension resolution note
hls_mp3_128 mp3 audio only audio@128k
hls_aac_256 aac audio only audio@256k (best)

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.

@blackjack4494
Copy link
Author

seems that Travis CI build is stuck?

@ytdl-org ytdl-org deleted a comment from blackjack4494 Sep 6, 2020
@ytdl-org ytdl-org locked and limited conversation to collaborators Sep 6, 2020
@dstftw dstftw force-pushed the master branch 2 times, most recently from 5e26784 to da2069f Compare September 13, 2020 13:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant