Miserlou / SoundScrape

SoundCloud (and Bandcamp and Mixcloud) downloader in Python.
MIT License
1.42k stars 146 forks source link

Can't download Soundcloud likes #253

Closed dan-asa closed 3 years ago

dan-asa commented 3 years ago

I can download individual tracks from soundcloud, but I can't download likes and this error shows up. Any idea why?

`Active code page: 65001 Traceback (most recent call last): File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 183, in process_soundcloud resolved2 = soundcloud.resource.ResourceList(resolved2['collection']) KeyError: 'collection'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Program Files\Python39\Scripts\soundscrape.exe__main__.py", line 7, in File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 123, in main process_soundcloud(vargs) File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 204, in process_soundcloud track_data = get_soundcloud_data(artist_url) File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 489, in get_soundcloud_data data['artist'] = title_tag.split(' by ')[1].split('|')[0].strip() IndexError: list index out of range`

markddavidoff commented 3 years ago

Url you input please, just tried with another url and works fine for me. this line depends on soundcloud title saying "X by Y"

dan-asa commented 3 years ago

I tried using soundscrape fdd-dan -l and soundscrape https://soundcloud.com/fdd-dan -l

Basically I tried to get the liked tracks from my account. I tried now with a different account and it works. Maybe it's the "-" character from the name?

markddavidoff commented 3 years ago

potential fix: @Miserlou https://github.com/Miserlou/SoundScrape/pull/254

dan-asa commented 3 years ago

I replaced soundscrape.py with the one from the fix and unfortunately I got a similar error.

`soundscrape fdd-dan -l -f Active code page: 65001 Traceback (most recent call last): File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 179, in process_soundcloud if('next_href' in resolved2): TypeError: argument of type 'Resource' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Program Files\Python39\Scripts\soundscrape.exe__main__.py", line 7, in File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 123, in main process_soundcloud(vargs) File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 203, in process_soundcloud track_data = get_soundcloud_data(artist_url) File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 488, in get_soundcloud_data data['artist'] = title_tag.split(' by ')[1].split('|')[0].strip() IndexError: list index out of range`

markddavidoff commented 3 years ago

Ah yes, lol, i forgot about the code above it as ive been using soundcloud as an import and not as a module via the cli. Ill update my pr.

On Thu, Feb 4, 2021, 11:36 AM Dan ASA notifications@github.com wrote:

I replaced soundscrape.py with the one from the fix and unfortunately I got a similar error.

`soundscrape fdd-dan -l -f Active code page: 65001 Traceback (most recent call last): File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 179, in process_soundcloud if('next_href' in resolved2): TypeError: argument of type 'Resource' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\program files\python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\program files\python39\lib\runpy.py", line 87, in

run_code exec(code, run_globals) File "C:\Program Files\Python39\Scripts\soundscrape.exe_main.py", line 7, in File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 123, in main process_soundcloud(vargs) File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 203, in process_soundcloud track_data = get_soundcloud_data(artist_url) File "c:\program files\python39\lib\site-packages\soundscrape\soundscrape.py", line 488, in get_soundcloud_data data['artist'] = title_tag.split(' by ')[1].split('|')[0].strip() IndexError: list index out of range`

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miserlou/SoundScrape/issues/253#issuecomment-773554432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKMFHZIFAVIDSNRGWASG7TS5LZJ7ANCNFSM4XC3JMPA .

markddavidoff commented 3 years ago

I believe its the number of likes that is the key factor and it is the pagination that does not work

On Thu, Feb 4, 2021, 10:44 AM Dan ASA notifications@github.com wrote:

I tried using soundscrape fdd-dan -l and soundscrape https://soundcloud.com/fdd-dan https://soundcloud.com/fdd-dan -l

Basically I tried to get the liked tracks from my account. I tried now with a different account and it works. Maybe it's the "-" character from the name?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Miserlou/SoundScrape/issues/253#issuecomment-773524773, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKMFH4YQC33AAX5WBOHIYDS5LTKVANCNFSM4XC3JMPA .

markddavidoff commented 3 years ago

I've updated my pr, should work now @FDDdan #254

dan-asa commented 3 years ago

Thanks a lot, it works!