murdos / musicbrainz-userscripts

Collection of userscripts for MusicBrainz, by various authors
554 stars 92 forks source link

beatport_importer: doesn't work properly when track number is over 100 #540

Open zyoshoka opened 1 year ago

zyoshoka commented 1 year ago

The Beatport API is called every 100 tracks, so for a release with more than 100 tracks like this, the import will not work properly.

Currently, the Beatport importer is not sending API requests directly but is importing from JSON data stored in the script whose id is __NEXT_DATA__. This data also only provides data for up to 100 tracks, so if you try to import a release with more than 100 tracks, you will end up with fewer track data than you actually see.

Possible Solutions

I believe there are two ways to solve this problem.

  1. Send API requests directly. This method is mentioned here, but it requires a token for the requests and I do not know how to put that token into the script.
  2. Browse the pages of each track. The track page also stores a script with the id of __NEXT_DATA__, where data for the track is stored, so you can solve this problem by getting the URLs of all tracks from the release and sending a request for each of them.