slskd-musicsearch/README.md

40 lines
2 KiB
Markdown
Raw Permalink Normal View History

2023-09-19 12:09:38 -04:00
slskd-musicsearch
=================
A small library to query for a release ID from musicbrainz, then locate and queue downloads for the tracks in that release on an instance of slskd
Installation
------------
2023-09-20 08:55:15 -04:00
* Install `requests`, `musicbrainzngs`, `slskd-api` from pypi with `pip3 install requests musicbrainzngs slskd-api`
2023-09-19 12:09:38 -04:00
* Copy the functions in `slskdsearch.py`, or the file itself, into your project (it's MIT license).
* Set the environment variables `SLSKD_HOST` and `SLSKD_KEY` to the path to your slskd instance (`http://hostname:port`) and your [API key for slskd](https://github.com/slskd/slskd/blob/master/docs/config.md#authentication) respectively, or edit the values in the definition for the `slskd` variable.
2023-09-20 08:55:15 -04:00
* Set the environment variables `LIDARR_HOST` and `LIDARR_KEY` to the path to your lidarr instance (`http://hostname:port`) and your API key for lidarr respectively, or edit the values for the `lidarr` variable.
2023-09-19 12:09:38 -04:00
2023-09-20 08:55:15 -04:00
Usage
2023-09-19 12:09:38 -04:00
-----
do the above installation, then run `python3 -i slskdsearch.py`, then find the release ID for the album you want (not the release-group, one of the listed releases, probably the US CD release for western music) and run
```python
2023-09-20 08:55:15 -04:00
release_id = "pasted_id"
album = get_album(release_id)
2023-09-19 12:09:38 -04:00
search(album)
```
check slskd/searches to see the search progress, if it's successful it'll queue the files under /downloads and delete the search, if it's unsuccessful it'll show the search ID and you'll have to manually select files because it couldn't do it automatically sorry
2023-09-20 08:55:15 -04:00
You can also now tell lidarr to create an entry for the album and artist with
```python
lidarr_album = add_album_to_lidarr(release_id)
```
2023-09-19 12:09:38 -04:00
2023-09-20 08:55:15 -04:00
So far I haven't been able to get Lidarr to import the files from my unsorted folder automatically, you'll want to go to `/wanted/missing`, click Manual Import, and import it like that. But after that you can use
2023-09-19 12:09:38 -04:00
```python
2023-09-20 08:55:15 -04:00
lidarr_retag(lidarr_album["artist"]["id"])
2023-09-19 12:09:38 -04:00
```
2023-09-20 08:55:15 -04:00
to trigger Lidarr to update the metadata in the files. And then your music server should pick up the new files and all should be fine and/or dandy.