The branch, frodo has been updated
via 4f57a4e1b1d6ed75231b343919bf6703ca0827a3 (commit)
from ade9d3e1494081b2ad5b0ee96f8c80c37719db1f (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=4f57a4e1b1d6ed75231b343919bf6703ca0827a3
commit 4f57a4e1b1d6ed75231b343919bf6703ca0827a3
Author: Martijn Kaijser <[email protected]>
Date: Sat Dec 7 21:07:13 2013 +0100
[plugin.video.yousee.tv] 3.0.2
diff --git a/plugin.video.yousee.tv/addon.py b/plugin.video.yousee.tv/addon.py
index cb41f0a..a3b2441 100644
--- a/plugin.video.yousee.tv/addon.py
+++ b/plugin.video.yousee.tv/addon.py
@@ -33,31 +33,6 @@ 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.setProperty('Fanart_Image', FANART_IMAGE)
- url = PATH + '?area=livetv'
- xbmcplugin.addDirectoryItem(HANDLE, url, item, True)
-
- 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.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.setProperty('Fanart_Image', FANART_IMAGE)
- url = PATH + '?area=movie-search'
- xbmcplugin.addDirectoryItem(HANDLE, url, item, True)
-
- xbmcplugin.endOfDirectory(HANDLE)
-
def showLiveTVChannels(self):
api = ysapi.YouSeeLiveTVApi()
channels = api.allowedChannels()
@@ -69,7 +44,7 @@ class YouSeeTv(object):
try:
self._generateChannelIcons(channels)
except Exception:
- xbmc.log("Caught exception whil generating channel icons!")
+ xbmc.log("Caught exception while generating channel icons!")
for channel in channels:
iconImage = os.path.join(CACHE_PATH, str(channel['id']) + '.png')
@@ -123,106 +98,6 @@ class YouSeeTv(object):
host = url[0:url.find('/', 8)]
return host + path
- def showMovieGenres(self):
- api = ysapi.YouSeeMovieApi()
- genres = api.genres()
- if not genres:
- self._showError()
- xbmcplugin.endOfDirectory(HANDLE, False)
- return
-
- for genre in genres:
- 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.endOfDirectory(HANDLE)
-
- def showMoviesInGenre(self, genre):
- api = ysapi.YouSeeMovieApi()
- moviesInGenre = api.moviesInGenre(genre)
- if not moviesInGenre:
- self._showError()
- xbmcplugin.endOfDirectory(HANDLE, False)
- return
-
- for movie in moviesInGenre['movies']:
- self._addMovieDirectoryItem(movie)
-
- xbmcplugin.setContent(HANDLE, 'movies')
- xbmcplugin.endOfDirectory(HANDLE)
-
- def showMovieThemes(self):
- api = ysapi.YouSeeMovieApi()
- themes = api.themes()
- if not themes:
- self._showError()
- xbmcplugin.endOfDirectory(HANDLE, False)
- return
-
- for theme in themes:
- 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.endOfDirectory(HANDLE)
-
- def showMoviesInTheme(self, theme):
- api = ysapi.YouSeeMovieApi()
- moviesInTheme = api.moviesInTheme(theme)
- if not moviesInTheme:
- self._showError()
- xbmcplugin.endOfDirectory(HANDLE, False)
- return
-
- for movie in moviesInTheme['movies']:
- self._addMovieDirectoryItem(movie)
-
- xbmcplugin.setContent(HANDLE, 'movies')
- xbmcplugin.endOfDirectory(HANDLE)
-
- def searchMovies(self):
- kbd = xbmc.Keyboard('', 'Search movies')
- kbd.doModal()
- if kbd.isConfirmed():
- api = ysapi.YouSeeMovieApi()
- movies = api.search(kbd.getText())
- if not movies:
- self._showError()
- xbmcplugin.endOfDirectory(HANDLE, False)
- return
-
- for movie in movies['movies']:
- self._addMovieDirectoryItem(movie)
-
- xbmcplugin.setContent(HANDLE, 'movies')
- xbmcplugin.endOfDirectory(HANDLE)
-
- def _addMovieDirectoryItem(self, movie):
- infoLabels = dict()
- infoLabels['title'] = movie['title']
- infoLabels['plot'] = movie['summary_medium']
- infoLabels['plotoutline'] = movie['summary_short']
- infoLabels['year'] = movie['year']
- infoLabels['duration'] = str(movie['length_in_minutes'])
- infoLabels['cast'] = movie['cast']
- infoLabels['director'] = ' / '.join(movie['directors'])
- infoLabels['mpaa'] = str(movie['age_rating'])
- infoLabels['code'] = str(movie['imdb_id'])
- infoLabels['genre'] = ' / '.join(movie['genres'])
- 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.setProperty('Fanart_Image', FANART_IMAGE)
- url = PATH + '?orderMovie=' + movie['id']
- xbmcplugin.addDirectoryItem(HANDLE, url, item)
-
def _anyChannelIconsMissing(self, channels):
for channel in channels:
path = os.path.join(CACHE_PATH, str(channel['id']) + '.png')
@@ -275,22 +150,15 @@ class YouSeeTv(object):
isYouSeeIP = False
if not isYouSeeIP and ADDON.getSetting('warn.if.not.yousee.ip') ==
'true':
- heading = ADDON.getLocalizedString(99970)
- line1 = ADDON.getLocalizedString(99971)
- line2 = ADDON.getLocalizedString(99972)
- line3 = ADDON.getLocalizedString(99973)
- nolabel = ADDON.getLocalizedString(99974)
- yeslabel = ADDON.getLocalizedString(99975)
+ heading = ADDON.getLocalizedString(30970)
+ line1 = ADDON.getLocalizedString(30971)
+ line2 = ADDON.getLocalizedString(30972)
+ line3 = ADDON.getLocalizedString(309973)
+ nolabel = ADDON.getLocalizedString(30974)
+ yeslabel = ADDON.getLocalizedString(30975)
if xbmcgui.Dialog().yesno(heading, line1, line2, line3, nolabel,
yeslabel):
ADDON.setSetting('warn.if.not.yousee.ip', 'false')
- def _showWarning(self):
- title = ADDON.getLocalizedString(39000)
- line1 = ADDON.getLocalizedString(39001)
- line2 = ADDON.getLocalizedString(39002)
- line3 = ADDON.getLocalizedString(39003)
- xbmcgui.Dialog().ok(title, line1, line2, line3)
-
def _showError(self, description=None):
xbmcplugin.endOfDirectory(HANDLE, succeeded=False)
if description is None:
@@ -315,32 +183,12 @@ if __name__ == '__main__':
ytv = YouSeeTv()
buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php'
try:
- if 'area' in PARAMS and PARAMS['area'][0] == 'livetv':
- ytv.showLiveTVChannels()
- elif 'channel' in PARAMS:
+ if 'channel' in PARAMS:
ytv.playLiveTVChannel(PARAMS['channel'][0])
- elif 'area' in PARAMS and PARAMS['area'][0] == 'movie-genre':
- ytv.showMovieGenres()
- elif 'genre' in PARAMS:
- ytv.showMoviesInGenre(PARAMS['genre'][0])
-
- elif 'area' in PARAMS and PARAMS['area'][0] == 'movie-theme':
- ytv.showMovieThemes()
- elif 'theme' in PARAMS:
- ytv.showMoviesInTheme(PARAMS['theme'][0])
-
- elif 'area' in PARAMS and PARAMS['area'][0] == 'movie-search':
- ytv.searchMovies()
-
- elif ADDON.getSetting('hide.movie.area') == 'true':
- ytv.isYouSeeIP()
- ytv.showLiveTVChannels()
-
else:
- ytv._showWarning()
ytv.isYouSeeIP()
- ytv.showOverview()
+ ytv.showLiveTVChannels()
except ysapi.YouSeeApiException, ex:
ytv._showError(str(ex))
diff --git a/plugin.video.yousee.tv/addon.xml b/plugin.video.yousee.tv/addon.xml
index 63faff7..6fccc79 100644
--- a/plugin.video.yousee.tv/addon.xml
+++ b/plugin.video.yousee.tv/addon.xml
@@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.yousee.tv" version="3.0.1" name="YouSee web-tv"
provider-name="twinther">
+<addon id="plugin.video.yousee.tv" version="3.0.2" name="YouSee web-tv"
provider-name="twinther">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
- <import addon="script.module.buggalo" version="1.1.2"/>
+ <import addon="script.module.buggalo" version="1.1.5"/>
<import addon="script.module.simplejson" version="2.0.10"/>
- <import addon="script.module.pil" version="1.1.7"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
diff --git a/plugin.video.yousee.tv/changelog.txt
b/plugin.video.yousee.tv/changelog.txt
index f68a572..d700fdf 100644
--- a/plugin.video.yousee.tv/changelog.txt
+++ b/plugin.video.yousee.tv/changelog.txt
@@ -1,3 +1,7 @@
+[B]Version 3.0.2 - 2013-12-07[/B]
+- Removed dependency on script.module.pil (seems to be removed in Gotham)
+- Removed Cinema navigation
+
[B]Version 3.0.1 - 2013-04-16[/B]
- Switched to use iPhone streams to get better quality
diff --git a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
index 7df9ede..88aca0c 100644
--- a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
@@ -11,7 +11,6 @@
<string id="30053">Ukendt fejl</string>
<string id="30100">Features</string>
- <string id="30101">Skjul YouSee Cinema navigation</string>
<string id="30102">Brugernavn</string>
<string id="30103">Adgangskode</string>
<string id="30104">Login er ikke nødvendigt for YouSee Bredbånd
kunder</string>
@@ -19,15 +18,10 @@
<string id="30110">Advarsler</string>
<string id="30111">Advar hvis ikke på YouSee Bredbånd
forbindelse</string>
- <string id="39000">Bemærk venligst!</string>
- <string id="39001">Det er desværre ikke muligt at leje film via
YouSee</string>
- <string id="39002">Cinema pt. YouSee arbejder på at få
rettighederne</string>
- <string id="39003">på plads.</string>
-
- <string id="99970">Advarsel!</string>
- <string id="99971">Det ser ud til du ikke befinder dig på en
YouSee</string>
- <string id="99972">Bredbånd internetforbindelse. Denne addon virker
pt.</string>
- <string id="99973">kun for YouSee Bredbånd kunder.</string>
- <string id="99974">OK</string>
- <string id="99975">Vis ikke igen</string>
+ <string id="30970">Advarsel!</string>
+ <string id="30971">Det ser ud til du ikke befinder dig på en
YouSee</string>
+ <string id="30972">Bredbånd internetforbindelse. Denne addon virker
pt.</string>
+ <string id="30973">kun for YouSee Bredbånd kunder.</string>
+ <string id="30974">OK</string>
+ <string id="30975">Vis ikke igen</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 0ebf551..6d51f62 100644
--- a/plugin.video.yousee.tv/resources/language/English/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/English/strings.xml
@@ -11,7 +11,6 @@
<string id="30053">Unknown error</string>
<string id="30100">Features</string>
- <string id="30101">Hide YouSee Cinema navigation</string>
<string id="30102">Username</string>
<string id="30103">Password</string>
<string id="30104">Login not required for YouSee Bredbånd
customers</string>
@@ -19,15 +18,10 @@
<string id="30110">Warnings</string>
<string id="30111">Warn if not on YouSee Bredbånd connection</string>
- <string id="39000">Please note!</string>
- <string id="39001">Unfortunately it is not possible to rent movies
via</string>
- <string id="39002">YouSee Cinema at the moment. YouSee is working
on</string>
- <string id="39003">getting the rights in place.</string>
-
- <string id="99970">Warning!</string>
- <string id="99971">It looks like you are not on a YouSee Bredbånd</string>
- <string id="99972">internet connection. This addon only works for</string>
- <string id="99973">YouSee Bredbånd customers.</string>
- <string id="99974">OK</string>
- <string id="99975">Don't show again</string>
+ <string id="30970">Warning!</string>
+ <string id="30971">It looks like you are not on a YouSee Bredbånd</string>
+ <string id="30972">internet connection. This addon only works for</string>
+ <string id="30973">YouSee Bredbånd customers.</string>
+ <string id="30974">OK</string>
+ <string id="30975">Don't show again</string>
</strings>
diff --git a/plugin.video.yousee.tv/resources/settings.xml
b/plugin.video.yousee.tv/resources/settings.xml
index 9c38125..90ec547 100644
--- a/plugin.video.yousee.tv/resources/settings.xml
+++ b/plugin.video.yousee.tv/resources/settings.xml
@@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<settings>
- <category label="30100">
- <setting id="hide.movie.area" label="30101" type="bool"
default="true" />
- </category>
<category label="30110">
<setting id="warn.if.not.yousee.ip" label="30111" type="bool"
default="true" />
</category>
diff --git a/plugin.video.yousee.tv/ysapi.py b/plugin.video.yousee.tv/ysapi.py
index d0d5db9..6e91c1b 100644
--- a/plugin.video.yousee.tv/ysapi.py
+++ b/plugin.video.yousee.tv/ysapi.py
@@ -21,11 +21,15 @@
#
import urllib
import urllib2
-import simplejson
import re
import xbmc
+try:
+ import json
+except:
+ import simplejson as json
+
API_URL = 'http://api.yousee.tv/rest'
API_KEY = 'HCN2BMuByjWnrBF4rUncEfFBMXDumku7nfT3CMnn'
@@ -37,7 +41,6 @@ AREA_TVGUIDE = 'tvguide'
AREA_SYSTEM = 'system'
AREA_CONTENT = 'content'
AREA_ARCHIVE = 'archive'
-AREA_PLAY = 'play'
METHOD_GET = 'get'
METHOD_POST = 'post'
@@ -63,15 +66,15 @@ class YouSeeApi(object):
xbmc.log("POST data: %s" % urllib.urlencode(params),
xbmc.LOGDEBUG)
r.add_data(urllib.urlencode(params))
u = urllib2.urlopen(r)
- json = u.read()
+ data = u.read()
u.close()
except urllib2.HTTPError, error:
- json = error.read()
+ data = error.read()
except Exception, ex:
raise YouSeeApiException(ex)
try:
- return simplejson.loads(json)
+ return json.loads(data)
except:
return None
@@ -128,215 +131,6 @@ class YouSeeLiveTVApi(YouSeeApi):
return json
-class YouSeeMovieApi(YouSeeApi):
- def themes(self):
- """
- Returns all active themes (themes with one or more movies attached)
- """
- return self._invoke(AREA_MOVIE, 'themes')
-
- def genres(self):
- """
- Returns all active genres (genres with one or more movies attached)
- """
- return self._invoke(AREA_MOVIE, 'genres')
-
- def search(self, query):
- """
- Returns movies matching search query.
- Searches are done on title, cast and director.
- If query is less than 4 chars a LIKE search will be made, and results
returned ordered by title. If query is 4 chars or more a MATCH AGAINST search
will be made, and results returned ordered by score.
- @param query:
- @type query: string
- @return:
- """
- return self._invoke(AREA_MOVIE, 'search', {
- 'query': query
- })
-
- def moviesInGenre(self, genre):
- """
- Returns movies in genre.
- @param genre: Genre
- """
- return self._invoke(AREA_MOVIE, 'movies_in_genre', {
- 'genre': genre
- })
-
- def moviesInTheme(self, theme):
- """
- Returns movies in theme.
- @param theme: Theme
- """
- return self._invoke(AREA_MOVIE, 'movies_in_theme', {
- 'theme': theme
- })
-
- def related(self, movie_id):
- """
-
- @param movie_id: can be both VODKa id and url-id
- @return: List of movies (see moviedata method for description of movie
object)
- """
- return self._invoke(AREA_MOVIE, 'related', {
- 'movie_id': movie_id
- })
-
- def supported_payment_methods(self, amount):
- """
- @param amount:
- @return: List of cards
- """
- return self._invoke(AREA_MOVIE, 'supported_payment_methods', {
- 'amount': amount
- })
-
-
-class YouSeeTVGuideApi(YouSeeApi):
- def channels(self):
- """
- Returns complete channel list ordered in channel packages.
-
- Note: the channel package "Mine Kanaler" contains the default channels
a user should have in her favorites, until overwritten by the user herself.
- """
- return self._invoke(AREA_TVGUIDE, 'channels')
-
- def categories(self):
- """
- Returns complete list of categories
- """
- return self._invoke(AREA_TVGUIDE, 'categories')
-
- def programs(self, channelId, offset=0):
- """
- Returns program list
- """
- 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
- })
-
-
class YouSeeUsersApi(YouSeeApi):
- def login(self, username, password):
- return self._invoke(AREA_USERS, 'login', {
- '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')
-
-
-class YouSeeSystemApi(YouSeeApi):
- def supportmessage(self):
- return self._invoke(AREA_SYSTEM, 'supportmessage')
-
-
-class YouSeeContentApi(YouSeeApi):
- def teasers(self, area):
- """
- Returns editorial teasers from YouSee. (see yousee.tv/film for
reference)
-
- @param area: Teaser area (allowed area: movie)
- @return:
- """
- return self._invoke(AREA_CONTENT, 'teasers', {
- '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):
- """
- Returns program list
- @param channel_id: (optional)
- @param genre_id: Genre ID (optional)
- @param tvdate: yyyy-mm-dd format (optional)
- @return:
- """
- params = dict()
- if channel_id:
- params['channel_id'] = channel_id
- if genre_id:
- params['genre_id'] = genre_id
- if tvdate:
- params['tvdate'] = tvdate
-
- return self._invoke(AREA_ARCHIVE, 'programs', params)
-
- def allowed_channels(self):
- return self._invoke(AREA_ARCHIVE, 'allowed_channels')
-
- def search(self, query, offset=None, limit=None):
- params = dict()
- params['query'] = query
- if offset:
- params['offset'] = offset
- if limit:
- params['limit'] = limit
- return self._invoke(AREA_ARCHIVE, 'search', params)
-
- def streamurl(self, epg_id, client='xbmc'):
- """
-
- @param epg_id: program_id
- @param client:
- @return:
- """
- return self._invoke(AREA_ARCHIVE, 'streamurl', {
- '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()
- json = api.allowedChannels()
-
- # api = YouSeeTVGuideApi()
- # json = api.programs(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()])
-
-----------------------------------------------------------------------
Summary of changes:
plugin.video.yousee.tv/addon.py | 170 +--------------
plugin.video.yousee.tv/addon.xml | 5 +-
plugin.video.yousee.tv/changelog.txt | 4 +
.../resources/language/Danish/strings.xml | 18 +-
.../resources/language/English/strings.xml | 18 +-
plugin.video.yousee.tv/resources/settings.xml | 3 -
plugin.video.yousee.tv/ysapi.py | 222 +-------------------
7 files changed, 35 insertions(+), 405 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Sponsored by Intel(R) XDK
Develop, test and display web and hybrid apps with a single code base.
Download it for free now!
http://pubads.g.doubleclick.net/gampad/clk?id=111408631&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons