3jackdaws / soundcloud-lib

Soundcloud API wrapper for tracks & playlists that doesn't require API credentials. Asyncio support.
MIT License
90 stars 23 forks source link

Some tracks aren't recognized #1

Closed gcmontilla closed 6 years ago

gcmontilla commented 6 years ago

I was using your library and I noticed that some songs aren't recognized as tracks:

working url = 'https://soundcloud.com/officialmedasin/i-fall-apart' non working url = 'https://soundcloud.com/nittigritti/lights-nitti-gritti-remix-1'

The non working urls had a '-1' at the end.

This is the error I get: <class 'urllib.error.HTTPError'> HTTP Error 404: Not Found Traceback (most recent call last): File "/Users/greg/Dropbox/python/soundcloud/test.py", line 6, in track = api.resolve('https://soundcloud.com/nittigritti/lights-nitti-gritti-remix-1') File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/sclib/lib.py", line 70, in resolve if obj['kind'] == 'track': TypeError: 'bool' object is not subscriptable

3jackdaws commented 6 years ago

I look into this. Thanks for the detailed report.

3jackdaws commented 6 years ago

I can't reproduce this on Ubuntu 17.10 or MacOS 10.12.4. Does the error happen every time with that URL? Can you provide other URLs that cause the same error? Thanks

edit: Or is that track part of a larger playlist?

gcmontilla commented 6 years ago

I don't think that track is part of a larger playlist, but I can see how that could be the problem.

'https://soundcloud.com/greg-montilla/sets/download-1' this was the url I was using to download songs. There are 20 but I was only able to grab 16.

Edit: I'm on MacOS 10.13.3 Edit: I'm able to download the song's if I don't give my client ID, but once I put my own client ID I get the error

3jackdaws commented 6 years ago

Was the client ID granted through Soundcloud's official application registration process?

gcmontilla commented 6 years ago

Yes, but this was a long time ago. Maybe 2-3 years ago.

3jackdaws commented 6 years ago

I've never been able to test this library with an official client ID because I wrote it after Soundcloud revoked/deleted mine. You can use the SoundcloudAPI class without putting in a clientID at all and it will work identically.

Actually the only reason the client_id parameter is there is so that an API consumer can cache the scraped client_id after the library fetches one. They don't really change that often.

Edit: check out the "Fetch a playlist" example in the README