The branch, eden has been updated
via 2e1c5f15d4a1858e66f4f8953c5ec61e5a115539 (commit)
from adc6f7044c7c91c615357e30aa5cf13eaedf9262 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=2e1c5f15d4a1858e66f4f8953c5ec61e5a115539
commit 2e1c5f15d4a1858e66f4f8953c5ec61e5a115539
Author: Martijn Kaijser <[email protected]>
Date: Mon Jan 21 12:47:29 2013 +0100
[plugin.video.the.trailers] -0.9.4
diff --git a/plugin.video.the.trailers/addon.xml
b/plugin.video.the.trailers/addon.xml
index 3f1faf1..27bdda5 100644
--- a/plugin.video.the.trailers/addon.xml
+++ b/plugin.video.the.trailers/addon.xml
@@ -2,7 +2,7 @@
<addon
id="plugin.video.the.trailers"
name="The Trailers"
- version="0.9.3"
+ version="0.9.4"
provider-name="Martijn, Sphere">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.the.trailers/changelog.txt
b/plugin.video.the.trailers/changelog.txt
index 45aa3d6..e62ce69 100644
--- a/plugin.video.the.trailers/changelog.txt
+++ b/plugin.video.the.trailers/changelog.txt
@@ -1,3 +1,6 @@
+[B]0.9.4[/B]
+- Fix apple trailers thx to "el.kiwi"
+
[B]0.9.3[/B]
- Fix empty ListItem.Art(thumb)
- Fix error when canncelling if asked for download path
diff --git a/plugin.video.the.trailers/resources/lib/apple_trailers.py
b/plugin.video.the.trailers/resources/lib/apple_trailers.py
index cd533f9..ef0b720 100644
--- a/plugin.video.the.trailers/resources/lib/apple_trailers.py
+++ b/plugin.video.the.trailers/resources/lib/apple_trailers.py
@@ -30,6 +30,8 @@ class AppleTrailers(object):
MAIN_URL = 'http://trailers.apple.com/trailers/home/xml/current.xml'
MOVIE_URL = 'http://trailers.apple.com/moviesxml/s/%s/index.xml'
+
BACKUP_MOVIE_URL='http://trailers.apple.com/trailers/%s/includes/playlists/web.inc'
+ BACKUP_MOVIE_BASE='http://trailers.apple.com/trailers/%s/'
'''
TRAILER_QUALITIES = [{'title': 'iPod',
'id': 'i320.m4v'},
@@ -106,15 +108,25 @@ class AppleTrailers(object):
% movie_title)
movie = self.get_single_movie(movie_title)
url = self.MOVIE_URL % movie['movie_string']
- 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')
trailer_types = []
- 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})
+ 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
def get_trailer_qualities(self, movie_title):
@@ -128,21 +140,37 @@ class AppleTrailers(object):
% (movie_title, trailer_type, quality_id))
movie = self.get_single_movie(movie_title)
url = self.MOVIE_URL % movie['movie_string']
- 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))
+ 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))
def __get_movies(self):
self.__log('__get_movies started')
@@ -231,4 +259,4 @@ class AppleTrailers(object):
return html
def __log(self, msg):
- print('Apple scraper: %s' % msg)
+ print('Apple scraper: %s' % msg)
\ No newline at end of file
-----------------------------------------------------------------------
Summary of changes:
plugin.video.the.trailers/addon.xml | 2 +-
plugin.video.the.trailers/changelog.txt | 3 +
.../resources/lib/apple_trailers.py | 76 +++++++++++++------
3 files changed, 56 insertions(+), 25 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122412
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons