• 1
  • 39
  • 40
  • 41(current)
  • 42
  • 43
  • 57
[RELEASE] Apple Movie Trailers Lite (formerly AMT II) Plugin
ossman, this is for the full script? those uri's don't match the lite's version.

if you would like to be added to the xbmc-addons repo and modify the script, i will add you.

i have no way to test this properly as i always max out my limited bandwith.
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Yes, this is for the full script. I didn't see any thread devoted specifically to it, and it has been mentioned here a few times so I figured it was one thread for both.

I'm not sure I'd consider this commit-worthy just yet. There is a risk that the modified URI will point to something that doesn't exist. In a perfect world there is an alternative source of [stable] information that contains these URIs. It's just the small matter of finding it. :p

I though the lite version used the same source data, just didn't bother making a database of it? What do the URIs look like there?
Reply
PHP Code:
http://trailers.apple.com/movies/independent/thegirlwhokickedthehornetsnest/girlwhokickedthehornetsnest-tlr1_h1080p.mov 


let me know if you want added. good luck.

your best bet is to check an older trailer with your change. if that works then you may be ok. i've also just discovered that the trailers for the lite version are still valid even if they are not still in the source. so now i create a db for lite version also, but it is fast. only a couple seconds on a new install and the update isn't any slower. (not available yet)
For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
Reply
Those are the "good" URIs, so whatever lite is doing should probably be done in the full script.
Reply
I looked at the AMT lite code and the XML files it looks at, and they don't seem to be as complete as the ones AMT "full" uses. So I guess that's not a way forward. Google also seems to know about all the XML files that we use, but no more...

I'll experiment a bit more with rewriting the URI and see what I can come up with.
Reply
Suggested patch:

Code:
diff -up ./cacheurl.py.orig ./cacheurl.py
--- ./cacheurl.py.orig    2010-12-30 17:28:54.955339079 +0100
+++ ./cacheurl.py    2010-12-30 17:34:13.015595168 +0100
@@ -86,6 +86,16 @@ def set_status_symbol( status_symbol ):
         status_symbol_index = 0
     return [ "-", "\\", "|", "/" ][ status_symbol_index ]

+# This class is only needed in order to make a HEAD request
+class HeadRequest(urllib2.Request):
+    def get_method(self):
+        return "HEAD"
+
+# And this is to prevent following redirects
+class HTTPRedirectPreventer(urllib2.HTTPRedirectHandler):
+    def redirect_request(self, req, fp, code, msg, hdrs, newurl):
+        return None
+
class HTTP:
     def __init__( self, cache = ".cache", title = "", actual_filename = False, flat_cache = False, clear_cache_folder=False ):
         # set the cache directory; default to a .cache directory in BASE_DATA_PATH
@@ -260,6 +270,30 @@ class HTTP:
             filepath = None
         return filepath

+    def urlcheck( self, url ):
+        # get the filename
+        filepath = self.make_cache_filename( url )
+
+        # if the file is already in the cache, we're done
+        if os.path.isfile( filepath ):
+            return True
+
+        try:
+            # special handler to do HEAD as we don't want to download
+            # the file
+            request = HeadRequest( url )
+            request.add_header( "User-Agent", __useragent__ )
+            # and a special opener to avoid following redirects
+            opener = urllib2.build_opener(HTTPRedirectPreventer)
+            response = opener.open( request )
+        except urllib2.HTTPError, e:
+            return False
+        except:
+            LOG( LOG_ERROR, self.__class__.__name__, "%s.%s [%s]", __module_name__, __module_version__, sys.exc_info()[ 1 ] )
+            return False
+
+        return True
+
     def on_data( self, url, filepath, filesize, size_read_so_far ):
         return True

diff -up ./gui.py.orig ./gui.py
--- ./gui.py.orig    2010-12-30 17:08:02.616221721 +0100
+++ ./gui.py    2010-12-31 00:22:18.998089032 +0100
@@ -509,9 +509,19 @@ class GUI( xbmcgui.WindowXML ):
                                 #self.core = xbmc.PLAYER_CORE_DVDPLAYER
                             #else:
                             #    self.core = xbmc.PLAYER_CORE_MPLAYER
+
+                            # The URIs we find in the XML data don't seem
+                            # to be properly distributed in the CDN so we
+                            # need to change them to what you can find on
+                            # the "normal" trailers page.
+                            alt_url = url.replace("/405/us/media/trailers/", "/movies/")
+                            tester = cacheurl.HTTP( clear_cache_folder=not self.flat_cache )
+                            if ( tester.urlcheck( alt_url ) ):
+                                url = alt_url
+
                             self.url = url
                             if ( self.settings[ "mode" ] == 0 ):
-                                filename = url + "?|User-Agent=%s" % ( urllib.quote_plus( cacheurl.__useragent__ ), )
+                                filename = url + "|User-Agent=%s" % ( urllib.quote_plus( cacheurl.__useragent__ ), )
                             else:
                                 if ( self.settings[ "mode" ] == 1 ):
                                     if ( not self.check_cache( self.trailers.movies[ self.trailer ].title ) ):

The basic principle is testing the modified URI by doing a HEAD request first, and using the original one if that request fails. Should allow us to use this hack safely.

Old trailers still have problems, but they're probably just poorly cached in the CDN. I tried "A Scanner Darkly" and got 3 Mbps. That's more than the 1 Mbps I get with the unmodified URIs, but insufficient for smooth playback.
Reply
Sad 
Hi,

i installed for the first time the new version and cant find the apple movie trailer :confused2:

where can i find the plugin or are the trailers not running under the new version?

thanks in advance.
schnoepel
Reply
I found the same thing. my guess is, it hasn't migrated over from the old beta repo to the new official one for whatever reason?
Reply
Try this. The Movie Trailers Lite works fine but the Full has some streaming hick ups.

http://xbmc.exstatic.org/repository.goog...addons.zip

Go to add-ons and install from zip file.
Reply
Is the Apple / QuickTime Movie Trailers plug in missing from the GA release of Dharma 10.0?
I've never had great consistent luck with the Trailers plugin on the old xbox or even Camelot but the Betas for Dharma all had it and overall I was fairly content with it. But the I just loaded Dharma 10 on my Revo and its not in the addons menu or anything??

I liked seeing some of the trailers on my big screen for instance Green Lantern looked much less cheesy on the big screen.
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
Hi, I had the same thing, add the following repositry and it's in there:

http://xbmc-addons.googlecode.com/svn/pa...addons.zip
Reply
kawasabi Wrote:Try this. The Movie Trailers Lite works fine but the Full has some streaming hick ups.

http://xbmc.exstatic.org/repository.goog...addons.zip

Go to add-ons and install from zip file.

Cheers, I'll give it a look.

Can someone just clarify that AMT II was in the official repo not so long ago. Or am I going mental Big Grin
Reply
Marvel Wrote:Cheers, I'll give it a look.

Can someone just clarify that AMT II was in the official repo not so long ago. Or am I going mental Big Grin

You're not going mental. It was, but it was removed.
Reply
thanks fryster. seems to work. curious since I think i tried each beta and was always in there.
Search first, provide details and keep forums clean. Mark things solved, to close them out and acknowledge helpful volunteers who share. If I have helped, click the plus button.
Reply
is the apple trailers addon workingHuh i reinstall xbmc 10 this night and i cant find this addon Huh what happend?
Reply
  • 1
  • 39
  • 40
  • 41(current)
  • 42
  • 43
  • 57

Logout Mark Read Team Forum Stats Members Help
[RELEASE] Apple Movie Trailers Lite (formerly AMT II) Plugin2