Best Script to sort out movies?

Come up with a useful post-processing script? Share it here!
Post Reply
Mrkennedy
Newbie
Newbie
Posts: 39
Joined: May 18th, 2010, 7:29 am

Best Script to sort out movies?

Post by Mrkennedy »

Hi guys,

with all the scripts here what is the best one to use for movies? All i would like it to sort them out in either SD/HD and then place each file in its own folder and and extra bonus naming it correctly.
akuiraz
Newbie
Newbie
Posts: 16
Joined: March 5th, 2010, 8:43 pm

Re: Best Script to sort out movies?

Post by akuiraz »

I too would like to hear everyone's input... I have tried quite a few but none seem to always work correctly most of the time.  Would like to see one that will cleanup other files (i.e. .nzb, .nfo, .sub, etc... have tried using the feature in sabnzbd under general but i want these files for some things that aren't movies...) and the script should definitely be able to use IMDb.com to check for correct name/year. 
cman675
Newbie
Newbie
Posts: 19
Joined: July 8th, 2010, 9:32 pm

Re: Best Script to sort out movies?

Post by cman675 »

I would also love to know of a great script for movies. The general sorting in sab moves the files wonderfully, but the naming is done poorly and as akuiraz stated, I would love to see the deletion of nzbs, nfos and whatnot, as well as the ability to scan imdb to get the year (if needed, I don't use the year most the time), and to verify the proper name.
User avatar
rascalli
Moderator
Moderator
Posts: 656
Joined: January 18th, 2008, 12:30 am
Location: Bossche bollen land

Re: Best Script to sort out movies?

Post by rascalli »

COUCHPOTATO  <3
feerlessleadr
Jr. Member
Jr. Member
Posts: 67
Joined: April 30th, 2009, 12:09 pm

Re: Best Script to sort out movies?

Post by feerlessleadr »

i use a combination of 2 scripts for my movies...the first one will delete any extra files from the download directory

Code: Select all

@echo off
setlocal
set fcount=0
set nzbcount=0
set sfvcount=0
set par2count=0
set txtcount=0
set gifcount=0
set urlcount=0
set srrcount=0
set samplecount=0
 
echo.
echo [Cleanup] Cleaning up download directory: %1
 
echo [Cleanup] Deleting .nzb files
for /f %%V in ('dir %1\*.nzb /b /s ^2^>NUL ^| find /v /c ""') do set/a nzbcount = %%V
if %nzbcount% GTR 0 del /s /q %1\*.nzb > NUL 2>NUL
 
echo [Cleanup] Deleting .sfv files
for /f %%V in ('dir %1\*.sfv /b /s ^2^>NUL ^| find /v /c ""') do set/a sfvcount = %%V
if %sfvcount% GTR 0 del /s /q %1\*.sfv > NUL 2>NUL

echo [Cleanup] Deleting .par2 files
for /f %%V in ('dir %1\*.par2 /b /s ^2^>NUL ^| find /v /c ""') do set/a par2count = %%V
if %par2count% GTR 0 del /s /q %1\*.par2 > NUL 2>NUL

echo [Cleanup] Deleting .txt files
for /f %%V in ('dir %1\*.txt /b /s ^2^>NUL ^| find /v /c ""') do set/a txtcount = %%V
if %txtcount% GTR 0 del /s /q %1\*.txt > NUL 2>NUL

echo [Cleanup] Deleting .gif files
for /f %%V in ('dir %1\*.gif /b /s ^2^>NUL ^| find /v /c ""') do set/a gifcount = %%V
if %gifcount% GTR 0 del /s /q %1\*.gif > NUL 2>NUL

echo [Cleanup] Deleting .url files
for /f %%V in ('dir %1\*.url /b /s ^2^>NUL ^| find /v /c ""') do set/a urlcount = %%V
if %urlcount% GTR 0 del /s /q %1\*.url > NUL 2>NUL

echo [Cleanup] Deleting .srr files
for /f %%V in ('dir %1\*.srr /b /s ^2^>NUL ^| find /v /c ""') do set/a srrcount = %%V
if %srrcount% GTR 0 del /s /q %1\*.srr > NUL 2>NUL

echo [Cleanup] Deleting sample files
for /f %%V in ('dir %1\*sample*.* /b /s ^2^>NUL ^| find /v /c ""') do set/a samplecount = %%V
if %samplecount% GTR 0 del /s /q %1\*sample*.* > NUL 2>NUL
 
set/a fcount = %nzbcount% + %sfvcount% + %par2count% + %txtcount% + %gifcount% + %urlcount% + %srrcount% + %samplecount%
 
echo [Cleanup] Deleted %fcount% files (%nzbcount% nzb, %sfvcount% sfv, %par2count% par2, %txtcount% txt, %gifcount% gif, %urlcount% url, %srrcount% srr, %samplecount% samples)
echo.
The second one i run as a scheduled task and not as part of sab since moving an HD movie onto an external HDD can be slow and I don't want to slow sab down with post processing.  Basically the script will look at the extension of the movie you are downloading (only supports avi and mkv) and will sort all avi files (usually sd) into one folder and all mkv files (usually hd) into another.  You will have to edit the script for the destination folders but that isn't difficult.

Code: Select all

On Error Resume Next

Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Dir :Dir = "YOUR DOWNLOAD DIRECTORY HERE (eg E:\SAB Downloads\Movies\)"
Dim CopyTo1, CopyTo2
  CopyTo1 = "THE DIRECTORY YOU WANT YOUR SD MOVIES MOVED TO"
  CopyTo2 = "THE DIRECTORY YOU WANT YOUR HD MOVIES MOVED TO"
  Recursive Fso.GetFolder(Dir)
   Function Recursive(Folder)
   On Error Resume Next
    Dim Col :Set Col = Folder.files
    Dim File, F1
    For Each File In Col
     If InStr(LCase(File.Path),".avi") Then
      Set F1 = Fso.GetFolder(Fso.GetParentFolderName(File.Path))
       Fso.CopyFolder F1.Path, CopyTo1 & F1.Name, True
       Fso.DeleteFolder(F1.Path),True
     End If
     If InStr(LCase(File.Path),".mkv") Then
      Set F1 = Fso.GetFolder(Fso.GetParentFolderName(File.Path))
       Fso.CopyFolder F1.Path, CopyTo2 & F1.Name, True
       Fso.DeleteFolder(F1.Path),True
     End If
    Next
    Dim Obj
    For Each Obj In Folder.subFolders
     Recursive Obj
    Next
   End Function
Post Reply