From 53870509be496ac566c29f3a4cb88e4daabb5c6a Mon Sep 17 00:00:00 2001 From: NZBLNK Date: Thu, 22 Dec 2022 23:26:56 +0100 Subject: [PATCH] Reactivate NZBKing --- src/LICENSE | 2 +- src/nzbmonkey.py | 13 +++++++++++-- src/nzbmonkeyspec.py | 6 ++++-- src/version.py | 5 ++++- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/LICENSE b/src/LICENSE index c63e441..1511191 100644 --- a/src/LICENSE +++ b/src/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 NZBLNK +Copyright (c) 2022 NZBLNK Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/nzbmonkey.py b/src/nzbmonkey.py index 2e33f46..08f73d5 100644 --- a/src/nzbmonkey.py +++ b/src/nzbmonkey.py @@ -763,6 +763,14 @@ def search_nzb(header, password, search_engines, best_nzb, max_missing_files, ma 'downloadUrl': 'http://www.binsearch.info/?action=nzb&{id}=1&server=2', 'skip_segment_debug': False }, + 'nzbking': + { + 'name': 'NZBKing', + 'searchUrl': 'https://www.nzbking.com/search/?q={0}', + 'regex': r'href="/nzb:(?P.*?)/".*"', + 'downloadUrl': 'https://www.nzbking.com/nzb:{id}/', + 'skip_segment_debug': True + }, 'nzbindex': { 'name': 'NZBIndex', @@ -1483,6 +1491,7 @@ def main(): {'binsearch': cfg['Searchengines'].as_int('binsearch'), 'binsearch_alternative': cfg['Searchengines'].as_int('binsearch_alternative'), + 'nzbking': cfg['Searchengines'].as_int('nzbking'), 'nzbindex': cfg['Searchengines'].as_int('nzbindex')}, cfg['NZBCheck'].as_bool('best_nzb'), cfg['NZBCheck'].get('max_missing_files', 2), @@ -1534,7 +1543,8 @@ def main(): try: res = requests.get(req_url, verify=False, timeout=REQUESTS_TIMEOUT * 2) if res.status_code == 403: - print_and_wait(Col.FAIL + ' - Please use the API KEY not the NZB KEY in your config!' + Col.OFF, WAITING_TIME_LONG) + print_and_wait(Col.FAIL + ' - Please use the API KEY not the NZB KEY in your config!' + Col.OFF, + WAITING_TIME_LONG) raise EnvironmentError res = json.loads(res.text) @@ -1551,7 +1561,6 @@ def main(): except (EnvironmentError, ValueError): cat_choice = [] - if ExeTypes.NZBGET.name == exe_target: scheme = 'https' if exe_target_cfg.as_bool('ssl') else 'http' diff --git a/src/nzbmonkeyspec.py b/src/nzbmonkeyspec.py index 3a25932..bd94a50 100644 --- a/src/nzbmonkeyspec.py +++ b/src/nzbmonkeyspec.py @@ -106,9 +106,11 @@ def getSpec(): # 0 = disabled; 1-9 = enabled; 1-9 are also the order in which the search engines are used # More than 1 server with the same order number is allowed # Enable Binsearch -binsearch = integer(default = 2) +binsearch = integer(default = 3) # Enable Binsearch - Alternative Server -binsearch_alternative = integer(default = 2) +binsearch_alternative = integer(default = 3) # Enable NZBIndex nzbindex = integer(default = 1) +# Enable NZBKing +nzbking = integer(default = 2) """.split('\n')) diff --git a/src/version.py b/src/version.py index 91f97bd..b9d408d 100644 --- a/src/version.py +++ b/src/version.py @@ -1,6 +1,9 @@ # -*- coding: utf-8 -*- """ History +v0.2.9 +- NZBKing is dead, long live the King + v0.2.8 - Fix #40 SABnzbd API compatibility - Remove NZBKing (Rip!) @@ -91,5 +94,5 @@ """ -__version__ = '0.2.8' +__version__ = '0.2.9' __requires__ = ['pyperclip', 'requests', 'configobj', 'colorama', 'cryptography']