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 401 unauthorized #6981

Closed
MichaelOultram opened this issue Sep 26, 2015 · 1 comment
Closed

Soundcloud 401 unauthorized #6981

MichaelOultram opened this issue Sep 26, 2015 · 1 comment

Comments

@MichaelOultram
Copy link

@MichaelOultram MichaelOultram commented Sep 26, 2015

Issue
I can not download anything from soundcloud via youtube-dl. I get a 401 error Unauthorized. full output below

Cause:
I believe the API key used for soundcloud is no longer valid. I've tested this on multiple installations, and also tried navigating to the api manually in my web browser with youtube-dl's key with no success.

Solution:
I created my own soundcloud API key to test in the browser and that works fine. So next I downloaded the youtube-dl code, changed the soundcloud API key to my newly created one and low an behold, it works as expected. So replacing the API key with a new one for soundcloud should fix it

Full Output with the current API key

# youtube-dl --verbose --print-traffic --rate-limit 50K http://soundcloud.com/ethmusic/lostin-powers-she-so-heavy
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'--print-traffic', u'--rate-limit', u'50K', u'http://soundcloud.com/ethmusic/lostin-powers-she-so-heavy']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2015.09.22
[debug] Python version 2.7.9 - Linux-3.19.0-22-generic-x86_64-with-Ubuntu-15.04-vivid
[debug] exe versions: ffmpeg 2.8-static, ffprobe 2.8-static
[debug] Proxy map: {}
[soundcloud] ethmusic/lostin-powers-she-so-heavy: Resolving id
[soundcloud] ethmusic/lostin-powers-she-so-heavy: Downloading info JSON
send: u'GET /resolve.json?url=http://soundcloud.com/ethmusic/lostin-powers-she-so-heavy&client_id=b45b1aa10f1ac2941910a7f0d10f8e28 HTTP/1.1\r\nHost: api.soundcloud.com\r\nAccept-Language: en-us,en;q=0.5\r\nAccept-Encoding: gzip, deflate\r\nAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20150101 Firefox/20.0 (Chrome)\r\nAccept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\nConnection: close\r\n\r\n'
reply: 'HTTP/1.1 401 Unauthorized\r\n'
header: Content-Encoding: gzip
header: Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Origin
header: Access-Control-Allow-Methods: GET, PUT, POST, DELETE
header: Access-Control-Allow-Origin: *
header: Access-Control-Expose-Headers: Date
header: Cache-Control: no-cache
header: Cache-Control: private, max-age=0
header: Content-Type: application/json; charset=utf-8
header: Date: Sat, 26 Sep 2015 11:34:53 GMT
header: Server: am/2
header: Status: 401 Unauthorized
header: Content-Length: 73
header: Connection: close
ERROR: Unable to download JSON metadata: HTTP Error 401: Unauthorized (caused by HTTPError()); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type  youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
  File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 326, in _request_webpage
    return self._downloader.urlopen(url_or_request)
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1865, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 26, 2015

Duplicate of #6930.

@dstftw dstftw closed this Sep 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.