### Cron Job Setup Example Source: https://soularr.net/ Example of how to set up a cron job to run the Soularr bash script every 5 minutes. Use `crontab -e` to edit your crontab file. ```bash crontab -e */5 * * * * /path/to/run.sh ``` -------------------------------- ### Soularr Configuration File Example Source: https://soularr.net/ This is an example of the `config.ini` file for Soularr, showing settings for Lidarr, Slskd, release preferences, search parameters, and logging. ```ini [Lidarr] # Get from Lidarr: Settings > General > Security api_key = yourlidarrapikeygoeshere # URL Lidarr uses (e.g., what you use in your browser) host_url = http://lidarr:8686 # Path to slskd downloads inside the Lidarr container download_dir = /data/slskd_downloads # If true, Lidarr won't auto-import from Slskd disable_sync = False [Slskd] # Create manually (see docs) api_key = yourslskdapikeygoeshere # URL Slskd uses host_url = http://slskd:5030 url_base = / # Download path inside Slskd container download_dir = /downloads # Delete search after Soularr runs delete_searches = False # Max seconds to wait for downloads (prevents infinite hangs) stalled_timeout = 3600 [Release Settings] # Pick release with most common track count use_most_common_tracknum = True allow_multi_disc = True # Accepted release countries accepted_countries = Europe,Japan,United Kingdom,United States,[Worldwide],Australia,Canada # Accepted formats accepted_formats = CD,Digital Media,Vinyl [Search Settings] search_timeout = 5000 maximum_peer_queue = 50 # Minimum upload speed (bits/sec) minimum_peer_upload_speed = 0 # Minimum match ratio between Lidarr track and Soulseek filename minimum_filename_match_ratio = 0.8 # Preferred file types and qualities (most to least preferred) # Use "flac" or "mp3" to ignore quality details allowed_filetypes = flac 24/192,flac 16/44.1,flac,mp3 320,mp3 ignored_users = User1,User2,Fred,Bob # Set to False to only search for album titles (Note Soularr does not search for individual tracks, this setting searches for track titles but still tries to match to the full album). search_for_tracks = True # Prepend artist name when searching for albums album_prepend_artist = False track_prepend_artist = True # Search modes: all, incrementing_page, first_page # "all": search for every wanted record, "first_page": repeatedly searchs the first page, "incrementing_page": starts with the first page and increments on each run. search_type = incrementing_page # Albums to process per run number_of_albums_to_grab = 10 # Unmonitor album on failure; logs to failure_list.txt remove_wanted_on_failure = False # Blacklist words in album or track titles (case-insensitive) title_blacklist = Word1,word2 # Lidarr search source: "missing" or "cutoff_unmet" search_source = missing [Logging] # Passed to Python's logging.basicConfig() # See: https://docs.python.org/3/library/logging.html level = INFO format = [%(levelname)s|%(module)s|L%(lineno)d] %(asctime)s: %(message)s datefmt = %Y-%m-%dT%H:%M:%S%z ``` -------------------------------- ### Install Python Dependencies Source: https://soularr.net/ Installs the required Python packages for Soularr using pip. Ensure you have Python installed and accessible in your PATH. ```bash python -m pip install -r requirements.txt ``` -------------------------------- ### Docker Compose for Lidarr, Slskd, and Soularr Source: https://soularr.net/ A comprehensive Docker Compose setup including Lidarr, Slskd, and Soularr. This configuration ensures proper volume mapping, environment variables, and user/group consistency for seamless integration. ```yaml services: lidarr: image: ghcr.io/hotio/lidarr:latest container_name: lidarr hostname: lidarr environment: - TZ=ETC/UTC - PUID=1000 - PGID=1000 volumes: - /Containers/lidarr:/config - /Media:/data ports: - 8686:8686 restart: unless-stopped slskd: image: slskd/slskd container_name: slskd hostname: slskd user: 1000:1000 environment: - TZ=ETC/UTC - SLSKD_REMOTE_CONFIGURATION=true ports: - 5030:5030 - 5031:5031 - 50300:50300 volumes: - /Containers/slskd:/app - /Media:/data restart: unless-stopped soularr: image: mrusse08/soularr:latest container_name: soularr hostname: soularr user: 1000:1000 environment: - TZ=ETC/UTC - SCRIPT_INTERVAL=300 volumes: - /Media/slskd_downloads:/downloads - /Container/soularr:/data restart: unless-stopped ``` -------------------------------- ### Run Soularr with Docker Source: https://soularr.net/ Use this command to run Soularr in a Docker container. Ensure your user and group IDs match and volumes are correctly mapped. ```bash docker run -d \ --name soularr \ --restart unless-stopped \ --hostname soularr \ -e TZ=ETC/UTC \ -e SCRIPT_INTERVAL=300 \ -v /Media/slskd_downloads:/downloads \ -v /Containers/soularr:/data \ --user 1000:1000 \ mrusse08/soularr:latest ``` -------------------------------- ### Docker Compose for Soularr Source: https://soularr.net/ Configure Soularr using Docker Compose. Adjust volume paths and user/group IDs as necessary for your environment. Ensure Lidarr and Slskd agree on user/group. ```yaml services: soularr: image: mrusse08/soularr:latest container_name: soularr hostname: soularr user: 1000:1000 # this should be set to your UID and GID, which can be determined via `id -u` and `id -g`, respectively environment: - TZ=Etc/UTC - SCRIPT_INTERVAL=300 # Script interval in seconds volumes: # "You can set /downloads to whatever you want but will then need to change the Slskd download dir in your config file" - /Media/slskd_downloads:/downloads # Select where you are storing your config file. # Leave "/data" since thats where the script expects the config file to be - /Containers/soularr:/data restart: unless-stopped ``` -------------------------------- ### Log to File with `tee` on Linux/macOS Source: https://soularr.net/ Use the `tee` command to pipe Soularr's output to both stdout and a specified log file. This is useful for long-running processes or cron jobs. ```bash python soularr.py 2>&1 | tee -a soularr.log ``` -------------------------------- ### Run Soularr Manually Source: https://soularr.net/ Executes the Soularr script directly from the command line. The `config.ini` file must be in the same directory. ```bash python soularr.py ``` -------------------------------- ### Log to File with `Tee-Object` on Windows PowerShell Source: https://soularr.net/ Utilize the `Tee-Object` cmdlet in PowerShell to redirect Soularr's output to both the console and a log file. Ensure the `-Append` flag is used if you want to append to an existing log. ```powershell python soularr.py 2>&1 | Tee-Object -FilePath soularr.log -Append ``` -------------------------------- ### Customize Logging Format Source: https://soularr.net/ Modifies the logging format in `config.ini` to display only the message content. This is useful for simplifying log output. ```ini [Logging] format = %(message)s ``` -------------------------------- ### Bash Script for Scheduling Soularr Source: https://soularr.net/ A bash script designed to be scheduled with cron. It checks if Soularr is already running before executing it, preventing multiple instances. ```bash #!/bin/bash cd /path/to/soularr/python/script dt=$(date '+%d/%m/%Y %H:%M:%S'); echo "Starting Soularr! $dt" if ps aux | grep "[s]oularr.py" > /dev/null; then echo "Soularr is already running. Exiting..." else python soularr.py fi ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.