2010-06-23, 20:48
I've made a mod to this script so that it will display trailers based upon the MPAA ratings of the movie and the trailer itself. See below for details and install instructions. Note I'm a bit of a Python noob so please let me know if you run into any problems.
Details
So the MPAA ratings work great with HTE trivia but do not work with the trailers themselves. I'm an avid fan of this script and use it at least once a week when I have scheduled showings in my home theater. The biggest problem though is that if you have kids then you really don't want trailers of SAW IV playing during a showing of Alvin & The Chipmunks. For this reason alone I modded the script to only show trailers within the correct MPAA group of the movie itself. There are some caveats and prerequisites though..
For this to work you need to use Apple Trailer Downloader (ATD) and you need to ensure MPAA ratings are being stored in your movie library in XBMC. During testing I found the TMDB scraper to be the best (latest version of the scraper that brings in MPAA ratings). I think IMDB brings in the full rating not just the code which might not work. So in other words if the MPAA rating in your library is one of the following then it should work: PG, PG-13, R, G, NC-17 and NR (not rated).
Usage
(note if you already use ATD skip the first few steps and just add --htenfo to your atd command line).
1. Download ATD from here.
2. Create a .bat file and enter the following:
atd -d <trailerpath> -a "-trailer" --htenfo
3. Save the .bat file and run it. This will download all new trailers to <trailerpath> along with a .NFO file that is required for this to work.
4. Download the HTE scraper file from here.
5. Make a backup copy of /home/yourusername/.xbmc/scripts/Home Theater Experience/resources/scrapers/local/scraper.py and replace it with the one you just downloaded.
6. Ensure your HTE script settings are pointing to your trailerpath where you downloaded the trailer.
That's it!
How it works
When you run the HTE script it will get the MPAA rating of the movie and pass it to the scraper script. For each trailer it finds it will locate the NFO file and read in the rating of the trailer. If the rating of the trailer falls into the same category as the MPAA rating of the movie then the trailer will get added to your playlist.
Trailers are selected based on the following criteria:
If the movie is rated PG-13, PG or G then any trailer from those 3 categories will be selected. No trailer from R, NC-17 or Unrated will be selected.
If the movie is rated R or NC-17 then any trailer from PG-13, PG, G, NC-17, R or Unrated will be selected.
If the movie is unrated (NR) or is missing the rating then only trailers from PG-13, PG or G will be selected.
The biggest issue I've come across is there are a lot of unrated trailers on Apple's website. ATD has a --imdb parameter that will scrape the correct rating from Imdb.com but I was unable to test this. Hopefully Therms will fix this in the new version he is working on.
Any questions or problems let me know. I can now finally run HTE and not worry about my kids freaking out because of some R rated trailer!
Big thanks to Nuka and Therms for some excellent scripts!
Cheers.
Details
So the MPAA ratings work great with HTE trivia but do not work with the trailers themselves. I'm an avid fan of this script and use it at least once a week when I have scheduled showings in my home theater. The biggest problem though is that if you have kids then you really don't want trailers of SAW IV playing during a showing of Alvin & The Chipmunks. For this reason alone I modded the script to only show trailers within the correct MPAA group of the movie itself. There are some caveats and prerequisites though..
For this to work you need to use Apple Trailer Downloader (ATD) and you need to ensure MPAA ratings are being stored in your movie library in XBMC. During testing I found the TMDB scraper to be the best (latest version of the scraper that brings in MPAA ratings). I think IMDB brings in the full rating not just the code which might not work. So in other words if the MPAA rating in your library is one of the following then it should work: PG, PG-13, R, G, NC-17 and NR (not rated).
Usage
(note if you already use ATD skip the first few steps and just add --htenfo to your atd command line).
1. Download ATD from here.
2. Create a .bat file and enter the following:
atd -d <trailerpath> -a "-trailer" --htenfo
3. Save the .bat file and run it. This will download all new trailers to <trailerpath> along with a .NFO file that is required for this to work.
4. Download the HTE scraper file from here.
5. Make a backup copy of /home/yourusername/.xbmc/scripts/Home Theater Experience/resources/scrapers/local/scraper.py and replace it with the one you just downloaded.
6. Ensure your HTE script settings are pointing to your trailerpath where you downloaded the trailer.
That's it!
How it works
When you run the HTE script it will get the MPAA rating of the movie and pass it to the scraper script. For each trailer it finds it will locate the NFO file and read in the rating of the trailer. If the rating of the trailer falls into the same category as the MPAA rating of the movie then the trailer will get added to your playlist.
Trailers are selected based on the following criteria:
If the movie is rated PG-13, PG or G then any trailer from those 3 categories will be selected. No trailer from R, NC-17 or Unrated will be selected.
If the movie is rated R or NC-17 then any trailer from PG-13, PG, G, NC-17, R or Unrated will be selected.
If the movie is unrated (NR) or is missing the rating then only trailers from PG-13, PG or G will be selected.
The biggest issue I've come across is there are a lot of unrated trailers on Apple's website. ATD has a --imdb parameter that will scrape the correct rating from Imdb.com but I was unable to test this. Hopefully Therms will fix this in the new version he is working on.
Any questions or problems let me know. I can now finally run HTE and not worry about my kids freaking out because of some R rated trailer!
Big thanks to Nuka and Therms for some excellent scripts!
Cheers.