diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a631f0..6365c63 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,5 +9,6 @@ jobs: release: uses: nzbgetcom/nzbget-extensions/.github/workflows/extension-release.yml@main with: - release-file-list: FailureLink.py + release-file-list: main.py manifest.json release-file-name: failurelink + release-dir: FailureLink diff --git a/README.md b/README.md index 5168bda..6dbfcbb 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ > **Note:** this repo is a fork of the original github [project](https://github.com/nzbget/FailureLink) > made by @hugbug. -> **Note:** This script is compatible with python 3.9.x and above. +## NZBGet Versions -> **Note:** If you need support for Python 2.x or older Python3.x versions please use [v1.21](https://github.com/nzbgetcom/Extension-FailureLink/releases/tag/v1.21) release. - -> **Note:** [Here](https://github.com/nzbgetcom/nzbget/discussions/56) you can discuss problems with different versions of Python. +- pre-release v23+ [v3.0](https://github.com/nzbgetcom/Extension-FailureLink/releases/tag/v3.0) +- stable v22 [v2.0](https://github.com/nzbgetcom/Extension-FailureLink/releases/tag/v2.0) +- legacy v21 [v2.0](https://github.com/nzbgetcom/Extension-FailureLink/releases/tag/v2.0) +> **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.21](https://github.com/nzbgetcom/Extension-FailureLink/releases/tag/v1.21) release. # FailureLink FailureLink [script](https://nzbget.com/documentation/post-processing-scripts/) for [NZBGet](https://nzbget.com). diff --git a/FailureLink.py b/main.py similarity index 83% rename from FailureLink.py rename to main.py index c87b4ef..81121bc 100644 --- a/FailureLink.py +++ b/main.py @@ -19,79 +19,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -############################################################################## -### NZBGET POST-PROCESSING SCRIPT ### -# Check videos to determine if they are corrupt. Inform indexer site about failed -# or corrupt download and request a replacement nzb. -# -# If download fails, or video files are corrupt, the script sends info about the -# failure to indexer site, so a replacement NZB (same movie or TV episode) can be -# queued up if available. The indexer site must support DNZB-Header. -# "X-DNZB-FailureLink". -# -# Info about pp-script: -# Author: Andrey Prygunkov (nzbget@gmail.com). -# Further modifications by Clinton Hall and dogzipp. -# Web-site: http://nzbget.sourceforge.net/forum/viewforum.php?f=8. -# Web-site: https://github.com/nzbgetcom/Extension-FailureLink/ (Python 3.9.x). -# License: GPLv2 (http://www.gnu.org/licenses/gpl.html). -# PP-Script Version: 1.21 -# -# -# NOTE: Make sure you run this script first (before any other PP-scripts). -# -# NOTE: The integration works only for downloads queued via URL (including -# RSS). NZB-files queued from local disk don't have enough information -# to contact the indexer site. -# -# NOTE: This script requires Python 3.9.x to be installed on your system. - -############################################################################## -### OPTIONS ### - -## General - -# Download another release (yes, no). -# -# If the NZB download of a Movie or TV Show fails, request an alternate -# NZB-file of the same release and add it to queue. If disabled the indexer -# site is still informed about the failure but no other nzb-file is queued. -#DownloadAnotherRelease=no - -# Cleanup Directory (yes, no). -# -# Set this to yes in order to delete all corrupt and failed Files -#Delete=no - -# Print more logging messages (yes, no). -# -# For debugging or if you need to report a bug. -#Verbose=no - -# Check videos for corruption (yes, no). -# -# If disabled, ignore the settings below. -#CheckVid=no - -# Absolute path for ffprobe. -# -# Enter the full path to ffprobe or avprobe here, or leave blank to search your system path. -#ffprobe= - -# Absolute path for known good video. -# -# This is optional and is only needed to test if ffprobe is correctly compiled and working. -# Enter the full path to a valid video file. -#testVid= - -# Media Extensions -# -# This is a list of video/media extensions that will be checked for corruption. -#mediaExtensions=.mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.ts - -### NZBGET POST-PROCESSING SCRIPT ### -############################################################################## import os import sys diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..4a43c2c --- /dev/null +++ b/manifest.json @@ -0,0 +1,123 @@ +{ + "main": "main.py", + "name": "FailureLink", + "homepage": "https://github.com/nzbgetcom/Extension-FailureLink/", + "kind": "POST-PROCESSING", + "displayName": "Failure Link", + "version": "3.0.0", + "author": "Andrey Prygunkov", + "license": "GNU", + "about": "Checks videos to determine if they are corrupt. Inform indexer site about failed or corrupt download and request a replacement nzb.", + "queueEvents": "", + "description": [ + "If download fails, or video files are corrupt, the script sends info about the", + "failure to indexer site, so a replacement NZB (same movie or TV episode) can be", + "queued up if available. The indexer site must support DNZB-Header.", + "\"X-DNZB-FailureLink\".", + "", + "Further modifications by Clinton Hall and dogzipp." + ], + "requirements": [ + "Make sure you run this script first (before any other PP-scripts).", + "The integration works only for downloads queued via URL (including RSS).", + "NZB-files queued from local disk don't have enough information to contact the indexer site.", + "", + "This script requires Python 3.8.x to be installed on your system." + ], + "options": [ + { + "name": "DownloadAnotherRelease", + "displayName": "DownloadAnotherRelease", + "value": "no", + "description": [ + "Download another release.", + "", + "If the NZB download of a Movie or TV Show fails, request an alternate", + "NZB-file of the same release and add it to queue. If disabled the indexer", + "site is still informed about the failure but no other nzb-file is queued." + ], + "select": [ + "yes", + "no" + ] + }, + { + "name": "Delete", + "displayName": "Delete", + "value": "no", + "description": [ + "Cleanup Directory.", + "", + "Set this to yes in order to delete all corrupt and failed Files." + ], + "select": [ + "yes", + "no" + ] + }, + { + "name": "Verbose", + "displayName": "Verbose", + "value": "no", + "description": [ + "Print more logging messages.", + "", + "For debugging or if you need to report a bug." + ], + "select": [ + "yes", + "no" + ] + }, + { + "name": "CheckVid", + "displayName": "CheckVid", + "value": "no", + "description": [ + "Check videos for corruption.", + "", + "If disabled, ignore the settings below." + ], + "select": [ + "yes", + "no" + ] + }, + { + "name": "ffprobe", + "displayName": "ffprobe", + "value": "", + "description": [ + "Absolute path for ffprobe.", + "", + "Enter the full path to ffprobe or avprobe here, or leave blank to search your system path." + ], + "select": [] + }, + { + "name": "testVid", + "displayName": "TestVid", + "value": "", + "description": [ + "Absolute path for known good video.", + "", + "This is optional and is only needed to test if ffprobe is correctly compiled and working.", + "Enter the full path to a valid video file. " + ], + "select": [] + }, + { + "name": "mediaExtensions", + "displayName": "MediaExtensions", + "value": ".mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg,.vob,.ts", + "description": [ + "Media Extensions.", + "", + "This is a list of video/media extensions that will be checked for corruption." + ], + "select": [] + } + ], + "commands": [], + "taskTime": "" +} \ No newline at end of file diff --git a/tests.py b/tests.py index 8253fe3..4e7710e 100644 --- a/tests.py +++ b/tests.py @@ -15,7 +15,7 @@ # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License -# along with the program. If not, see . +# along with the program. If not, see . # import sys @@ -99,7 +99,7 @@ def clean_up(): def run_script(): sys.stdout.flush() - proc = subprocess.Popen([get_python(), root_dir + '/FailureLink.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() ret_code = proc.returncode return (out.decode(), int(ret_code), err.decode())