[Windows] Automate your XBMC Database using AutoHotkey and Ember Media Manager
#1
It can be a pain keeping your XBMC client(s) feed with new TV shows. This is especially true if you use Ember Media Manager to create your .nfo files and fetch fanart, etc. This is my process and so far its working quite well.

I download files from XBMC using the Icefilms and JDownloader addons. This is just one method. You can also use RSS Torrents or News Groups. All we are worried about at this point is getting content from the net and downloading it to a central location on your hard drive. A scheduled task, Batch file and AutoHotKey script handles the rest.

This post assumes the user is currently using XBMC and Ember Media Manager. Please don't ask me how to use these programs. As I said before, I'm using Icefilms and JDownloader. Don't ask me how to use these either. There are seperate support threads for those topics and I have provided links below.


The scheduled task does the following:
  • Batch File launches a program called theRenamer
  • theRenamer grabs files from the download folder, renames them for XBMC and copies them to the correct location on my hard drive.
  • Batch File then launches an AutoHotKey script and closes
  • AutoHotKey script launches Ember Media Manager and presses the "Update Library" button before closing.
  • XBMC Library Auto Updater Addon in XBMC updates the library every 4 hours



Required Programs:

XBMC I don't need to tell you where to find this
AutoHotKey found here
theRenamer found here
Ember Media Manager found here




Once you download/install the required programs we are ready to begin.


Configure theRenamer with the following settings
Image
Fetch Folder = your downloaded files (JDownloader, Torrents etc)
TV Show Archive = where you keep all of your tv shows

*Optional* press settings>next page. This brings up a text document that you can edit. Delete the words Camelot and Cam from this list. Only do this if you plan on downloading the show Camelot




Create the Batch File
Open notepad and paste this:
Code:
start /WAIT "" "c:\Program Files (x86)\theRenamer\theRenamer.exe" -fetch

start "" "c:\ClickUpdateLibrary.ahk
Exit
Name the file and give it a .bat extension. (name it whatever you like)
Later you will set up a scheduled task to kick of this program.
I saved mine to the root of C:\
If you change the location then I assume you know what to edit further along.





Create the AutoHotkey Script
Open Notepad and paste this:
Change the first line to reflect the path of Ember Media Manager.exe on your system
Code:
C:\Users\CPU Name\AppData\Ember Media Manager\Ember Media Manager.exe ;opens Ember Media Manager

WinWait, Ember Media Manager ; Waits for Ember to finish loading

IfWinExist Ember Media Manager ; Checks if Ember is running

{
    WinActivate ; Brings Ember into focus
}


Click 533, 64 ; Clicks the Update Library button

Sleep, 10000 ; Waits 10 seconds for the library to finish updating.  Increase this value if you have a large database.  Value is in millisecods

WinClose, Ember Media Manager ; Closes Ember Media Manager
Save the file as ClickUpdateLibrary.ahk and save to the root of C:\
I commented the AutoHotKey script with additional info. Just read.


Create a scheduled task in Windows that will run the first .bat file. I scheduled mine for every 4 hours. This is entirely up to you. If you don't know how to do this then Google it. I'm not going to beat a dead horse. There are hundreds of sites with instructions.


Now you will have a scheduled task kicks of theRenamer, copies your files to the correct location, kicks of Ember to scrape/get fanart. Now we just need to update XBMC. You can do this with the XBMC Library Auto Updater.

Alternative options is to modify the keymap.xml file to assign an Update Library to your remote. You can also Favorite the XBMC Library Auto Updater and add it to your skins home menu.


Please ask if you have any questions on the batch file or AutoHotKey script. Hopefully this will help others.


Final Thoughts
If theRenamer does not copy your files to the correct location then most likely there is an issue with the file names. Launching theRenamer from command line eliminates the gui alltogether and you will not receive any errors. If you open the program and try, it will tell you why it could not move the files.

This will also not work when theTVDB's website is down.
How to use Git
| AMD Athlon II X3 Triple Core Processor 2.9 GHz |GIGABYTE GA-MA785GM-US2H Mobo 2GB DDR2 Ram | MSI N430GT |
| Logitec Harmony Smart Control Remote| 52" Sharp Aquos LED TV | Denon AVR-X1000 |
| Freenas Server with 18TB ASRock Intel Avoton C2750 |
Reply
#2
Although it is very nice of you to share your process with us, i would like to make a suggestion that will probably make your life even easier :

Use Sick Beard. It, IMHO, is the greatest thing since TiVo.

A little over a year ago, i was like you... Had everything down to a science when it came to having a perfectly updated library with perfectly named files.

I was using home made scripts and a combination of TVrename, tvrenamer and some other tools i have long since forgotten...

Then i found Sick Beard and i haven't looked back since. I loved it so much that i bought the sickbeard.com and .org domain names and setup a website for the author. I paid for 1 year hosting and transferred everything to him. That's how much i just love this program.

Do yourself a favor and check it out... I am sure you will love it...

Sick Beard Thread on XBMC : http://forum.xbmc.org/showthread.php?tid=63591
Sick Beard Official website : http://www.sickbeard.com

-Pr.
------------------------------------------
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/237 TB HDD Space]
Reply
#3
Thanks for the info. I don't subscribe to News Groups. I like downloading from the Icefilms addon. Its not quite automated since I have to initiate the downloads but I can do it from my couch using my remote. Its the only option that I know of that avoids torrents or fees for news groups.
How to use Git
| AMD Athlon II X3 Triple Core Processor 2.9 GHz |GIGABYTE GA-MA785GM-US2H Mobo 2GB DDR2 Ram | MSI N430GT |
| Logitec Harmony Smart Control Remote| 52" Sharp Aquos LED TV | Denon AVR-X1000 |
| Freenas Server with 18TB ASRock Intel Avoton C2750 |
Reply
#4
htpc guy Wrote:Thanks for the info. I don't subscribe to News Groups. I like downloading from the Icefilms addon. Its not quite automated since I have to initiate the downloads but I can do it from my couch using my remote. Its the only option that I know of that avoids torrents or fees for news groups.

Newsgroup fees a well worth it... there are plenty that will give you unlimited bandwidth for $10/month... But if you don't want to spend that for the ultimate in automation/convenience/privacy/security, you can still use your current download situation and just have Sick Beard take care of moving, renaming, generating nfos and updating XBMC.

-Pr.
------------------------------------------
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/237 TB HDD Space]
Reply
#5
sorry for highjacking this thread,
thought sickbeard was only usable with newsgroups etc.
How to tell sickbeard to process files in downloadfolder which dont come from newsgroups etc,for example i just copy files there or other clients puts them in?
Reply
#6
Malexx Wrote:sorry for highjacking this thread,
thought sickbeard was only usable with newsgroups etc.
How to tell sickbeard to process files in downloadfolder which dont come from newsgroups etc,for example i just copy files there or other clients puts them in?

Check your PM.

Don't want to hijack htpc guy's thread...

-Pr.
------------------------------------------
[4 Kodi Clients + 4 Norco RPC-4224 Media Servers w/237 TB HDD Space]
Reply



Logout Mark Read Team Forum Stats Members Help
[Windows] Automate your XBMC Database using AutoHotkey and Ember Media Manager0
This forum uses Lukasz Tkacz MyBB addons.