[mythtv-users] Problem with Apple Trailer

Jay Foster jayf0ster at sbcglobal.net
Fri Aug 21 18:48:10 UTC 2009


> > I'm using the Ben Leto Apple Trailer Grabber script to
> download the Apple
> > movie trailers.  Last night, it started failing.  I
> am using it in the
> > download mode.  The script seems to run correctly and
> produces a valid
> > appletrailer.xml file, but the movie trailer files
> themselves fail to
> > download.  After some investigation, I discovered
> that the
> > 'system("/usr/bin/wget --quiet $movieLink");' line is
> really downloading a
> > file called "index.html" instead of the movie trailer
> file.  The value of
> > $movieLink is correct (ie, not "index.html").  Any
> one else having this
> > problem?
> >
> > In looking into this, I also made some modifications
> to the
> > myth_trailers_grabber script to detect and report
> these errors properly in
> > the appletrailer.xml file.
> 
> Apple changed stuff yesterday when they released the Avatar
> trailer.
> Now you can only download from quicktime. If you are able
> to change it
> so that you can give the quicktime user agent then you will
> be allowed
> to download again. I know you can do it with wget:
> http://www.hd-trailers.net/blog/2009/08/20/direct-download-links-from-apple-are-not-working/
> 
> 
Thanks for that.  I've modified my myth_trailers_grabber script to work around this issue and to report it in the appletrailer.xml file if something similar happens again.  Here is what I changed:

--- myth_trailers_grabber.0.4.2.2	2009-08-21 11:11:37.000000000 -0700
+++ myth_trailers_grabber	2009-08-21 11:22:07.000000000 -0700
@@ -173,15 +173,26 @@ function init_main()
 			if($movieLink && $STREAM_OR_DOWNLOAD == 'download') {
 				// change the directory the the place where we are to download the movies to
 				chdir($DOWNLOAD_FILES_DIR);
 				// download that movie!!
 				// 14/06/2009 - Extra code added to check if movie already exists in download directory, if so then don't download it again !
+				// command to use to play the local movie
+				$mythtvPlayerCmd = "EXEC $LOCAL_EXEC_CMD ".$DOWNLOAD_FILES_DIR."/".basename($movieLink);
 				if(!is_file(basename($movieLink))) {
 					system("/usr/bin/wget --quiet $movieLink");
+					// JAF 8/21/2009
+					if(!is_file(basename($movieLink))) {
+						// Try again spoofing Quicktime
+
+						system("/bin/rm -f ".$DOWNLOAD_FILES_DIR."/index.html*");
+						system("/usr/bin/wget --quiet -U QuickTime/7.6.2 $movieLink");
+						if(!is_file(basename($movieLink))) {
+							$movieTitle = "ERROR: $movieTitle";
+							$mythtvPlayerCmd = "EXEC xmessage -center -timeout 10 There was an error downloading this Apple trailer (".$movieLink.")...";
+						}
+					}
 				}
-				// command to use to play the local movie
-				$mythtvPlayerCmd = "EXEC $LOCAL_EXEC_CMD ".$DOWNLOAD_FILES_DIR."/".basename($movieLink);
 
 			// we're going to be streaming the trailer from the internet
 			} else if($movieLink) {
 				// command to use to play the local movie
 				$mythtvPlayerCmd = "EXEC $STREAMING_EXEC_CMD $movieLink";

Jay


More information about the mythtv-users mailing list