Apple Movie Trailers Import Utility - Updated v3.4 - 6/01/08

Xlobby plugin development

Apple Movie Trailers Import Utility - Updated v3.4 - 6/01/08

Postby tswhite70 on Sat May 27, 2006 11:55 pm

While working on the InTheaters plugin hvs69 suggested I take a look at bradsjm's Apple Movie Trailer Import Utility to help me with my trailer links. I downloaded Brad's code and dug into it but it wasn't working and he didn't include all the source files... and sadly he's not around anymore. I spent a few weeks banging away at it using Ethereal to watch the network traffic and parsing through the code and the XML from ITunes and was able to get it working again.

Apple had changed some of there backend XML structure which is why the old code wasn't working anymore. I've made a few other modifications and it seems to be working pretty good so I'm posting it for testing.

Apple Movie Trailers Import:
http://home.comcast.net/~twhite644/appl ... ailers.zip

Source Code:
http://home.comcast.net/~twhite644/appl ... ation1.zip

Download the AppleMovieTrailers.zip file, unzip it and put the executable in your PLUGINS folder. Create an event to run the executable:

AppleMovieTrailers.exe /size=large

You'll need to create your screens to use the database that's created.

This application has 9 command line parameters (you must use at least one of them when you call the app or it will balk):
1) xlobby trailers database (/db=), allows you to set the name of the xml file to output, default is trailers.xml
2) directory to store the downloaded cover art (/covers=), default is Xlobby\Covers
3) /full flag forces an update for all web based trailers (ie those whose Parameter value start with "http://")
4) specify which size Quicktime movie URL to capture (/size=[small|medium|large|HD 480|HD 720|HD 1080]), default is large
5) specify how long to wait for downloads (/timeout=) (slower connections may need a larger value here, in milliseconds: default is 10000).
6) /lowres to limit covers to the lowres version on Itunes
7) /isnew to update "IsNew" database field (Changes trailers "IsNew" field to "False" during update for all existing trailers)
8) Download trailer (/download="categoryname>parameter"), downloads trailer to local disk with progress information, updates database to point to downloaded trailer
9) Download path (/dlpath=), default is Xlobby\Covers

For example:
AppleMovieTrailers.exe /size=medium /isnew
AppleMovieTrailers.exe /db=trailers.xml /covers="\\Server\Share1\Itunes" /full /size="HD 720" /timeout=10000 /lowres
AppleMovieTrailers.exe /download=%trailers>parameter% /dlpath="\\Server\ShareName\Directory\%trailers>display%"

The following parameters are getting saved to the database where available:
    - Parameter: Direct URL to the QuickTime preview
    - Display: Trailer Movie Title
    - CoverArt: default directory is Xlobby\covers
    - Offline: (True|False)
    - IsNew: (True|False)
    - Date: Release date if available
    - itunesurl: url to the XML page for the movie on Itunes - for internal use
    - Genre(s):
    - Rating:
    - Studio:
    - SortTitle: title corrected for "The", "A", "An"
    - Size: (small|medium|large|HD 480|HD 720|HD 1080)
    - Actors:
    - Runtime: trailer runtime
    - Plot:
v2.1 Highlights/Changes - Updated 10/22/2006:
- Executable must be placed in Xlobby\Plugins directory
- XML Schema change - DELETE your old trailers db before running the new version
- default db xml file is Xlobby\Databases\trailers.xml
- default coverart directory is Xlobby\plugins\covers
- Fixed code to match iTunes backend update
- DIRECTOR field removed, no longer available from Itunes
- RUNTIME field added
- SIZE field now accepts 480, 720, and 1080 (HD links)
- size code will now link to the largest available trailer up to the SIZE specified; ie if you put 720 as SIZE but only Medium is available you'll ge the link to the medium trailer
- pulling higher resolution cover by default when available
- added /lowres option to force low resolution cover download
- increased default timeout from 5000 to 10000
- made a couple of code/speed improvements
- updated SortTitle code to process "A" and "An"
- /db and /covers command line parameters now support Xlobby path options of:
    "root://" - The XLobby root directory.
    "skin://" - The XLobby skin directory.
    "directory://" - A path under the XLobby root directory.
    "\\WindowsShareName" - standard windows share path designation
v3.0 Highlights/Changes - Updated 02/17/2007:
- XML Schema change - DELETE your old trailers db before running the new version
- Coverart default location has been changed to Xlobby\covers; delete your old covers directory if located in Xlobby\Plugins or move it to Xlobby root
- /size= variable for HD trailer links changed to "HD 480", "HD 720", and "HD 1080";
- Size code fixed to link to the largest available trailer up to the SIZE specified; or if only 1 trailer available, to that trailer, regardless of size;
- /newonly option removed;
- Updates are now incremental by default based on "iTunesURL" value;
- Incremental update will remove trailers that no longer exist at Itunes and have not been downloaded;
- ISNEW field added - set to True for each new trailer discovered;
- /isnew option added: "/isnew" Updates ISNEW value to "False" for previously imported trailers - default is disabled;
- /full option added: Forces update of all HTTP based trailers;
- /download option added: "/download=%categoryname>parameter%" Download the trailer and update the database;
- /dlpath download directory option added: "/dlpath=directory" sets the trailer download directory - default is Xlobby\covers;
- OFFLINE field added - set to "True" for all new trailers; /download option will update this value to "False";

v3.1 Highlights/Changes - Updated 3/03/2007:
- Fixed an indexing problem with old trailer cleanup.
- Updated GENRE field to support filtering

v3.2 Highlights/Changes - Updated 9/01/2007:
- Updated trailer regex to match Itunes back end change.

v3.4 Highlights/Changes - Updated 6/01/2008:
- Updated trailer regex to match Itunes back end change.
- Parsing trailers by Genre now instead of Studio, this added approximately 200 trailers that were being missed from mostly independent studios (Full update this morning was 1726 trailers)

Big kudos to bradsjm for the original code!
Special thanks to Jack Simbach, aka spencer171 for the Xlobby path options idea and code from the XscriptNG Plugin!

Good luck,
tsw
Last edited by tswhite70 on Sun Jun 01, 2008 9:18 pm, edited 15 times in total.
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby CiXel on Sun May 28, 2006 2:46 am

Nice Job!
Works great. I'm looking forward to implementing random trailers at the start of my movies now.

Just an FYI to all VLC will also play Quicktime streams.
CiXel
 
Posts: 177
Joined: Tue Feb 22, 2005 6:27 pm
Location: New York

Postby P3rv3rt B3ar on Sun May 28, 2006 3:25 am

WOW!!! this is great news... i should goto sleep, i should read for exam... but instead im going to test this cause i simply cant wait :P
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby epitaph on Sun May 28, 2006 7:28 am

wow this is great. but how do i set this up to automatically play a few of these at random when i launch a movie? how do i get the category to display the cover art? and can these be played using zoomplayer?

Ep.
epitaph
 
Posts: 58
Joined: Wed Apr 19, 2006 8:28 am

Postby hvs69 on Wed May 31, 2006 5:46 pm

Thank you so much. :)
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby hvs69 on Wed May 31, 2006 5:49 pm

epitaph wrote:wow this is great. but how do i set this up to automatically play a few of these at random when i launch a movie? how do i get the category to display the cover art? and can these be played using zoomplayer?

Ep.


From my experience, zoom does not handle streaming quicktime format very well (with QT alternative codecs). I would recommend using Media Player Classic.
hvs69
 
Posts: 219
Joined: Wed Feb 11, 2004 8:06 am

Postby tswhite70 on Sat Jun 03, 2006 6:04 pm

ZP 5 (preview version) has fixed the old problem with URL's from the command line being in caps - but it still tends to miss the start of the video... MPC seems to be the choice of most.

To display the coverart just create a new text item on your screen and put the following "category>trailers>cover" - 'trailers' will be what ever you decided to call your category.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby phunk311 on Fri Jun 16, 2006 12:37 am

Thanks for this geat program. I've got a Trailer Screen setup to view and play the trailers. I can easily play any trailer I choose automatially with MPC. I can't get the play random trailer from db to work though. Anyone have any luck with this yet?
phunk311
 
Posts: 5
Joined: Mon Jun 05, 2006 6:27 am

Postby epitaph on Sat Jun 17, 2006 1:47 am

phunk311 wrote:I can't get the play random trailer from db to work though. Anyone have any luck with this yet?


i also cant get that to work and would really like if anybody could help ;).
epitaph
 
Posts: 58
Joined: Wed Apr 19, 2006 8:28 am

Trailer Playlist v1.0

Postby tswhite70 on Sun Jun 18, 2006 12:24 am

Let's see if this works - I wrote a quick vb.net plugin (via Xscript) to take the trailer database and turn it into a MPC playlist.

Apple Movie Trailers Playlist:
http://home.houston.rr.com/rswhite/appl ... aylist.zip

Load up Xscript or XscriptNG if you don't already have them. Call the script with your trailers db name as the variable.

AppleTrailers_Playlist.txt trailers.xml

Execute the event and it will parse all the URL's out of your database
and create a file called AppleMovie_Trailers.mpcpl in your DATABASES folder.

Call this file with Media Player Classic to start seeing your trailers. MPC seems to remember what playlist configs you have set so if you run it once and set the playlist to randomize it should be random every time after that... I think....

The script runs in just a couple seconds on my system so I just created a single event to create the playlist and then play it.

good luck,
tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby tswhite70 on Sun Jun 18, 2006 2:14 pm

Well, I take it back. I can't get MPC to play the playlist. It will play the first url but marks all the following URL's as Invalid including the first one that it played when it comes back around to the start. I've tried all the different playlist formats .m3u, .pls, .asx, .mpcpl - all of them exibit the same behaviour. It's almost like MPC isn't using the full URL on the subsequent "files".

Any ideas?

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby dgemily on Sun Jun 18, 2006 4:51 pm

strange, it's working for me....
try with this playlist: http://www.france.xlobby.com/forum/dgemily/temp/BA.m3u
just to see if the problem is from your file or your config...

later
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby epitaph on Sun Jun 18, 2006 9:25 pm

hmm it doesnt even work for me like it wont even play 1 url.

strange, it's working for me....
try with this playlist: http://www.france.xlobby.com/forum/dgemily/temp/BA.m3u
just to see if the problem is from your file or your config...


your playlist works for me.

so this will put ALL trailers from the db into a playlist? would there be anyway of specifying how many trailers would play?
epitaph
 
Posts: 58
Joined: Wed Apr 19, 2006 8:28 am

Postby tswhite70 on Mon Jun 19, 2006 2:47 pm

Weird...

dgemily - your playlist works fine on my setup. But I can't get a playlist of the Apple trailers to work, even if I create the playlist direct in MPC. Only the 1st file plays.

I sniffed it with Ethereal and the correct URL's are getting requested and ack'ed from my playlist. But it looks like Apple is sending a FIN packet right after the request on all the subsequent trailer requests - maybe they don't want us to playlist their trailers?

I'm going to see if I can maybe use a dummy file in the playlist to fake them out - or maybe it's something else, but I can't think of anything right now.

Epitaph - If I can get the playlist working, I'll add "# of trailers" as a variable to the script and then do some kind of random selection for them.

tsw
tswhite70
 
Posts: 318
Joined: Tue Jan 06, 2004 3:44 pm
Location: Houston, Tx

Postby epitaph on Mon Jun 19, 2006 7:44 pm

that would be awesome
epitaph
 
Posts: 58
Joined: Wed Apr 19, 2006 8:28 am

Next