Package: beets-beatport4
Plugin forbeetsto replace stock beatport plugin and use Beatport API v4 as an
autotagger source.As Beatport had killed their API v3, the stock beatport plugin does not work anymore. It is also currently not possible to request the access to the API “normal” way (by using your client credentials or API token generated by Beatport), so I have found workaround that uses public API client id used forBeatport docs frontendand updated the code to use the new specification.For more info, see the discussion on this issue:https://github.com/beetbox/beets/issues/3862I have also opened a pull request in the official beets repository (https://github.com/beetbox/beets/pull/4477), so if it gets merged, I am probably going to take down this plugin.InstallationInstall this plugin with$ pip install beets-beatport4and addbeatport4to thepluginslist in your beets config file.Beatport AuthorizationThere are two ways of acquiring user access token to the Beatport v4 API using
this plugin.Method 1: username and passwordThis method is fully automatic and relies on holding your Beatport username
and password inside your beets config file.
It will authorize to the Beatport API usingauthorization_codegrant type
andclient_idprovided by beatport for the sake of theirswagger-uifrontend in which you can test their API:https://api.beatport.com/v4/docs/By default,client_idis scrapped automatically from the above URL.
Alternatively, you can also pass it via plugin configuration.Steps:Addbeatport4plugin to yourbeets/config.yamlplugins listAdd below configuration and fill your credentialsbeatport4:art:yesart_overwrite:nousername:<YOUR_BEATPORT_USERNAME>password:<YOUR_BEATPORT_PASSWORD>Method 2. copy token from the browserYou will probably want to use this method if you don’t want to store your
credentials unencrypted within the config file. Also, it will be helpful if
for any reason something goes wrong during the username/password authorization
process.This is also a fallback method if you provide wrong credentials in the config.Steps:Addbeatport4plugin to yourbeets/config.yamlplugins listWhen the first import with plugin enabled happens, you will be prompted to paste the access token JSONVisithttps://api.beatport.com/v4/docs/Open Network tab in your browser and start capturing the trafficLogin with your Beatport accountSearch for the following request:https://api.beatport.com/v4/auth/o/token/Copy the response (whole JSON structure)Paste it to the terminal (orbeatport_token.jsonfile next to yourbeets/config.yaml- you can check the path by runningbeet config--pathscommand)If the token expires, you will be prompted again and required to repeat above stepsFetching and embedding an artAdditionally, this plugin has implemented separate art fetching and embedding.
Unlikefetchart plugin,
it handles both singletons, but it will not work if you choose candidate source
other than Beatport.
Also, it does not require enablingfetchartorembedartplugins, as it usesbeets.art moduleshipped with the core library.Under the hood, it uses image URL for the track’s release,
exposed by the Beatport API.You can enable this feature via configuration (it is disabled by default):beatport4:art:yesBy default, if a track already contains an art, it will not be overwritten.
Again, you can force such behaviour via configuration:beatport4:art:yesart_overwrite:yesImage sizeOriginal images from Beatport might have big resolution and size, but thanks to
Beatport’s dynamic image URIs, it is possible to fetch image already resized by
Beatport backend, saving the bandwidth and resources on resizing images locally.
To specify the dynamic width and height, just pass it via configuration:beatport4:art:yesart_width:250# don't specify or 0 to disableart_height:250# don't specify or 0 to disableif you specify just one dimension, the other will be set to the same value, so the aspect ratio is 1:1if you don’t specify any dimension, original art will be downloadedif you specify both dimensions, they will be used in the dynamic URI, but they usually (always?) return images in 1:1 aspect ratio using lower dimension anywayPlugin configurationbeatport4:art:noart_overwrite:noart_width:<WIDTH_PX>art_height:<HEIGHT_PX>username:<YOUR_BEATPORT_USERNAME>password:<YOUR_BEATPORT_PASSWORD>client_id:<BEATPORT_API_CLIENT_ID># optional, you can set it, but it should be scrapped automatically from the docsApart from the above, plugin should work exactly the same way as the stock one, so please refer to theofficial documentation