This commit is contained in:
bobokun 2024-09-06 09:10:35 -04:00 committed by GitHub
parent 87ffdda8c6
commit 66aec5b0ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 52 additions and 19 deletions

View file

@ -1,16 +1,4 @@
# Requirements Updated
- qbittorrent-api==2024.8.65
- croniter==3.0.3
- humanize==4.10.0
# New Updates
- Adds `force_auto_tmm_ignore_tags` feature to ignore tags when force_auto_tmm is enabled (#634)
# Bug Fixes # Bug Fixes
- Fixes Print the schedule and delay before starting the sleep (Closes [#605](https://github.com/StuffAnThings/qbit_manage/issues/605)) - Fixes Blutopia torrents being deleted due to passkeys being invalid (#646)
- Fixes noHL counting symlinks as part of its logic (Closes [#608](https://github.com/StuffAnThings/qbit_manage/issues/608)) - Adds edit_passkey.py script
- Fix typos in documentation (#627) **Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.8...v4.1.9
- Extended logging to explain why torrent files were not deleted (#625)
Special thanks to @ineednewpajamas, @glicholas, @Minituff, @Dark3clipse, @TJZine for their contributions!
**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v4.1.7...v4.1.8

View file

@ -1 +1 @@
4.1.8 4.1.9

View file

@ -94,10 +94,8 @@ class TorrentMessages:
IGNORE_MSGS = [ IGNORE_MSGS = [
"YOU HAVE REACHED THE CLIENT LIMIT FOR THIS TORRENT", "YOU HAVE REACHED THE CLIENT LIMIT FOR THIS TORRENT",
"MISSING PASSKEY", "PASSKEY", # Any mention of passkeys should be a clear sign it should NOT be deleted
"MISSING INFO_HASH", "MISSING INFO_HASH",
"PASSKEY IS INVALID",
"INVALID PASSKEY",
"EXPECTED VALUE (LIST, DICT, INT OR STRING) IN BENCODED STRING", "EXPECTED VALUE (LIST, DICT, INT OR STRING) IN BENCODED STRING",
"COULD NOT PARSE BENCODED DATA", "COULD NOT PARSE BENCODED DATA",
"STREAM TRUNCATED", "STREAM TRUNCATED",

47
scripts/edit_passkey.py Normal file
View file

@ -0,0 +1,47 @@
#!/usr/bin/env python3
# This standalone script is used to edit passkeys from one tracker.
# Needs to have qbittorrent-api installed
# pip3 install qbittorrent-api
import sys
# --DEFINE VARIABLES--#
qbt_host = "qbittorrent:8080"
qbt_user = None
qbt_pass = None
TRACKER = "blutopia" # Part of the tracker URL, e.g., "blutopia" or "your-tracker.com"
OLD_PASSKEY = "OLD_PASSKEY"
NEW_PASSKEY = "NEW_PASSKEY"
# --DEFINE VARIABLES--#
# --START SCRIPT--#
try:
from qbittorrentapi import APIConnectionError
from qbittorrentapi import Client
from qbittorrentapi import LoginFailed
except ModuleNotFoundError:
print('Requirements Error: qbittorrent-api not installed. Please install using the command "pip install qbittorrent-api"')
sys.exit(1)
if __name__ == "__main__":
try:
client = Client(host=qbt_host, username=qbt_user, password=qbt_pass)
except LoginFailed:
raise ("Qbittorrent Error: Failed to login. Invalid username/password.")
except APIConnectionError:
raise ("Qbittorrent Error: Unable to connect to the client.")
except Exception:
raise ("Qbittorrent Error: Unable to connect to the client.")
torrent_list = client.torrents.info(sort="added_on", reverse=True)
for torrent in torrent_list:
for x in torrent.trackers:
if TRACKER in x.url and OLD_PASSKEY in x.url:
try:
newurl = x.url.replace(OLD_PASSKEY, NEW_PASSKEY)
print(f"Updating passkey for torrent name: {torrent.name}\n")
torrent.remove_trackers(urls=x.url)
torrent.add_trackers(urls=newurl)
except Exception as e:
print(f"Error updating tracker for {torrent.name}: {e}")
print("Passkey update completed.")