[Queue-Script] PasswordDetector - stop dl of protected .rar

Share your scripts or request scripts with specific features.
Forum rules
Please keep the forum clean - one topic per script. Questions not related to a specific script should be posted in Support forum.
Post Reply
JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

[Queue-Script] PasswordDetector - stop dl of protected .rar

Post by JVM » 17 Aug 2014, 02:16

PasswordDetector is a queue script that checks for passwords inside of every .rar file of a NZB downloaded. This means that it can detect password protected NZB's very early before downloading is complete, allowing the NZB to be automatically deleted or paused. Detecting early saves data, time, resources, etc.

Settings
Once NZB found password protected, PasswordDetector can either:
  • mark bad the NZB, where the download is aborted, marked as bad and processed by duplicate handling (if active). All pp-scripts are executed as well. If option DeleteCleanupDisk is active in NZBGet the downloaded files are deleted, which deletes the NZB and informs post processing scripts, e.g. call another NZB; or
  • pause the NZB, awaiting user action, e.g. so a password can be defined later. If a NZB found password protected and allowed to resume, password detection is skipped to allow the download to complete.
It's also possible to enable/disable detection for passwords as required:
  • if NZBGet finds a password in NZB metatag, detection is skipped automatically;
  • if the user manually adds a password for a given NZB via the web ui (Postprocess), detection is skipped;
  • if the user manually enables/disables PasswordDetector for a given NZB via the web ui (Postprocess);
  • earlier scripts can define password (e.g. [Scan-Script] pfftn) and PasswordDetector cancels detection;
  • detect only for certain categories, via the CategoryX.PostScript option (CATEGORIES settings page); or
  • detect for all downloads by default, via the QueueScript option (EXTENSION SCRIPTS settings page)
Requirements
  • NZBGet v14 r1094+
  • Python 2.x; may not work with Python 3.x.
Other notes
  • May have a noticeable effect on performance during downloads
  • It is based off another queue script, FakeDetector. They are both independent; you need both to detect for fakes and passwords.
  • Tested on a 256MB Model B Raspberry Pi running Raspbain
Authors
This script is written by a joined force of forum members including:
  • Clinton Hall;
  • JVM;
  • hugbug;
  • get39678;
  • prinz2311;
To install
  • Copy to NZBGet's scripts folder;
  • choose the script in option QueueScript and/or PostScript;
  • configure and save script options;
Current
Old

[/size]
Last edited by JVM on 08 Apr 2015, 02:41, edited 22 times in total.

TRaSH
Posts: 54
Joined: 23 Mar 2014, 10:11

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by TRaSH » 17 Aug 2014, 07:30

hmm,
this would be nice to have as default in nzbget,
i know sab had a option when a rar was password protected and you didn't provide a password it would pause the download.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by hugbug » 17 Aug 2014, 09:43

Great work!

An idea: add action "Pause and EMail". But don't add all email config options to the script, instead use the options saved for Email.py:

Code: Select all

host = os.environ['NZBPO_EMAIL_PY_SERVER']

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by JVM » 17 Aug 2014, 10:59

TRaSH wrote:hmm,
this would be nice to have as default in nzbget,
i know sab had a option when a rar was password protected and you didn't provide a password it would pause the download.
I was thinking about that, at the moment it will keep pausing a download every time it sees a passworded rar, not sure how to disable checking once a password is specified or if a user chooses to continue... apart from removing the script from the default queue script setting.

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by JVM » 17 Aug 2014, 11:04

hugbug wrote:Great work!

An idea: add action "Pause and EMail". But don't add all email config options to the script, instead use the options saved for Email.py:

Code: Select all

host = os.environ['NZBPO_EMAIL_PY_SERVER']
That was on the back of my mind, but I was thinking to boarding it out to every notification script here by having a setting like on the extension scripts page. Like a PostOueue option where you could list the default scripts after PasswordDetector was done?

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by hugbug » 17 Aug 2014, 13:09

JVM wrote:at the moment it will keep pausing a download every time it sees a passworded rar, not sure how to disable checking once a password is specified or if a user chooses to continue... apart from removing the script from the default queue script setting.
Once a protected rar is detect - set a post-processing parameter for the nzb:

Code: Select all

print('[NZB] NZBPR_PASSWORDDETECTOR_HASPASSWORD=yes')
Then at the beginning of the script check if the parameter is set:

Code: Select all

if os.environ.get('NZBPR_PASSWORDDETECTOR_HASPASSWORD')=='yes':
      sys.exit(POSTPROCESS_SUCCESS)

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by JVM » 17 Aug 2014, 13:58

Cheers hugbug, once password found, password detection stops as desired. Updated file in OP.

get39678
Posts: 222
Joined: 09 Jun 2014, 10:49

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by get39678 » 17 Aug 2014, 18:36

I am currently giving these a go but I am wondering to try to reduce the overhead of starting the scripts and looking in the archive files multiple times is is feasible to combine the PasswordDetector and FakeDetector and have options to enable and disable each as required on a single options screen?

picardtux
Posts: 71
Joined: 05 Sep 2012, 12:45
Contact:

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by picardtux » 17 Aug 2014, 21:04

thank you for this extension,
I'll be happy to test it ;-)

JVM
Posts: 83
Joined: 21 Oct 2013, 05:11

Re: [Queue-Script] PasswordDetector - stop dl of protected .

Post by JVM » 18 Aug 2014, 13:42

get39678 wrote:I am currently giving these a go but I am wondering to try to reduce the overhead of starting the scripts and looking in the archive files multiple times is is feasible to combine the PasswordDetector and FakeDetector and have options to enable and disable each as required on a single options screen?
Yes it's feasible but I might leave them separate for now and see if any issues arise. Something more efficient again would be implementing the scripts in bash or similar. Hugbug is looking into an interval between calls of queue scripts.

I'm curious what sort of processing times do you and others get? Easy way to find out is searching "detector" in the Messages tab. Any impact of download speed?

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests