Dniel97 / orpheusdl-beatport

An OrpheusDL Beatport module
31 stars 11 forks source link

Territory Restricted Tracks, Despite appearing in my region. #12

Open SquashingBugs opened 1 week ago

SquashingBugs commented 1 week ago

Hello I get this error for a territory restricted track: territory Despite the track being available in my region and available for purchase. I am using a USA based beatport streaming account. Proof that this track is streamable: proof Track link of concern: https://www.beatport.com/track/i-rave-you-original-mix/3519499 This issue is not exclusive to this track, but applies to many tracks as well, possibly any track with a Region restriction I think. If I have a beatport streaming account, and this track appears in my region and is available for streaming, I should be able to download it without any issues, but there is something that is preventing me from being able to.

zhordon commented 3 days ago

This one may have been a Beatport issue. I was just able to download the track using USA and GB based location.

However, I have seen what your seeing before, one Label in particular recently.

zhordon commented 2 days ago

I found another one similar to the OP while going through and redownloading some stuff.

Release: https://www.beatport.com/release/pegasus-extended-mix/4561083 Track: https://www.beatport.com/track/pegasus/19007718

Track is fully streamable, but shows restricted when downloading.

Screenshot 2024-11-02 at 11 31 41 AM

Release Error Message:

   ____             _                    _____  _      
  / __ \           | |                  |  __ \| |     
 | |  | |_ __ _ __ | |__   ___ _   _ ___| |  | | |     
 | |  | | '__| '_ \| '_ \ / _ \ | | / __| |  | | |     
 | |__| | |  | |_) | | | |  __/ |_| \__ \ |__| | |____ 
  \____/|_|  | .__/|_| |_|\___|\__,_|___/_____/|______|
             | |                                       
             |_|                                       

Traceback (most recent call last):
  File "/Users/Music/OrpheusDL/orpheus.py", line 225, in <module>
    main()
  File "/Users/Music/OrpheusDL/orpheus.py", line 220, in main
    orpheus_core_download(orpheus, media_to_download, tpm, sdm, path)
  File "/Users/Music/OrpheusDL/orpheus/core.py", line 397, in orpheus_core_download
    downloader.download_album(media_id, extra_kwargs=media.extra_kwargs)
  File "/Users/Music/OrpheusDL/orpheus/music_downloader.py", line 207, in download_album
    album_info: AlbumInfo = self.service.get_album_info(album_id, **extra_kwargs)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Music/OrpheusDL/modules/beatport/interface.py", line 264, in get_album_info
    album_data = data.get(album_id) if album_id in data else self.session.get_release(album_id)
                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/troy/Music/OrpheusDL/modules/beatport/beatport_api.py", line 99, in get_release
    return self._get(f'catalog/releases/{release_id}')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Music/OrpheusDL/modules/beatport/beatport_api.py", line 88, in _get
    raise ConnectionError(r.text)
ConnectionError: {"detail":"Territory Restricted."}

Track Error Message:

   ____             _                    _____  _      
  / __ \           | |                  |  __ \| |     
 | |  | |_ __ _ __ | |__   ___ _   _ ___| |  | | |     
 | |  | | '__| '_ \| '_ \ / _ \ | | / __| |  | | |     
 | |__| | |  | |_) | | | |  __/ |_| \__ \ |__| | |____ 
  \____/|_|  | .__/|_| |_|\___|\__,_|___/_____/|______|
             | |                                       
             |_|                                       

Traceback (most recent call last):
  File "/Users/Music/OrpheusDL/orpheus.py", line 225, in <module>
    main()
  File "/Users/Music/OrpheusDL/orpheus.py", line 220, in main
    orpheus_core_download(orpheus, media_to_download, tpm, sdm, path)
  File "/Users/Music/OrpheusDL/orpheus/core.py", line 399, in orpheus_core_download
    downloader.download_track(media_id, extra_kwargs=media.extra_kwargs)
  File "/Users/Music/OrpheusDL/orpheus/music_downloader.py", line 294, in download_track
    track_info: TrackInfo = self.service.get_track_info(track_id, quality_tier, codec_options, **extra_kwargs)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Music/OrpheusDL/modules/beatport/interface.py", line 299, in get_track_info
    track_data = data[track_id] if track_id in data else self.session.get_track(track_id)
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Music/OrpheusDL/modules/beatport/beatport_api.py", line 96, in get_track
    return self._get(f'catalog/tracks/{track_id}')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Music/OrpheusDL/modules/beatport/beatport_api.py", line 88, in _get
    raise ConnectionError(r.text)
ConnectionError: {"detail":"Territory Restricted."}
zhordon commented 2 days ago

Just for verification purposes, I've connected my Beatport account to my Denon DJ equipment and the track is streamable/downloadable.

image image image image

zhordon commented 1 day ago

So after some further investigation the track links I provided, the API is giving what it believes is the appropriate response.

The track downloaded by DJ hardware was an alternate track. Upon playing the correct track in the web player, it went from full track to a specific preview section. I then added the track to a playlist, and the track is not visible from the DJ hardware nor searchable.

I have seen a couple of tracks like this, and confirmed the same behaviour. Beatport is reporting the tracks as Territory Restricted, when they are in fact not streamable.

Maybe further testing needs to be done, but it seems more like a Beatport API issue rather than a module issue.

Screenshot 2024-11-03 at 10 18 07 AM Screenshot 2024-11-03 at 10 18 42 AM