diff --git a/VERSION b/VERSION index acf9bf0..06eda28 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.2 \ No newline at end of file +3.2.3 \ No newline at end of file diff --git a/modules/notifiarr.py b/modules/notifiarr.py index e53b84b..3dd143d 100644 --- a/modules/notifiarr.py +++ b/modules/notifiarr.py @@ -18,6 +18,7 @@ class Notifiarr: self.instance = params["instance"] url, _ = self.get_url("user/validate/") response = self.config.get(url) + response_json = None try: response_json = response.json() except JSONDecodeError as e: @@ -26,6 +27,8 @@ class Notifiarr: raise Failed("Notifiarr Error (Response: 525): SSL handshake between Cloudflare and the origin web server failed.") else: raise Failed(e) + if response_json is None: + raise Failed("Notifiarr Error: Unable to connect to Notifiarr. It may be down?") if response.status_code >= 400 or ("result" in response_json and response_json["result"] == "error"): logger.debug(f"Response: {response_json}") raise Failed(f"({response.status_code} [{response.reason}]) {response_json}") diff --git a/modules/qbittorrent.py b/modules/qbittorrent.py index a8ecbfb..70cb4f8 100644 --- a/modules/qbittorrent.py +++ b/modules/qbittorrent.py @@ -295,7 +295,7 @@ class Qbt: # self.config.notify(e, 'Tag No Hard Links', False) logger.warning(e) continue - for torrent in alive_it(torrent_list): + for torrent in torrent_list: tracker = self.config.get_tags([x.url for x in torrent.trackers if x.url.startswith('http')]) if any(tag in torrent.tags for tag in nohardlinks[category]['exclude_tags']): # Skip to the next torrent if we find any torrents that are in the exclude tag @@ -430,10 +430,10 @@ class Qbt: cfg_tag_error = self.config.args['tag_tracker_error'] def tag_tracker_error(): - nonlocal dry_run, t_name, msg_up, tracker, t_cat, torrent, tag_error, tor_error_summary, num_tor_error + nonlocal dry_run, t_name, msg_up, msg, tracker, t_cat, torrent, tag_error, tor_error_summary, num_tor_error tor_error = '' tor_error += (util.insert_space(f'Torrent Name: {t_name}', 3)+'\n') - tor_error += (util.insert_space(f'Status: {msg_up}', 9)+'\n') + tor_error += (util.insert_space(f'Status: {msg}', 9)+'\n') tor_error += (util.insert_space(f'Tracker: {tracker["url"]}', 8)+'\n') tor_error += (util.insert_space(f"Added Tag: {tag_error}", 6)+'\n') tor_error_summary += tor_error @@ -445,7 +445,7 @@ class Qbt: "torrent_name": t_name, "torrent_category": t_cat, "torrent_tag": tag_error, - "torrent_status": msg_up, + "torrent_status": msg, "torrent_tracker": tracker["url"], "notifiarr_indexer": tracker["notifiarr"], } @@ -453,17 +453,17 @@ class Qbt: if not dry_run: torrent.add_tags(tags=tag_error) def del_unregistered(): - nonlocal dry_run, loglevel, del_tor, del_tor_cont, t_name, msg_up, tracker, t_cat, t_msg, t_status, torrent + nonlocal dry_run, loglevel, del_tor, del_tor_cont, t_name, msg_up, msg, tracker, t_cat, t_msg, t_status, torrent body = [] body += print_line(util.insert_space(f'Torrent Name: {t_name}', 3), loglevel) - body += print_line(util.insert_space(f'Status: {msg_up}', 9), loglevel) + body += print_line(util.insert_space(f'Status: {msg}', 9), loglevel) body += print_line(util.insert_space(f'Tracker: {tracker["url"]}', 8), loglevel) attr = { "function": "rem_unregistered", "title": "Removing Unregistered Torrents", "torrent_name": t_name, "torrent_category": t_cat, - "torrent_status": msg_up, + "torrent_status": msg, "torrent_tracker": tracker["url"], "notifiarr_indexer": tracker["notifiarr"], } @@ -548,6 +548,7 @@ class Qbt: if x.url.startswith('http'): tracker = self.config.get_tags([x.url]) msg_up = x.msg.upper() + msg = x.msg # Tag any error torrents if cfg_tag_error: if x.status == 4 and tag_error not in check_tags: diff --git a/requirements.txt b/requirements.txt index 6ee3366..31577a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ ruamel.yaml==0.17.21 qbittorrent-api>=2022.3.29 schedule==1.1.0 retrying==1.3.3 -alive_progress==2.3.1 +alive_progress==2.4.1 requests==2.27.1 \ No newline at end of file