Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
SoundCloud secret_token for private tracks is dropped #7872
Comments
|
Post the full output of youtube-dl when run with |
|
Oh... right, whoops. Of course.
That's not really that informative though, as it hides the bug. Here's a transcript with
|
|
You must provide concrete example URL. |
|
Unfortunately I don't know of one :( On 12/16/15, Sergey M. notifications@github.com wrote:
|
|
youtube-dl works fine with private links at least with those we have in tests:
There is nothing we can do until you provide an concrete example URL that reproduces the problem. |
|
Wait! Wait! _YOU ARE EXPERIENCING THE SAME ISSUE WITH YOUR EXAMPLES!_ Look!!!
Please alter the code that fetches the download URL to include the In my case, it was the difference between getting 128k MP3 and lossless WAV. :P |
Some SoundCloud URLs are private; these are in the form
https://soundcloud.com/publisher/trackname/s-NWnsv.youtube-dlneeds to grab the characters off the end of the URL and submit them assecret_tokenin all API requests.This is what's happening instead:
We get:
header: Location: https://api.soundcloud.com/tracks/12345678.json?client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea&secret_token=s-NWnsvaaand then we go to
send: u'GET /tracks/12345678.json?client_id=aGVsbG8gd29ybGQgdGVzdGluZyAxMjMK&secret_token=s-NWnsv HTTP/1.1 ....'...so far so good
send: u'GET /i1/tracks/12345678/streams?client_id=aGVsbG8gd29ybGQgdGVzdGluZyAxMjMK&secret_token=s-NWnsv HTTP/1.1 ...'uh oh
send: u'GET /tracks/12345678/download?client_id=aGVsbG8gd29ybGQgdGVzdGluZyAxMjMK HTTP/1.1 ...'no that's not going to work
[soundcloud] 12345678: download video format URL is invalid, skippingI'm all good though; my shell hack is currently trundling along file 5 of 10 at 100Mbps ^^
url='.......'; X="$(youtube-dl --print-traffic --dump-json "$url")"; tid="$(echo "$X" | grep -o '"display_id": "[^"]\+"' | sed 's/.*: "//;s/"$//')"; cid="$(echo "$X" | grep -o 'client_id=[A-Za-z0-9]\+' -m1)"; filename="$(echo "$X" | grep -o '"_filename": "[^"]\+"' | sed 's/.*: "//;s/mp3"$/wav/')"; wget -vvvv "https://api.soundcloud.com/tracks/$tid/download?$cid&secret_token=${url##*/}" -O "$filename"