Git Product home page Git Product logo

beetseeker's Introduction

BeetSeeker

Automagic beets for your Soulseek beats.

What does BeetSeeker do?

BeetSeeker leverages the APIs of two self-hosted services:

  1. slskd: A browser-based client for Soulseek (the peer-to-peer file sharing system).
  2. betanin: A browser-based interface for beets, designed for torrent clients and automation.

Getting Started

BeetSeeker requires Python 3.7 or higher for requests. Using a virtual environment is recommended to install the Python modules:

pip install -r requirements.txt

Customize and rename example_config.py: BeetSeeker needs to know the URLs and API keys for slskd and betanin, plus the path to the "downloads directory.

BeetSeeker does not need direct access to any other files. Instead, BeetSeeker uses APIs, so it depends on preexisting installs of slskd and betanin, with both APIs enabled and configured.

slskd API considerations

The setup for slskd API keys is described in the slskd docs. Please use HTTPS if possible.

betanin API considerations

Although betanin was designed to make beets work with a torrent client, we can make it work with Soulseek using the the slskd APIs to wait until each directory request is complete. The APIs track subdirectories of the slskd "completed downloads" path -- the same path you'd configure in slskd itself, which prevents BeetSeeker from trying to process each file individually.

It is not recommended to run beets jobs in parallel. Since betanin's config.toml is undocumented for now, here is a minimal example:

[frontend]
username = "betanin"
password = "betanin"

[clients]
api_key = ""

[server]
num_parallel_jobs = 1

[notifications.services]

[notifications.strings]
body = "@ $time. view/use the console at http://127.0.0.1:9393/$console_path"
title = "[betanin] torrent `$name` $status"

How does BeetSeeker work??

  1. Directory Monitoring: BeetSeeker is designed to monitor slskd's "Completed Downloads" path. It continuously checks for the presence of new subdirectories. When a new subdirectory is detected, BeetSeeker queries slskd to retrieve the status of these recent downloads, and waits until all downloads within the new subdirectory have been completed.

  2. Download Import: Once the latest downloads from the new directory are completed, BeetSeeker initiates the beets import process using betanin, and continually checks its status. This will have one of two possible results:

  • If the import succeeds, BeetSeeker's process repeats from step 1.
  • If the import process encounters an issue that requires manual intervention, BeetSeeker will skip the current subdirectory and let you know.

Manual Intervention

When BeetSeeker requires attention, you (the human) will need to take action.

  • Check the status of slskd and betanin. If their API's don't respond, nothing works. (Note: Both services can be configured to provide a /swagger interface for testing.)
  • Remove and retry any download errors, and/or
  • Manually import the downloads yourself via the betanin web interface.

BeetSeeker completely skips directories with errors, so once you have resolved the issue, you can either download something else or restart BeetSeeker to continue the monitoring and automatic import process.

beetseeker's People

Contributors

andrewjmetzger avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

beetseeker's Issues

ImportError: attempted relative import with no known parent package

I get the following error on runtime for docker compose:

beetseeker       |   File "/app/main.py", line 6, in <module>
beetseeker       |     from . import config
beetseeker       | ImportError: attempted relative import with no known parent package
beetseeker exited with code 1```

beetseeker:
image: ghcr.io/andrewjmetzger/beetseeker:latest
container_name: beetseeker
environment:
- UID=1000 # (optionally) set user id
- GID=1000 # (optionally) set group id
volumes:
- ${DATA}/beetseeker/config.py:/app/config.py
- ${MEDIA}/media/music-beets:/music-beets/
- ${MEDIA}/beetsingress:/beetsingress/
- /mnt/tank/public/downloads/slskd:/public/downloads/

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.