A Redacted plugin for Beets.
Project description
Redacted Beets Plugin
A Beets plugin for searching and updating Redacted information for your Beets library. The plugin searches for both matching torrents and requests on Redacted, helping you keep your library metadata up to date and find potential uploads.
Installation
- Install the redacted plugin via Pip with
pip install https://github.com/judas-red/beets-redacted@main. If you installed Beets via PipX, then you can usepipx inject beets https://github.com/judas-red/beets-redacted@main. - Create a Redacted API key. Go to your user's 'Settings' page, then to the 'Access Settings' section. Under 'API Keys', enter a name for your new API key (perhaps 'beets-redacted'), copy the key in the 'API Key' field for use in the next step, check only the 'Torrents' checkbox, and check the 'Confirm API Key' checkbox. Then, save your profile. The new API Key should then be present with the name you gave it.
- Update your Beets configuration. Enable the
redactedplugin, and configure the API Key you generated above:
plugins:
...
- redacted
redacted:
api_key: <your new api key>
Configuration
The options you can set are
- api_key (required): Your Redacted API key, with at least 'torrents' scope.
- auto (default: no): When enabled, search for matching torrents during import.
- force (default: no): When enabled, search for matching torrents even for albums that already have a match in the database.
- pretend (default: no): When enabled, show the changes that would be made to the database, but do not modify the database.
- min-score (experimental, default: 0.75): Minimum match score needed to consider a torrent to be a match to an album. Likely to be changed soon.
Some of these parameters can also be set on the command line, with -f / --force, -p / --pretend, and -m 0.75 / --min-score=0.75.
Usage
Search for matching torrents for the entire library:
beet redacted
Search for matching torrents for Radiohead albums:
beet redacted Radiohead
Search for matching torrents for Radiohead albums, and overwrite the existing matches:
beet redacted -f Radiohead
List albums that don't have a matching torrent in Redacted, which may be candidates to upload to Redacted:
beet ls -a red_torrentid::^$
(note: matching torrents to albums imperfect and has room for improvement. It's possible or even likely that there are torrents for albums without matches. Please do not automatically upload all unmatched albums without manually verifying that they aren't already present in Redacted)
List albums that are missing tracks (using the missing plugin) and have a matching torrent, which may be candidates for snatching to fill gaps in the library:
beet missing -a -c -f '$albumartist - $album: Missing $missing; Red: https://redacted.sh/torrents.php?id=$red_groupid&torrentid=$red_torrentid' ^red_torrentid::^$
Roadmap
Features under development include
- Improved album - torrent matching logic.
- Configure preferred torrent encoding, e.g. 'Lossless' > '24bit Lossless' > 'V0 (VBR)' > '320'.
- Command for snatching and exporting
.torrentfiles.
Development
beets-redacted uses Poetry and Poe the Poet to manage the package, its dependencies, and to format, lint, and test the code. Please ensure you have both installed and are familiar with their usage.
While Beets supports Python 3.8+, this plugin requires 3.9+.
Set up the development environment:
# Install dependencies
poetry install
# Install Git pre-commit hooks
poetry run pre-commit install
Run Beets using the development plugin:
poetry run beet redacted
Sort imports, format, lint, run tests, and check types:
poetry run poe sort
poetry run poe format
poetry run poe lint
poetry run poe test
poetry run poe type
Sort, format, and run tests - useful for AI agents' self-iteration:
poetry run poe check
Sort imports, format, run tests, lint, and check types - enforced on merging pull requests:
poetry run poe checkall
Development guidelines
To support AI-assisted development, strong type checking is required and it's imperative to maintain very high code coverage with effective unit tests.
Contributing
Comments and suggestions are welcome. Discussion may happen in the Redacted forum thread (link TBC). Pull requests will be eagerly considered.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beets_redacted-0.1.0.tar.gz.
File metadata
- Download URL: beets_redacted-0.1.0.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee6efe1d9e81f713c87d70ee17226a56993b92f27d21a186ab1db26cba08ff38
|
|
| MD5 |
0ce92d3a0ab738342c2ab912d36891fa
|
|
| BLAKE2b-256 |
5d51af53814424bcb01826de8c43275faab760194872c79f7bac9a0a3b2f2157
|
Provenance
The following attestation bundles were made for beets_redacted-0.1.0.tar.gz:
Publisher:
python-publish.yml on Judas-red/beets-redacted
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beets_redacted-0.1.0.tar.gz -
Subject digest:
ee6efe1d9e81f713c87d70ee17226a56993b92f27d21a186ab1db26cba08ff38 - Sigstore transparency entry: 201732806
- Sigstore integration time:
-
Permalink:
Judas-red/beets-redacted@363c9dfed1c9720f0d980101778b684930c1db64 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/Judas-red
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@363c9dfed1c9720f0d980101778b684930c1db64 -
Trigger Event:
release
-
Statement type:
File details
Details for the file beets_redacted-0.1.0-py3-none-any.whl.
File metadata
- Download URL: beets_redacted-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f32d4eda74736d991eae2dcda2dc64914f2e0045cd5cf4f066ca0ea6d46bbcfd
|
|
| MD5 |
19b51f1de721e83b3218af9b2b848e88
|
|
| BLAKE2b-256 |
6b60479338e4fafe9fd79385f3c69b8821b436e7d64483be737f9986d2503b17
|
Provenance
The following attestation bundles were made for beets_redacted-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on Judas-red/beets-redacted
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beets_redacted-0.1.0-py3-none-any.whl -
Subject digest:
f32d4eda74736d991eae2dcda2dc64914f2e0045cd5cf4f066ca0ea6d46bbcfd - Sigstore transparency entry: 201732809
- Sigstore integration time:
-
Permalink:
Judas-red/beets-redacted@363c9dfed1c9720f0d980101778b684930c1db64 -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/Judas-red
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@363c9dfed1c9720f0d980101778b684930c1db64 -
Trigger Event:
release
-
Statement type: