diff --git a/README.md b/README.md index 409bed2..125765e 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ > **Note:** this repo is a fork of the original github [project](https://github.com/nzbget/FakeDetector) > made by @hugbug. -> **Note:** This script is compatible with python 3.9.x and above. +> **Note:** This script is compatible with NZBGet v23 and above. +For older versions of NZBGet please use [v2.0](https://github.com/nzbgetcom/Extension-FakeDetector/releases/tag/v2.0) release. -> **Note:** If you need support for Python 2.x or older Python3.x versions please use [v1.7](https://github.com/nzbgetcom/Extension-FakeDetector/releases/tag/v1.7) release. +> **Note:** This script is compatible with python 3.8.x and above. +If you need support for Python 2.x or older Python3.x versions please use [v1.7](https://github.com/nzbgetcom/Extension-FakeDetector/releases/tag/v1.7) release. -> **Note:** [Here](https://github.com/nzbgetcom/nzbget/discussions/56) you can discuss problems with different versions of Python. # FakeDetector Fake detection [script](https://nzbget.com/documentation/extension-scripts/) for [NZBGet](https://nzbget.com). @@ -18,5 +19,3 @@ Authors: Detects nzbs with fake media files. If a fake is detected the download is marked as bad. NZBGet removes the download from queue and (if option "DeleteCleanupDisk" is active) the downloaded files are deleted from disk. If duplicate handling is active (option "DupeCheck") then another duplicate is chosen for download if available. The status "FAILURE/BAD" is passed to other scripts and informs them about failure. - -For more info and support please visit forum topic [PP-Script FakeDetector](http://nzbget.net/forum/viewtopic.php?f=8&t=1394). diff --git a/FakeDetector.py b/main.py old mode 100755 new mode 100644 similarity index 92% rename from FakeDetector.py rename to main.py index 5a219bd..a639e70 --- a/FakeDetector.py +++ b/main.py @@ -21,40 +21,6 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -############################################################################## -### NZBGET QUEUE/POST-PROCESSING SCRIPT ### -### QUEUE EVENTS: NZB_ADDED, NZB_DOWNLOADED, FILE_DOWNLOADED - -# Detect nzbs with fake media files. -# -# If a fake is detected the download is marked as bad. NZBGet removes -# the download from queue and (if option "DeleteCleanupDisk" is active) the -# downloaded files are deleted from disk. If duplicate handling is active -# (option "DupeCheck") then another duplicate is chosen for download -# if available. -# -# The status "FAILURE/BAD" is passed to other scripts and informs them -# about failure. -# -# PP-Script version: 1.7. -# -# -# NOTE: This script requires Python 3.9.x to be installed on your system - - -############################################################################## -### OPTIONS ### - -# Banned extensions. -# -# Downloads which contain files with any of the following extensions will be marked as fake. -# Extensions must be separated by a comma (eg: .wmv, .divx). -#BannedExtensions= - - -### NZBGET QUEUE/POST-PROCESSING SCRIPT ### -############################################################################## - import os import sys diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..d41bd36 --- /dev/null +++ b/manifest.json @@ -0,0 +1,39 @@ +{ + "main": "main.py", + "name": "FakeDetector", + "homepage": "https://github.com/nzbgetcom/Extension-FakeDetector", + "kind": "QUEUE/POST-PROCESSING", + "displayName": "Fake Detector", + "version": "3.0.0", + "author": "Andrey Prygunkov", + "license": "GNU", + "about": "Detect nzbs with fake media files.", + "queueEvents": "NZB_ADDED, NZB_DOWNLOADED, FILE_DOWNLOADED", + "requirements": [ + "This script requires Python 3.8.x to be installed on your system" + ], + "description": [ + "If a fake is detected the download is marked as bad. NZBGet removes", + "the download from queue and (if option \"DeleteCleanupDisk\" is active) the", + "downloaded files are deleted from disk. If duplicate handling is active", + "(option \"DupeCheck\") then another duplicate is chosen for download if available.", + "", + "The status \"FAILURE/BAD\" is passed to other scripts and informs them about failure." + ], + "options": [ + { + "name": "BannedExtensions", + "displayName": "BannedExtensions", + "value": "", + "description": [ + "BannedExtensions.", + "", + "Downloads which contain files with any of the following extensions will be marked as fake.", + "Extensions must be separated by a comma (eg: .wmv, .divx)." + ], + "select": [] + } + ], + "commands": [], + "taskTime": "" +} \ No newline at end of file diff --git a/tests.py b/tests.py index 25f2835..7695e28 100644 --- a/tests.py +++ b/tests.py @@ -109,7 +109,7 @@ def clean_up(): def run_script(): sys.stdout.flush() - proc = subprocess.Popen([get_python(), root_dir + '/FakeDetector.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ.copy()) + proc = subprocess.Popen([get_python(), root_dir + '/main.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=os.environ.copy()) out, err = proc.communicate() proc.pid ret_code = proc.returncode