A Redacted plugin for Beets.
Project description
Redacted Beets Plugin
A Beets plugin for matching albums to torrents on Redacted.
Installation
- Install the redacted plugin via Pip with
pip install beets-redacted. If you installed Beets via PipX, then you can usepipx inject beets beets-redacted. - 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 your Beets config, 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 configuration options are
- api_key (required): Your Redacted API key, with at least 'torrents' scope. If
user_idis also set, the API key must also have the 'User' scope. - user_id (default: empty): Your Redacted user id, used only for looking up your snatches to improve torrent matching. To find your Redacted user id, go to your profile and copy the "id" parameter from the URL bar. It will likely be a number between 1 and 100,000.
- 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.
For example,
redacted:
api_key: ...
user_id: ...
auto: no
force: no
pretend: no
min_score: 0.75
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
Match torrents for the entire library:
beet redacted
Match torrents for Radiohead albums:
beet redacted Radiohead
Match torrents for Radiohead albums, and overwrite the existing matches:
beet redacted -f Radiohead
List albums that don't have a matching torrent, which may be albums to upload:
beet ls -a red_torrentid::^$
(note: matching torrents is fuzzy and imperfect and has room for improvement. It's likely that there are torrents for albums without matches. Please do not automatically upload all unmatched albums without review - you are responsible for your own uploads)
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
- Improved album - torrent matching logic.
- Configure preferred torrent encoding, e.g. 'Lossless' > '24bit Lossless' > 'V0 (VBR)' > '320'.
- Command for snatching and exporting
.torrentfiles.
Planned matching improvements:
Prioritize user's snatches- If possible, re-use Beets' distance matching algorithm.
- Add fields other than artist name, album name, and year to the matching process. It should also include the album's media, distributor, multiple artists, remastering, format, encoding, if it's personal freeleech, and if it's bookmarked.
Contributing
Comments and suggestions are welcome. Discussion may happen in the Redacted forum thread. Pull requests will be eagerly considered.
Development environment
The plugin 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.
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.1.tar.gz.
File metadata
- Download URL: beets_redacted-0.1.1.tar.gz
- Upload date:
- Size: 28.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2408d1123b965cc8d671812cc6e75642384a1e49c0ac56a12d79675e407b46a4
|
|
| MD5 |
d0a9f9267ec4f2fb220de7b70b17a849
|
|
| BLAKE2b-256 |
f9d295e041c18221ff9c85fa0cfd3086b25b70e81a94a3ae1d82154e74db54e0
|
Provenance
The following attestation bundles were made for beets_redacted-0.1.1.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.1.tar.gz -
Subject digest:
2408d1123b965cc8d671812cc6e75642384a1e49c0ac56a12d79675e407b46a4 - Sigstore transparency entry: 206594796
- Sigstore integration time:
-
Permalink:
Judas-red/beets-redacted@68199f7b4dab5f29414bd6196de5170df6587b5c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Judas-red
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@68199f7b4dab5f29414bd6196de5170df6587b5c -
Trigger Event:
release
-
Statement type:
File details
Details for the file beets_redacted-0.1.1-py3-none-any.whl.
File metadata
- Download URL: beets_redacted-0.1.1-py3-none-any.whl
- Upload date:
- Size: 31.7 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 |
06a24216022418f7b42e1844f5fde9ccd4700b110320d3ccaa2ed64fefa1af39
|
|
| MD5 |
534a6191b4d20c59711ce8d636506cb1
|
|
| BLAKE2b-256 |
a0f7262c635c0b2fcf69006d16f996ef8d3ff2ca1f3cdc9dd6f856a3d2c48fd2
|
Provenance
The following attestation bundles were made for beets_redacted-0.1.1-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.1-py3-none-any.whl -
Subject digest:
06a24216022418f7b42e1844f5fde9ccd4700b110320d3ccaa2ed64fefa1af39 - Sigstore transparency entry: 206594798
- Sigstore integration time:
-
Permalink:
Judas-red/beets-redacted@68199f7b4dab5f29414bd6196de5170df6587b5c -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/Judas-red
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@68199f7b4dab5f29414bd6196de5170df6587b5c -
Trigger Event:
release
-
Statement type: