{"id":27832040,"url":"https://github.com/ThijmenGThN/swaparr","last_synced_at":"2025-05-02T06:01:29.794Z","repository":{"id":226298081,"uuid":"766635280","full_name":"ThijmenGThN/swaparr","owner":"ThijmenGThN","description":"✦ A robust solution addressing stalled downloads in Starr apps.","archived":false,"fork":false,"pushed_at":"2025-04-09T15:30:45.000Z","size":2710,"stargazers_count":75,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-25T23:34:11.437Z","etag":null,"topics":["docker","radarr","rust","sonarr"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThijmenGThN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-03T19:51:03.000Z","updated_at":"2025-04-25T22:03:51.000Z","dependencies_parsed_at":"2024-10-19T23:14:44.102Z","dependency_job_id":"39371dda-e4a0-41d8-aa60-da51def66ff0","html_url":"https://github.com/ThijmenGThN/swaparr","commit_stats":null,"previous_names":["thijmengthn/swaparr"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThijmenGThN%2Fswaparr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThijmenGThN%2Fswaparr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThijmenGThN%2Fswaparr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThijmenGThN%2Fswaparr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThijmenGThN","download_url":"https://codeload.github.com/ThijmenGThN/swaparr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251993055,"owners_count":21677026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","radarr","rust","sonarr"],"created_at":"2025-05-02T06:01:28.321Z","updated_at":"2025-05-02T06:01:29.779Z","avatar_url":"https://github.com/ThijmenGThN.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\n# Swaparr\n\nRadarr, Sonarr and the other Starrs currently lack a built-in mechanism to handle stalled downloads, this project aims to solve that.\n\n\u003e Swaparr is inspired by a Reddit thread [\"I wrote a script that repl..\"](https://www.reddit.com/r/radarr/comments/101q31k/i_wrote_a_script_that_replaces_slowdead_torrents/) from [Douglas96](https://www.reddit.com/user/Douglas96/).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://i.imgur.com/HMCDGbO.png?s=128\"\u003e\n\u003c/p\u003e\n\n\n\n#### ⭐ Show Your Support for Open Source!\n\nIf Swaparr has been helpful to you and you appreciate the power of open-source software, please consider giving this repository a star. Your gesture will greatly support our efforts and help others discover Swaparr!\n\n[![Stargazers](https://reporoster.com/stars/dark/notext/ThijmenGThN/swaparr)](https://github.com/ThijmenGThN/swaparr/stargazers)\n\n\n\n## What is Swaparr?\n\nSwaparr quietly operates in the background, offering full customization options and clear visibility through console logs. Its primary function is to address the issue of stalled downloads in starr instances.\n\n\n\n### Key Features:\n\n- **Automatic Detection:** Swaparr scans through all active downloads in your starr instances every 10 minutes (adjustable) to identify potential slowdowns.\n- **Strike System:** Identified downloads are given a strike, and this evaluation cycle repeats periodically. If a download accumulates the maximum allowed strikes, Swaparr automatically removes it from your instance.\n- **Customization:** Swaparr offers customization options to fine-tune striking behaviour.\n\n\n\n## Getting Started\n\n\u003e [!WARNING]\n\u003e Swaparr is still in beta, things might change before reaching version ` 1.0.0 `\n\n\n\n### Prerequisites \n\nDocker and it's compose plugin are required, below is a matrix on how to install both for your system:\n\n|Operating System|Official Instructions|\n|-|-|\n|Linux|[docs.docker.com/../linux-install](https://docs.docker.com/desktop/install/linux-install/)\n|MacOS|[docs.docker.com/.../mac-install](https://docs.docker.com/desktop/install/mac-install/)\n|Windows|[docs.docker.com/.../windows-install](https://docs.docker.com/desktop/install/windows-install/)\n\n\n\n### Configurations\n\nStart with the provided compose file as a foundation, and customize it by excluding or adjusting any services.\n\n```yml\nversion: '3'\nservices:\n\n  radarr:\n    image: ghcr.io/thijmengthn/swaparr:latest\n    container_name: swaparr-radarr\n    restart: unless-stopped\n    environment:\n      - BASEURL=http://127.0.0.1:7878 # IP or FQDN           (Required)\n      - APIKEY=7f3a8..cbc07           # Radarr API Key       (Required)                \n      - PLATFORM=radarr               # \"radarr\", \"sonarr\".. (Optional) default: radarr\n      - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n      - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n      - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n      - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n      - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n      - DRY_RUN=false                 # Boolean              (Optional) default: false\n\n  # -- (Optional)\n  sonarr: \n    image: ghcr.io/thijmengthn/swaparr:latest\n    container_name: swaparr-sonarr\n    restart: unless-stopped\n    environment:\n      - BASEURL=http://127.0.0.1:8989 # IP or FQDN           (Required)\n      - APIKEY=7f3a8..cbc07           # Sonarr API Key       (Required)                \n      - PLATFORM=sonarr               # \"radarr\", \"sonarr\".. (Optional) default: radarr\n      - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n      - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n      - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n      - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n      - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n      - DRY_RUN=false                 # Boolean              (Optional) default: false\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003cstrong\u003e🚩 Extended experimental support:\u003c/strong\u003e Lidarr, Readarr and Whisparr\n  \u003c/summary\u003e\n\n  ```yml\n  version: '3'\n  services:\n\n    radarr:\n      image: ghcr.io/thijmengthn/swaparr:latest\n      container_name: swaparr-radarr\n      restart: unless-stopped\n      environment:\n        - BASEURL=http://127.0.0.1:7878 # IP or FQDN           (Required)\n        - APIKEY=7f3a8..cbc07           # Radarr API Key       (Required)                \n        - PLATFORM=radarr               # \"radarr\", \"sonarr\".. (Optional) default: radarr\n        - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n        - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n        - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n        - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n        - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n        - DRY_RUN=false                 # Boolean              (Optional) default: false\n\n    # -- (Optional)\n    sonarr: \n      image: ghcr.io/thijmengthn/swaparr:latest\n      container_name: swaparr-sonarr\n      restart: unless-stopped\n      environment:\n        - BASEURL=http://127.0.0.1:8989 # IP or FQDN           (Required)\n        - APIKEY=7f3a8..cbc07           # Sonarr API Key       (Required)                \n        - PLATFORM=sonarr               # \"radarr\", \"sonarr\".. (Optional) default: radarr\n        - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n        - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n        - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n        - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n        - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n        - DRY_RUN=false                 # Boolean              (Optional) default: false\n\n    # -- (Optional)\n    lidarr: \n      image: ghcr.io/thijmengthn/swaparr:latest\n      container_name: swaparr-lidarr\n      restart: unless-stopped\n      environment:\n        - BASEURL=http://127.0.0.1:8989 # IP or FQDN           (Required)\n        - APIKEY=7f3a8..cbc07           # Lidarr API Key       (Required)                \n        - PLATFORM=lidarr               # \"radarr\", \"sonarr\".. (Optional) default: radarr\n        - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n        - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n        - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n        - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n        - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n        - DRY_RUN=false                 # Boolean              (Optional) default: false\n\n    # -- (Optional)\n    readarr: \n      image: ghcr.io/thijmengthn/swaparr:latest\n      container_name: swaparr-readarr\n      restart: unless-stopped\n      environment:\n        - BASEURL=http://127.0.0.1:8989 # IP or FQDN           (Required)\n        - APIKEY=7f3a8..cbc07           # Readarr API Key      (Required)                \n        - PLATFORM=readarr              # \"radarr\", \"sonarr\".. (Optional) default: radarr\n        - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n        - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n        - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n        - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n        - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n        - DRY_RUN=false                 # Boolean              (Optional) default: false\n\n    # -- (Optional)\n    whisparr: \n      image: ghcr.io/thijmengthn/swaparr:latest\n      container_name: swaparr-whisparr\n      restart: unless-stopped\n      environment:\n        - BASEURL=http://127.0.0.1:8989 # IP or FQDN           (Required)\n        - APIKEY=7f3a8..cbc07           # Whisparr API Key     (Required)                \n        - PLATFORM=whisparr             # \"radarr\", \"sonarr\".. (Optional) default: radarr\n        - MAX_STRIKES=3                 # Positive number      (Optional) default: 3     \n        - SCAN_INTERVAL=10m             # 1d, 6h, 30m, etc..   (Optional) default: 10m   \n        - MAX_DOWNLOAD_TIME=2h          # 1d, 6h, 30m, etc..   (Optional) default: 2h    \n        - IGNORE_ABOVE_SIZE=25GB        # 1TB, 1GB, 1MB, etc.. (Optional) default: 25GB  \n        - REMOVE_FROM_CLIENT=true       # Boolean              (Optional) default: true\n        - DRY_RUN=false                 # Boolean              (Optional) default: false\n  ```\n\u003c/details\u003e\n\n\n\n### Starting Swaparr\n\nTo start Swaparr, run the following command:\n\n```\ndocker compose up -d\n```\n\n\n\n### Monitor\n\nYou can monitor Swaparr's activities and track the processing of downloads by executing the following command. Omit the ` \u003ccontainer_name\u003e ` parameter to view logs for all platforms:\n\n```\ndocker compose logs \u003ccontainer_name\u003e\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003cstrong\u003eInstructions:\u003c/strong\u003e Stop or Update Swaparr\n  \u003c/summary\u003e\n\n  #### Stop\n\n  To shutdown Swaparr, run the following command:\n\n  ```\n  docker compose down\n  ```\n\n  \n  #### Update\n\n  Updating Swaparr is a breeze, pull the latest images and restart the service:\n\n  ```\n  docker compose pull\n  ```\n\n  ```\n  docker compose down\n  ```\n\n  ```\n  docker compose up -d\n  ```\n\u003c/details\u003e\n\n\n\n## Useful Information\n\nA brief rundown to shed light on a couple of things for you:\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003cstrong\u003eEnvironment Variables\u003c/strong\u003e\n  \u003c/summary\u003e\n\n  | Name               | Default                 | Description                                                                                         |\n  |--------------------|-------------------------|-----------------------------------------------------------------------------------------------------|\n  | BASEURL            | `http://127.0.0.1:7878` | The URL of a radarr, sonarr or other starr instance.                                                |\n  | APIKEY             | `7f3a8..cbc07`          | The API key of a radarr, sonarr or other starr instance.                                            |\n  | PLATFORM           | `radarr`                | Indicates the type of starr platform, either `radarr`, `sonarr`, `lidarr`, `readarr` or `whisparr`. |\n  | MAX_STRIKES        | `3`                     | Maximum number of strikes a download can accumulate before it is removed.                           |\n  | SCAN_INTERVAL      | `10m`                   | How often Swaparr checks for stalled downloads.                                                     |\n  | MAX_DOWNLOAD_TIME  | `2h`                    | Maximum allowed download time before it's considered stalled.                                       |\n  | IGNORE_ABOVE_SIZE  | `25GB`                  | Files larger than this size will be ignored and not monitored.                                      |\n  | REMOVE_FROM_CLIENT | `true`                  | Remove from both queue and download client (default) OR `false` only the queue of a starr instance. |\n  | DRY_RUN            | `false`                 | Sandbox mode; try Swaparr without it performing destructive actions on your instances.              |\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003e\n    \u003cstrong\u003eStatus-Types Explained\u003c/strong\u003e\n    \u003c/summary\u003e\n\n  | **Status** | **Description**                                                                                    |\n  |------------|----------------------------------------------------------------------------------------------------| \n  | `Normal`   | Download is proceeding as expected; no issues detected.                                            |\n  | `Striked`  | Download flagged as slow or stalled; may be removed if it continues to accumulate strikes.         |\n  | `Removed`  | Download has been attempted to be removed from the starr instance.                                 |\n  | `Ignored`  | Download is not monitored because it falls outside the set thresholds (e.g., size or time limits). |\n  | `Queued`   | Download is in the queue within the download client waiting to start; will not be striked.         |\n  | `Delayed`  | Download is temporarily paused or scheduled for later processing as defined in a delay profile.    |\n\u003c/details\u003e\n\n\n\n## ✨ Swaparr is for everyone!\n\nWhether you need help, want to pitch in, or found a bug that needs fixing, just [open an issue](https://github.com/ThijmenGThN/swaparr/issues). We're all ears and ready to collaborate with you!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThijmenGThN%2Fswaparr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FThijmenGThN%2Fswaparr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FThijmenGThN%2Fswaparr/lists"}