[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.
get39678
Posts: 212
Joined: 09 Jun 2014, 10:49

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

Post by get39678 » 24 Aug 2014, 17:47

so I'm not sure why PasswordDetector doesn't delete temp files for you. FakeDetector doesn't delete files at the moment as it checks for mark bad and other stuff before it gets to cleaning up the temp file.
Set password detector to Pause download.
Add a password protected item and let it detect the password.
Wait for item to be Paused.
Check temp folder and a file will be listed (0 bytes usually for me).
Go to NZBGet and Delete the item from the queue.
The temp file will not be deleted.

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

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

Post by JVM » 25 Aug 2014, 11:28

Updated script to version 1.2 in OP.
get39678 wrote: Go to NZBGet and Delete the item from the queue.
The temp file will not be deleted.
Oh I see what you mean, yeah post processing scripts won't run if item manually deleted from queue, but will run if an item is marked bad like the script does automatically.

I've updated the script with a new function clean_up_FakeDetector() to delete both PasswordDetector [clean_up()] and FakeDetector [clean_up_FakeDetector()] temp files once password found, so if one chooses to delete a paused item, the files are already gone.

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

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

Post by get39678 » 26 Aug 2014, 10:02

JVM wrote:Oh I see what you mean, yeah post processing scripts won't run if item manually deleted from queue, but will run if an item is marked bad like the script does automatically.
I've updated the script with a new function clean_up_FakeDetector() to delete both PasswordDetector [clean_up()] and FakeDetector [clean_up_FakeDetector()] temp files once password found, so if one chooses to delete a paused item, the files are already gone.
Working fine for me no more PasswordDetector Temp files being left behind now.
...
Have you noticed this post would a feature request for a new event so it is event driven rather than a none event driven workaround be a good idea?
http://nzbget.net/forum/viewtopic.php?f=8&t=1394#p9068

When the queue item is paused is it possible for it to display something in the queue item for the reason of the pausing?
Perhaps a red/orange rectangle with "nameofextension" in it so know what extension caused pausing of the queue item?
If it sounds like a good idea I will post a feature request?

prinz2311
Posts: 460
Joined: 08 Dec 2012, 00:03

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

Post by prinz2311 » 26 Aug 2014, 20:10

The new Event driven method is the only way to do it when it's needed and at the same time prevent unnecessary rechecks of already checked rar files.

Hopefully hughug will add this event in a future release.

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

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

Post by hugbug » 28 Aug 2014, 07:59

The problem with NZB_DELETED-event is that at the moment the script is executed the nzb-entry is already gone and it's hard to pass all the information which scripts usually become (nzb-name, pp-parameters, etc.).
We would also need an event for MERGE because one (or more) of nzb-entries dissapear after merging.

I have tow simpler solutions:
  1. at the pp-stage the script should delete old files. What files to consider old? For example it could delete all files except the last (by timestamp) 10 or even 100 files. The files are very small and keeping a hundred of them isn't a problem.
    If the script deletes a file for a download which is in the queue still (and is probably paused), well, the next time something is downloaded from this nzb the detection will be performed again. In the worst case (on a big download on a slow device) this can take few minutes.
  2. another possibility: at the pp-stage the script obtains the list of queued items and deletes temp-files for non existing items. This is probably the best.

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

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

Post by JVM » 28 Aug 2014, 11:17

hugbug wrote:another possibility: at the pp-stage the script obtains the list of queued items and deletes temp-files for non existing items. This is probably the best.
Nice idea. Updated PasswordDetector.py to 1.3. I modified the clean_up() function to do this and it correctly deleted the 20 or so old temp files in my ".../tmp/PasswordDetector/" folder. You should be able to copy the updated clean_up() function across to FakeDetector.py @hugbug.

prinz2311
Posts: 460
Joined: 08 Dec 2012, 00:03

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

Post by prinz2311 » 28 Aug 2014, 11:37

hugbug wrote:
  1. another possibility: at the pp-stage the script obtains the list of queued items and deletes temp-files for non existing items. This is probably the best.
Problem is: The script is not necessarily executed for all categorys. So again it will leave Files behind and if the /tmp folder is in RAM like on my device even many small files could get fast problematic since the available space is very limited.

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

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

Post by hugbug » 28 Aug 2014, 11:53

prinz2311 wrote:Problem is: The script is not necessarily executed for all categorys. So again it will leave Files behind and if the /tmp folder is in RAM like on my device even many small files could get fast problematic since the available space is very limited.
You would need to add a lot of nzbs within a category which uses PasswordDetector and then you would need to delete every of these nzbs after each of them started downloading but before any of them completed. Otherwise once the script is executed for any of the files, it performs the cleanup for all previously allocated temp files.

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

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

Post by JVM » 28 Aug 2014, 12:40

JVM wrote:Nice idea. Updated PasswordDetector.py to 1.3. I modified the clean_up() function to do this and it correctly deleted the 20 or so old temp files in my ".../tmp/PasswordDetector/" folder. You should be able to copy the updated clean_up() function across to FakeDetector.py @hugbug.
Ok I tested it further and it deleted everything except the file being post processed; I was comparing a set of strings and a set ints and of course there was no intersection of 'would be' common items. Now it leaves the temp items of nzbs in queue. Anyway updated OP again.

prinz2311
Posts: 460
Joined: 08 Dec 2012, 00:03

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

Post by prinz2311 » 29 Aug 2014, 21:47

1. The Setting "Categories" is no longer needed since this can be set directly in the nzbget options now.

2. For nzb's that have a valid Password already this script doesn't work.

And rar5 has another error message (should be added as default):

Code: Select all

The specified password is incorrect.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest