Miserlou / SoundScrape

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

AttributeError: 'HTTPError' object has no attribute 'replace' #204

Closed moonym closed 6 years ago

moonym commented 6 years ago

Getting the stack trace from below when using soundscrape <artist> -f This seems to be occurring for soundcloud only, right now. Bandcamp works fine for me.

Traceback (most recent call last):
  File "/usr/local/bin/soundscrape", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 119, in main
    process_soundcloud(vargs)
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 292, in process_soundcloud
    id3_extras=id3_extras)
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 460, in download_tracks
    puts_safe(e)
  File "/usr/local/lib/python2.7/dist-packages/soundscrape/soundscrape.py", line 1315, in puts_safe
    puts(text)
  File "/usr/local/lib/python2.7/dist-packages/clint/textui/core.py", line 57, in puts
    s = tsplit(s, NEWLINES)
  File "/usr/local/lib/python2.7/dist-packages/clint/utils.py", line 69, in tsplit
    string = string.replace(i, final_delimiter)
AttributeError: 'HTTPError' object has no attribute 'replace'
RodolfoSalido commented 6 years ago

I recently updated soundscape. I had been using it and downloaded 600+ songs but it no longer works properly and returns a similar error description.

c-v-ya commented 6 years ago

Same issue, I can guess the root of the problem may be in:

Because it was working just fine and I didn't update soundscrape itself.

tdufala commented 6 years ago

This is an exception thrown while handling an original exception that occurs due to a 429 HTTP response (see issue #203 ):

Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 437, in download_tracks
    stream = client.get(track['stream_url'], allow_redirects=False, limit=200)
  File "/usr/lib/python3.6/site-packages/soundcloud/client.py", line 133, in _request
    return wrapped_resource(make_request(method, url, kwargs))
  File "/usr/lib/python3.6/site-packages/soundcloud/request.py", line 148, in make_request
    result.raise_for_status()
  File "/usr/lib/python3.6/site-packages/requests/models.py", line 909, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 429 Client Error: Unknown for url: https://api.soundcloud.com/tracks/94732714/stream?limit=200&client_id=<client_id>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/soundscrape", line 11, in <module>
    sys.exit(main())
  File "/usr/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 119, in main
    process_soundcloud(vargs)
  File "/usr/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 292, in process_soundcloud
    id3_extras=id3_extras)
  File "/usr/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 460, in download_tracks
    puts_safe(e)
  File "/usr/lib/python3.6/site-packages/soundscrape/soundscrape.py", line 1315, in puts_safe
    puts(text)
  File "/usr/lib/python3.6/site-packages/clint/textui/core.py", line 57, in puts
    s = tsplit(s, NEWLINES)
  File "/usr/lib/python3.6/site-packages/clint/utils.py", line 69, in tsplit
    string = string.replace(i, final_delimiter)
AttributeError: 'HTTPError' object has no attribute 'replace'

I editted out the client_id. I reproduce the above via: soundscrape -l <username>, but I think it would be the same with -f.

thetakodev commented 6 years ago

same problem

Vladikamira commented 6 years ago

I also have the same problem

GillesJ commented 6 years ago

Same issue.

vinz243 commented 6 years ago

same

fshuetli commented 6 years ago

same here - is this in progress?

boardfish commented 6 years ago

Getting this issue myself when scraping my likes.

Lanchon commented 6 years ago

duplicate of #203, please close

moonym commented 6 years ago

Sure thing - closing this issue.

br101 commented 6 years ago

i see this too, but i think it's not related to 429 as in (#203)...

`Downloading: Ajeet Kaur - Ra Ma Da Sa Problem downloading XXXAjeet Kaur - Ra Ma Da Sa Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/soundscrape/soundscrape.py", line 437, in download_tracks stream = client.get(track['stream_url'], allow_redirects=False, limit=200) File "/usr/local/lib/python3.6/dist-packages/soundcloud/client.py", line 133, in _request return wrapped_resource(make_request(method, url, kwargs)) File "/usr/local/lib/python3.6/dist-packages/soundcloud/request.py", line 148, in make_request result.raise_for_status() File "/usr/lib/python3/dist-packages/requests/models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.soundcloud.com/tracks/452383728/stream?limit=200&client_id=175c043157ffae2c6d5fed16c3d95a4c

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/local/bin/soundscrape", line 11, in sys.exit(main()) File "/usr/local/lib/python3.6/dist-packages/soundscrape/soundscrape.py", line 119, in main process_soundcloud(vargs) File "/usr/local/lib/python3.6/dist-packages/soundscrape/soundscrape.py", line 292, in process_soundcloud id3_extras=id3_extras) File "/usr/local/lib/python3.6/dist-packages/soundscrape/soundscrape.py", line 460, in download_tracks puts_safe(e) File "/usr/local/lib/python3.6/dist-packages/soundscrape/soundscrape.py", line 1315, in puts_safe puts(text) File "/usr/local/lib/python3.6/dist-packages/clint/textui/core.py", line 57, in puts s = tsplit(s, NEWLINES) File "/usr/local/lib/python3.6/dist-packages/clint/utils.py", line 69, in tsplit string = string.replace(i, final_delimiter) AttributeError: 'HTTPError' object has no attribute 'replace'`

malleable808 commented 6 years ago

Same issue as @br101 !

douglasrolim commented 5 years ago

Same here