Kodi Community Forum
[RELEASE] The Trailers - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Video Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=154)
+---- Thread: [RELEASE] The Trailers (/showthread.php?tid=119587)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26


RE: [RELEASE] The Trailers - kiesel - 2013-01-13

I have the exact same problem as everybody else. It would be awesome if we could have an update


Re: [RELEASE] The Trailers - nooz - 2013-01-15

Also having the network error msg when attempting playback, would really love to have this working again it's just such an awesome add on, I use(d) it all the time Sad


RE: [RELEASE] The Trailers - ErlendSB - 2013-01-16

It seems like the movieinfo xml file has been removed by apple for most of the trailers.
The current.xml file contains a path to the large trailer (MovieInfo/Preview/Large).
Can this be used instead?

To me it looks like one could do some string replacement to get the path to other qualities.
ie: http://trailers.apple.com/movies/sony_pictures/afterearth/afterearth-tlr1_h640w.mov
-> h640w.mov -> h720p.mov

It's a great addon when it works.


RE: [RELEASE] The Trailers - Hitcher - 2013-01-16

Tried that but it needs more to get it working again.

It should have been marked as broken a long time ago now.


'The Trailers' is broken - Hitcher - 2013-01-16

The Trailers hasn't worked for a while now and as it doesn't seem to be getting any attention at the moment shouldn't it at least be marked as such?

Thanks.


RE: 'The Trailers' is broken - Martijn - 2013-01-16

and why do you need to open a new thread for that.

I currently have no time look at fixing it. Maybe Sphere has time


RE: [RELEASE] The Trailers - Hitcher - 2013-01-16

I just thought that as there was no official reply here (along with the fact that it hasn't been marked as broken) meant no-one knew.


RE: [RELEASE] The Trailers - m1mi.dan0s - 2013-01-17

I seriously hope you guys will find the time to fix the error. No pressure. Smile

Has anyone noticed that it's not on ALL trailers, just on most?

It's a great plugin and I love the CouchPotato-feature.


RE: [RELEASE] The Trailers - Van Gogh - 2013-01-19

Hi,

Completely new here Smile I also have problems with The Trailers. I looked in the debug log and for instance the url: http://trailers.apple.com/moviesxml/s/fox/agooddaytodiehard/index.xml is loaded, but the url http://trailers.apple.com/moviesxml/s/independent/girlsagainstboys/index.xml does not. I also looked in the code of The Trailers. So far I understand is that the trailers are retreived from http://trailers.apple.com/trailers/home/xml/current.xml. From this list The Trailers creates an xml per movie/trailer matching the url http://trailers.apple.com/moviesxml/s/%s/index.xml (where %s is the name of the studio + trailer). But as I said some url simply do not exist. I think this is more an issue at Apple. I could not find documentation on how Apple generates the urls of the xml of the individual moves.

ps. I did try to create a work around, eg if the xml-file is not found, then use the url of the trailer in http://trailers.apple.com/trailers/home/xml/current.xml, but Python is not my language Smile

hope it helps..


RE: [RELEASE] The Trailers - el.kiwi - 2013-01-21

Hi there,

i am also completely new here and the trailers plugin not working really got kind of annoying :/
I think i found a workaround for that particular "missing index.xml because Apple didn't learn to share" problem and i need adventurous users, who would like to give it a shot.

Just simply oben the file apple_trailers.py (should be located in xbmc_userfolder/addons/plugin.video.the.trailers/resources/lib) and replace the two methods "get_trailer" and "get_trailer_types" with the two below.

Code:
def get_trailer_types(self, movie_title):
        self.__log('get_trailer_types started with movie_title: %s'
                   % movie_title)
        movie = self.get_single_movie(movie_title)
        url = self.MOVIE_URL % movie['movie_string']
        trailer_types = []
        try:
            cache_filename = '%s.xml' % movie['movie_string'].split('/')[1]
            tree = self.__get_tree(url, cache_filename=cache_filename)
            r_type = re.compile('/moviesxml/s/.+?/.+?/(.+?).xml')
            
            for t in tree.findAll('gotourl', {'target': 'main'}):
                if t.find('b'):
                    type_string = re.search(r_type, t['url']).group(1)
                    trailer_types.append({'title': t['draggingname'],
                                    'id': type_string})
        except:            
            t_url=self.BACKUP_MOVIE_URL % movie['movie_string']
            cache_filename='%swebinc.xml' % movie['movie_string'].split('/')[1]
            tree=self.__get_tree(t_url,cache_filename=cache_filename)
            
            for t in tree.findAll('div',{'class':'column first'}):
                if t.find('h3'):
                    trailer_types.append({'title': t.find('h3').getText(),'id':t.find('h3').getText().lower().replace(" ","")})


        return trailer_types

Code:
def get_trailer(self, movie_title, quality_id, trailer_type='trailer'):
        self.__log(('get_trailer started with movie_title: %s '
                    'trailer_type: %s quality_id: %s')
                    % (movie_title, trailer_type, quality_id))
        movie = self.get_single_movie(movie_title)
        url = self.MOVIE_URL % movie['movie_string']
        self.__log(url)
        try:
            if trailer_type != 'trailer':
                url = url.replace('index', trailer_type)
            cache_filename = '%s-%s.xml' % (movie['movie_string'].split('/')[1],
                                            trailer_type)
            html = self.__get_url(url, cache_filename=cache_filename)
            r_section = re.compile('<array>(.*?)</array>', re.DOTALL)
            section = re.search(r_section, html).group(1)
            tree = BS(section, convertEntities=BS.XML_ENTITIES)
            trailers = []
            for s in tree.findAll('dict'):
                for k in s.findAll('key'):
                    if k.string == 'previewURL':
                        url = k.nextSibling.string
                        if quality_id in url:
                            return ('%s?|User-Agent=%s' % (url, self.UA))
        except:            
            url=self.BACKUP_MOVIE_BASE % movie['movie_string']
            tree = None
            if quality_id=='h480p.mov':
                tree=self.__get_tree(url + 'itsxml/25-'+trailer_type+'.xml')
            if quality_id=='h720p.mov':
                tree=self.__get_tree(url + 'itsxml/26-'+trailer_type+'.xml')
            if quality_id=='h1080p.mov':
                tree=self.__get_tree(url + 'itsxml/27-'+trailer_type+'.xml')
            for s in tree.findAll('dict'):
                for k in s.findAll('key'):                
                    if k.string == 'URL':
                        url = k.nextSibling.string
                        if quality_id in url:
                            return ('%s?|User-Agent=%s' % (url, self.UA))

Furthermore please add the following two lines in the beginning of the file right after MOVIE_URL='...'
Code:
BACKUP_MOVIE_URL='http://trailers.apple.com/trailers/%s/includes/playlists/web.inc'
    BACKUP_MOVIE_BASE='http://trailers.apple.com/trailers/%s/'

If i find out how to attach a file, i will do that ...

Hope that helps




RE: [RELEASE] The Trailers - darkscout - 2013-01-21

So far so good.


RE: [RELEASE] The Trailers - Hitcher - 2013-01-21

Working here, thanks.

Full file, right click and save as 'apple_trailers.py' -

apple_trailers.py


RE: [RELEASE] The Trailers - cruzannavy - 2013-01-21

Im assuming this only work for Eden and not Frodo RC3. I know this plugin needs to be rebuilt but i was just hoping it might work.. and it didnt work on Frodo RC3 but Thanks to all of you for making this addon


RE: [RELEASE] The Trailers - Hitcher - 2013-01-21

The fixed version is now in the official Frodo repo.

Changelog -

1.9.4
- Frodo bump

0.9.4
- Fix apple trailers thx to "el.kiwi"

0.9.3
- Fix empty ListItem.Art(thumb)
- Fix error when canncelling if asked for download path

0.9.2
- Added Couchpotato v2 support in settings

0.9.0
- Catch error when no trailers types are avaiable

0.9.0
- Eden repo release


RE: [RELEASE] The Trailers - curtis-r - 2013-01-21

(2013-01-21, 16:58)cruzannavy Wrote: Im assuming this only work for Eden and not Frodo RC3. I know this plugin needs to be rebuilt but i was just hoping it might work.. and it didnt work on Frodo RC3

Just tried it on a nearly clean install at my office. Worked for Eden. Worked for Frodo RC3. Big thanks to all. This was a heavily used add-on by me.