Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torrent hook #221

Merged
merged 23 commits into from
Jul 7, 2024
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
14c4389
Scaffold for torrent_hook
shaldengeki Jul 7, 2024
44dd8e1
Pause torrent
shaldengeki Jul 7, 2024
58e671e
Run gazelle
shaldengeki Jul 7, 2024
692b263
Restructure args a little
shaldengeki Jul 7, 2024
0cbcc56
Mark as required
shaldengeki Jul 7, 2024
09c1e00
Set up logging
shaldengeki Jul 7, 2024
bb21941
Add script
shaldengeki Jul 7, 2024
b075627
Catch 404 when pausing
shaldengeki Jul 7, 2024
68380c6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 7, 2024
1775226
Remove plugin
shaldengeki Jul 7, 2024
bcaeb3a
Merge remote-tracking branch 'refs/remotes/origin/torrent-hook' into …
shaldengeki Jul 7, 2024
953bf50
Ignore typing errors in py_proto/test
shaldengeki Jul 7, 2024
589dcfb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 7, 2024
27acc9c
Fixup remaining errors
shaldengeki Jul 7, 2024
5453c68
Merge remote-tracking branch 'refs/remotes/origin/torrent-hook' into …
shaldengeki Jul 7, 2024
285342c
Fix non-required value
shaldengeki Jul 7, 2024
973d73a
Quote args
shaldengeki Jul 7, 2024
3bbcf35
Set type of pause
shaldengeki Jul 7, 2024
f9e1eb2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 7, 2024
3abd051
Type and notify
shaldengeki Jul 7, 2024
35123bc
Merge remote-tracking branch 'refs/remotes/origin/torrent-hook' into …
shaldengeki Jul 7, 2024
b3b39d8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 7, 2024
43e3463
Fixup tag parsing
shaldengeki Jul 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Catch 404 when pausing
  • Loading branch information
shaldengeki committed Jul 7, 2024
commit b07562787397da1ae479b84f3d58b610ce325a39
5 changes: 4 additions & 1 deletion torrent_hook/torrent_finished.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ def notify_consumer(notify_url: str, args: argparse.Namespace) -> None:
def pause_torrent(torrent_id: str) -> None:
logger.info(f"Pausing torrent {torrent_id}")
with qbittorrentapi.Client(host="localhost", port=8080) as client:
client.torrents_pause([torrent_id])
try:
client.torrents_pause([torrent_id])
except qbittorrentapi.NotFound404Error:
pass

def main() -> int:
args = parse_args()
Expand Down