qbit_manage/qbit_manage.py

688 lines
24 KiB
Python
Raw Permalink Normal View History

#!/usr/bin/env python3
"""qBittorrent Manager."""
2022-10-29 23:19:09 +08:00
import argparse
import glob
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
import math
2022-10-29 23:19:09 +08:00
import os
2023-05-23 09:29:31 +08:00
import platform
2022-10-29 23:19:09 +08:00
import sys
import time
from datetime import datetime
from datetime import timedelta
from functools import lru_cache
try:
import schedule
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
from croniter import croniter
from humanize import precisedelta
2024-02-11 00:15:41 +08:00
from modules.logs import MyLogger
except ModuleNotFoundError:
print("Requirements Error: Requirements are not installed")
v4.0.5 (#418) * Fixes #388 * Bump docker/setup-buildx-action from 2 to 3 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/login-action from 2 to 3 Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/build-push-action from 4 to 5 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump gitpython from 3.1.35 to 3.1.36 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.36. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.36) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) * Error handling when BHD API doesn't respond * add BHD specific announce related issues * handle JSONDecodeError * Special mapping to leave torrents uncategorized on cat-update (#398) Special mapping to leave torrents uncategorized on cat-update (closes #395) * Bump gitpython from 3.1.36 to 3.1.37 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.36 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.36...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.32 to 0.17.33 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.32 to 0.17.33. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * last_active flag for share_limits (#397) Added a last_active flag for share_limits to resume torrents and avoid cleanup if there was activity in the last X minutes. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#405) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.13.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump schedule from 1.2.0 to 1.2.1 Bumps [schedule](https://github.com/dbader/schedule) from 1.2.0 to 1.2.1. - [Changelog](https://github.com/dbader/schedule/blob/master/HISTORY.rst) - [Commits](https://github.com/dbader/schedule/compare/1.2.0...1.2.1) --- updated-dependencies: - dependency-name: schedule dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.33 to 0.17.34 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.33 to 0.17.34. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix exit codes when program fails (#411) Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump ruamel-yaml from 0.17.34 to 0.17.35 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.34 to 0.17.35. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate (#409) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.14.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * New option cat in trackers (#400) * New option cat in trackers * [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> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * update config.sample for #200 * add additional script to edit trackers * clarify remote_dir usage (#417) * Bump gitpython from 3.1.35 to 3.1.37 (#414) Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#413) updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.15.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * 4.0.5 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Esteban Thilliez <77675611+estebanthi@users.noreply.github.com> Co-authored-by: Fabricio Silva <hi@fabricio.dev> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
2023-10-14 23:08:33 +08:00
sys.exit(1)
REQUIRED_VERSION = (3, 8, 1)
2023-04-01 06:35:35 +08:00
REQUIRED_VERSION_STR = ".".join(str(x) for x in REQUIRED_VERSION)
current_version = sys.version_info
2023-04-01 07:15:22 +08:00
if current_version < (REQUIRED_VERSION):
2022-10-29 23:19:09 +08:00
print(
"Version Error: Version: %s.%s.%s incompatible with qbit_manage please use Python %s+"
2023-04-01 06:35:35 +08:00
% (current_version[0], current_version[1], current_version[2], REQUIRED_VERSION_STR)
2022-10-29 23:19:09 +08:00
)
v4.0.5 (#418) * Fixes #388 * Bump docker/setup-buildx-action from 2 to 3 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/login-action from 2 to 3 Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/build-push-action from 4 to 5 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump gitpython from 3.1.35 to 3.1.36 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.36. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.36) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) * Error handling when BHD API doesn't respond * add BHD specific announce related issues * handle JSONDecodeError * Special mapping to leave torrents uncategorized on cat-update (#398) Special mapping to leave torrents uncategorized on cat-update (closes #395) * Bump gitpython from 3.1.36 to 3.1.37 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.36 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.36...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.32 to 0.17.33 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.32 to 0.17.33. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * last_active flag for share_limits (#397) Added a last_active flag for share_limits to resume torrents and avoid cleanup if there was activity in the last X minutes. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#405) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.13.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump schedule from 1.2.0 to 1.2.1 Bumps [schedule](https://github.com/dbader/schedule) from 1.2.0 to 1.2.1. - [Changelog](https://github.com/dbader/schedule/blob/master/HISTORY.rst) - [Commits](https://github.com/dbader/schedule/compare/1.2.0...1.2.1) --- updated-dependencies: - dependency-name: schedule dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.33 to 0.17.34 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.33 to 0.17.34. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix exit codes when program fails (#411) Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump ruamel-yaml from 0.17.34 to 0.17.35 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.34 to 0.17.35. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate (#409) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.14.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * New option cat in trackers (#400) * New option cat in trackers * [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> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * update config.sample for #200 * add additional script to edit trackers * clarify remote_dir usage (#417) * Bump gitpython from 3.1.35 to 3.1.37 (#414) Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#413) updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.15.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * 4.0.5 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Esteban Thilliez <77675611+estebanthi@users.noreply.github.com> Co-authored-by: Fabricio Silva <hi@fabricio.dev> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
2023-10-14 23:08:33 +08:00
sys.exit(1)
2021-02-20 13:04:02 +08:00
2022-10-29 23:19:09 +08:00
parser = argparse.ArgumentParser("qBittorrent Manager.", description="A mix of scripts combined for managing qBittorrent.")
parser.add_argument("-db", "--debug", dest="debug", help=argparse.SUPPRESS, action="store_true", default=False)
parser.add_argument("-tr", "--trace", dest="trace", help=argparse.SUPPRESS, action="store_true", default=False)
2022-10-29 23:19:09 +08:00
parser.add_argument(
"-r",
"--run",
dest="run",
action="store_true",
default=False,
help="Run without the scheduler. Script will exit after completion.",
)
parser.add_argument(
"-sch",
"--schedule",
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
dest="schedule",
2022-10-29 23:19:09 +08:00
default="1440",
type=str,
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
help=(
"Schedule to run every x minutes. (Default set to 1440 (1 day))."
4.1.4 (#553) * 4.1.4-develop1 * Fixes #545 * Fixes #546 * oops forgot to check if group_tag is enabled * (fix) blu unregistered torrent message (#547) InfoHash not found. * fix broken tags check * Fixes MinSeedTimeNotReached not being applied correctly #548 * Bump pre-commit from 3.7.0 to 3.7.1 (#549) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.7.0 to 3.7.1. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.7.0...v3.7.1) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fixes exclude directory of recently deleted torrents from rem_orphaned #550 * minor debug comment update * Fixes exclude directory of recently deleted torrents from rem_orphaned #550 for those that don't use recycle bin * Fixes cross-seed bug introduced in v6 with cross-seed-data * optimize remove_empty_dirs and remove empty folders in orphaned_data * Additional blutopia unregistered_torrent status, do not delete orphaned_data root folder if it's empty * Adds additional logging for cleaning up empty folders * 4.1.4 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-18 22:39:24 +08:00
"Can also customize schedule via cron syntax (See https://crontab.guru/examples.html)"
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
),
2022-10-29 23:19:09 +08:00
)
parser.add_argument(
"-sd",
"--startup-delay",
dest="startupDelay",
default="0",
type=str,
help="Set delay in seconds on the first run of a schedule (Default set to 0)",
)
parser.add_argument(
"-c",
"--config-file",
dest="configfiles",
action="store",
default="config.yml",
type=str,
2023-06-12 03:54:52 +08:00
help=(
"This is used if you want to use a different name for your config.yml or if you want to load multiple"
"config files using *. Example: tv.yml or config*.yml"
),
2022-10-29 23:19:09 +08:00
)
parser.add_argument(
"-lf",
"--log-file",
dest="logfile",
action="store",
default="qbit_manage.log",
type=str,
help="This is used if you want to use a different name for your log file. Example: tv.log",
)
parser.add_argument(
"-cs",
"--cross-seed",
dest="cross_seed",
action="store_true",
default=False,
help="Use this after running cross-seed script to add torrents from the cross-seed output folder to qBittorrent",
)
parser.add_argument(
"-re",
"--recheck",
dest="recheck",
action="store_true",
default=False,
help="Recheck paused torrents sorted by lowest size. Resume if Completed.",
)
parser.add_argument(
"-cu",
"--cat-update",
dest="cat_update",
action="store_true",
default=False,
help="Use this if you would like to update your categories.",
)
parser.add_argument(
"-tu",
"--tag-update",
dest="tag_update",
action="store_true",
default=False,
2023-06-12 03:54:52 +08:00
help=(
"Use this if you would like to update your tags and/or set seed goals/limit upload speed by tag."
" (Only adds tags to untagged torrents)"
),
2022-10-29 23:19:09 +08:00
)
parser.add_argument(
"-ru",
"--rem-unregistered",
dest="rem_unregistered",
action="store_true",
default=False,
help="Use this if you would like to remove unregistered torrents.",
)
parser.add_argument(
"-tte",
"--tag-tracker-error",
dest="tag_tracker_error",
action="store_true",
default=False,
help="Use this if you would like to tag torrents that do not have a working tracker.",
)
parser.add_argument(
"-ro",
"--rem-orphaned",
dest="rem_orphaned",
action="store_true",
default=False,
help="Use this if you would like to remove unregistered torrents.",
)
parser.add_argument(
"-tnhl",
"--tag-nohardlinks",
dest="tag_nohardlinks",
action="store_true",
default=False,
2023-06-12 03:54:52 +08:00
help=(
"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 which hard link 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."
),
2022-10-29 23:19:09 +08:00
)
parser.add_argument(
"-sl",
"--share-limits",
dest="share_limits",
action="store_true",
default=False,
2023-06-12 03:54:52 +08:00
help=(
"Use this to help apply and manage your torrent share limits based on your tags/categories."
"This can apply a max ratio, seed time limits to your torrents or limit your torrent upload speed as well."
"Share limits are applied in the order of priority specified."
),
)
2022-10-29 23:19:09 +08:00
parser.add_argument(
"-sc",
"--skip-cleanup",
dest="skip_cleanup",
action="store_true",
default=False,
help="Use this to skip cleaning up Recycle Bin/Orphaned directory.",
2022-10-29 23:19:09 +08:00
)
parser.add_argument(
"-svc",
"--skip-qb-version-check",
dest="skip_qb_version_check",
action="store_true",
default=False,
2023-05-27 08:53:25 +08:00
# help="Bypass qBittorrent/libtorrent version compatibility check. "
# "You run the risk of undesirable behavior and will receive no support.",
help=argparse.SUPPRESS,
)
2022-10-29 23:19:09 +08:00
parser.add_argument(
"-dr",
"--dry-run",
dest="dry_run",
action="store_true",
default=False,
help="If you would like to see what is gonna happen but not actually move/delete or tag/categorize anything.",
)
parser.add_argument(
"-ll", "--log-level", dest="log_level", action="store", default="INFO", type=str, help="Change your log level."
)
parser.add_argument(
"-d", "--divider", dest="divider", help="Character that divides the sections (Default: '=')", default="=", type=str
)
2021-11-24 04:45:16 +08:00
parser.add_argument("-w", "--width", dest="width", help="Screen Width (Default: 100)", default=100, type=int)
2021-02-20 13:04:02 +08:00
args = parser.parse_args()
2021-12-29 01:19:58 +08:00
2023-05-23 09:29:31 +08:00
static_envs = []
test_value = None
2021-11-21 11:54:20 +08:00
def get_arg(env_str, default, arg_bool=False, arg_int=False):
2023-05-23 09:29:31 +08:00
global test_value
env_vars = [env_str] if not isinstance(env_str, list) else env_str
final_value = None
2023-05-23 09:29:31 +08:00
static_envs.extend(env_vars)
for env_var in env_vars:
env_value = os.environ.get(env_var)
2023-05-23 09:29:31 +08:00
if env_var == "BRANCH_NAME":
test_value = env_value
if env_value is not None:
final_value = env_value
break
2023-05-23 09:29:31 +08:00
if final_value or (arg_int and final_value == 0):
2021-11-21 11:54:20 +08:00
if arg_bool:
if final_value is True or final_value is False:
return final_value
elif final_value.lower() in ["t", "true"]:
2021-11-21 11:54:20 +08:00
return True
else:
return False
elif arg_int:
2023-05-23 09:29:31 +08:00
try:
return int(final_value)
except ValueError:
return default
2021-11-21 11:54:20 +08:00
else:
return str(final_value)
2021-11-21 11:54:20 +08:00
else:
return default
2021-12-29 01:19:58 +08:00
@lru_cache(maxsize=1)
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
def is_valid_cron_syntax(cron_expression):
try:
croniter(str(cron_expression))
return True
except (ValueError, KeyError):
return False
2023-05-23 09:29:31 +08:00
try:
2024-02-11 00:15:41 +08:00
from git import InvalidGitRepositoryError
from git import Repo
2023-05-23 09:29:31 +08:00
try:
git_branch = Repo(path=".").head.ref.name # noqa
except InvalidGitRepositoryError:
git_branch = None
except ImportError:
git_branch = None
env_version = get_arg("BRANCH_NAME", "master")
is_docker = get_arg("QBM_DOCKER", False, arg_bool=True)
run = get_arg("QBT_RUN", args.run, arg_bool=True)
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
sch = get_arg("QBT_SCHEDULE", args.schedule)
2022-01-11 05:21:13 +08:00
startupDelay = get_arg("QBT_STARTUP_DELAY", args.startupDelay)
config_files = get_arg("QBT_CONFIG", args.configfiles)
2021-11-21 11:54:20 +08:00
log_file = get_arg("QBT_LOGFILE", args.logfile)
cross_seed = get_arg("QBT_CROSS_SEED", args.cross_seed, arg_bool=True)
recheck = get_arg("QBT_RECHECK", args.recheck, arg_bool=True)
cat_update = get_arg("QBT_CAT_UPDATE", args.cat_update, arg_bool=True)
tag_update = get_arg("QBT_TAG_UPDATE", args.tag_update, arg_bool=True)
rem_unregistered = get_arg("QBT_REM_UNREGISTERED", args.rem_unregistered, arg_bool=True)
tag_tracker_error = get_arg("QBT_TAG_TRACKER_ERROR", args.tag_tracker_error, arg_bool=True)
rem_orphaned = get_arg("QBT_REM_ORPHANED", args.rem_orphaned, arg_bool=True)
tag_nohardlinks = get_arg("QBT_TAG_NOHARDLINKS", args.tag_nohardlinks, arg_bool=True)
share_limits = get_arg("QBT_SHARE_LIMITS", args.share_limits, arg_bool=True)
skip_cleanup = get_arg("QBT_SKIP_CLEANUP", args.skip_cleanup, arg_bool=True)
skip_qb_version_check = get_arg("QBT_SKIP_QB_VERSION_CHECK", args.skip_qb_version_check, arg_bool=True)
dry_run = get_arg("QBT_DRY_RUN", args.dry_run, arg_bool=True)
log_level = get_arg("QBT_LOG_LEVEL", args.log_level)
2021-11-24 04:45:16 +08:00
divider = get_arg("QBT_DIVIDER", args.divider)
screen_width = get_arg("QBT_WIDTH", args.width, arg_int=True)
debug = get_arg("QBT_DEBUG", args.debug, arg_bool=True)
trace = get_arg("QBT_TRACE", args.trace, arg_bool=True)
2022-11-19 22:46:38 +08:00
if debug:
2022-10-29 23:19:09 +08:00
log_level = "DEBUG"
2022-11-19 22:46:38 +08:00
if trace:
log_level = "TRACE"
stats = {}
args = {}
2021-12-16 07:34:26 +08:00
2022-10-29 23:19:09 +08:00
if os.path.isdir("/config") and glob.glob(os.path.join("/config", config_files)):
default_dir = "/config"
2021-12-17 02:34:03 +08:00
else:
default_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "config")
2021-12-16 07:34:26 +08:00
2022-10-29 23:19:09 +08:00
if "*" not in config_files:
config_files = [config_files]
else:
glob_configs = glob.glob(os.path.join(default_dir, config_files))
if glob_configs:
config_files = [os.path.split(x)[-1] for x in glob_configs]
else:
print(f"Config Error: Unable to find any config files in the pattern '{config_files}'.")
v4.0.5 (#418) * Fixes #388 * Bump docker/setup-buildx-action from 2 to 3 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/login-action from 2 to 3 Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/build-push-action from 4 to 5 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump gitpython from 3.1.35 to 3.1.36 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.36. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.36) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) * Error handling when BHD API doesn't respond * add BHD specific announce related issues * handle JSONDecodeError * Special mapping to leave torrents uncategorized on cat-update (#398) Special mapping to leave torrents uncategorized on cat-update (closes #395) * Bump gitpython from 3.1.36 to 3.1.37 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.36 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.36...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.32 to 0.17.33 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.32 to 0.17.33. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * last_active flag for share_limits (#397) Added a last_active flag for share_limits to resume torrents and avoid cleanup if there was activity in the last X minutes. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#405) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.13.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump schedule from 1.2.0 to 1.2.1 Bumps [schedule](https://github.com/dbader/schedule) from 1.2.0 to 1.2.1. - [Changelog](https://github.com/dbader/schedule/blob/master/HISTORY.rst) - [Commits](https://github.com/dbader/schedule/compare/1.2.0...1.2.1) --- updated-dependencies: - dependency-name: schedule dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.33 to 0.17.34 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.33 to 0.17.34. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix exit codes when program fails (#411) Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump ruamel-yaml from 0.17.34 to 0.17.35 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.34 to 0.17.35. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate (#409) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.14.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * New option cat in trackers (#400) * New option cat in trackers * [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> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * update config.sample for #200 * add additional script to edit trackers * clarify remote_dir usage (#417) * Bump gitpython from 3.1.35 to 3.1.37 (#414) Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#413) updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.15.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * 4.0.5 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Esteban Thilliez <77675611+estebanthi@users.noreply.github.com> Co-authored-by: Fabricio Silva <hi@fabricio.dev> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
2023-10-14 23:08:33 +08:00
sys.exit(1)
2021-12-29 01:19:58 +08:00
for v in [
2022-10-29 23:19:09 +08:00
"run",
"sch",
"startupDelay",
"config_files",
"log_file",
"cross_seed",
"recheck",
"cat_update",
"tag_update",
"rem_unregistered",
"tag_tracker_error",
"rem_orphaned",
"tag_nohardlinks",
"share_limits",
2022-10-29 23:19:09 +08:00
"skip_cleanup",
"skip_qb_version_check",
2022-10-29 23:19:09 +08:00
"dry_run",
"log_level",
"divider",
"screen_width",
"debug",
"trace",
2021-12-29 01:19:58 +08:00
]:
args[v] = eval(v)
2021-11-21 11:54:20 +08:00
2021-11-24 04:45:16 +08:00
if screen_width < 90 or screen_width > 300:
print(f"Argument Error: width argument invalid: {screen_width} must be an integer between 90 and 300 using the default 100")
screen_width = 100
2021-12-29 01:19:58 +08:00
# Check if Schedule parameter is a number
try:
sch = int(sch)
except ValueError:
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
if not is_valid_cron_syntax(sch):
print(f"Invalid Schedule: Please use a valid cron schedule or integer (minutes). Current value is set to '{sch}'")
sys.exit(1)
2022-01-11 05:21:13 +08:00
# Check if StartupDelay parameter is a number
try:
startupDelay = int(startupDelay)
except ValueError:
print(f"startupDelay Error: startupDelay is not a number. Current value is set to '{startupDelay}'")
v4.0.5 (#418) * Fixes #388 * Bump docker/setup-buildx-action from 2 to 3 Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 2 to 3. - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/setup-buildx-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/login-action from 2 to 3 Bumps [docker/login-action](https://github.com/docker/login-action) from 2 to 3. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/v2...v3) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump docker/build-push-action from 4 to 5 Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4 to 5. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v4...v5) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Bump gitpython from 3.1.35 to 3.1.36 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.36. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.36) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.11.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.11.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) * Error handling when BHD API doesn't respond * add BHD specific announce related issues * handle JSONDecodeError * Special mapping to leave torrents uncategorized on cat-update (#398) Special mapping to leave torrents uncategorized on cat-update (closes #395) * Bump gitpython from 3.1.36 to 3.1.37 Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.36 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.36...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.32 to 0.17.33 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.32 to 0.17.33. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * last_active flag for share_limits (#397) Added a last_active flag for share_limits to resume torrents and avoid cleanup if there was activity in the last X minutes. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#405) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.11.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.11.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.13.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.13.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump schedule from 1.2.0 to 1.2.1 Bumps [schedule](https://github.com/dbader/schedule) from 1.2.0 to 1.2.1. - [Changelog](https://github.com/dbader/schedule/blob/master/HISTORY.rst) - [Commits](https://github.com/dbader/schedule/compare/1.2.0...1.2.1) --- updated-dependencies: - dependency-name: schedule dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Bump ruamel-yaml from 0.17.33 to 0.17.34 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.33 to 0.17.34. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * fix exit codes when program fails (#411) Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump ruamel-yaml from 0.17.34 to 0.17.35 Bumps [ruamel-yaml](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree) from 0.17.34 to 0.17.35. --- updated-dependencies: - dependency-name: ruamel-yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] pre-commit autoupdate (#409) updates: - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.14.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.14.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * New option cat in trackers (#400) * New option cat in trackers * [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> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * update config.sample for #200 * add additional script to edit trackers * clarify remote_dir usage (#417) * Bump gitpython from 3.1.35 to 3.1.37 (#414) Bumps [gitpython](https://github.com/gitpython-developers/GitPython) from 3.1.35 to 3.1.37. - [Release notes](https://github.com/gitpython-developers/GitPython/releases) - [Changelog](https://github.com/gitpython-developers/GitPython/blob/main/CHANGES) - [Commits](https://github.com/gitpython-developers/GitPython/compare/3.1.35...3.1.37) --- updated-dependencies: - dependency-name: gitpython dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#413) updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.5.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.5.0) - [github.com/asottile/reorder-python-imports: v3.10.0 → v3.12.0](https://github.com/asottile/reorder-python-imports/compare/v3.10.0...v3.12.0) - [github.com/asottile/pyupgrade: v3.10.1 → v3.15.0](https://github.com/asottile/pyupgrade/compare/v3.10.1...v3.15.0) - [github.com/psf/black: 23.7.0 → 23.9.1](https://github.com/psf/black/compare/23.7.0...23.9.1) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * 4.0.5 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Esteban Thilliez <77675611+estebanthi@users.noreply.github.com> Co-authored-by: Fabricio Silva <hi@fabricio.dev> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
2023-10-14 23:08:33 +08:00
sys.exit(1)
2022-01-11 05:21:13 +08:00
2022-11-19 22:46:38 +08:00
logger = MyLogger("qBit Manage", log_file, log_level, default_dir, screen_width, divider[0], False)
2022-11-01 23:24:13 +08:00
from modules import util # noqa
2022-10-29 23:19:09 +08:00
util.logger = logger
2022-11-01 23:24:13 +08:00
from modules.config import Config # noqa
2023-04-10 23:52:51 +08:00
from modules.core.category import Category # noqa
2023-04-11 02:57:26 +08:00
from modules.core.cross_seed import CrossSeed # noqa
2023-04-11 03:11:03 +08:00
from modules.core.recheck import ReCheck # noqa
2023-04-11 04:44:51 +08:00
from modules.core.remove_orphaned import RemoveOrphaned # noqa
2024-02-11 00:15:41 +08:00
from modules.core.remove_unregistered import RemoveUnregistered # noqa
from modules.core.share_limits import ShareLimits # noqa
2024-02-11 00:15:41 +08:00
from modules.core.tag_nohardlinks import TagNoHardLinks # noqa
from modules.core.tags import Tags # noqa
from modules.util import Failed # noqa
from modules.util import GracefulKiller # noqa
2021-12-29 01:19:58 +08:00
def my_except_hook(exctype, value, tbi):
"""Handle uncaught exceptions"""
if issubclass(exctype, KeyboardInterrupt):
sys.__excepthook__(exctype, value, tbi)
else:
logger.critical("Uncaught Exception", exc_info=(exctype, value, tbi))
2021-12-29 01:19:58 +08:00
2021-11-24 04:45:16 +08:00
sys.excepthook = my_except_hook
2021-02-21 11:45:09 +08:00
2023-05-23 09:29:31 +08:00
version = ("Unknown", "Unknown", 0)
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "VERSION")) as handle:
for line in handle.readlines():
line = line.strip()
if len(line) > 0:
2023-05-23 09:29:31 +08:00
version = util.parse_version(line)
break
2023-05-23 09:29:31 +08:00
branch = util.guess_branch(version, env_version, git_branch)
2023-06-17 07:15:40 +08:00
if branch is None:
branch = "Unknown"
2023-05-23 09:29:31 +08:00
version = (version[0].replace("develop", branch), version[1].replace("develop", branch), version[2])
2021-12-29 01:19:58 +08:00
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
def start_loop(first_run=False):
"""Start the main loop"""
if len(config_files) == 1:
args["config_file"] = config_files[0]
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
if not first_run:
print_logo(logger)
start()
else:
for config_file in config_files:
args["config_file"] = config_file
config_base = os.path.splitext(config_file)[0]
logger.add_config_handler(config_base)
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
if not first_run:
print_logo(logger)
start()
logger.remove_config_handler(config_base)
def start():
"""Start the run"""
2021-11-24 04:45:16 +08:00
start_time = datetime.now()
args["time"] = start_time.strftime("%H:%M")
args["time_obj"] = start_time
stats_summary = []
logger.separator("Starting Run")
cfg = None
2022-10-29 23:19:09 +08:00
body = ""
run_time = ""
end_time = None
next_run = None
global stats
2021-12-29 01:19:58 +08:00
stats = {
"added": 0,
"deleted": 0,
"deleted_contents": 0,
"resumed": 0,
"rechecked": 0,
2021-12-29 01:19:58 +08:00
"orphaned": 0,
"recycle_emptied": 0,
"orphaned_emptied": 0,
"tagged": 0,
"categorized": 0,
"rem_unreg": 0,
"tagged_tracker_error": 0,
"untagged_tracker_error": 0,
"tagged_noHL": 0,
2022-10-29 23:19:09 +08:00
"untagged_noHL": 0,
"updated_share_limits": 0,
"cleaned_share_limits": 0,
}
def finished_run():
"""Handle the end of a run"""
nonlocal end_time, start_time, stats_summary, run_time, next_run, body
end_time = datetime.now()
run_time = str(end_time - start_time).split(".", maxsplit=1)[0]
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
if run is False:
if is_valid_cron_syntax(sch): # Simple check to guess if it's a cron syntax
next_run_time = schedule_from_cron(sch)
else:
delta = timedelta(minutes=sch)
logger.info(f" Scheduled Mode: Running every {precisedelta(delta)}.")
next_run_time = schedule_every_x_minutes(sch)
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
else:
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
next_run_time = datetime.now()
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
nxt_run = calc_next_run(next_run_time)
next_run_str = nxt_run["next_run_str"]
next_run = nxt_run["next_run"]
2022-10-29 23:19:09 +08:00
body = logger.separator(
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
f"Finished Run\n{os.linesep.join(stats_summary) if len(stats_summary) > 0 else ''}"
f"\nRun Time: {run_time}\n{next_run_str if len(next_run_str) > 0 else ''}".replace("\n\n", "\n").rstrip()
2022-10-29 23:19:09 +08:00
)[0]
return next_run, body
2022-10-29 23:19:09 +08:00
try:
2021-12-29 01:19:58 +08:00
cfg = Config(default_dir, args)
2023-04-10 23:52:51 +08:00
qbit_manager = cfg.qbt
except Exception as ex:
2023-05-06 21:37:11 +08:00
logger.stacktrace()
logger.print_line(ex, "CRITICAL")
logger.print_line("Exiting scheduled Run.", "CRITICAL")
finished_run()
return None
2021-12-29 01:19:58 +08:00
2023-04-10 23:52:51 +08:00
if qbit_manager:
2021-12-29 01:19:58 +08:00
# Set Category
2023-04-10 23:52:51 +08:00
if cfg.commands["cat_update"]:
stats["categorized"] += Category(qbit_manager).stats
2021-12-29 01:19:58 +08:00
# Set Tags
2023-04-10 23:52:51 +08:00
if cfg.commands["tag_update"]:
stats["tagged"] += Tags(qbit_manager).stats
2021-12-29 01:19:58 +08:00
2023-05-23 03:51:19 +08:00
# Set Cross Seed
if cfg.commands["cross_seed"]:
cross_seed = CrossSeed(qbit_manager)
stats["added"] += cross_seed.stats_added
stats["tagged"] += cross_seed.stats_tagged
2023-04-11 02:55:14 +08:00
# Remove Unregistered Torrents and tag errors
if cfg.commands["rem_unregistered"] or cfg.commands["tag_tracker_error"]:
rem_unreg = RemoveUnregistered(qbit_manager)
stats["rem_unreg"] += rem_unreg.stats_deleted + rem_unreg.stats_deleted_contents
stats["deleted"] += rem_unreg.stats_deleted
stats["deleted_contents"] += rem_unreg.stats_deleted_contents
stats["tagged_tracker_error"] += rem_unreg.stats_tagged
stats["untagged_tracker_error"] += rem_unreg.stats_untagged
stats["tagged"] += rem_unreg.stats_tagged
2021-12-29 01:19:58 +08:00
# Recheck Torrents
2023-04-11 03:11:03 +08:00
if cfg.commands["recheck"]:
recheck = ReCheck(qbit_manager)
stats["resumed"] += recheck.stats_resumed
stats["rechecked"] += recheck.stats_rechecked
2021-12-29 01:19:58 +08:00
# Tag NoHardLinks
2023-04-11 04:30:57 +08:00
if cfg.commands["tag_nohardlinks"]:
no_hardlinks = TagNoHardLinks(qbit_manager)
stats["tagged"] += no_hardlinks.stats_tagged
stats["tagged_noHL"] += no_hardlinks.stats_tagged
stats["untagged_noHL"] += no_hardlinks.stats_untagged
# Set Share Limits
if cfg.commands["share_limits"]:
share_limits = ShareLimits(qbit_manager)
stats["tagged"] += share_limits.stats_tagged
stats["updated_share_limits"] += share_limits.stats_tagged
stats["deleted"] += share_limits.stats_deleted
stats["deleted_contents"] += share_limits.stats_deleted_contents
stats["cleaned_share_limits"] += share_limits.stats_deleted + share_limits.stats_deleted_contents
2021-12-29 01:19:58 +08:00
# Remove Orphaned Files
2023-04-11 04:44:51 +08:00
if cfg.commands["rem_orphaned"]:
stats["orphaned"] += RemoveOrphaned(qbit_manager).stats
# Empty RecycleBin
2023-04-11 04:44:51 +08:00
stats["recycle_emptied"] += cfg.cleanup_dirs("Recycle Bin")
# Empty Orphaned Directory
2023-04-11 04:44:51 +08:00
stats["orphaned_emptied"] += cfg.cleanup_dirs("Orphaned Data")
2022-10-29 23:19:09 +08:00
if stats["categorized"] > 0:
stats_summary.append(f"Total Torrents Categorized: {stats['categorized']}")
if stats["tagged"] > 0:
stats_summary.append(f"Total Torrents Tagged: {stats['tagged']}")
if stats["rem_unreg"] > 0:
stats_summary.append(f"Total Unregistered Torrents Removed: {stats['rem_unreg']}")
if stats["tagged_tracker_error"] > 0:
2023-04-01 23:25:01 +08:00
stats_summary.append(f"Total {cfg.tracker_error_tag} Torrents Tagged: {stats['tagged_tracker_error']}")
2022-10-29 23:19:09 +08:00
if stats["untagged_tracker_error"] > 0:
2023-04-01 23:25:01 +08:00
stats_summary.append(f"Total {cfg.tracker_error_tag} Torrents untagged: {stats['untagged_tracker_error']}")
2022-10-29 23:19:09 +08:00
if stats["added"] > 0:
stats_summary.append(f"Total Torrents Added: {stats['added']}")
if stats["resumed"] > 0:
stats_summary.append(f"Total Torrents Resumed: {stats['resumed']}")
if stats["rechecked"] > 0:
stats_summary.append(f"Total Torrents Rechecked: {stats['rechecked']}")
if stats["deleted"] > 0:
stats_summary.append(f"Total Torrents Deleted: {stats['deleted']}")
if stats["deleted_contents"] > 0:
stats_summary.append(f"Total Torrents + Contents Deleted : {stats['deleted_contents']}")
if stats["orphaned"] > 0:
stats_summary.append(f"Total Orphaned Files: {stats['orphaned']}")
if stats["tagged_noHL"] > 0:
2023-04-01 23:25:01 +08:00
stats_summary.append(f"Total {cfg.nohardlinks_tag} Torrents Tagged: {stats['tagged_noHL']}")
2022-10-29 23:19:09 +08:00
if stats["untagged_noHL"] > 0:
2023-04-01 23:25:01 +08:00
stats_summary.append(f"Total {cfg.nohardlinks_tag} Torrents untagged: {stats['untagged_noHL']}")
if stats["updated_share_limits"] > 0:
stats_summary.append(f"Total Share Limits Updated: {stats['updated_share_limits']}")
if stats["cleaned_share_limits"] > 0:
stats_summary.append(f"Total Torrents Removed from Meeting Share Limits: {stats['cleaned_share_limits']}")
2022-10-29 23:19:09 +08:00
if stats["recycle_emptied"] > 0:
stats_summary.append(f"Total Files Deleted from Recycle Bin: {stats['recycle_emptied']}")
if stats["orphaned_emptied"] > 0:
stats_summary.append(f"Total Files Deleted from Orphaned Data: {stats['orphaned_emptied']}")
finished_run()
if cfg:
try:
2023-04-01 08:22:27 +08:00
cfg.webhooks_factory.end_time_hooks(start_time, end_time, run_time, next_run, stats, body)
except Failed as err:
logger.stacktrace()
logger.error(f"Webhooks Error: {err}")
2021-12-29 01:19:58 +08:00
def end():
"""Ends the program"""
logger.info("Exiting Qbit_manage")
logger.remove_main_handler()
sys.exit(0)
2021-11-24 04:45:16 +08:00
2021-12-29 01:19:58 +08:00
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
def calc_next_run(next_run_time):
"""Calculates the next run time based on the schedule"""
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
current_time = datetime.now()
current = current_time.strftime("%I:%M %p")
time_to_run_str = next_run_time.strftime("%Y-%m-%d %I:%M %p")
delta_seconds = (next_run_time - current_time).total_seconds()
time_until = precisedelta(timedelta(minutes=math.ceil(delta_seconds / 60)), minimum_unit="minutes", format="%d")
next_run = {}
if run is False:
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
next_run["next_run"] = next_run_time
next_run["next_run_str"] = f"Current Time: {current} | {time_until} until the next run at {time_to_run_str}"
else:
2022-10-29 23:19:09 +08:00
next_run["next_run"] = None
next_run["next_run_str"] = ""
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
return next_run
def schedule_from_cron(cron_expression):
schedule.clear()
base_time = datetime.now()
try:
iter = croniter(cron_expression, base_time)
next_run_time = iter.get_next(datetime)
except Exception as e:
logger.error(f"Invalid Cron Syntax: {cron_expression}. {e}")
logger.stacktrace()
sys.exit(1)
delay = (next_run_time - base_time).total_seconds()
schedule.every(delay).seconds.do(start_loop)
return next_run_time
def schedule_every_x_minutes(min):
schedule.clear()
schedule.every(min).minutes.do(start_loop)
next_run_time = datetime.now() + timedelta(minutes=min)
return next_run_time
2021-12-29 01:19:58 +08:00
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
def print_logo(logger):
global is_docker, version, git_branch
logger.separator()
logger.info_center(" _ _ _ ") # noqa: W605
logger.info_center(" | | (_) | ") # noqa: W605
logger.info_center(" __ _| |__ _| |_ _ __ ___ __ _ _ __ __ _ __ _ ___ ") # noqa: W605
2022-11-01 23:32:02 +08:00
logger.info_center(" / _` | '_ \\| | __| | '_ ` _ \\ / _` | '_ \\ / _` |/ _` |/ _ \\") # noqa: W605
logger.info_center(" | (_| | |_) | | |_ | | | | | | (_| | | | | (_| | (_| | __/") # noqa: W605
2022-11-01 23:32:02 +08:00
logger.info_center(r" \__, |_.__/|_|\__| |_| |_| |_|\__,_|_| |_|\__,_|\__, |\___|") # noqa: W605
logger.info_center(" | | ______ __/ | ") # noqa: W605
logger.info_center(" |_| |______| |___/ ") # noqa: W605
2023-05-23 09:29:31 +08:00
system_ver = "Docker" if is_docker else f"Python {platform.python_version()}"
logger.info(f" Version: {version[0]} ({system_ver}){f' (Git: {git_branch})' if git_branch else ''}")
latest_version = util.current_version(version, branch=branch)
new_version = (
latest_version[0]
if latest_version and (version[1] != latest_version[1] or (version[2] and version[2] < latest_version[2]))
else None
)
if new_version:
logger.info(f" Newest Version: {new_version}")
logger.info(f" Platform: {platform.platform()}")
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
if __name__ == "__main__":
killer = GracefulKiller()
logger.add_main_handler()
print_logo(logger)
try:
if run:
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
run_mode_message = " Run Mode: Script will exit after completion."
logger.info(run_mode_message)
start_loop(True)
else:
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
if is_valid_cron_syntax(sch): # Simple check to guess if it's a cron syntax
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
run_mode_message = f" Scheduled Mode: Running cron '{sch}'"
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
next_run_time = schedule_from_cron(sch)
next_run = calc_next_run(next_run_time)
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
run_mode_message += f"\n {next_run['next_run_str']}"
logger.info(run_mode_message)
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
else:
delta = timedelta(minutes=sch)
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
run_mode_message = f" Scheduled Mode: Running every {precisedelta(delta)}."
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
next_run_time = schedule_every_x_minutes(sch)
if startupDelay:
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
run_mode_message += f"\n Startup Delay: Initial Run will start after {startupDelay} seconds"
Release 4.1.8 (#645) * 4.1.8-develop1 * Bump humanize from 4.9.0 to 4.10.0 (#603) Bumps [humanize](https://github.com/python-humanize/humanize) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/python-humanize/humanize/releases) - [Commits](https://github.com/python-humanize/humanize/compare/4.9.0...4.10.0) --- updated-dependencies: - dependency-name: humanize dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Print the schedule and delay before starting the sleep (#606) * Bump croniter from 2.0.5 to 2.0.7 (#607) Bumps [croniter](https://github.com/kiorky/croniter) from 2.0.5 to 2.0.7. - [Changelog](https://github.com/kiorky/croniter/blob/master/CHANGELOG.rst) - [Commits](https://github.com/kiorky/croniter/compare/2.0.5...2.0.7) --- updated-dependencies: - dependency-name: croniter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump qbittorrent-api from 2024.5.63 to 2024.7.64 (#611) Bumps [qbittorrent-api](https://github.com/rmartin16/qbittorrent-api) from 2024.5.63 to 2024.7.64. - [Release notes](https://github.com/rmartin16/qbittorrent-api/releases) - [Changelog](https://github.com/rmartin16/qbittorrent-api/blob/main/CHANGELOG.md) - [Commits](https://github.com/rmartin16/qbittorrent-api/compare/v2024.5.63...v2024.7.64) --- updated-dependencies: - dependency-name: qbittorrent-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Check for symlinks prior to counting file as a hardlink (#609) * Bump croniter from 2.0.7 to 3.0.1 (#617) * Update SUPPORTED_VERSIONS.json (#618) * Update SUPPORTED_VERSIONS.json (#612) Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump croniter from 3.0.1 to 3.0.3 (#621) Bumps [croniter](https://github.com/kiorky/croniter) from 3.0.1 to 3.0.3. - [Changelog](https://github.com/kiorky/croniter/blob/master/CHANGELOG.rst) - [Commits](https://github.com/kiorky/croniter/compare/3.0.1...3.0.3) --- updated-dependencies: - dependency-name: croniter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.7.1 to 3.8.0 (#620) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.7.1 to 3.8.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.7.1...v3.8.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: bump required python version to 3.9.0+ (#623) * Typo fix in ` docs/Config-Setup.md` (#627) * Typo fix in `config.yml.sample` (#626) * Bump flake8 from 7.1.0 to 7.1.1 (#628) Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.0 to 7.1.1. - [Commits](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(docs): Sync wiki to docs [skip-cd] * Bump qbittorrent-api from 2024.7.64 to 2024.8.65 (#637) Bumps [qbittorrent-api](https://github.com/rmartin16/qbittorrent-api) from 2024.7.64 to 2024.8.65. - [Release notes](https://github.com/rmartin16/qbittorrent-api/releases) - [Changelog](https://github.com/rmartin16/qbittorrent-api/blob/main/CHANGELOG.md) - [Commits](https://github.com/rmartin16/qbittorrent-api/compare/v2024.7.64...v2024.8.65) --- updated-dependencies: - dependency-name: qbittorrent-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update SUPPORTED_VERSIONS.json (#639) * Extend logging to explain why torrent files were not deleted. (#640) * Extend logging to explain why torrent files were not deleted. * [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> * update tox * Add force_auto_tmm_ignore_tags feature (#634) * Add force_auto_tmm_ignore_tags feature to qbittorrent module This commit introduces a new configuration option 'force_auto_tmm_ignore_tags' that allows users to specify tags which will prevent the force_auto_tmm feature from being applied to that torrent. Changes: qbittorrent.py: Modified the get_torrent_info method in the Qbt class Added a check for matching tags to ignore when applying force_auto_tmm config.py: Added 'force_auto_tmm_ignore_tags' to the settings dictionary Implemented check_for_attribute method call to load the new setting from config.yml config.yml: Added 'force_auto_tmm_ignore_tags' to the settings section Included example tags 'cross-seed' and 'Upload' as default values to ignore * remove extra spacing between lines. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix line length to adhere to flake8 * change log output for force_auto_tmm to multiline comment to adhere to flake8 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add comment explaining logic for ignoring force_auto_tmm using tags. * Add force_auto_tmm_ignore_tags feature to qbittorrent module This commit introduces a new configuration option 'force_auto_tmm_ignore_tags' that allows users to specify tags which will prevent the force_auto_tmm feature from being applied to that torrent. Changes: qbittorrent.py: Modified the get_torrent_info method in the Qbt class Added a check for matching tags to ignore when applying force_auto_tmm config.py: Added 'force_auto_tmm_ignore_tags' to the settings dictionary Implemented check_for_attribute method call to load the new setting from config.yml config.yml: Added 'force_auto_tmm_ignore_tags' to the settings section Included example tags 'cross-seed' and 'Upload' as default values to ignore remove extra spacing between lines. fix line length to adhere to flake8 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci change log output for force_auto_tmm to multiline comment to adhere to flake8 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Add comment explaining logic for ignoring force_auto_tmm using tags. * fixed text formatting so its displayed properly when script is run * remove f-string --------- Co-authored-by: TJZine <tzine@student.bridgew.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump peter-evans/create-pull-request from 6 to 7 (#642) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.8 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: bobokun <jon.cy.lee98@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Nicholas Sereni <glicholas@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> Co-authored-by: James Tufarelli <8152401+Minituff@users.noreply.github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: darkeclipse <5069005+Dark3clipse@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tristan Zine <72631199+TJZine@users.noreply.github.com> Co-authored-by: TJZine <tzine@student.bridgew.edu>
2024-09-06 08:08:15 +08:00
logger.info(run_mode_message)
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
time.sleep(startupDelay)
Release 4.1.8 (#645) * 4.1.8-develop1 * Bump humanize from 4.9.0 to 4.10.0 (#603) Bumps [humanize](https://github.com/python-humanize/humanize) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/python-humanize/humanize/releases) - [Commits](https://github.com/python-humanize/humanize/compare/4.9.0...4.10.0) --- updated-dependencies: - dependency-name: humanize dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Print the schedule and delay before starting the sleep (#606) * Bump croniter from 2.0.5 to 2.0.7 (#607) Bumps [croniter](https://github.com/kiorky/croniter) from 2.0.5 to 2.0.7. - [Changelog](https://github.com/kiorky/croniter/blob/master/CHANGELOG.rst) - [Commits](https://github.com/kiorky/croniter/compare/2.0.5...2.0.7) --- updated-dependencies: - dependency-name: croniter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump qbittorrent-api from 2024.5.63 to 2024.7.64 (#611) Bumps [qbittorrent-api](https://github.com/rmartin16/qbittorrent-api) from 2024.5.63 to 2024.7.64. - [Release notes](https://github.com/rmartin16/qbittorrent-api/releases) - [Changelog](https://github.com/rmartin16/qbittorrent-api/blob/main/CHANGELOG.md) - [Commits](https://github.com/rmartin16/qbittorrent-api/compare/v2024.5.63...v2024.7.64) --- updated-dependencies: - dependency-name: qbittorrent-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Check for symlinks prior to counting file as a hardlink (#609) * Bump croniter from 2.0.7 to 3.0.1 (#617) * Update SUPPORTED_VERSIONS.json (#618) * Update SUPPORTED_VERSIONS.json (#612) Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump croniter from 3.0.1 to 3.0.3 (#621) Bumps [croniter](https://github.com/kiorky/croniter) from 3.0.1 to 3.0.3. - [Changelog](https://github.com/kiorky/croniter/blob/master/CHANGELOG.rst) - [Commits](https://github.com/kiorky/croniter/compare/3.0.1...3.0.3) --- updated-dependencies: - dependency-name: croniter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pre-commit from 3.7.1 to 3.8.0 (#620) Bumps [pre-commit](https://github.com/pre-commit/pre-commit) from 3.7.1 to 3.8.0. - [Release notes](https://github.com/pre-commit/pre-commit/releases) - [Changelog](https://github.com/pre-commit/pre-commit/blob/main/CHANGELOG.md) - [Commits](https://github.com/pre-commit/pre-commit/compare/v3.7.1...v3.8.0) --- updated-dependencies: - dependency-name: pre-commit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs: bump required python version to 3.9.0+ (#623) * Typo fix in ` docs/Config-Setup.md` (#627) * Typo fix in `config.yml.sample` (#626) * Bump flake8 from 7.1.0 to 7.1.1 (#628) Bumps [flake8](https://github.com/pycqa/flake8) from 7.1.0 to 7.1.1. - [Commits](https://github.com/pycqa/flake8/compare/7.1.0...7.1.1) --- updated-dependencies: - dependency-name: flake8 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(docs): Sync wiki to docs [skip-cd] * Bump qbittorrent-api from 2024.7.64 to 2024.8.65 (#637) Bumps [qbittorrent-api](https://github.com/rmartin16/qbittorrent-api) from 2024.7.64 to 2024.8.65. - [Release notes](https://github.com/rmartin16/qbittorrent-api/releases) - [Changelog](https://github.com/rmartin16/qbittorrent-api/blob/main/CHANGELOG.md) - [Commits](https://github.com/rmartin16/qbittorrent-api/compare/v2024.7.64...v2024.8.65) --- updated-dependencies: - dependency-name: qbittorrent-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Update SUPPORTED_VERSIONS.json (#639) * Extend logging to explain why torrent files were not deleted. (#640) * Extend logging to explain why torrent files were not deleted. * [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> * update tox * Add force_auto_tmm_ignore_tags feature (#634) * Add force_auto_tmm_ignore_tags feature to qbittorrent module This commit introduces a new configuration option 'force_auto_tmm_ignore_tags' that allows users to specify tags which will prevent the force_auto_tmm feature from being applied to that torrent. Changes: qbittorrent.py: Modified the get_torrent_info method in the Qbt class Added a check for matching tags to ignore when applying force_auto_tmm config.py: Added 'force_auto_tmm_ignore_tags' to the settings dictionary Implemented check_for_attribute method call to load the new setting from config.yml config.yml: Added 'force_auto_tmm_ignore_tags' to the settings section Included example tags 'cross-seed' and 'Upload' as default values to ignore * remove extra spacing between lines. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix line length to adhere to flake8 * change log output for force_auto_tmm to multiline comment to adhere to flake8 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add comment explaining logic for ignoring force_auto_tmm using tags. * Add force_auto_tmm_ignore_tags feature to qbittorrent module This commit introduces a new configuration option 'force_auto_tmm_ignore_tags' that allows users to specify tags which will prevent the force_auto_tmm feature from being applied to that torrent. Changes: qbittorrent.py: Modified the get_torrent_info method in the Qbt class Added a check for matching tags to ignore when applying force_auto_tmm config.py: Added 'force_auto_tmm_ignore_tags' to the settings dictionary Implemented check_for_attribute method call to load the new setting from config.yml config.yml: Added 'force_auto_tmm_ignore_tags' to the settings section Included example tags 'cross-seed' and 'Upload' as default values to ignore remove extra spacing between lines. fix line length to adhere to flake8 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci change log output for force_auto_tmm to multiline comment to adhere to flake8 [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Add comment explaining logic for ignoring force_auto_tmm using tags. * fixed text formatting so its displayed properly when script is run * remove f-string --------- Co-authored-by: TJZine <tzine@student.bridgew.edu> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> * Bump peter-evans/create-pull-request from 6 to 7 (#642) Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7. - [Release notes](https://github.com/peter-evans/create-pull-request/releases) - [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7) --- updated-dependencies: - dependency-name: peter-evans/create-pull-request dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.8 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: bobokun <jon.cy.lee98@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Nicholas Sereni <glicholas@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com> Co-authored-by: James Tufarelli <8152401+Minituff@users.noreply.github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: darkeclipse <5069005+Dark3clipse@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Tristan Zine <72631199+TJZine@users.noreply.github.com> Co-authored-by: TJZine <tzine@student.bridgew.edu>
2024-09-06 08:08:15 +08:00
else:
logger.info(run_mode_message)
4.1.7 (#602) * 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](https://github.com/pycqa/flake8/compare/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] <support@github.com> 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 <12660469+bobokun@users.noreply.github.com> * [pre-commit.ci] pre-commit autoupdate (#584) updates: - [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1) - [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0) - [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/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 <12660469+bobokun@users.noreply.github.com> * 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 <12660469+bobokun@users.noreply.github.com> * 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](https://github.com/dependabot/fetch-metadata/compare/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] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 4.1.7 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Actionbot <actions@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Amos (lflare) <me@amosng.com> Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com> Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
2024-07-06 04:55:11 +08:00
start_loop(True)
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
while not killer.kill_now:
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
next_run = calc_next_run(next_run_time)
schedule.run_pending()
4.1.3 (#542) * 4.1.3-develop1 * removes `ignoreTags_OnUpdate` setting as it was confusing for users - Adds cache for tag updates - Updates doc to include cat in tracker * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537) * Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0. - [Release notes](https://github.com/dependabot/fetch-metadata/releases) - [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0) --- updated-dependencies: - dependency-name: dependabot/fetch-metadata dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * minor bug fix in process torrent issues * remove force_retag setting since it's no longer valid with the new tag-update * move hotio webhook to start earlier * adds better trace logs for share limits #533 * Adds #538 * [pre-commit.ci] pre-commit autoupdate (#539) * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2) * [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> * add additional trace logs for noHL * nohl config fixes * Fixes #540 * adds cron scheduling support * minor bug fix in rounding minutes * bugfixes in cron scheduling * don't spam the logs * chore: Update qbit_manage.py to display next run time after first cron run * remove spam in logs * QOL improvement: Refactor time parsing logic for share limits * bug fix in new parse data * 4.1.3 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-06 02:07:36 +08:00
logger.trace(f" Pending Jobs: {schedule.get_jobs()}")
time.sleep(60)
end()
except KeyboardInterrupt:
2021-12-29 01:19:58 +08:00
end()