The message from unrar says for a reason:
Only since the rar5 format you can definitely say it's password protected or not. That is a the problem with the old rar4 and older formats.Corrupt file or wrong password.
Only since the rar5 format you can definitely say it's password protected or not. That is a the problem with the old rar4 and older formats.Corrupt file or wrong password.
Agree this may be an issue. Could the impact be lessened with the following?prinz2311 wrote:The Problem with testing for "CRC" is that this doesn't need to be because of a password, this can simply be a corrupted (but repairable) rar File.
The message from unrar says for a reason:
Only since the rar5 format you can definitely say it's password protected or not. That is a the problem with the old rar4 and older formats.Corrupt file or wrong password.
Code: Select all
if verbose:
print(out)
print(err)
if "*" in out:
return True
if err.find("wrong password") != -1:
return True
I have attached a proposed new version. As this is my first attempt please do not use until someone (e.g. jvm, hugbug) has looked it over. Many things that I thought would work didn't until I got use to tabs/spaces are important but hopefully it will work for others now. I had to click Save on the extensions options screen for things to work but again that may be just because I originally had bad whitespace whilst I was tinkering.JVM wrote:Yeah sure post it here.
Someone on the FakeDetector thread has reported similar issues. I have no categories defined and I have PasswordDectector.py configured as a PostProcess script only (NZBGet auto picks up its a Queue one also). I am going to try to work out how to reproduce if 1.2 is fine - still think it is something in the area of when NZBGet Pauses an item.JVM wrote:Also the files should be deleted if it is being run as a post processing script, I made it so the first thing it does is check if it is called as a pp script so it can delete. Are you sure it's being run as a pp script? Might need to define it in the default category pp scripts as well.
I did some testing with your script with r1103 and seems to work as expected. Here's my log when FakeDetector correctly finds an exe (I manully triggered with a .exe inside a rar I compressed), marks nzb bad, PasswordDetector deletes temp file 203 as expected but FakeDetector does not:get39678 wrote: I have attached a proposed new version.
Code: Select all
INFO Sun Aug 24 2014 0:28:32 Post-process-script PasswordDetector.py for TEST_NZB successful
DETAIL Sun Aug 24 2014 0:28:32 PasswordDetector: Completed removing temp file /mnt/usbhdd/NZBget/tmp/PasswordDetector/203
INFO Sun Aug 24 2014 0:28:31 Executing post-process-script PasswordDetector.py for TEST_NZB
INFO Sun Aug 24 2014 0:28:31 Post-process-script FakeDetector.py for TEST_NZB successful
WARNING Sun Aug 24 2014 0:28:31 FakeDetector: Download has media files and executables
INFO Sun Aug 24 2014 0:28:30 Executing post-process-script FakeDetector.py for TEST_NZB
DETAIL Sun Aug 24 2014 0:28:12 FakeDetector: Detecting completed for TEST_NZB
WARNING Sun Aug 24 2014 0:28:12 FakeDetector: Download has media files and executables
INFO Sun Aug 24 2014 0:28:12 FakeDetector: Found executable password.exe
DETAIL Sun Aug 24 2014 0:28:0 FakeDetector: Detecting fake for TEST_NZB
DETAIL Sun Aug 24 2014 0:28:09 Executing queue-script FakeDetector.py for TEST_NZB
Code: Select all
DETAIL Sun Aug 24 2014 0:40:40 PasswordDetector: Detecting completed for TEST_NZB
DETAIL Sun Aug 24 2014 0:40:40 PasswordDetector: Paused TEST_NZB
WARNING Sun Aug 24 2014 0:40:40 PasswordDetector: Password found in TEST_NZB
INFO Sun Aug 24 2014 0:40:40 PasswordDetector: out: UNRAR 5.0 beta 1 freeware Copyright (c) 1993-2014 Alexander RoshalArchive: /mnt/usbhdd/NZBget/inter/TEST_NZB.#203/PASSWORD_RAR.rarDetails: RAR 4, volume Attributes Size Date Time Name----------- --------- -------- ----- ----* ..A.... 729808896 09-08-14 15:15 lubuntu-14.04.1-desktop-i386.iso----------- --------- -------- ----- ---- 0 volume 5 0
INFO Sun Aug 24 2014 0:40:40 PasswordDetector: command: ['unrar', 'l -p-', '/mnt/usbhdd/NZBget/inter/TEST_NZB.#203/PASSWORD_RAR.rar']
INFO Sun Aug 24 2014 0:40:40 PasswordDetector: out: UNRAR 5.0 beta 1 freeware Copyright (c) 1993-2014 Alexander RoshalArchive: /mnt/usbhdd/NZBget/inter/TEST_NZB.#203/TEST_NZB.r03Details: RAR 4, volume Attributes Size Date Time Name----------- --------- -------- ----- ---- ..A.... 1000000000 23-08-14 19:53 TEST_NZB.mkv----------- --------- -------- ----- ---- 0 volume 5 0
INFO Sun Aug 24 2014 0:40:40 PasswordDetector: command: ['unrar', 'l -p-', '/mnt/usbhdd/NZBget/inter/TEST_NZB.#203/TEST_NZB.r03']
DETAIL Sun Aug 24 2014 0:40:40 PasswordDetector: Detecting password for TEST_NZB
DETAIL Sun Aug 24 2014 0:40:37 Executing queue-script PasswordDetector.py for TEST_NZB
DETAIL Sun Aug 24 2014 0:40:37 FakeDetector: Detecting completed for TEST_NZB
DETAIL Sun Aug 24 2014 0:40:37 FakeDetector: Detecting fake for TEST_NZB
Code: Select all
DETAIL Sun Aug 24 2014 1:24:22 PasswordDetector: Password previously found, skipping detection
DETAIL Sun Aug 24 2014 1:24:19 Executing queue-script PasswordDetector.py for TEST_NZB
DETAIL Sun Aug 24 2014 1:24:19 FakeDetector: Detecting completed for TEST_NZB
DETAIL Sun Aug 24 2014 1:24:19 FakeDetector: Detecting fake for TEST_NZB
DETAIL Sun Aug 24 2014 1:24:10 Executing queue-script FakeDetector.py for TEST_NZB
Code: Select all
INFO Sun Aug 24 2014 1:48:40 Post-process-script PasswordDetector.py for TEST_NZB successful
DETAIL Sun Aug 24 2014 1:48:39 PasswordDetector: Completed removing temp file /mnt/usbhdd/NZBget/tmp/PasswordDetector/203
INFO Sun Aug 24 2014 1:48:39 Executing post-process-script PasswordDetector.py for TEST_NZB
INFO Sun Aug 24 2014 1:48:39 Post-process-script FakeDetector.py for TEST_NZB skipped
INFO Sun Aug 24 2014 1:48:39 FakeDetector: Destination directory doesn't exist, exiting
INFO Sun Aug 24 2014 1:48:38 Executing post-process-script FakeDetector.py for TEST_NZB
Yeah need to save new config options because the script checks for options you added to the start_check() function. Also python is very picky about whitespace and line endings, gets me all the time because I edit remotely on a Windows machine. You can get text editors (I use Notepad++) that display white space (python finds lines 387 and 388 bad) and uses UNIX line endings.get39678 wrote:I had to click Save on the extensions options screen for things to work but again that may be just because I originally had bad whitespace whilst I was tinkering.
Great. Is it good enough to be included in the official version?JVM wrote:I did some testing with your script with r1103 and seems to work as expected.
Once I realised the problem I ended up with Notepad++ glad to know I am using the correct thing.JVM wrote:Yeah need to save new config options because the script checks for options you added to the start_check() function. Also python is very picky about whitespace and line endings, gets me all the time because I edit remotely on a Windows machine. You can get text editors (I use Notepad++) that display white space (python finds lines 387 and 388 bad) and uses UNIX line endings.
Users browsing this forum: No registered users and 30 guests