Page 8 of 9

Re: [bash] SceneSort [v3 - AIO post-processor script.]

Posted: May 8th, 2010, 3:26 am
by sweetie
Oh right.

Just add:

Code: Select all

echo_process "Cleaning up.."
for cleanup in "srr.log" "srs.log" *.srr *.srs "unrar.log" "cfv_c.log" "xml.log" "mencoder.log" "mkvinfo.log" "mkvextract.log" "dcadec_aften.log" "tsMuxeR.log" "cfv.log" "abgx360.log" "wget.log" "index.html?q=$CWD" "orlydb.log"; do
[ -f "$cleanup" ] || continue; rm -f "$cleanup"; done

echo_success "Successfully processed: $CWD~!"
to the bottom.

Re: [bash] SceneSort [v3 - AIO post-processor script.]

Posted: May 8th, 2010, 3:54 pm
by stabu
Thanks, works perfect!

Re: [LiNUX/OSX - bash] SceneSort [v4 - ReScene Assistant.]

Posted: June 6th, 2010, 9:49 am
by sweetie
stabu: latest version is behaving under Ubuntu* now. Have separated functions for remuxing/transcoding to MediaMux post.

http://forums.sabnzbd.org/index.php?topic=4500.0


Keep me posted on stats~!



*errors seem to have been caused by pastebin.

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 10th, 2010, 4:32 pm
by bwq
Amazing script! Just one thing though, how do you get this to work with multi-CD releases? I'm trying with a random multi-CD release and it keeps saying it can't find the cd1.avi and cd2.avi (with the proper filenames of course). That's because they are in CD1 and CD2 though, and it's trying to look for them in the root dir, just like srr.exe would do.

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 10th, 2010, 9:56 pm
by sweetie
@bwq: You've just reminded me, intended to add a check for subdirs. Adding/updating in a moment.

edit: Added.

(also, to be safe: you'd better remove reference to the dir. name - against forum rules!)

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 1:19 am
by bwq
Cool, gonna check it out when I get back home and report my findings :). Thanks!

Btw, would you mind adding an option to remove the source (avi/mkv) files after cfv has succesfully verified the rar files' integrity? I know it's a very easy fix to implement myself, but I'm sure others would like this too. :)

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 10:38 am
by sweetie
The latest version will remove all input files with same extension. Previously, only input files with original filenames were removed.

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 11:06 am
by bwq
That's nice :). I'd suggest adding this line of code btw:

search for:

toprar=$(mono "$SRREXE" "${PWD##*/}.srr" -l | grep "RAR Files:" -A1 | tail -n 1$
[ -f "$toprar" ] || mono "$SRREXE" "${PWD##*/}.srr" -r -u -y

add below:

toprar=`echo $toprar | sed -r 's/(.*)\///g'`

This is necessary for .srr files that contain CD1/ in the .srr itself. One example is the BELIAL release of 12 Monkeys. By adding that line of code you remove everything in front of the slash, so
for example:

CD1/rlsname.cd1-grp.rar will become rlsname.cd1-grp.rar

If you don't do this, it will not know that the files have extracted succesfully because it tries for the rar in CD1, while the script gets all the .avi files from the subdirs and places them in the root dir.

I'd also suggest only removing the source files after the release has been verified with cfv.

*edit: oops, don't do this right below that line, else it'll mess up the next if, because the $? now has the value of the echo | sed.

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 11:29 am
by bwq
Here you go, this should work:

toprar=$(mono "$SRREXE" "${PWD##*/}.srr" -l | grep "RAR Files:" -A1 | tail -n 1 | sed -e 's/^[ \t]*//;s/[ \t]*$//') [ -f "$toprar" ] || mono "$SRREXE" "${PWD##*/}.srr" -r -u -y
hurrdurr=$?
toprar=`echo $toprar | sed -r 's/(.*)\///g'`
if [ "$hurrdurr" = "0" -a -f "$toprar" ]; then
       srrfext=($(mono "$SRREXE" "${PWD##*/}.srr" -l | grep "Archived Files:" -A20 | egrep -i ".[a-z]|.[0-9]" | sed -e 's/^[ \t]*//;s/[ \t]*$//'))
       rm -f $(ls -A | grep "*.${srrfext[*]##*.}") &> "/dev/null"
       echo -e "\n>> RARs successfully reconstructed."
elif [ "$hurrdurr" != "0" -a -f "$toprar" ]; then
       echo -e "\n>> RARs exist - Not attempting to reconstruct." && return 0
else
       echo -e "\n@@ Error reconstructing RARs." && return 1
fi


*edit: It looks like there are some problems with the script. I figured it was the stuff I added but even without it does something wrong:

It goes ahead to recreate the original files, even though they are in the dir, which results in a corrupt filename.rar (only the filename.rar, then it stops since it can't find the source avi/mkv).

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 12:29 pm
by sweetie
Updated. Only required adding of additional sed expression.

Also, srr.exe has an inbuilt CRC verifier. It was disabled by default, as I've yet to encounter a release where RARs reconstructed, yet failed SFV verification. (have tested literally thousands.)
I've re-enabled at the cost of around (~5-10%) extra time per RAR set. Hardly a compromise.

Thanks for feedback!


edit: updated again. Re-organised method for checking existing RARs.

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 12:33 pm
by bwq
I modified the script a little and replaced the rescene_srr_rebuild function. Tested it and now it doesn't create the .srr anymore if it finds one of the scene rars. I'll test more thoroughly when I have the time.

Replace the rescene_srr_rebuild function with this:
http://pastebin.com/1hjhR3hc

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 12:42 pm
by sweetie
Oh, you beat me to it.


Current version has same check in place. (I only modified that last night - though it shouldn't have been behaving as it was. It's now as it was originally.)

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 3:45 pm
by bwq
Ok cool :). Could you also make it so it doesn't delete the original folders (CD[0-9], Subs, Sample) after it got the files out of there? Else I'd have to create a CD1/CD2 for every single one of my multi-CD releases :P

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: August 11th, 2010, 5:30 pm
by sweetie
You should be able to use the 'c' option. Will call AweScript only to sort directories.


edit: Seems I managed to break the AweScript installer last night as well. Don't know what I was thinking - seemed far more stable at 4:30AM.

Everything in working order now.

Re: [LiNUX/OSX/BSD - bash] SceneSort [v4 - ReScene Assistant.]

Posted: January 11th, 2011, 2:29 pm
by dbznbas
Possibility of a windows version?