kokarare1212 / librespot-python

Open Source Spotify Client
http://librespot-python.rtfd.io
Apache License 2.0
234 stars 45 forks source link

[BUG] Error 404 on certain songs when used in conjunction with zotify #280

Open FISSI0N opened 1 month ago

FISSI0N commented 1 month ago

I hope this is the right place to mention this bug, as I found it using zotify (and reported it there too: https://github.com/zotify-dev/zotify/issues/195 ). Please delete if it's the wrong place to report too, even though it seems to be connected to librespot's init.py file:

Track_ID: 1wPhVZMt6eIkGxcGBX6L2S

404

        [∙●∙] Preparing download... Traceback (most recent call last):
  File "C:\Python 3\Lib\site-packages\zotify\track.py", line 225, in download_track
    stream = Zotify.get_content_stream(track, Zotify.DOWNLOAD_QUALITY)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\zotify\zotify.py", line 53, in get_content_stream
    return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 723, in load
    return self.load_track(playable_id, audio_quality_picker, preload,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 784, in load_track
    return self.load_stream(file, track, None, preload, halt_listener)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 738, in load_stream
    return CdnFeedHelper.load_track(self.__session, track, file,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 340, in load_track
    streamer = session.cdn().stream_file(file, key, url, halt_listener)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 439, in stream_file
    return CdnManager.Streamer(
           ^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 562, in __init__
    response = self.request(range_start=0,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python 3\Lib\site-packages\librespot\audio\__init__.py", line 623, in request
    raise IOError(response.status_code)
OSError: 404

im using the latest snapshot version of librespot (which is still displayed as 0.0.9 though).

Masterolic commented 1 month ago

404 stands for not found seems like the track is not available at your region or unavailable

FISSI0N commented 1 month ago

I just tryied via VPN and am still getting the same error. I believe its got nothing to do with a region lock

Masterolic commented 1 month ago

I just tryied via VPN and am still getting the same error. I believe its got nothing to do with a region lock

That what make us confuse robust blocking had being done by Spotify just using a vpn does not resolve it else we would use that but that made harder for us. When we use vpn Spotify detect it as different region from which region your account had being created so they still stuck us on the current region. In case if we had to shift Country use vpn and login to web and there to your profile settings you can see a option had enabled named region which you can select your current ip address region and the default region (the region when you created).

Unfortunately the game had not ended it takes several minutes to get updated through the whole service

Erriez commented 2 weeks ago

Discussed in librespot-org project issue Connection reset by peer (os error 104) #1340.

Looks like this MR should be backported to this project in order to fix the connection problems.