zeekay / soundcloud-cli

Soundcloud command-line interface.
MIT License
47 stars 13 forks source link

upload 401 #10

Open AlanTrewartha-HC opened 8 years ago

AlanTrewartha-HC commented 8 years ago

In the last few weeks I've just been getting 401 on any upload. Even a simple > sc /path/to/file.mp3 comes back 401, and errors that start in failing on url = res['permalink_url']

authentication (sc auth) runs fine and I can see the JSON in ~/.sc is all ok. just any upload method failing.

AlanTrewartha-HC commented 8 years ago

i think maybe it's (soundcloud) server-side weirdness. I'm still getting 401 as the status code, but headers come back with "201 Created"

zeekay commented 8 years ago

Should check headers I guess?

jmontiel commented 8 years ago

I'm seeing the same problem

uploading mres-20161010.mp3 [==================================================] 100% 401 {'Status': '201 Created', 'Content-Length': '0', 'Access-Control-Allow-Headers': 'Accept, Authorization, Content-Type, Origin', 'Access-Control-Expose-Headers': 'Date', 'Server': 'am/2', 'Location': 'https://api.soundcloud.com/tracks/287200401', 'Cache-Control': 'no-cache', 'Date': 'Tue, 11 Oct 2016 19:12:35 GMT', 'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE', 'Content-Type': 'application/json; charset=utf-8'}

Traceback (most recent call last): File "/usr/bin/sc", line 3, in cli.main() File "/usr/lib/python2.7/site-packages/soundcloud_cli/cli.py", line 216, in main args.command(args) File "/usr/lib/python2.7/site-packages/soundcloud_cli/utils.py", line 37, in wrapper return f(_args, *_kwargs) File "/usr/lib/python2.7/site-packages/soundcloud_cli/cli.py", line 141, in command_upload url = res['permalink_url'] TypeError: 'NoneType' object has no attribute 'getitem'

AlanTrewartha-HC commented 8 years ago

Yep, that's it. I'm settling for parsing out the track ID (your eg 287200401) as that allows to embed the uploaded item. But the 'canonical URL' of the soundcloud page is lost :-/