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 - Hitcher - 2013-01-23

Here's my working copy -

Right click and save as 'apple_trailers.py' -

apple_trailers.py


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

@Hitcher,

Your copy works PERFECTLY! Thanks a bunch.


RE: [RELEASE] The Trailers - jdastas - 2013-01-24

(2013-01-23, 09:17)Hitcher Wrote: Here's my working copy -

Right click and save as 'apple_trailers.py' -

apple_trailers.py

how can i use this?


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

Could all the people, who experience the one frame thing post a pastebin link to a debug log, please? And furthermore, did this error occur with trailers which worked before my meddling with the code too or not.

Thanks


@jdastas

Open your xbmc userfolder (Windows: C:\Users\<USERNAME>\AppData\Roaming\Xbmc Linux: /home/<USERNAME>/.xbmc). There open addons -> plugin.video.the.trailers -> resources -> lib and finally the file apple_trailers.py with notepad or any other text editor you got handy. As last step replace the content of your apple_trailers.py with the content of the link provided by Hitcher




RE: [RELEASE] The Trailers - Martijn - 2013-01-24

It works for me. Thx Smile


RE: [RELEASE] The Trailers - aNILEator - 2013-01-25

all tested trailers work except the #1 in the list RED 2, that gives a check internet proxy settings error (for me at least)


Re: RE: [RELEASE] The Trailers - Martijn - 2013-01-25

(2013-01-25, 00:49)aNILEator Wrote: all tested trailers work except the #1 in the list RED 2, that gives a check internet proxy settings error (for me at least)

Played for me on first try


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

That was the error that started this mess in Frodo, but I've had no issues since the latest build, including playing Red 2.


RE: [RELEASE] The Trailers - kevinkelm - 2013-01-25

I am using the latest apple_trailers.py but still get freezing
log
http://pastebin.com/J6y0m58z


RE: [RELEASE] The Trailers - winestock - 2013-01-25

I copied over Hitcher's code and I get a failure when the trailer is attempted to play. Debug log

Items of note from the debug log:
Code:
19:33:14 T:4574838784  NOTICE: Apple scraper: get_trailer_types started with movie_title: Star Trek Into Darkness
19:33:14 T:4574838784  NOTICE: Apple scraper: __get_url started with url=http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/index.xml, cache_filename=startrekintodarkness.xml
19:33:14 T:4574838784  NOTICE: Apple scraper: __get_url opening url: http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/index.xml
19:33:15 T:4574838784  NOTICE: Apple scraper: __get_url started with url=http://trailers.apple.com/trailers/paramount/startrekintodarkness/includes/playlists/web.inc, cache_filename=startrekintodarknesswebinc.xml
19:33:15 T:4574838784  NOTICE: Apple scraper: __get_url using cachefile: /Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/userdata/addon_data/plugin.video.the.trailers/cache/startrekintodarknesswebinc.xml
19:33:15 T:4574838784  NOTICE: Apple scraper: __get_url got 43169 bytes
19:33:16 T:4574838784  NOTICE: Apple scraper: get_trailer_qualities started with movie_title: Star Trek Into Darkness
19:33:16 T:4574838784  NOTICE: Apple scraper: get_trailer_qualities started with movie_title: Star Trek Into Darkness
19:33:16 T:4574838784  NOTICE: Apple scraper: get_trailer started with movie_title: Star Trek Into Darkness trailer_type: teaser quality_id: i320.m4v
19:33:16 T:4574838784  NOTICE: Apple scraper: __get_url started with url=http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/teaser.xml, cache_filename=startrekintodarkness-teaser.xml
19:33:16 T:4574838784  NOTICE: Apple scraper: __get_url opening url: http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/teaser.xml
19:33:17 T:4574838784   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'findAll'
                                            Traceback (most recent call last):
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/addon.py", line 489, in <module>
                                                plugin.run()
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/script.module.xbmcswift/lib/xbmcswift/plugin.py", line 330, in run
                                                self.dispatch(self.path)
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/script.module.xbmcswift/lib/xbmcswift/plugin.py", line 129, in dispatch
                                                return view_func(**items)
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/addon.py", line 171, in get_trailer
                                                source_id, movie_title, is_download=is_download,
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/addon.py", line 470, in __select_check_trailer
                                                trailer_type)
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/resources/lib/apple_trailers.py", line 171, in get_trailer
                                                for s in tree.findAll('dict'):
                                            AttributeError: 'NoneType' object has no attribute 'findAll'
                                            -->End of Python script error report<--
19:33:17 T:140735080116608   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.the.trailers/apple/trailer/Star+Trek+Into+Darkness/play]

I then remove the add-on and installed it again. I get the same problem and the debug log shows the same error above.


RE: [RELEASE] The Trailers - crni - 2013-01-25

Still freezes fro me on first frame Sad
tried deleting and reinstalling and whatnot but no luck...
funny thing is all of the same trailers plays just fine when started using Cinema Experience script which is also streaming from Apple.com Huh


RE: [RELEASE] The Trailers - winestock - 2013-01-25

(2013-01-25, 02:42)winestock Wrote: I copied over Hitcher's code and I get a failure when the trailer is attempted to play. Debug log

Items of note from the debug log:
Code:
19:33:14 T:4574838784  NOTICE: Apple scraper: get_trailer_types started with movie_title: Star Trek Into Darkness
19:33:14 T:4574838784  NOTICE: Apple scraper: __get_url started with url=http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/index.xml, cache_filename=startrekintodarkness.xml
19:33:14 T:4574838784  NOTICE: Apple scraper: __get_url opening url: http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/index.xml
19:33:15 T:4574838784  NOTICE: Apple scraper: __get_url started with url=http://trailers.apple.com/trailers/paramount/startrekintodarkness/includes/playlists/web.inc, cache_filename=startrekintodarknesswebinc.xml
19:33:15 T:4574838784  NOTICE: Apple scraper: __get_url using cachefile: /Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/userdata/addon_data/plugin.video.the.trailers/cache/startrekintodarknesswebinc.xml
19:33:15 T:4574838784  NOTICE: Apple scraper: __get_url got 43169 bytes
19:33:16 T:4574838784  NOTICE: Apple scraper: get_trailer_qualities started with movie_title: Star Trek Into Darkness
19:33:16 T:4574838784  NOTICE: Apple scraper: get_trailer_qualities started with movie_title: Star Trek Into Darkness
19:33:16 T:4574838784  NOTICE: Apple scraper: get_trailer started with movie_title: Star Trek Into Darkness trailer_type: teaser quality_id: i320.m4v
19:33:16 T:4574838784  NOTICE: Apple scraper: __get_url started with url=http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/teaser.xml, cache_filename=startrekintodarkness-teaser.xml
19:33:16 T:4574838784  NOTICE: Apple scraper: __get_url opening url: http://trailers.apple.com/moviesxml/s/paramount/startrekintodarkness/teaser.xml
19:33:17 T:4574838784   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.AttributeError'>
                                            Error Contents: 'NoneType' object has no attribute 'findAll'
                                            Traceback (most recent call last):
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/addon.py", line 489, in <module>
                                                plugin.run()
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/script.module.xbmcswift/lib/xbmcswift/plugin.py", line 330, in run
                                                self.dispatch(self.path)
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/script.module.xbmcswift/lib/xbmcswift/plugin.py", line 129, in dispatch
                                                return view_func(**items)
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/addon.py", line 171, in get_trailer
                                                source_id, movie_title, is_download=is_download,
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/addon.py", line 470, in __select_check_trailer
                                                trailer_type)
                                              File "/Volumes/MacBook_Pro HD/Users/dwinestock/Library/Application Support/XBMC/addons/plugin.video.the.trailers/resources/lib/apple_trailers.py", line 171, in get_trailer
                                                for s in tree.findAll('dict'):
                                            AttributeError: 'NoneType' object has no attribute 'findAll'
                                            -->End of Python script error report<--
19:33:17 T:140735080116608   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.the.trailers/apple/trailer/Star+Trek+Into+Darkness/play]

I then remove the add-on and installed it again. I get the same problem and the debug log shows the same error above.

The issue was that I had the stream quality left at iPod (320). The code does not handle iPod which is why the code crashed.

I do have a fix for this. Replace the existing code starting at line 159 with the following:
Code:
#
        except:            
            url=self.BACKUP_MOVIE_BASE % movie['movie_string']
            tree = None
            if quality_id=='i320.m4v':
                quality_id='h320.mov'
                cache=(movie['movie_string'].split('/')[1])+trailer_type+quality_id+'.xml'
                tree=self.__get_tree(url + 'itsxml/22-'+trailer_type+'.xml',cache_filename=cache)
            if quality_id=='h480p.mov':
                cache=(movie['movie_string'].split('/')[1])+trailer_type+quality_id+'.xml'
                tree=self.__get_tree(url + 'itsxml/25-'+trailer_type+'.xml',cache_filename=cache)
            if quality_id=='h720p.mov':
                cache=(movie['movie_string'].split('/')[1])+trailer_type+quality_id+'.xml'
                tree=self.__get_tree(url + 'itsxml/26-'+trailer_type+'.xml',cache_filename=cache)
            if quality_id=='h1080p.mov':
                cache=(movie['movie_string'].split('/')[1])+trailer_type+quality_id+'.xml'
                tree=self.__get_tree(url + 'itsxml/27-'+trailer_type+'.xml',cache_filename=cache)
            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))

EDIT: Could someone please add this change to the repo. Thanks.


RE: [RELEASE] The Trailers - abba77 - 2013-01-26

i am getting a freeze right away on any trailer using the latest code on any skin: http://pastebin.com/ggRVeqBv


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

For those who did such an awesome job at getting this great add-on up-and-running, is it too soon to bring up a feature that some have suggested in the past? It would be great if the 'download and play' feature allowed background downloading. Since I get 1080p trailers, even with a pretty fast internet connection, it can take up to a couple of minutes to download a trailer, so it would be nice to be able to browse around xbmc rather than just watching a progress bar.

Also, not sure if I'm alone in this, but a 'download only' option would be nice. I often just download trailers, so they are stored locally to watch in the future. If you eliminate the 'play' part, it wouldn't stop music or video that is already playing while I download trailers. Thanks for the consideration.


RE: [RELEASE] The Trailers - aNILEator - 2013-01-28

Have come back today, red 2 is still throwing a proxy error, all others appear fine.
Might just ignore it Tongue