Page 2 of 7

Re: [Windows] Post Processing Scripts

Posted: March 14th, 2010, 3:53 pm
by markus101
What happens if you open up command prompt and manually run the script, change directory to the folder where your scripts are and run the following: movies.exe "path to movie" 2 "movie name". It sounds like either the log folder does not exist already on disk, or it is having troubles loading the config file.

Please post the error (if any) you get and also your Config file if possible.

-Markus

Re: [Windows] Post Processing Scripts

Posted: March 14th, 2010, 7:15 pm
by vinister
that worked.  It renamed the movie in the folder to the name I typed in the command prompt.  However, no log was generated in the folder.  The log folder exists at the exact location I have specified in the config.

Question:

- The "movies" and "HD movies" folders in the config.... are these the 'target' folders where I want the movies to end up, or is this supposed to be the temporary "complete" folder that SAB is downloading into?

eg.. SAB downloads into c:\users\me\downloads\complete\
      My XBMC Folder is D:\Videos\Movies

I want the whole folder moved to the D:\ drive, the movie file renamed, and all the rars and other files removed.

What should my config look like?

Here's how I have it setup:

Code: Select all

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="logDir" value="C:\Program Files (x86)\SABnzbd\scripts\logs\"/>
    <add key="movieDir" value="D:\VIDEO\MOVIES\"/>
    <add key="hdMovieDir" value="D:\VIDEO\MOVIES\"/>
    <add key="ipodMovieDir" value="D:\VIDEO\MOVIES\"/>
    <!--Delete Movie Folder?-->
    <add key ="deleteFolder" value="false"/>
    <!-- Update XBMC Library?-->
    <add key ="updateXbmc" value="true"/>
    <!-- XBMC Path to Movies-->
    <add key ="xbmcMoviePath" value="D:\VIDEO\MOVIES\"/>
    <!-- XBMC Path to HD Movies-->
    <add key ="xbmcHdMoviePath" value="D:\VIDEO\MOVIES\"/>
    <!-- XBMC Hostname/IP Address-->
    <add key ="xbmcInfo" value="xxx.xxx.xxx.xxx:xxx"/>
    <!-- XBMC HTTP Username-->
    <add key ="xbmcUsername" value="xxxxxx"/>
    <!-- XBMC HTTP Password-->
    <add key ="xbmcPassword" value="xxxxxx"/>
  </appSettings>
</configuration>

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 7:23 pm
by markus101
Okay... figured out why you don't get a log file... I never had it log anything - I will need to add that.

The error you get in SAB is because I don't log anything to the console (which is what SAB captures) - this is expected.
The "movies" and "HD movies" folders in the config.... are these the 'target' folders where I want the movies to end up, or is this supposed to be the temporary "complete" folder that SAB is downloading into?
Those should be the target folders.

Your config file looks good.

-Markus

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 7:24 pm
by vinister
the script still isn't moving any movies. 

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 7:40 pm
by markus101
Did it when you manually ran it?
Probably a stupid question, but are the files named Movies.exe and Movies.exe.config and are both in the same folder?

-Markus

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 8:52 pm
by vinister
it did not move it, it only renamed it.

Yes both files are named correctly and are in the /scripts/ folder.

Run manually it does everything except for move it.
Run via SAB it does nothing at all.

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 9:08 pm
by markus101
Okay, I know what the issue was - it has to do with moving the file over to a different volume is the issue (C to D in your case). I will look into a way of doing this while still supporting the move process for files on the same volume.

I should have figured this out earlier, but just ran into it with another app. I'll also try to add in the logging part...finally.

-Markus

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 9:19 pm
by vinister
thanks very much for your replies!  That makes sense.  I checked over and over and couldn't find anything else wrong.

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 10:00 pm
by markus101
Ahhh, something else, even though it is not moving the file, is it renaming it?

I found another issue, where I simply just rename the file if you choose not to delete the folder... which works for me, but wouldn't for anyone else... I'll see what i can do to fix these bugs up.

-Markus

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 10:33 pm
by vinister
well I don't really need the folder deleted if the whole folder gets moved.

Ideally, you could simplify the target folder name as well.

For example, the result of a download/extract:


C:\Downloads\Complete\Example.free.video.name.2009.MERRY.XMAS.720p.BluRay.x264-ReLeAsEr\Example.free.video.name.2009.MERRY.XMAS.720p.BluRay.x264-ReLeAsEr.AVI


I would like your script to create:  D:\movies\Example free video name (2009)\example free video name.BluRay.avi

so,

1) rename folder with only simple movie name and year, with spaces, not periods.
2) rename movie file with only the simple movie name and the format, if applicable.
3) delete all the rar's, par's, nfo's, etc
4) move the whole folder and file to target dir
5) tell XBMC to update the parent folder (ie /movies/)

is that the expected result?

Re: [Windows] Post Processing Scripts

Posted: March 15th, 2010, 10:55 pm
by markus101
Somewhat, but I'm just using the names SAB passes, I'm not cleaning up the filename at all, which works great for Newzbin, but other sources aren't as nice looking. If SAB passes a clean "Movie Name" Which is the job name, then it would look clean, but I'm not going to write all the regex to get it to place nice with ugly names (sorry).

One thing I could probably do, if you have SAB sort them nicely I could look at using the Parent Folder name of the video file (avi, mkv, etc) as the "Movie Name" maybe make that a config option, which would allow better use for non-Newzbin users. Since I'm already hunting around I'll give it a whirl.

That said, I'm almost done the changes, still haven't done any logging though.

-Markus

P.S. thanks for the feedback... I typically forget there are sites other than Newzbin, since NB has been so good (though lacking on some stuff recently), hopefully I can make this work for a broader audience.

Re: [Windows] Post Processing Scripts

Posted: March 16th, 2010, 12:05 am
by markus101
That should do it, please take a look, this will move the video file and delete all other files, even allows moving to a different volume.

Set useFolderName in the new config file to true to use the final extracted folder name as the movie name.

Please let me know if you have any issues. I will also be updating it at some point to use the Event Server in XBMC as the update mechanism instead of the Web Server.

-Markus

Windows Post Processing Scripts

Posted: March 16th, 2010, 1:44 am
by SkibLiam
You dont have to be a -. None of this is stolen. Most of it was coded for me by Firey and paid for. The scripts are being posted so everyone can use and enjoy them. I have Reyns full permission to post his datamining script - not only that, but he has done it himself before.

Re: [Windows] Post Processing Scripts

Posted: March 19th, 2010, 10:56 pm
by markus101
I have updated TVConvert to support different HandBrakeCLI Presets at the request of randyharris.

See the note in the config file regarding the ampersand (&).

Hope this helps, i have it defaulting to the iPod & iPod Touch Preset (Capitalization also matters).

-Markus

Re: [Windows] Post Processing Scripts

Posted: March 20th, 2010, 11:41 am
by markus101
Question: Do you have some examples for TVMove, TVConvert and Movies?

TVMove is a post-processing script - It should be run on the TV Category, you set the shows it should watch and pick the temp directory (and any other settings), this output directory can then be used by TVConvert.

TVConvert - I run it as a scheduled task, it should have the same Temp directory as TVMove, but now it will convert the files using HandBrakeCLI and then tag it with Atomic Parsley.

Movies - Post-processing script that can combine multiple AVI files + rename it, rename and move AVI, MKV, WMV and MP4 files. Requires mencoder for AVI combining.

TVMove and Convert were designed separately for two reasons:
1) It will not hold up the queue within SABnzbd to continue repairing and extracting other files
2) My Desktop is much better than my HomeServer box, so I found it necessary to convert from AVI to MP4 on my Desktop, where it takes 10-15 minutes, versus the 30 minutes or so on my HomeServer.

If you need any more detail, please let me know.

-Markus