lavolp3 / spotify-ripper

A fork of @hbashtons spotify-ripper with latest fixes
MIT License
15 stars 5 forks source link

can network timeout tolerance be increased? #23

Open kaefert opened 4 years ago

kaefert commented 4 years ago

couldn't find anything about it in the -h help text.

Crashed with this error while my network connection was flaky:

Exception in thread SpotifyRipperThread:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/spotify_ripper-2.9.1-py2.7.egg/spotify_ripper/ripper.py", line 258, in run
    tracks = list(get_tracks_from_uri(uri))
  File "/usr/local/lib/python2.7/dist-packages/spotify_ripper-2.9.1-py2.7.egg/spotify_ripper/ripper.py", line 225, in get_tracks_from_uri
    return self.load_link(uri)
  File "/usr/local/lib/python2.7/dist-packages/spotify_ripper-2.9.1-py2.7.egg/spotify_ripper/ripper.py", line 475, in load_link
    album_browser.load()
  File "/usr/lib/python2.7/dist-packages/spotify/album.py", line 264, in load
    return utils.load(self._session, self, timeout=timeout)
  File "/usr/lib/python2.7/dist-packages/spotify/utils.py", line 246, in load
    raise spotify.Timeout(timeout)
Timeout: Operation did not complete in 10.000s
lavolp3 commented 4 years ago

This is a problem with the api call. The timeout of the response cannot be changed. It wouldn't make a difference either way. What did you try to call?

kaefert commented 4 years ago

just normal track downloading, but it succeeded at the second try. It was simply a network issue on my side.

I just wanted to ask if spotify-ripper could be made more tolerant to network problems and retry on such failures instead of crashing.

lavolp3 commented 4 years ago

There is a variable for that but I believe it is inside the spotify code so not accessible from here. May be accessible via an api call. Will have a look at it. You're invited to research that as well