Skip to content

Commit

Permalink
4.1.7 (#602)
Browse files Browse the repository at this point in the history
* 4.1.7

* chore(docs): Sync wiki to docs [skip-cd]

* Bump flake8 from 7.0.0 to 7.1.0 (#585)

Bumps [flake8](https://github.com/pycqa/flake8) from 7.0.0 to 7.1.0.
- [Commits](PyCQA/flake8@7.0.0...7.1.0)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump docker/build-push-action from 5 to 6 (#588)

* chore(docs): Sync wiki to docs [skip-cd]

* fix(unregistered): Ignore 520 (#592)

* fix: max vs min seeding time check (#596)

* fix: max vs min seeding time check

Allow max_seeding_time to be unlimited (-1) even if a min_seeding_time is set

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* fix pre-commit test

* fix: check tracker status in udp & wss as well (#586)

* fix: check tracker status in udp & wss as well

* bump VERSION

---------

Co-authored-by: bobokun <[email protected]>

* [pre-commit.ci] pre-commit autoupdate (#584)

updates:
- [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](hhatto/autopep8@v2.2.0...v2.3.1)
- [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](asottile/pyupgrade@v3.15.2...v3.16.0)
- [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](PyCQA/flake8@7.0.0...7.1.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Fixes #595 to use BHD deleted reason list instead of API

* Fixes #591 [FR]: Logging header doesn't get logged for every run

* minor fixes in #591

* Adds deprecated message for bhd attribute in config

* Fix min_seeding_time tag removal when max_seeding_time is -1 (#598)

* Update share_limits.py to fix #590

---------

Co-authored-by: bobokun <[email protected]>

* Adds logging to mover script

* Fixes [FR]: Remove orphaned without moving to orphaned_dir #590

* Fixes bug in printing schedule mode when run is True

* Fix bug in Use BHD list of reasons instead of API #595

* Add additional BHD deletion reason #595

* Fix bug in #595 when status contains optional message

* Update mover.py: add optional arg --status-filter to allow fine tune which torrents to pauseUpdate mover.py: add optional arg --status-filter to allow fine tune which torrents to pause (#599)

* Update mover.py

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update mover.py: making the default behavior to only move `completed` torrents

This will leave 1) unfinished files 2) actively seeding files in `downloading` torrents in cache. This helps to keep write-heavy operation on Cache, not on hard drive.

Change this to "all" if you want this to always move everything every time.

* minor fixes in help description

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: bobokun <[email protected]>

* modify noHL threshold to address false positives

* Add additional BHD deletion reason #595

* Bump dependabot/fetch-metadata from 2.1.0 to 2.2.0 (#601)

Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](dependabot/fetch-metadata@v2.1.0...v2.2.0)

---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* 4.1.7

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Actionbot <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bakerboy448 <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Amos (lflare) <[email protected]>
Co-authored-by: ineednewpajamas <[email protected]>
Co-authored-by: Tony <[email protected]>
  • Loading branch information
8 people authored Jul 5, 2024
1 parent 28a837e commit 4e08f62
Show file tree
Hide file tree
Showing 23 changed files with 245 additions and 152 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v2.1.0
uses: dependabot/fetch-metadata@v2.2.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Here the PR gets approved.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: ./
file: ./Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: pretty-format-json
args: [--autofix, --indent, '4', --no-sort-keys]
- repo: https://github.com/hhatto/autopep8
rev: v2.2.0
rev: v2.3.1
hooks:
- id: autopep8
- repo: https://github.com/adrienverge/yamllint.git
Expand All @@ -38,7 +38,7 @@ repos:
name: isort (python)
args: [--force-single-line-imports, --profile, black]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py3-plus]
Expand All @@ -49,7 +49,7 @@ repos:
language_version: python3
args: [--line-length, '130']
- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
args: [--config=.flake8]
Expand Down
21 changes: 12 additions & 9 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Requirements Updated
- qbittorrent-api==2024.5.63
- requests==2.32.3
- schedule==1.2.2

# New Updates
- Add config option `cat_update_all` to categorize only uncategorized torrents (Closes [#575](https://github.com/StuffAnThings/qbit_manage/issues/575))
- BHD config options are now deprecated due to qbm no longer needing to use the api to detect unregistered torrents (Closes #595)
- Updates mover script to add logging and default to completed torrents only with new optional argument (`--status-filter`)

# Bug Fixes
- Fixes [#560](https://github.com/StuffAnThings/qbit_manage/issues/560)

- Adds new ignore message for unregistered torrents (Closes #592)
- Allow `max_seeding_time` to be unlimited (-1) if min_seeding_time is set (Closes #596)
- Fixes checking tracker status for udp/wss (Closes #586)
- Fixes Logging header not getting logged in every run (Closes #591)
- Fixes min_seeding_time tag removal when max_seeding_time is -1 (#Closes 598)
- Fixes Remove orphaned without moving to orphaned_dir (Closes #590)
- Fixes bug in printing schedule mode when run is set to True
- Modifies noHL threshold to 0.1 to address false positives

**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.5...v4.1.6
Special thanks to @bakerboy448, @ineednewpajamas, @lflare, @convexshiba for their contributions!
**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.6...v4.1.7
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.6
4.1.7
4 changes: 0 additions & 4 deletions config/config.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,3 @@ webhooks:
tag_nohardlinks: notifiarr
share_limits: notifiarr
cleanup_dirs: notifiarr

bhd:
# BHD Integration used for checking unregistered torrents
apikey:
9 changes: 0 additions & 9 deletions docs/Config-Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,12 +530,3 @@ Payload will be sent when files are deleted/cleaned up from the various folders
"size_in_bytes": int, // Total number of bytes deleted from the location
}
```

## **bhd:**

---
BHD integration is used if you are on the private tracker BHD. (Used to identify any unregistered torrents from this tracker)

| Variable | Definition | Default Values | Required |
| :------- | :---------- | :------------- | :----------------- |
| `apikey` | BHD API Key | `None` (blank) | <center>✅</center> |
26 changes: 1 addition & 25 deletions docs/Docker-Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,7 @@ The official build on github is available [here](https://ghcr.io/StuffAnThings/q
2. The config file needs to drill down (if required) further to the desired root dir.
* `remote_dir`: is not required and can be commented out with `#`

Below is a list of the docker environment variables
| Docker Environment Variable | Description | Default Value |
| :-------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------ |
| QBT_RUN | Run without the scheduler. Script will exit after completion. | False |
| QBT_SCHEDULE | Schedule to run every x minutes. (Default set to 1440) | 1440 |
| QBT_STARTUP_DELAY | Initial run will start after x seconds (Default set to 0) | 0 |
| QBT_CONFIG | This is used if you want to use a different name for your config.yml. `Example: tv.yml` This variable can also be used to allow the use of multiple config files for a single instance of qbit-manage. For example, listing a wildcard value `Example: QBIT_CONFIG=config_*.yml` and naming your config files accordingly `Example: config_movies.yml` and `config_tv.yml` will instruct qbit-manage to utilize each config file that matches the specified naming convention during every run. | config.yml |
| QBT_LOGFILE | This is used if you want to use a different name for your log file. `Example: tv.log` | activity.log |
| QBT_CROSS_SEED | Use this after running [cross-seed script](https://github.com/mmgoodnow/cross-seed) to add torrents from the cross-seed output folder to qBittorrent | False |
| QBT_RECHECK | Recheck paused torrents sorted by lowest size. Resume if Completed. | False |
| QBT_CAT_UPDATE | Use this if you would like to update your categories or move from one category to another.. | False |
| QBT_TAG_UPDATE | Use this if you would like to update your tags. (Only adds tags to untagged torrents) | False |
| QBT_REM_UNREGISTERED | Use this if you would like to remove unregistered torrents. (It will the delete data & torrent if it is not being cross-seeded, otherwise it will just remove the torrent without deleting data) | False |
| QBT_TAG_TRACKER_ERROR | Use this to tag any torrents with tracker errors, such as unregistered torrents or unreachable trackers. | False |
| QBT_REM_ORPHANED | Use this if you would like to remove orphaned files from your `root_dir` directory that are not referenced by any torrents. It will scan your `root_dir` directory and compare it with what is in qBittorrent. Any data not referenced in qBittorrent will be moved into `/data/torrents/orphaned_data` folder for you to review/delete. | False |
| QBT_TAG_NOHARDLINKS | Use this to tag any torrents that do not have any hard links associated with any of the files. This is useful for those that use Sonarr/Radarr that hard links your media files with the torrents for seeding. When files get upgraded they no longer become linked with your media therefore will be tagged with a new tag noHL. You can then safely delete/remove these torrents to free up any extra space that is not being used by your media folder. | False |
| QBT_SHARE_LIMITS | Control how torrent share limits are set depending on the priority of your grouping. This can apply a max ratio, seed time limits to your torrents or limit your torrent upload speed as well. Each torrent will be matched with the share limit group with the highest priority that meets the group filter criteria. Each torrent can only be matched with one share limit group. | False |
| QBT_SKIP_CLEANUP | Use this to skip emptying the Recycle Bin folder (`/root_dir/.RecycleBin`) and Orphaned directory. (`/root_dir/orphaned_data`) | False |
| QBT_SKIP_QB_VERSION_CHECK | Use this to bypass qBittorrent/libtorrent version compatibility check. You run the risk of undesirable behavior and will receive no support. | False |
| QBT_DRY_RUN | If you would like to see what is gonna happen but not actually move/delete or tag/categorize anything. | False |
| QBT_LOG_LEVEL | Change the output log level. | INFO |
| QBT_DIVIDER | Character that divides the sections (Default: '=') | = |
| QBT_WIDTH | Screen Width (Default: 100) | 100 |
| QBT_DEBUG | Enable Debug logs | False |
| QBT_TRACE | Enable Trace logs | False |
Please see [Commands](https://github.com/StuffAnThings/qbit_manage/wiki/Commands) for a list of arguments and docker environment variables.

Here is an example of a docker compose

Expand Down
1 change: 0 additions & 1 deletion docs/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ This wiki should tell you everything you need to know about the script to get it
* [apprise](Config-Setup#apprise)
* [notifiarr](Config-Setup#notifiarr)
* [webhooks](Config-Setup#webhooks)
* [bhd](Config-Setup#bhd)
* [Commands](Commands)
1 change: 0 additions & 1 deletion docs/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
- [apprise](Config-Setup#apprise)
- [notifiarr](Config-Setup#notifiarr)
- [webhooks](Config-Setup#webhooks)
- [bhd](Config-Setup#bhd)
- [Commands](Commands)
4 changes: 2 additions & 2 deletions docs/v4-Migration-Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ nohardlinks:
```yml
cat:
- movies: “/data/torrents/movies”
- tv: “/data/torrents/tv”
movies: “/data/torrents/movies”
tv: “/data/torrents/tv”
tracker:
Tracker-a:
tag: a
Expand Down
3 changes: 3 additions & 0 deletions modules/bhd.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ def search(self, json, path="torrents/"):
if response.status_code >= 400:
logger.debug(f"Response: {response_json}")
raise Failed(f"({response.status_code} [{response.reason}]) {response_json}")
if "rate limited" in response_json.get("status_message", ""):
logger.error(f"BHD Error: {response_json.get('status_message')}")
return {}
if not response_json.get("success"):
raise Failed(f"BHD Error: {response_json.get('status_message', 'Issue receiving response from BHD API.')}")
return response_json
Loading

0 comments on commit 4e08f62

Please sign in to comment.