Author Topic: Automated Media Center (AMC) - File processing and sorting  (Read 6812 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Automated Media Center (AMC) - File processing and sorting
« on: July 01, 2015, 02:37:12 PM »
This group of commands will process and sort movies, and TV Shows.



you can drag and drop an entire season of a TV show into the First folder and it will test the first file until it sees that it is fully transferred and then move it to the second folder where another program script is ran (FileBot AMC Script) this script will rename and build the folder structure needed for the video File. while the Filebot script is running it will pause file testing in folder 1 so it doesn't move the next file while processing

in order for this to rename and sort your media you will need to download and install Filebot

you will need the windows installer http://www.filebot.net/#download

after downloading and installing filebot you will want to run the Filebot.exe as you may need to update java,

if the program starts up and runs with no errors then you should be fine and you can close the window,

if your java is outdated then it should popup an error message, letting you know you need to update java

you will need the latest version of VoxCommando 2.1.5.1 (Beta)
http://voxcommando.com/home/downloads/

Then you will need to activate the Watcher Plugin http://voxcommando.com/mediawiki/index.php?title=Plugins#Enable_Plugins

you will need to create 2 new watchers

the First watcher Needs to be named "AMC"

the Second watcher needs to be named "AMC2" (I use "AMC" and "AMC2" for my folder names but you could use folder names like "Download" and Download2" as long as your watchers are named "AMC" and "AMC2")

this is what the watchers should look like:

Then click save options


now that the watchers are setup and saved you need to modify the Launch.Hidden action that is disabled in the "Move Files and processing" command

you will need to edit the parameters:

Code: [Select]
-script fn:amc "{Var.AMC FP1}2" --output "C:\your\media\file\path\here" -non-strict
where it says "C:\your\media\file\path\here" you will need to put the file path where you want your movies and TV Shows moved to
(Note: if you are setting them at the base of a drive then your path would look like "F:")

In the "AMC Complete" command there are two disabled commands, the first is an OSD message this is where you could put an action to be notified when each file is done

the second command is used to update XBMC/KODI if you are using another media center, then you can put the update action there
this will update your media center when all videos have been processed,

AMC Group:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.0.7-->
<commandGroup open="True" name="AMC" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="1274" name="Starting Folder Watcher" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Var.AMC}&amp;&amp;Paused</ifParams>
      <then>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>File.GetFiles</cmdType>
      <params>
        <param>{3}</param>
        <param>*.*</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>AMC FP1</param>
        <param>{3}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Append</cmdType>
      <params>
        <param>{Match.1}</param>
        <param>.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>AMC.File Move</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.SetEventTimer</cmdType>
          <params>
            <param>10s</param>
            <param>Watcher.AMC.File Test</param>
            <param />
            <param />
            <param>{3}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.SetEventTimer</cmdType>
          <params>
            <param>60s</param>
            <param>Watcher.AMC.File Test</param>
            <param />
            <param />
            <param>{3}</param>
          </params>
          <cmdRepeat>0</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Watcher.AMC.*</event>
  </command>
  <command id="1277" name="Move Files and processing" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Var.AMC}&amp;&amp;Paused</ifParams>
      <then>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>File.GetFiles</cmdType>
      <params>
        <param>{Var.AMC FP1}</param>
        <param>*.*</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Var.AMC FP1}\Thumbs.db&amp;&amp;{Match.1}</ifParams>
      <then>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>([^\\]+(?=\.*$))</param>
            <param />
            <param>{Match.2}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>([^\\]+(?=\.*$))</param>
            <param />
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <action>
      <cmdType>File.Move</cmdType>
      <params>
        <param>{Var.AMC FP1}\{Match.1}</param>
        <param>{Var.AMC FP1}2\{Match.1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>AMC Title</param>
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Launch.Hidden</cmdType>
          <params>
            <param>C:\Program Files\FileBot\filebot.exe</param>
            <param> -script fn:amc "{Var.AMC FP1}2" --output "C:\your\media\file\path\here" -non-strict</param>
          </params>
          <cmdRepeat>0</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.SetEventTimer</cmdType>
          <params>
            <param>2m 30s</param>
            <param>Filebot.Scripted.Failed</param>
            <param>{Var.AMC FP1}2</param>
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>AMC</param>
            <param>Paused</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>Results.SetVar</cmdType>
          <params>
            <param>AMC</param>
            <param>UNPaused</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.GetFiles</cmdType>
          <params>
            <param>{Var.AMC FP1}</param>
            <param>*.*</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.RegEx</cmdType>
          <params>
            <param>([^\\]+(?=\.*$))</param>
            <param />
            <param>{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>File.Append</cmdType>
          <params>
            <param>{Var.AMC FP1}\{Match.1}</param>
            <param>.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>File.Move</cmdType>
          <params>
            <param>{Var.AMC FP1}\{Match.1}</param>
            <param>{Var.AMC FP1}2\{Match.1}</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.SetEventTimer</cmdType>
          <params>
            <param>10s</param>
            <param>AMC.File Move</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>AMC.File Move</event>
  </command>
  <command id="1301" name="AMC Complete" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)==(B)</ifType>
      <ifParams>{Var.AMC Processing}&amp;&amp;Failed</ifParams>
      <then>
        <action>
          <cmdType>VC.StopMacro</cmdType>
          <params />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else />
    </if>
    <action>
      <cmdType>VC.StopEventTimer</cmdType>
      <params>
        <param>Filebot.Scripted.Failed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Finished processing - {3} </param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>AMC</param>
        <param>UNPaused</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>AMC.File Move</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <action>
      <cmdType>File.GetFiles</cmdType>
      <params>
        <param>{Var.AMC FP1}</param>
        <param>*.*</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{Match.1}&amp;&amp;Thumbs.db</ifParams>
      <then>
        <action>
          <cmdType>XJson.ExecBuiltin</cmdType>
          <params>
            <param>XBMC.UpdateLibrary(video)</param>
          </params>
          <cmdRepeat>0</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>AMC.File Move</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Watcher.AMC2.Deleted.*</event>
  </command>
  <command id="1332" name="Filebot script failed" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>AMC Processing</param>
        <param>Failed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>(.+?)\\</param>
        <param />
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.MatchConcat</cmdType>
      <params>
        <param>\</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.MakeDir</cmdType>
      <params>
        <param>{LastResult}\Filebot Failed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.GetFiles</cmdType>
      <params>
        <param>{Var.AMC FP1}2</param>
        <param>*.*</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Move</cmdType>
      <params>
        <param>{Match.1}</param>
        <param>{LastResult}\Filebot Failed\{2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Write</cmdType>
      <params>
        <param>{LastResult}\Filebot Failed\READ ME.txt</param>
        <param>Filebot was not able to process the files in this folder.{CR}{CR}Make sure your output folder in the Filebot script action is setup correctly, and that the action is not disabled{CR}{CR}The Command for the Filebot script can be found in the "AMC" Group in the "Move Files and processing" command{CR}{CR}Most TV Shows and Movies can be processed by the Filebot script, however there are some shows that wont work and due to that you may have to manually process these files.{CR}{CR}you may delete this folder when done.</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>Filebot script failed to process {2}, the file has been moved to {LastResult}\Filebot Failed\{2}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TTS.SpeakSync</cmdType>
      <params>
        <param>File bot script failed to process a file, the file has been moved to a new folder called File Bot Failed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>AMC</param>
        <param>UNPaused</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>AMC.File Move</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>AMC Processing</param>
        <param>Clear</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Filebot.Scripted.Failed</event>
  </command>
</commandGroup>

if you are planing on using this to watch a download folder or recoding folder then you will want to enable the disabled VC.SetEventTimer action in the "Starting Folder Watcher" command, and disable the one above it, (there's no reason to have it test the file every 10 seconds if its going to take a couple minutes or more to finish)

« Last Edit: August 09, 2015, 02:14:50 AM by PegLegTV »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Automated Media Center (AMC) - File processing and sorting
« Reply #1 on: July 01, 2015, 05:12:43 PM »
Fancy.

So here's the annoying question that people always seem to ask on Youtube videos...

What TTS voice are you using?  It might just be due to the "small speaker" effect but it sounds a lot like Majel Barrett!  8)

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Automated Media Center (AMC) - File processing and sorting
« Reply #2 on: July 01, 2015, 05:19:44 PM »
Fancy.

So here's the annoying question that people always seem to ask on Youtube videos...

What TTS voice are you using?  It might just be due to the "small speaker" effect but it sounds a lot like Majel Barrett!  8)

lol
Windows 7 Anna, it sounds different in person then in the video

MMatty1

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 4
    • View Profile
Re: Automated Media Center (AMC) - File processing and sorting
« Reply #3 on: February 27, 2017, 05:24:15 AM »
Hi Im using this to rename my files works great, was wondering can it do .srt files aswell, and when i move a movie folder to amc with movie and srt in it voxcommando doesnt pick it up, does it only look for files in amc folder,ive tried putting srt into amc folder but it gets moved always to filebot failed folder after the specified time,any help much appreciated

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 497
  • Karma: 43
    • View Profile
Re: Automated Media Center (AMC) - File processing and sorting
« Reply #4 on: February 27, 2017, 09:20:55 AM »
I'm glad to here it's working for you. I no longer use this command due to changing my setup.

With the .srt file you would need to check with the filebot forums. It says it should be able to handle subites, but I haven't used filebot in a long time so I wouldn't know where to start troubleshooting. I would start here http://www.filebot.net/forums/viewtopic.php?f=4&t=215#p1561 and look over the script setup and see if there is anything you need to add for the subtitles. I hope this helps


MMatty1

  • Jr. Member
  • **
  • Posts: 40
  • Karma: 4
    • View Profile
Re: Automated Media Center (AMC) - File processing and sorting
« Reply #5 on: February 27, 2017, 08:39:49 PM »
Yes that helps thnxx for info.  ;)