AppleTV Movies and TV Show script for Mac
Posted: April 20th, 2010, 5:32 pm
I am starting a new thread for this script since it is now out of the idea and development stage.
As this script progressed, it has become a real benefit for me in conjunction with SABnzbd+. Hopefully it will be something that you or a mate can use as well.
WHAT IS THE PURPOSE OF THIS SCRIPT?
This script is for AppleTV users who want as automated a process as possible for Video that comes through SABnzbd. This single script handles Movies and TV Shows. Recently I started using SAB and feeding it with RSS feeds, as well as using NZB index sites - it's a great tool, and I happily donated to the people that work on it. As an AppleTV user this seemed like it could be a great relationship, SABnzbd and AppleTV. Unfortunately there were few scripts on this board that did what I wanted, some did a few basics but I was looking for an end to end script that handled everything I threw at it, and one that had fall backs built into it so that it could handle things like TV Shows without Season and Episode information. I started off by modifying a script that somebody had posted, and I taught myself enough Bash knowledge via Google in order for me to complete this script. I am no programmer and Bash language looks like a foreign language to me, but I was able to get the job done.
TV Shows are auto-tagged into iTunes based on information contained from the download. In other words, if you have RSS feeds for your TV Shows - from start to finish it is a completely hands off process of them getting onto your AppleTV for viewing. If you select random shows from an NZB Indexing site, you simply need to be sure to set the Category to TV, (and the associated script will be AppleTV), and the rest is fully automatic.
Movies use iDentify for tagging and injecting into iTunes and are ready for your preview/edits before the tags are committed. I'm sure some of you use some RSS voodoo to select Movies automatically, most probably select from an indexing site. You only need to set the Category to Movies (and the associated script will be AppleTV). I also got in the habit of renaming the Movie in the SAB interface right when I add it and select the Category, that way the folder / files that are written out use the actual Movie name, and it speeds up iDentify in finding the proper tagging information. The movie will be make it through HandbrakeCLI to your destination folder and it will be opened in iDentify and awaiting your approval/edits before committing the tag/cover art to the file and injecting it into iTunes. You can have iDentify set to automatically tag without your telling it to process the information, but I find I edit enough that I want to preview it first, if nothing else but to set my preferred Genre.
WHY DO YOU USE iDentify TO TAG MOVIES?
Because it is awesome, MetaX showed promise but floundered and is not working for many. iDentify will cost you $10 to unlock everything but it is well worth it and it does a great job. You're welcome to use any other GUI tagger that you may prefer, just change the single line in the script that references iDentify to the GUI tagger of choice and it will use that instead.
WHICH MOVIE FORMATS DOES IT HANDLE?
The script will join 2 AVI's into 1. Additionally, the 2 original AVI's are moved into a new subfolder "Unjoined AVIs" for safe keeping.
The script will convert these sources for AppleTV:
MKV, M4V, MP4, AVI, WMV, ISO, IMG, and VIDEO_TS rips
Why is M4V in the list? Because not all M4V's are AppleTV compliant, it made sense to me to open up the possibility of input files, not just use MKV and AVI.
WHAT ABOUT MOVIES WITH SUBTITLES?
HandBrake does not currently support reading subtitles from MKV's, so I can't control that issue. Handbrake will read subtitles from ISO, IMG, and VIDEO_TS, however I don't have subtitles turned on, for fear that I'll burn some subtitle onto an English speaking movie - and I don't want that. In short, if it is a movie with Subtitles, you will need to handle that manually. I don't see how this could be an automated process, if you have an idea of a systematic flow of how it might be, please let me know and I'll see about incorporating it.
DOES IT HANDLE TV SHOWS WITHOUT SxxExx
Absolutely, if SxxExx information is not available it will use information from the Job Name for the Show Name, it will use the current year as the Season and defaults to an Episode number of 01.
WHY DON'T USE USE THE EPISODE TITLE IN YOUR TAGS?
I don't use them for 2 reasons, 1) I simply don't need that information, and 2) The Episode Title is not regularly given in the NZB download so I chose to not include it. The script could be modified fairly simply to incorporate the Episode Title, in fact I do use it for my racing series, Formula1, etc...
IS THE FULL JOB NAME USED FOR TAGGING?
Of course not, that would be hideous! SAB does a great job of renaming shows with SxxExx information, and I have done my best to clean up the tagging information for shows without it. For example, a show with the fictitious job name of: This.Earth.from.USA.to.China.WS.720P-ANGELiC
Would result in the following tag information: TV Show: "This Earth From USA to China", Season: 2010, Episode 01.
DO YOU DELETE THE SOURCE FILES AFTER IT'S DONE?
Sort of, I move the original folder and all the files and sub-folders within it into the Trash Bin, you will have them until you empty the Trash on your Mac.
ok - I may expand on this more later, I have done my best to documented the script pretty well internally so read through it. There are a few settings in SAB that you will need to set to work properly with the script, and there are a few local computer folder names that will need to match your system. Additionally you'll need to get HandBrakeCLI, Mencoder, and iDentify, and in the correct locations.
The version of the script that I am using is built to format the information for the motorsports I watch really, REALLY, nicely, I realize that it is a specialty thing that most people won't benefit from - no worries, having those sections of the code in the script makes no difference to you has no ill affects sitting there. If you would rather it not be there, you can easily strip those sections out of the script and it will affect nothing.
The script is done, aside from anything needing a fix.
Here is a PDF of the script that you can view in your browser.
Here is the script by itself.
Here is the script along with the apps that you need to go along with it. (The mencoder cli app is hard to find.)
Please feel free to use this for your own use, if you're on Mac and use an AppleTV that is... I can't promise, but will help troubleshoot if needed.
As this script progressed, it has become a real benefit for me in conjunction with SABnzbd+. Hopefully it will be something that you or a mate can use as well.
WHAT IS THE PURPOSE OF THIS SCRIPT?
This script is for AppleTV users who want as automated a process as possible for Video that comes through SABnzbd. This single script handles Movies and TV Shows. Recently I started using SAB and feeding it with RSS feeds, as well as using NZB index sites - it's a great tool, and I happily donated to the people that work on it. As an AppleTV user this seemed like it could be a great relationship, SABnzbd and AppleTV. Unfortunately there were few scripts on this board that did what I wanted, some did a few basics but I was looking for an end to end script that handled everything I threw at it, and one that had fall backs built into it so that it could handle things like TV Shows without Season and Episode information. I started off by modifying a script that somebody had posted, and I taught myself enough Bash knowledge via Google in order for me to complete this script. I am no programmer and Bash language looks like a foreign language to me, but I was able to get the job done.
TV Shows are auto-tagged into iTunes based on information contained from the download. In other words, if you have RSS feeds for your TV Shows - from start to finish it is a completely hands off process of them getting onto your AppleTV for viewing. If you select random shows from an NZB Indexing site, you simply need to be sure to set the Category to TV, (and the associated script will be AppleTV), and the rest is fully automatic.
Movies use iDentify for tagging and injecting into iTunes and are ready for your preview/edits before the tags are committed. I'm sure some of you use some RSS voodoo to select Movies automatically, most probably select from an indexing site. You only need to set the Category to Movies (and the associated script will be AppleTV). I also got in the habit of renaming the Movie in the SAB interface right when I add it and select the Category, that way the folder / files that are written out use the actual Movie name, and it speeds up iDentify in finding the proper tagging information. The movie will be make it through HandbrakeCLI to your destination folder and it will be opened in iDentify and awaiting your approval/edits before committing the tag/cover art to the file and injecting it into iTunes. You can have iDentify set to automatically tag without your telling it to process the information, but I find I edit enough that I want to preview it first, if nothing else but to set my preferred Genre.
WHY DO YOU USE iDentify TO TAG MOVIES?
Because it is awesome, MetaX showed promise but floundered and is not working for many. iDentify will cost you $10 to unlock everything but it is well worth it and it does a great job. You're welcome to use any other GUI tagger that you may prefer, just change the single line in the script that references iDentify to the GUI tagger of choice and it will use that instead.
WHICH MOVIE FORMATS DOES IT HANDLE?
The script will join 2 AVI's into 1. Additionally, the 2 original AVI's are moved into a new subfolder "Unjoined AVIs" for safe keeping.
The script will convert these sources for AppleTV:
MKV, M4V, MP4, AVI, WMV, ISO, IMG, and VIDEO_TS rips
Why is M4V in the list? Because not all M4V's are AppleTV compliant, it made sense to me to open up the possibility of input files, not just use MKV and AVI.
WHAT ABOUT MOVIES WITH SUBTITLES?
HandBrake does not currently support reading subtitles from MKV's, so I can't control that issue. Handbrake will read subtitles from ISO, IMG, and VIDEO_TS, however I don't have subtitles turned on, for fear that I'll burn some subtitle onto an English speaking movie - and I don't want that. In short, if it is a movie with Subtitles, you will need to handle that manually. I don't see how this could be an automated process, if you have an idea of a systematic flow of how it might be, please let me know and I'll see about incorporating it.
DOES IT HANDLE TV SHOWS WITHOUT SxxExx
Absolutely, if SxxExx information is not available it will use information from the Job Name for the Show Name, it will use the current year as the Season and defaults to an Episode number of 01.
WHY DON'T USE USE THE EPISODE TITLE IN YOUR TAGS?
I don't use them for 2 reasons, 1) I simply don't need that information, and 2) The Episode Title is not regularly given in the NZB download so I chose to not include it. The script could be modified fairly simply to incorporate the Episode Title, in fact I do use it for my racing series, Formula1, etc...
IS THE FULL JOB NAME USED FOR TAGGING?
Of course not, that would be hideous! SAB does a great job of renaming shows with SxxExx information, and I have done my best to clean up the tagging information for shows without it. For example, a show with the fictitious job name of: This.Earth.from.USA.to.China.WS.720P-ANGELiC
Would result in the following tag information: TV Show: "This Earth From USA to China", Season: 2010, Episode 01.
DO YOU DELETE THE SOURCE FILES AFTER IT'S DONE?
Sort of, I move the original folder and all the files and sub-folders within it into the Trash Bin, you will have them until you empty the Trash on your Mac.
ok - I may expand on this more later, I have done my best to documented the script pretty well internally so read through it. There are a few settings in SAB that you will need to set to work properly with the script, and there are a few local computer folder names that will need to match your system. Additionally you'll need to get HandBrakeCLI, Mencoder, and iDentify, and in the correct locations.
The version of the script that I am using is built to format the information for the motorsports I watch really, REALLY, nicely, I realize that it is a specialty thing that most people won't benefit from - no worries, having those sections of the code in the script makes no difference to you has no ill affects sitting there. If you would rather it not be there, you can easily strip those sections out of the script and it will affect nothing.
The script is done, aside from anything needing a fix.
Here is a PDF of the script that you can view in your browser.
Here is the script by itself.
Here is the script along with the apps that you need to go along with it. (The mencoder cli app is hard to find.)
Please feel free to use this for your own use, if you're on Mac and use an AppleTV that is... I can't promise, but will help troubleshoot if needed.