The branch, eden has been updated
via 46f431b03cb72b057dc04178ae29db421f44a629 (commit)
via 1f1ec436121d12982c1acb9dd28da60c082b73cc (commit)
from 3108648ea8dd38e3bc01cea770d1ad503ad3f5cb (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=46f431b03cb72b057dc04178ae29db421f44a629
commit 46f431b03cb72b057dc04178ae29db421f44a629
Author: beenje <[email protected]>
Date: Tue Jan 29 22:54:52 2013 +0100
[plugin.video.yousee.tv] updated to version 2.0.3
diff --git a/plugin.video.yousee.tv/addon.py b/plugin.video.yousee.tv/addon.py
index a1dcb29..869fa75 100644
--- a/plugin.video.yousee.tv/addon.py
+++ b/plugin.video.yousee.tv/addon.py
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2012 Tommy Winther
+# Copyright (C) 2013 Tommy Winther
# http://tommy.winther.nu
#
# This Program is free software; you can redistribute it and/or modify
@@ -31,26 +31,27 @@ import xbmcaddon
import xbmcgui
import xbmcplugin
+
class YouSeeTv(object):
def showOverview(self):
iconImage = os.path.join(ADDON.getAddonInfo('path'), 'icon.png')
- item = xbmcgui.ListItem(ADDON.getLocalizedString(30000), iconImage =
iconImage)
+ item = xbmcgui.ListItem(ADDON.getLocalizedString(30000),
iconImage=iconImage)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?area=livetv'
xbmcplugin.addDirectoryItem(HANDLE, url, item, True)
- item = xbmcgui.ListItem(ADDON.getLocalizedString(30001), iconImage =
iconImage)
+ item = xbmcgui.ListItem(ADDON.getLocalizedString(30001),
iconImage=iconImage)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?area=movie-genre'
xbmcplugin.addDirectoryItem(HANDLE, url, item, True)
- item = xbmcgui.ListItem(ADDON.getLocalizedString(30002), iconImage =
iconImage)
+ item = xbmcgui.ListItem(ADDON.getLocalizedString(30002),
iconImage=iconImage)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?area=movie-theme'
xbmcplugin.addDirectoryItem(HANDLE, url, item, True)
- item = xbmcgui.ListItem(ADDON.getLocalizedString(30003), iconImage =
iconImage)
+ item = xbmcgui.ListItem(ADDON.getLocalizedString(30003),
iconImage=iconImage)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?area=movie-search'
xbmcplugin.addDirectoryItem(HANDLE, url, item, True)
@@ -74,22 +75,22 @@ class YouSeeTv(object):
iconImage = os.path.join(CACHE_PATH, str(channel['id']) + '.png')
if not os.path.exists(iconImage):
iconImage = channel['logos']['large']
- item = xbmcgui.ListItem(channel['nicename'], iconImage =
iconImage, thumbnailImage = iconImage)
+ item = xbmcgui.ListItem(channel['nicename'], iconImage=iconImage,
thumbnailImage=iconImage)
item.setProperty('Fanart_Image', FANART_IMAGE)
item.setProperty('IsPlayable', 'true')
url = PATH + '?channel=' + str(channel['id'])
xbmcplugin.addDirectoryItem(HANDLE, url, item)
- xbmcplugin.endOfDirectory(HANDLE, succeeded = len(channels) > 0)
+ xbmcplugin.endOfDirectory(HANDLE, succeeded=len(channels) > 0)
def playLiveTVChannel(self, channelId):
api = ysapi.YouSeeLiveTVApi(CACHE_PATH)
channel = api.channel(channelId)
stream = api.streamUrl(channelId)
- if not stream or not stream.has_key('url') or not stream['url']:
+ if not stream or not 'url' in stream or not stream['url']:
xbmcplugin.setResolvedUrl(HANDLE, False, xbmcgui.ListItem())
- if stream and stream.has_key('error'):
+ if stream and 'error' in stream:
self._showError(stream['error'])
else:
self._showError()
@@ -98,7 +99,7 @@ class YouSeeTv(object):
thumbnailImage = os.path.join(CACHE_PATH, str(channelId) + '.png')
if not os.path.exists(thumbnailImage):
thumbnailImage = channel['logos']['large']
- item = xbmcgui.ListItem(channel['nicename'], path = stream['url'],
thumbnailImage = thumbnailImage)
+ item = xbmcgui.ListItem(channel['nicename'], path=stream['url'],
thumbnailImage=thumbnailImage)
xbmcplugin.setResolvedUrl(HANDLE, True, item)
def showMovieGenres(self):
@@ -110,10 +111,10 @@ class YouSeeTv(object):
return
for genre in genres:
- item = xbmcgui.ListItem(genre['name'] + ' (' + str(genre['count'])
+ ')', iconImage = ICON)
+ item = xbmcgui.ListItem(genre['name'] + ' (' + str(genre['count'])
+ ')', iconImage=ICON)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?genre=' + genre['url_id']
- xbmcplugin.addDirectoryItem(HANDLE, url, item, isFolder = True,
totalItems = int(genre['count']))
+ xbmcplugin.addDirectoryItem(HANDLE, url, item, isFolder=True,
totalItems=int(genre['count']))
xbmcplugin.endOfDirectory(HANDLE)
@@ -131,7 +132,6 @@ class YouSeeTv(object):
xbmcplugin.setContent(HANDLE, 'movies')
xbmcplugin.endOfDirectory(HANDLE)
-
def showMovieThemes(self):
api = ysapi.YouSeeMovieApi(CACHE_PATH)
themes = api.themes()
@@ -140,18 +140,17 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE, False)
return
-
for theme in themes:
- item = xbmcgui.ListItem(theme['name'] + ' (' + str(theme['count'])
+ ')', iconImage = ICON)
+ item = xbmcgui.ListItem(theme['name'] + ' (' + str(theme['count'])
+ ')', iconImage=ICON)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?genre=' + theme['url_id']
- xbmcplugin.addDirectoryItem(HANDLE, url, item, isFolder = True,
totalItems = int(theme['count']))
+ xbmcplugin.addDirectoryItem(HANDLE, url, item, isFolder=True,
totalItems=int(theme['count']))
xbmcplugin.endOfDirectory(HANDLE)
def showMoviesInTheme(self, theme):
api = ysapi.YouSeeMovieApi(CACHE_PATH)
- moviesInTheme= api.moviesInTheme(theme)
+ moviesInTheme = api.moviesInTheme(theme)
if not moviesInTheme:
self._showError()
xbmcplugin.endOfDirectory(HANDLE, False)
@@ -174,7 +173,6 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE, False)
return
-
for movie in movies['movies']:
self._addMovieDirectoryItem(movie)
@@ -193,13 +191,13 @@ class YouSeeTv(object):
infoLabels['mpaa'] = str(movie['age_rating'])
infoLabels['code'] = str(movie['imdb_id'])
infoLabels['genre'] = ' / '.join(movie['genres'])
- if movie['trailer'].has_key('rtmpe'):
+ if 'rtmpe' in movie['trailer']:
infoLabels['trailer'] = movie['trailer']['rtmpe']
iconImage = movie['cover_prefix'] + movie['covers']['big']
- item = xbmcgui.ListItem(movie['title'] + ' (DKK ' +
str(movie['price']) + ')', iconImage = iconImage)
- item.setInfo('video', infoLabels = infoLabels)
+ item = xbmcgui.ListItem(movie['title'] + ' (DKK ' +
str(movie['price']) + ')', iconImage=iconImage)
+ item.setInfo('video', infoLabels=infoLabels)
item.setProperty('Fanart_Image', FANART_IMAGE)
url = PATH + '?orderMovie=' + movie['id']
xbmcplugin.addDirectoryItem(HANDLE, url, item)
@@ -222,12 +220,13 @@ class YouSeeTv(object):
if self._anyChannelIconsMissing(channels):
import PIL.Image
- sys.modules['Image'] = PIL.Image #
http://projects.scipy.org/scipy/ticket/1374
+
+ sys.modules['Image'] = PIL.Image #
http://projects.scipy.org/scipy/ticket/1374
for channel in channels:
path = os.path.join(CACHE_PATH, str(channel['id']) + '.png')
xbmc.log("Generating image for " + channel['nicename'] + "...")
-
+
u = urllib2.urlopen(channel['logos']['large'])
data = u.read()
u.close()
@@ -250,7 +249,7 @@ class YouSeeTv(object):
def isYouSeeIP(self):
api = ysapi.YouSeeUsersApi(CACHE_PATH)
try:
- isYouSeeIP = api.isYouSeeIP()
+ isYouSeeIP = api.isYouSeeIP()['status'] == 1
except Exception:
isYouSeeIP = False
@@ -272,11 +271,12 @@ class YouSeeTv(object):
line3 = ADDON.getLocalizedString(39003)
xbmcgui.Dialog().ok(title, line1, line2, line3)
- def _showError(self, description = None):
+ def _showError(self, description=None):
+ xbmcplugin.endOfDirectory(HANDLE, succeeded=False)
if description is None:
description = ADDON.getLocalizedString(30053)
xbmcgui.Dialog().ok(ADDON.getLocalizedString(30050),
ADDON.getLocalizedString(30051),
- ADDON.getLocalizedString(30052), description)
+ ADDON.getLocalizedString(30052), description)
if __name__ == '__main__':
@@ -294,22 +294,22 @@ if __name__ == '__main__':
ytv = YouSeeTv()
try:
- if PARAMS.has_key('area') and PARAMS['area'][0] == 'livetv':
+ if 'area' in PARAMS and PARAMS['area'][0] == 'livetv':
ytv.showLiveTVChannels()
- elif PARAMS.has_key('channel'):
+ elif 'channel' in PARAMS:
ytv.playLiveTVChannel(PARAMS['channel'][0])
- elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-genre':
+ elif 'area' in PARAMS and PARAMS['area'][0] == 'movie-genre':
ytv.showMovieGenres()
- elif PARAMS.has_key('genre'):
+ elif 'genre' in PARAMS:
ytv.showMoviesInGenre(PARAMS['genre'][0])
- elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-theme':
+ elif 'area' in PARAMS and PARAMS['area'][0] == 'movie-theme':
ytv.showMovieThemes()
- elif PARAMS.has_key('theme'):
+ elif 'theme' in PARAMS:
ytv.showMoviesInTheme(PARAMS['theme'][0])
- elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-search':
+ elif 'area' in PARAMS and PARAMS['area'][0] == 'movie-search':
ytv.searchMovies()
elif ADDON.getSetting('hide.movie.area') == 'true':
diff --git a/plugin.video.yousee.tv/addon.xml b/plugin.video.yousee.tv/addon.xml
index 7ea8d3e..f67b408 100644
--- a/plugin.video.yousee.tv/addon.xml
+++ b/plugin.video.yousee.tv/addon.xml
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.yousee.tv" version="2.0.2" name="YouSee web-tv"
provider-name="twinther [[email protected]]">
+<addon id="plugin.video.yousee.tv" version="2.0.3" name="YouSee web-tv"
provider-name="twinther [[email protected]]">
<requires>
<import addon="xbmc.python" version="2.0"/>
+ <import addon="script.module.buggalo" version="1.1.2"/>
<import addon="script.module.simplejson" version="2.0.10"/>
<import addon="script.module.pil" version="1.1.7"/>
</requires>
diff --git a/plugin.video.yousee.tv/changelog.txt
b/plugin.video.yousee.tv/changelog.txt
index 80a5f3b..abb48ab 100644
--- a/plugin.video.yousee.tv/changelog.txt
+++ b/plugin.video.yousee.tv/changelog.txt
@@ -1,3 +1,7 @@
+[B]Version 2.0.3 - 2013-01-27[/B]
+- Updated to use script.module.buggalo
+- Fixed a couple minor programs reported by buggalo
+
[B]Version 2.0.2 - 2012-02-23[/B]
- Fix problem with YouSee check
diff --git a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
index ae53246..7df9ede 100644
--- a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
@@ -30,18 +30,4 @@
<string id="99973">kun for YouSee Bredbånd kunder.</string>
<string id="99974">OK</string>
<string id="99975">Vis ikke igen</string>
-
- <string id="99980">Game over, man! [I]Game over![/I]</string>
- <string id="99981">You can't handle the truth!</string>
- <string id="99982">Danger Will Robinson</string>
- <string id="99983">Why does it cry, Sméagol?</string>
- <string id="99984">Houston, we have a problem...</string>
- <string id="99985">E.T. phone home</string>
-
- <string id="99990">Der er desværre opstået en fejl i addon'en.</string>
- <string id="99991">Du kan hjælpe med at løse fejlen ved at indsende
en</string>
- <string id="99992">fejlrapport. Der sendes ikke personlige
oplysninger.</string>
- <string id="99993">Indsend fejlrapport</string>
- <string id="99994">Indsend ikke</string>
- <string id="99995">Tak!</string>
</strings>
diff --git a/plugin.video.yousee.tv/resources/language/English/strings.xml
b/plugin.video.yousee.tv/resources/language/English/strings.xml
index 067f225..0ebf551 100644
--- a/plugin.video.yousee.tv/resources/language/English/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/English/strings.xml
@@ -30,18 +30,4 @@
<string id="99973">YouSee Bredbånd customers.</string>
<string id="99974">OK</string>
<string id="99975">Don't show again</string>
-
- <string id="99980">Game over, man! [I]Game over![/I]</string>
- <string id="99981">You can't handle the truth!</string>
- <string id="99982">Danger Will Robinson</string>
- <string id="99983">Why does it cry, Sméagol?</string>
- <string id="99984">Houston, we have a problem...</string>
- <string id="99985">E.T. phone home</string>
-
- <string id="99990">Unfortunately an error occurred in the addon.</string>
- <string id="99991">You can help with fixing the problem by
submitting</string>
- <string id="99992">an error report. No personal information is
sent.</string>
- <string id="99993">Submit error report</string>
- <string id="99994">Don't submit</string>
- <string id="99995">Thank you!</string>
</strings>
diff --git a/plugin.video.yousee.tv/ysapi.py b/plugin.video.yousee.tv/ysapi.py
index da3626d..4be7729 100644
--- a/plugin.video.yousee.tv/ysapi.py
+++ b/plugin.video.yousee.tv/ysapi.py
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2012 Tommy Winther
+# Copyright (C) 2013 Tommy Winther
# http://tommy.winther.nu
#
# This Program is free software; you can redistribute it and/or modify
@@ -39,13 +39,16 @@ AREA_TVGUIDE = 'tvguide'
AREA_SYSTEM = 'system'
AREA_CONTENT = 'content'
AREA_ARCHIVE = 'archive'
+AREA_PLAY = 'play'
METHOD_GET = 'get'
METHOD_POST = 'post'
+
class YouSeeApiException(Exception):
pass
+
class YouSeeApi(object):
COOKIE_JAR = cookielib.LWPCookieJar()
COOKIES_LWP = 'cookies.lwp'
@@ -54,11 +57,14 @@ class YouSeeApi(object):
xbmc.log('YouSeeApi.__init__(dataPath = %s)' % dataPath, xbmc.LOGDEBUG)
self.cookieFile = os.path.join(dataPath, self.COOKIES_LWP)
if os.path.isfile(self.cookieFile):
- self.COOKIE_JAR.load(self.cookieFile, ignore_discard=True,
ignore_expires=True)
+ try:
+ self.COOKIE_JAR.load(self.cookieFile, ignore_discard=True,
ignore_expires=True)
+ except cookielib.LoadError:
+ pass # ignore
urllib2.install_opener(urllib2.build_opener(urllib2.HTTPCookieProcessor(self.COOKIE_JAR)))
- def _invoke(self, area, function, params = None, method = METHOD_GET):
+ def _invoke(self, area, function, params=None, method=METHOD_GET):
url = API_URL + '/' + area + '/' + function
if method == METHOD_GET and params:
for key, value in params.items():
@@ -68,7 +74,7 @@ class YouSeeApi(object):
xbmc.log('Invoking URL: %s' % re.sub('/password/([^/]+)/',
'/password/****/', url), xbmc.LOGDEBUG)
try:
- r = urllib2.Request(url, headers = {'X-API-KEY' : API_KEY})
+ r = urllib2.Request(url, headers={'X-API-KEY': API_KEY})
if method == METHOD_POST and params:
xbmc.log("POST data: %s" % urllib.urlencode(params),
xbmc.LOGDEBUG)
r.add_data(urllib.urlencode(params))
@@ -84,9 +90,10 @@ class YouSeeApi(object):
try:
return simplejson.loads(json)
- except simplejson.JSONDecodeError:
+ except:
return None
+
class YouSeeLiveTVApi(YouSeeApi):
def channel(self, id):
"""
@@ -96,8 +103,9 @@ class YouSeeLiveTVApi(YouSeeApi):
@return:
"""
return self._invoke(AREA_LIVETV, 'channel', {
- 'id' : id
+ 'id': id
})
+
def popularChannels(self):
"""
Returns list of channels sorted by popularity.
@@ -105,21 +113,11 @@ class YouSeeLiveTVApi(YouSeeApi):
"""
return self._invoke(AREA_LIVETV, 'popularchannels')
- def allowedChannels(self, branch = 'yousee'):
+ def allowedChannels(self):
"""
Returns list of channels the requesting IP is allowed to stream.
"""
- params = dict()
- if branch == 'tdc':
- params['branch'] = branch
- try:
- u =
urllib2.urlopen('http://automation.whatismyip.com/n09230945.asp')
- params['clientip'] = u.read()
- u.close()
- except urllib2.URLError:
- pass
-
- return self._invoke(AREA_LIVETV, 'allowed_channels', params)
+ return self._invoke(AREA_LIVETV, 'allowed_channels')
def suggestedChannels(self):
"""
@@ -128,8 +126,7 @@ class YouSeeLiveTVApi(YouSeeApi):
"""
return self._invoke(AREA_LIVETV, 'suggested_channels')
-
- def streamUrl(self, channelId, client = 'xbmc'):
+ def streamUrl(self, channelId, client='xbmc'):
"""
Returns absolute streaming URL for channel.
Channel rights are based on client ip address.
@@ -140,12 +137,13 @@ class YouSeeLiveTVApi(YouSeeApi):
@type client: str
"""
json = self._invoke(AREA_LIVETV, 'streamurl', {
- 'channel_id' : channelId,
- 'client' : client
+ 'channel_id': channelId,
+ 'client': client
})
return json
+
class YouSeeMovieApi(YouSeeApi):
def themes(self):
"""
@@ -169,7 +167,7 @@ class YouSeeMovieApi(YouSeeApi):
@return:
"""
return self._invoke(AREA_MOVIE, 'search', {
- 'query' : query
+ 'query': query
})
def moviesInGenre(self, genre):
@@ -178,7 +176,7 @@ class YouSeeMovieApi(YouSeeApi):
@param genre: Genre
"""
return self._invoke(AREA_MOVIE, 'movies_in_genre', {
- 'genre' : genre
+ 'genre': genre
})
def moviesInTheme(self, theme):
@@ -187,7 +185,7 @@ class YouSeeMovieApi(YouSeeApi):
@param theme: Theme
"""
return self._invoke(AREA_MOVIE, 'movies_in_theme', {
- 'theme' : theme
+ 'theme': theme
})
def related(self, movie_id):
@@ -197,7 +195,7 @@ class YouSeeMovieApi(YouSeeApi):
@return: List of movies (see moviedata method for description of movie
object)
"""
return self._invoke(AREA_MOVIE, 'related', {
- 'movie_id' : movie_id
+ 'movie_id': movie_id
})
def supported_payment_methods(self, amount):
@@ -206,7 +204,7 @@ class YouSeeMovieApi(YouSeeApi):
@return: List of cards
"""
return self._invoke(AREA_MOVIE, 'supported_payment_methods', {
- 'amount' : amount
+ 'amount': amount
})
@@ -225,38 +223,47 @@ class YouSeeTVGuideApi(YouSeeApi):
"""
return self._invoke(AREA_TVGUIDE, 'categories')
- def programs(self, channelId, offset = 0):
- """
+ def programs(self, channelId, offset=0):
+ """
Returns program list
"""
- return self._invoke(AREA_TVGUIDE, 'programs', {
- 'channel_id' : channelId,
- 'offset' : offset
- })
+ return self._invoke(AREA_TVGUIDE, 'programs', {
+ 'channel_id': channelId,
+ 'offset': offset
+ })
+
class YouSeePlayApi(YouSeeApi):
def album(self, id):
return self._invoke(AREA_PLAY, 'album', {
- 'id' : id
+ 'id': id
})
+
class YouSeeUsersApi(YouSeeApi):
def login(self, username, password):
return self._invoke(AREA_USERS, 'login', {
- 'username' : username,
- 'password' : password
+ 'username': username,
+ 'password': password
+ })
+
+ def user(self, session_id):
+ return self._invoke(AREA_USERS, 'user', {
+ 'yspro': session_id
})
def transactions(self):
return self._invoke(AREA_USERS, 'transactions')
def isYouSeeIP(self):
- return self._invoke(AREA_USERS, 'isyouseeip') == 1
+ return self._invoke(AREA_USERS, 'isyouseeip')
+
class YouSeeSystemApi(YouSeeApi):
def supportmessage(self):
return self._invoke(AREA_SYSTEM, 'supportmessage')
+
class YouSeeContentApi(YouSeeApi):
def teasers(self, area):
"""
@@ -266,14 +273,15 @@ class YouSeeContentApi(YouSeeApi):
@return:
"""
return self._invoke(AREA_CONTENT, 'teasers', {
- 'area' : area
+ 'area': area
})
+
class YouSeeArchiveApi(YouSeeApi):
def genres(self):
return self._invoke(AREA_ARCHIVE, 'genres')
- def programs(self, channel_id = None, genre_id = None, tvdate = None):
+ def programs(self, channel_id=None, genre_id=None, tvdate=None):
"""
Returns program list
@param channel_id: (optional)
@@ -294,7 +302,7 @@ class YouSeeArchiveApi(YouSeeApi):
def allowed_channels(self):
return self._invoke(AREA_ARCHIVE, 'allowed_channels')
- def search(self, query, offset = None, limit = None):
+ def search(self, query, offset=None, limit=None):
params = dict()
params['query'] = query
if offset:
@@ -303,7 +311,7 @@ class YouSeeArchiveApi(YouSeeApi):
params['limit'] = limit
return self._invoke(AREA_ARCHIVE, 'search', params)
- def streamurl(self, epg_id, client = 'xbmc'):
+ def streamurl(self, epg_id, client='xbmc'):
"""
@param epg_id: program_id
@@ -311,20 +319,40 @@ class YouSeeArchiveApi(YouSeeApi):
@return:
"""
return self._invoke(AREA_ARCHIVE, 'streamurl', {
- 'epg_id' : epg_id,
- 'client' : client
+ 'epg_id': epg_id,
+ 'client': client
})
+
+class YouSeePlayApi(YouSeeApi):
+ def search(self, query, limit=None, offset=None, startLetter=None):
+ return self._invoke(AREA_PLAY, 'search', {
+ 'query': query.replace(' ', '+')
+ })
+
+ def usersession(self, externalPersonId, email):
+ return self._invoke(AREA_PLAY, 'usersession', {
+ 'external_person_id': externalPersonId,
+ 'email': email
+ })
+
+ def streamUrl(self, trackId, userSession):
+ return self._invoke(AREA_PLAY, 'streamurl', {
+ 'track_id': trackId,
+ 'usersession': userSession
+ })
+
+
if __name__ == '__main__':
api = YouSeeLiveTVApi('/tmp')
- json = api.channel(1)
+ json = api.allowedChannels()
-# api = YouSeeTVGuideApi()
-# json = api.programs(1)
+ # api = YouSeeTVGuideApi()
+ # json = api.programs(1)
-# api = YouSeeMovieApi()
-# json= api.moviesInGenre('action')['movies'][1]
+ # api = YouSeeMovieApi()
+ # json= api.moviesInGenre('action')['movies'][1]
s = simplejson.dumps(json, sort_keys=True, indent=' ')
- print '\n'.join([l.rstrip() for l in s.splitlines()])
+ print '\n'.join([l.rstrip() for l in s.splitlines()])
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=1f1ec436121d12982c1acb9dd28da60c082b73cc
commit 1f1ec436121d12982c1acb9dd28da60c082b73cc
Author: beenje <[email protected]>
Date: Tue Jan 29 22:54:50 2013 +0100
[plugin.video.espn.video] updated to version 1.0.4
diff --git a/plugin.video.espn.video/addon.xml
b/plugin.video.espn.video/addon.xml
index 2277f4a..32bc99c 100644
--- a/plugin.video.espn.video/addon.xml
+++ b/plugin.video.espn.video/addon.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<addon id="plugin.video.espn.video"
name="ESPN Video"
- version="1.0.3"
+ version="1.0.4"
provider-name="stacked">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.espn.video/changelog.txt
b/plugin.video.espn.video/changelog.txt
index ac3f2b3..f13ba3d 100644
--- a/plugin.video.espn.video/changelog.txt
+++ b/plugin.video.espn.video/changelog.txt
@@ -1,4 +1,10 @@
-[B]Version 1.0.3[/B]
+[B]Version 1.0.4[/B]
+
+- Fixed 'status' error when playing videos
+- Fixed 'ascii' errors when searching
+- Fixed 'IndexError' when searching
+
+[B]Version 2.0.3[/B]
- Fixed error when playing videos
- Version bump for Frodo
diff --git a/plugin.video.espn.video/default.py
b/plugin.video.espn.video/default.py
index 4cf2eab..fc3738e 100644
--- a/plugin.video.espn.video/default.py
+++ b/plugin.video.espn.video/default.py
@@ -4,8 +4,8 @@ import xbmc, xbmcgui, xbmcplugin, xbmcaddon, urllib, re,
string, sys, os, buggal
plugin = "ESPN Video"
__author__ = 'stacked <[email protected]>'
__url__ = 'http://code.google.com/p/plugin/'
-__date__ = '01-20-2013'
-__version__ = '1.0.3'
+__date__ = '01-27-2013'
+__version__ = '1.0.4'
settings = xbmcaddon.Addon(id='plugin.video.espn.video')
buggalo.SUBMIT_URL = 'http://www.xbmc.byethost17.com/submit.php'
dbg = False
@@ -23,6 +23,7 @@ common.plugin = plugin + ' ' + __version__
from addonfunc import addListItem, playListItem, getUrl, getPage, setViewMode,
getParameters, retry
+@retry(IndexError)
def build_main_directory():
main=[
( settings.getLocalizedString( 30000 ), tvshows_thumb,
'menu2949050', '1' ),
@@ -41,6 +42,7 @@ def build_main_directory():
build_video_directory('http://espn.go.com/video/format/libraryPlaylist?categoryid=2378529',
'The Latest', 'null')
setViewMode("503")
+@retry(IndexError)
def build_sub_directory(url, thumb):
saveurl = url
html = getUrl('http://espn.go.com/video/')
@@ -72,6 +74,7 @@ def build_sub_directory(url, thumb):
setViewMode("503")
xbmcplugin.endOfDirectory( int( sys.argv[1] ) )
+@retry(IndexError)
def build_video_directory(url, name, type):
nextname = name
if name == settings.getLocalizedString( 30005 ):
@@ -93,10 +96,15 @@ def build_video_directory(url, name, type):
newStr = getParameters(url)["searchString"]
url = 'http://search.espn.go.com/results?searchString=' +
newStr + '&start=' + str(int(page) * 16) + '&dims=6'
nexturl = url
- html = getUrl(url)
+ html = getUrl(url).decode('ascii', 'ignore')
results = common.parseDOM(html, "li", attrs = { "class":
"result video-result" })
titledata = common.parseDOM(results, "h3")
title = common.parseDOM(titledata, "a", attrs = { "rel":
"nofollow" })
+ if len(title) == 0:
+ dialog = xbmcgui.Dialog()
+ ok = dialog.ok( plugin , settings.getLocalizedString(
30013 ) + '\n' + settings.getLocalizedString( 30014 ) )
+ remove_menu(newStr,'search')
+ return
img = common.parseDOM(results, "a", attrs = { "class":
"list-thumb" })
desc = common.parseDOM(results, "p")
thumb = common.parseDOM(img, "img", ret = "src" )
@@ -104,11 +112,6 @@ def build_video_directory(url, name, type):
maxlength = common.parseDOM(pagenum, "span")[1].replace('of
','')
value = common.parseDOM(pagenum, "input", attrs = { "id":
"page-number" }, ret = "value" )[0]
pagecount = [ value, maxlength ]
- if len(title) == 0:
- dialog = xbmcgui.Dialog()
- ok = dialog.ok( plugin , settings.getLocalizedString(
30013 ) + '\n' + settings.getLocalizedString( 30014 ) )
- remove_menu(newStr,'search')
- return
else:
nexturl = url
html = getUrl(url + "&pageNum=" + str(int(page)) +
"&sortBy=&assetURL=http://assets.espn.go.com&module=LibraryPlaylist&pagename=vhub_index")
@@ -119,13 +122,24 @@ def build_video_directory(url, name, type):
pagecount = common.parseDOM(html, "div", attrs = { "class":
"page-numbers" })[0].rsplit(' of ')
item_count = 0
for name in title:
- plot = desc[item_count]
- data =
thumb[item_count].replace('_thumdnail_wbig.jpg','').replace('.jpg','').rsplit('/')[-4:]
- url = data[0] + '/' + data[1] + '/' + data[2] + '/' + data[3]
- thumbnailImage = thumb[item_count].replace('_thumdnail_wbig','')
- u = { 'mode': '3', 'name': name, 'url': url, 'thumb':
thumbnailImage, 'plot': plot }
- infoLabels = { "Title": name, "Plot": name }
- addListItem(label = name, image = thumbnailImage, url = u,
isFolder = False, infoLabels = infoLabels)
+ if '/espn360/' not in thumb[item_count]:
+ if 'http://' in desc[item_count]:
+ plot = name
+ else:
+ plot = desc[item_count]
+ try:
+ data =
thumb[item_count].replace('_thumdnail_wbig.jpg','').replace('.jpg','').rsplit('motion/')
+ url = data[1]
+ except:
+ data =
thumb[item_count].replace('_thumdnail_wbig.jpg','').replace('.jpg','').rsplit('/')[-4:]
+ if len(data) >= 4:
+ url = data[0] + '/' + data[1] + '/' +
data[2] + '/' + data[3]
+ else:
+ url = 'null'
+ thumbnailImage =
thumb[item_count].replace('_thumdnail_wbig','')
+ u = { 'mode': '3', 'name': name, 'url':
url.replace('motion/',''), 'thumb': thumbnailImage, 'plot': plot }
+ infoLabels = { "Title": name, "Plot": plot }
+ addListItem(label = name, image = thumbnailImage, url =
u, isFolder = False, infoLabels = infoLabels)
item_count += 1
if pagecount[0] != pagecount[1]:
u = { 'mode': '2', 'name': nextname, 'url': nexturl, 'page':
str(int(page) + 1), 'type': 'null' }
@@ -191,14 +205,11 @@ def edit_menu(name, url):
xbmc.executebuiltin( "Container.Refresh" )
def play_video(url, name, thumb, plot):
- if plot.find('http://') != -1:
- html = getUrl(plot)
- plot = common.parseDOM(html, "meta", attrs = { "name":
"description" }, ret = "content")[0].replace('ESPN Video: ', '')
infoLabels = { "Title": name, "Studio": plugin, "Plot": plot }
result = getPage("http://vod.espn.go.com/motion/" + url +
".smil?FLVPlaybackVersion=2.1")
if '404' in str(result["error"]):
dialog = xbmcgui.Dialog()
- ok = dialog.ok( plugin , settings.getLocalizedString( 30004 ) +
' (' + str(result["status"]) + ')' )
+ ok = dialog.ok(plugin, settings.getLocalizedString( 30004 ))
return
else:
playpath = "mp4:" + url + "_" + settings.getSetting("quality")
+ ".mp4"
-----------------------------------------------------------------------
Summary of changes:
plugin.video.espn.video/addon.xml | 2 +-
plugin.video.espn.video/changelog.txt | 8 +-
plugin.video.espn.video/default.py | 49 +++++---
plugin.video.yousee.tv/addon.py | 66 +++++-----
plugin.video.yousee.tv/addon.xml | 3 +-
plugin.video.yousee.tv/buggalo.py | 117 ------------------
plugin.video.yousee.tv/changelog.txt | 4 +
.../resources/language/Danish/strings.xml | 14 --
.../resources/language/English/strings.xml | 14 --
plugin.video.yousee.tv/ysapi.py | 126 ++++++++++++--------
10 files changed, 154 insertions(+), 249 deletions(-)
delete mode 100644 plugin.video.yousee.tv/buggalo.py
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. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons