please share your post processing scripts

Get help, report and discuss bugs.
nobody

RE: please share your post processing scripts

Post by nobody » 27 Mar 2008, 07:22

Interesting. It appears that nzbget doesn't pass any par-names unless ParCheck = yes. All that means is that the test script can/will only repair archives when ParRepair=no and par-check equals 3 (checked and repairable).

hugbug

RE: please share your post processing scripts

Post by hugbug » 27 Mar 2008, 10:14

>It appears that nzbget doesn't pass any par-names unless ParCheck = yes

Yes, if parcheck is disabled there is no parset-detection and the script is called only once with the empty paramater "parfile".


>All that means is that the test script can/will only repair archives when
>ParRepair=no and par-check equals 3 (checked and repairable).

And this makes a little sense, because the files will be verified two times - once by nzbget and once by par2.

Anyway, this can be also achieved with the proposed call-once-behaviour - you need to scan the directory for par-sets and to get the par-result from _brokenlog.txt.

Currently the file "_brokenlog.txt" is a simple text-file, but I can make it more suitable for machine-analyse. Although I doubt it is neccessary, because we currently discuss a hypothetical case, which will probably never have a place :)

As you see, the change from "mutlicalls" to "onecall" does not eliminate any existing possibilities, but makes the interface between nzbget and scripts certain.

nobody

RE: please share your post processing scripts

Post by nobody » 27 Mar 2008, 18:14

The files are not verified two times. The script does not need to scan the directory or analyze any files. The script knows which rars belong to which pars. The script extracts good sets independent of other, possibly broken, sets. The list goes on but, I feel I'm wasting my time, that you made your mind up a long time ago. If you care to actually use the script or ask any questions, you know where to find me.

nobody

RE: please share your post processing scripts

Post by nobody » 27 Mar 2008, 18:54

P.S. I'd appreciate it if you would do a 0.3.2 (or whatever) release before making any changes to PostProcess.

hugbug

RE: please share your post processing scripts

Post by hugbug » 27 Mar 2008, 21:44

> The files are not verified two times.

If the option ParCheck is enabled (it must be enabled for this script to work), nzbget verifies the files (otherwise it would not be able to pass the parameter "result of parcheck" - "checked and repairable"), then par2 verifies the files again.


>If you care to actually use the script

This script will not work if the option "ParCheck" is disabled and this script makes the files to be verified two times if the option "ParCheck" is enabled. This makes the script not very usable.


>I feel I'm wasting my time.

I am very sorry I could not convince you. Since no one else interested in this discussion, and from two of us you are the only one, who actually uses scripts, I decided to keep all things as they are.

The proposal is closed with status "rejected" :)

likeatim

RE: please share your post processing scripts

Post by likeatim » 27 Mar 2008, 22:36

it's not true that no one uses scripts, just not the perl one.
i had no problems with the script I was talking about and that was corrected.
never forget the silent readers!

hugbug

RE: please share your post processing scripts

Post by hugbug » 28 Mar 2008, 07:25

Updated the description of parameter "PostProcess" with a hint of the importance of the parameter "state of nzb-job". Hope this helps to avoid mistakes.

nobody

RE: please share your post processing scripts

Post by nobody » 14 May 2008, 22:42

If no repair is needed, the test script only runs 'par2 repair' long enough (~1.5sec) to retrieve the rar-name. I was trying to show how useful having the rar-name would be, how easy/safe/certain it makes collection by collection processing (no need for $5 or $6), and hoping that the rar-name was similarly available during nzbget's par check.

likeatim

RE: please share your post processing scripts

Post by likeatim » 26 May 2008, 11:06

I found a fundamental flaw in my extract script: if there were 2 rar files to be extracted (e.g. movie + subtitles) and extraction went wrong in one of them, still ALL rar files were deleted because ONE of the extractions went fine.
I posted my updated script on pastebin: http://pastebin.com/f249f7ba6
It now processes each rar set. In case the extraction is broken in ONE of them, a line with the filename and the word "broken" is added to a file "broken.log". The file is created if it doesn't exist.
ONLY if now file "broken.log" exists after all extraction processes (= extraction went fine in each rar set), the rar files are deleted.

nobody

RE: please share your post processing scripts

Post by nobody » 27 May 2008, 05:54

*.rar works for all standard rar naming schemes (the only exception is the rare .nnn scheme). Your "for File in *.part1.rar" and "for File in *.rar" will both extract foo.part1.rar. With your script, unrar can get called two times. If either call succeeded, your rars would get deleted. With a single unrar call, you can only get a "0" exit code when all archives successfully extract.

"-kb" serves no purpose here. Do you really want to save partial/incomplete files from failed extractions of broken archives?

Since you're extracting to the current directory, use "e" instead of "x".

Since you're not writing unrar output, you could disable messages (-inul).

Since I've never seen _duplicate1, I'm guessing you don't have DupeCheck=yes.

#!/bin/bash
DownloadDir="$1"
NzbFile="$2"
ParCheck=$4
NzbState=$5
ParFail=$6

if [ "$NzbState" -eq 1 -a "$ParCheck" -eq 2 -a "$ParFail" -eq 0 ]
then
cd "$DownloadDir"
unrar e -y -inul "*.rar"

if [ "$?" -eq "0" ]; then
rm *.[pP][aA][rR]2
rm *.[pP][0-9][0-9]
rm *.r[0-9][0-9]
rm *.rar
rm *.sfv
rm *.nzb
rm "$NzbFile.queued"
fi

fi

Post Reply

Who is online

Users browsing this forum: No registered users and 60 guests