Page 2 of 2
Re: specify my own par2 file for active .nzb
Posted: May 31st, 2013, 5:56 pm
by me2
great thx, does that work for par2 also?
Re: specify my own par2 file for active .nzb
Posted: May 31st, 2013, 8:30 pm
by me2
just an idea, would it be possible to make the password available to postprocessing scripts by defining a specific value like %1 for final job directory?
http://wiki.sabnzbd.org/user-scripts
Re: specify my own par2 file for active .nzb
Posted: June 1st, 2013, 3:01 am
by shypike
The password is stored here:
Code: Select all
<incomplete>\%3\__ADMIN__\SABnzbd_attrib
The content is like this:
Code: Select all
*
3
None
0
Job name / PASSWORD
Job name.nzb
Please note that this will only work if you haven't renamed a job.
Re: specify my own par2 file for active .nzb
Posted: June 1st, 2013, 7:08 am
by me2
o.k. this is what i got so far:
Code: Select all
@echo off
cd /d %1
IF EXIST "*.p*" (rename "*.p*" "*.par2") ELSE echo no pars found !
IF EXIST "*.par2" echo pars successfully renamed
"C:\Program Files (x86)\SABnzbd\win\par2\x64\par2.exe" r "*.par2" "*"
"C:\Program Files (x86)\SABnzbd\win\unrar\x64\unrar.exe" x -p%3 "*.rar"
IF errorlevel 1 echo unpacking failure ! (wrong password?)
IF not errorlevel 1 del "*.rar" "*.par2"
everything works fine, the only downside is that the rar password is set to jobname, so you have to name your imported .nzb to the extraction password which is only a small downside but still it would be nice if you could name the job to release name so that you see in your qeue what you are downloading
i´m not sure how to extract the / password from the sabnzb attribute file and make that available for unrar, is that possible with windows shell? (i don´t want to bloat the script so that users who would use that script don´t have to install any additional software)
Re: specify my own par2 file for active .nzb
Posted: June 1st, 2013, 10:09 am
by shypike
me2 wrote:i´m not sure how to extract the / password from the sabnzb attribute file and make that available for unrar, is that possible with windows shell?
You should google a bit more.
This is the way to extract the password:
Code: Select all
for /f "delims=/ tokens=2,*" %%k in ('type "<incomplete>\%3\__ADMIN__\SABnzbd_attrib') do set pw=%%k
set pw=%pw: =%
Re: specify my own par2 file for active .nzb
Posted: June 1st, 2013, 2:07 pm
by me2
>You should google a bit more.
yeah i know, it´s just in this case i know almost nothing and then it´s really hard to specify search parameters to narrow it down that something useful comes out, i know you´re not my designated SABnzb-Yoda

so thx again for all the help, when this is done i´ll donate something

if you have a link to a forum/site where stuff like this is better explained, please post it, i´ll definitely check it
the thing is: since my script is a postprocessing script, the tmp folder and therefore the attribute file doesn´t exist anymore, that´s why the password can´t be set?
so just to test if it´s working at all, i copied the attribute file to a fixed location and linked to it in the script, but it still says corrupt/wrong password when extracting
i guess somewhere in that line something is still not right, any idea?
Code: Select all
@echo off
cd /d %1
IF EXIST "*.p*" (rename "*.p*" "*.par2") ELSE echo no pars found !
IF EXIST "*.par2" echo pars successfully renamed
"C:\Program Files (x86)\SABnzbd\win\par2\x64\par2.exe" r "*.par2" "*"
for /f "delims=/ tokens=2,*" %%k in ('type "E:\Finished\SABnzbd_attrib"') do set pw=%%k
set pw=%pw: =%
"C:\Program Files (x86)\SABnzbd\win\unrar\x64\unrar.exe" x "*.rar"
IF errorlevel 1 echo unpacking failure ! (wrong password?)
IF not errorlevel 1 del "*.rar" "*.par2"
how much work would it be to output the password as a %Parameter? (sort of feature request) that would be an easy solution (for me

)
Re: specify my own par2 file for active .nzb
Posted: June 2nd, 2013, 1:32 am
by shypike
You forgot the %3 part in the attrib file path.
That file is only removed after the script runs.
I never found a comprehensive manual for cmd.
The built-in help tells you quite a bit though: like "for /?"
Re: specify my own par2 file for active .nzb
Posted: June 3rd, 2013, 11:31 am
by me2
i´m away for about a week, will look into it and probably have 1 or 2 questions then
