The branch, eden-pre has been updated
via e31e29c04c84db01b3c41b345478af4c53658bc7 (commit)
via 5c6eb4857e70e55d13ecd3fe5fcc9c271e9536d0 (commit)
from bdccf04856c6630024886df827efc81d56c90108 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=e31e29c04c84db01b3c41b345478af4c53658bc7
commit e31e29c04c84db01b3c41b345478af4c53658bc7
Author: spiff <[email protected]>
Date: Thu Feb 23 18:14:15 2012 +0100
[plugin.video.drnu] updated to version 2.1.3
diff --git a/plugin.video.drnu/addon.py b/plugin.video.drnu/addon.py
index 69f5dec..a01ee9f 100644
--- a/plugin.video.drnu/addon.py
+++ b/plugin.video.drnu/addon.py
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2011 Tommy Winther
+# Copyright (C) 2012 Tommy Winther
# http://tommy.winther.nu
#
# This Program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with XBMC; see the file COPYING. If not, write to
+# along with this Program; see the file LICENSE.txt. If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
# http://www.gnu.org/copyleft/gpl.html
#
@@ -24,7 +24,6 @@ import urlparse
import urllib2
import re
import datetime
-import random
import xbmc
import xbmcgui
@@ -384,7 +383,8 @@ class NuAddon(object):
xbmcgui.Dialog().ok(ADDON.getLocalizedString(30008),
ADDON.getLocalizedString(30009))
def delFavorite(self, slug):
- self.favorites.remove(slug)
+ if self.favorites.count(slug):
+ self.favorites.remove(slug)
self._save()
xbmcgui.Dialog().ok(ADDON.getLocalizedString(30008),
ADDON.getLocalizedString(30010))
@@ -396,7 +396,7 @@ class NuAddon(object):
self._save()
def displayError(self, message = 'n/a'):
- heading = ADDON.getLocalizedString(random.randint(99980, 99985))
+ heading = buggalo.getRandomHeading()
line1 = ADDON.getLocalizedString(30900)
line2 = ADDON.getLocalizedString(30901)
xbmcgui.Dialog().ok(heading, line1, line2, message)
@@ -414,6 +414,7 @@ if __name__ == '__main__':
FAVORITES_PATH = os.path.join(CACHE_PATH, 'favorites.pickle')
RECENT_PATH = os.path.join(CACHE_PATH, 'recent.pickle')
+ buggalo.SUBMIT_URL = 'http://tommy.winther.nu/exception/submit.php'
nuAddon = NuAddon()
try:
if PARAMS.has_key('show'):
diff --git a/plugin.video.drnu/addon.xml b/plugin.video.drnu/addon.xml
index fae54a5..b79d2ba 100644
--- a/plugin.video.drnu/addon.xml
+++ b/plugin.video.drnu/addon.xml
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.drnu" version="2.1.1" name="DR NU Player"
provider-name="twinther [[email protected]]">
+<addon id="plugin.video.drnu" version="2.1.3" name="DR NU Player"
provider-name="twinther [[email protected]]">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
+ <import addon="script.module.buggalo" version="1.0.0"/>
</requires>
<extension point="xbmc.python.pluginsource" library="addon.py">
<provides>video</provides>
diff --git a/plugin.video.drnu/changelog.txt b/plugin.video.drnu/changelog.txt
index 0c18135..e03f022 100644
--- a/plugin.video.drnu/changelog.txt
+++ b/plugin.video.drnu/changelog.txt
@@ -1,3 +1,11 @@
+[B]Version 2.1.3 - 2012-02-15[/B]
+- Fixed problem with the 'børn' area due to the Danish character
+
+[B]Version 2.1.2 - 2012-02-05[/B]
+- Fixed problem with removing favorites twice
+- Better handle time-outs and other error scenarios from DR NU
+- Introduced usage of script.module.buggalo
+
[B]Version 2.1.1 - 2012-01-04[/B]
- Fixed a couple of bugs reported by user using the improved error handling
- Fixed error handling on Windows
diff --git a/plugin.video.drnu/nuapi.py b/plugin.video.drnu/nuapi.py
index 7201f9b..03ad14a 100644
--- a/plugin.video.drnu/nuapi.py
+++ b/plugin.video.drnu/nuapi.py
@@ -51,7 +51,7 @@ class DrNuApi(object):
if label is not None:
seriesWithLabel = list()
for serie in series:
- if label in serie['labels']:
+ if label.decode('utf-8', 'ignore') in serie['labels']:
seriesWithLabel.append(serie)
series = seriesWithLabel
@@ -142,9 +142,12 @@ class DrNuApi(object):
content = self._http_request(path)
if content:
- f = open(cachePath, 'w')
- f.write(content)
- f.close()
+ try:
+ f = open(cachePath, 'w')
+ f.write(content)
+ f.close()
+ except Exception:
+ pass # just too bad if file system is read-only
else:
f = open(cachePath)
@@ -167,7 +170,7 @@ class DrNuApi(object):
u = urllib2.urlopen(API_URL % path)
content = u.read()
u.close()
- except urllib2.URLError, ex:
+ except Exception as ex:
raise DrNuException(ex)
return content
diff --git a/plugin.video.drnu/resources/language/Danish/strings.xml
b/plugin.video.drnu/resources/language/Danish/strings.xml
index 28cbb69..d08afb2 100644
--- a/plugin.video.drnu/resources/language/Danish/strings.xml
+++ b/plugin.video.drnu/resources/language/Danish/strings.xml
@@ -35,18 +35,4 @@
<string id="30900">Der er sket en fejl i kommunikationen med DR
NU.</string>
<string id="30901">Prøv igen senere. Fejlen er:</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.drnu/resources/language/English/strings.xml
b/plugin.video.drnu/resources/language/English/strings.xml
index 5d886b8..fc608dc 100644
--- a/plugin.video.drnu/resources/language/English/strings.xml
+++ b/plugin.video.drnu/resources/language/English/strings.xml
@@ -35,19 +35,4 @@
<string id="30900">There was an error while communication with DR
NU.</string>
<string id="30901">Please try again later. Error message is:</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>
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=5c6eb4857e70e55d13ecd3fe5fcc9c271e9536d0
commit 5c6eb4857e70e55d13ecd3fe5fcc9c271e9536d0
Author: spiff <[email protected]>
Date: Thu Feb 23 18:12:51 2012 +0100
[plugin.video.yousee.tv] updated to version 2.0.2
diff --git a/plugin.video.yousee.tv/addon.py b/plugin.video.yousee.tv/addon.py
index adf5deb..a1dcb29 100644
--- a/plugin.video.yousee.tv/addon.py
+++ b/plugin.video.yousee.tv/addon.py
@@ -58,8 +58,6 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE)
def showLiveTVChannels(self):
- if not self._checkLogin():
- return
api = ysapi.YouSeeLiveTVApi(CACHE_PATH)
channels = api.allowedChannels()
if not channels:
@@ -85,9 +83,6 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE, succeeded = len(channels) > 0)
def playLiveTVChannel(self, channelId):
- if not self._checkLogin():
- return
-
api = ysapi.YouSeeLiveTVApi(CACHE_PATH)
channel = api.channel(channelId)
stream = api.streamUrl(channelId)
@@ -107,8 +102,6 @@ class YouSeeTv(object):
xbmcplugin.setResolvedUrl(HANDLE, True, item)
def showMovieGenres(self):
- if not self._checkLogin():
- return
api = ysapi.YouSeeMovieApi(CACHE_PATH)
genres = api.genres()
if not genres:
@@ -125,8 +118,6 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE)
def showMoviesInGenre(self, genre):
- if not self._checkLogin():
- return
api = ysapi.YouSeeMovieApi(CACHE_PATH)
moviesInGenre = api.moviesInGenre(genre)
if not moviesInGenre:
@@ -142,8 +133,6 @@ class YouSeeTv(object):
def showMovieThemes(self):
- if not self._checkLogin():
- return
api = ysapi.YouSeeMovieApi(CACHE_PATH)
themes = api.themes()
if not themes:
@@ -161,8 +150,6 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE)
def showMoviesInTheme(self, theme):
- if not self._checkLogin():
- return
api = ysapi.YouSeeMovieApi(CACHE_PATH)
moviesInTheme= api.moviesInTheme(theme)
if not moviesInTheme:
@@ -177,8 +164,6 @@ class YouSeeTv(object):
xbmcplugin.endOfDirectory(HANDLE)
def searchMovies(self):
- if not self._checkLogin():
- return
kbd = xbmc.Keyboard('', 'Search movies')
kbd.doModal()
if kbd.isConfirmed():
@@ -196,19 +181,6 @@ class YouSeeTv(object):
xbmcplugin.setContent(HANDLE, 'movies')
xbmcplugin.endOfDirectory(HANDLE)
- def orderMovie(self, movie_id):
- if not self._checkLogin():
- return
- api = ysapi.YouSeeMovieApi(CACHE_PATH)
- json = api.order(movie_id)
-
- if json and json.has_key('error'):
- self._showError(json['error'])
- return
- else:
- self._showError()
- return
-
def _addMovieDirectoryItem(self, movie):
infoLabels = dict()
infoLabels['title'] = movie['title']
@@ -275,25 +247,14 @@ class YouSeeTv(object):
out.save(path)
- def _checkLogin(self):
- return True # Disable login for now
-
- username = ADDON.getSetting('username')
- password = ADDON.getSetting('password')
-
- if username != '' and password != '':
- xbmc.log('[plugin.video.yousee.tv] Logging in...')
- api = ysapi.YouSeeUsersApi(CACHE_PATH)
- resp = api.login(username, password)
- if resp.has_key('error'):
- self._showError(resp['error'])
- return False
-
- return True
-
def isYouSeeIP(self):
api = ysapi.YouSeeUsersApi(CACHE_PATH)
- if not api.isYouSeeIP() and ADDON.getSetting('warn.if.not.yousee.ip')
== 'true':
+ try:
+ isYouSeeIP = api.isYouSeeIP()
+ except Exception:
+ 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)
@@ -331,8 +292,8 @@ if __name__ == '__main__':
if not os.path.exists(CACHE_PATH):
os.makedirs(CACHE_PATH)
+ ytv = YouSeeTv()
try:
- ytv = YouSeeTv()
if PARAMS.has_key('area') and PARAMS['area'][0] == 'livetv':
ytv.showLiveTVChannels()
elif PARAMS.has_key('channel'):
@@ -351,9 +312,6 @@ if __name__ == '__main__':
elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-search':
ytv.searchMovies()
-# elif PARAMS.has_key('orderMovie'):
-# ytv.orderMovie(PARAMS['orderMovie'][0])
-
elif ADDON.getSetting('hide.movie.area') == 'true':
ytv.isYouSeeIP()
ytv.showLiveTVChannels()
@@ -363,5 +321,8 @@ if __name__ == '__main__':
ytv.isYouSeeIP()
ytv.showOverview()
+ except ysapi.YouSeeApiException, ex:
+ ytv._showError(str(ex))
+
except Exception:
- buggalo.onExceptionRaised()
\ No newline at end of file
+ buggalo.onExceptionRaised()
diff --git a/plugin.video.yousee.tv/addon.xml b/plugin.video.yousee.tv/addon.xml
index a7f5e6c..7ea8d3e 100644
--- a/plugin.video.yousee.tv/addon.xml
+++ b/plugin.video.yousee.tv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.yousee.tv" version="2.0.1" name="YouSee web-tv"
provider-name="twinther [[email protected]]">
+<addon id="plugin.video.yousee.tv" version="2.0.2" name="YouSee web-tv"
provider-name="twinther [[email protected]]">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/plugin.video.yousee.tv/changelog.txt
b/plugin.video.yousee.tv/changelog.txt
index e961800..80a5f3b 100644
--- a/plugin.video.yousee.tv/changelog.txt
+++ b/plugin.video.yousee.tv/changelog.txt
@@ -1,3 +1,6 @@
+[B]Version 2.0.2 - 2012-02-23[/B]
+- Fix problem with YouSee check
+
[B]Version 2.0.1 - 2012-01-13[/B]
- Improved error handling with option for the user to submit exceptions/bugs
- Show warning if not on YouSee Bredbånd connection
diff --git a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
index acfdff0..ae53246 100644
--- a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
@@ -6,7 +6,7 @@
<string id="30003">Søg i film</string>
<string id="30050">Ups, det er pinligt...</string>
- <string id="30051">Streamen kunne ikke afspilles!</string>
+ <string id="30051">Der er sket en fejl i kommunikationen med
YouSee.</string>
<string id="30052">Fejlen fra serveren er:</string>
<string id="30053">Ukendt fejl</string>
diff --git a/plugin.video.yousee.tv/resources/language/English/strings.xml
b/plugin.video.yousee.tv/resources/language/English/strings.xml
index 55f85da..067f225 100644
--- a/plugin.video.yousee.tv/resources/language/English/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/English/strings.xml
@@ -6,7 +6,7 @@
<string id="30003">Search movies</string>
<string id="30050">Oops, sorry about that...</string>
- <string id="30051">The stream could not be started!</string>
+ <string id="30051">There was an error while communication with
YouSee.</string>
<string id="30052">The error from the server is:</string>
<string id="30053">Unknown error</string>
diff --git a/plugin.video.yousee.tv/resources/settings.xml
b/plugin.video.yousee.tv/resources/settings.xml
index 5dad4c7..9c38125 100644
--- a/plugin.video.yousee.tv/resources/settings.xml
+++ b/plugin.video.yousee.tv/resources/settings.xml
@@ -2,10 +2,6 @@
<settings>
<category label="30100">
<setting id="hide.movie.area" label="30101" type="bool"
default="true" />
-<!-- <setting type="sep" />
- <setting type="lsep" label="30104" />
- <setting id="username" label="30102" type="text" />
- <setting id="password" label="30103" type="text" option="hidden" />-->
</category>
<category label="30110">
<setting id="warn.if.not.yousee.ip" label="30111" type="bool"
default="true" />
diff --git a/plugin.video.yousee.tv/ysapi.py b/plugin.video.yousee.tv/ysapi.py
index 50072b1..da3626d 100644
--- a/plugin.video.yousee.tv/ysapi.py
+++ b/plugin.video.yousee.tv/ysapi.py
@@ -25,7 +25,6 @@ import urllib2
import simplejson
import os
import re
-import uuid
import xbmc
@@ -39,10 +38,14 @@ AREA_USERS = 'users'
AREA_TVGUIDE = 'tvguide'
AREA_SYSTEM = 'system'
AREA_CONTENT = 'content'
+AREA_ARCHIVE = 'archive'
METHOD_GET = 'get'
METHOD_POST = 'post'
+class YouSeeApiException(Exception):
+ pass
+
class YouSeeApi(object):
COOKIE_JAR = cookielib.LWPCookieJar()
COOKIES_LWP = 'cookies.lwp'
@@ -76,6 +79,8 @@ class YouSeeApi(object):
self.COOKIE_JAR.save(self.cookieFile, ignore_discard=True,
ignore_expires=True)
except urllib2.HTTPError, error:
json = error.read()
+ except Exception, ex:
+ raise YouSeeApiException(ex)
try:
return simplejson.loads(json)
@@ -100,11 +105,21 @@ class YouSeeLiveTVApi(YouSeeApi):
"""
return self._invoke(AREA_LIVETV, 'popularchannels')
- def allowedChannels(self):
+ def allowedChannels(self, branch = 'yousee'):
"""
Returns list of channels the requesting IP is allowed to stream.
"""
- return self._invoke(AREA_LIVETV, 'allowed_channels')
+ 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)
def suggestedChannels(self):
"""
@@ -194,50 +209,6 @@ class YouSeeMovieApi(YouSeeApi):
'amount' : amount
})
- def order(self, movie_id, reference_id = None, client_ip = None):
- """
- Creates order in yousee.tv backend. This is first step in the two-step
procedure for generating orders
-
- @param movie_id: VodKa ID for movie (VODKxxxxx)
- @param reference_id: Unique reference id for order. This has to be
unique within your API-key
- @param client_ip: Client ip-address
- @return:
- """
- if reference_id is None:
- reference_id = 'plugin.video.yousee.tv-%s' % uuid.uuid1().hex
- xbmc.log("Generated reference_id: %s" % reference_id,
xbmc.LOGDEBUG)
-
- if client_ip is None:
- client_ip =
urllib2.urlopen('http://automation.whatismyip.com/n09230945.asp').read()
- xbmc.log("Looked up client_ip: %s" % client_ip, xbmc.LOGDEBUG)
-
- return self._invoke(AREA_MOVIE, 'order', {
- 'movie_id' : movie_id,
- 'reference_id' : reference_id,
- 'client_ip' : client_ip
- }, METHOD_POST)
-
- def order_confirm(self, order_id, transaction_id, giftcode, fee):
- """
- Confirms order in yousee.tv backend. This is the second step in the
two-step procedure for generating orders.
- A receipt is sent to the customer upon successful confirmation of order
-
- @param order_id: Order id generated in order POST. This is returned as
a POST variable from DIBS in callback request.
- @param transaction_id: Transaction id returned from DIBS (POST
variable name "transact") (optional if giftcode is set)
- @param giftcode: 12-digit yousee giftcode (optional if transaction_id
is set)
- @param fee: fee amount in oere from DIBS (POST variable name "fee")
- @return:
- """
- pass
-
- def playerdata(self, movie_id):
- """
- Returns information needed for embedding player.
-
- @param movie_id: VodKa ID for movie (VODKxxxxx)
- @return:
- """
- pass
class YouSeeTVGuideApi(YouSeeApi):
def channels(self):
@@ -291,13 +262,58 @@ class YouSeeContentApi(YouSeeApi):
"""
Returns editorial teasers from YouSee. (see yousee.tv/film for
reference)
- @param area: Teaser area (allowed areas: movie)
+ @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
+ })
if __name__ == '__main__':
api = YouSeeLiveTVApi('/tmp')
-----------------------------------------------------------------------
Summary of changes:
plugin.video.drnu/addon.py | 11 +-
plugin.video.drnu/addon.xml | 3 +-
plugin.video.drnu/buggalo.py | 117 --------------------
plugin.video.drnu/changelog.txt | 8 ++
plugin.video.drnu/nuapi.py | 13 ++-
.../resources/language/Danish/strings.xml | 14 ---
.../resources/language/English/strings.xml | 15 ---
plugin.video.yousee.tv/addon.py | 61 ++---------
plugin.video.yousee.tv/addon.xml | 2 +-
plugin.video.yousee.tv/changelog.txt | 3 +
.../resources/language/Danish/strings.xml | 2 +-
.../resources/language/English/strings.xml | 2 +-
plugin.video.yousee.tv/resources/settings.xml | 4 -
plugin.video.yousee.tv/ysapi.py | 112 +++++++++++--------
14 files changed, 105 insertions(+), 262 deletions(-)
delete mode 100644 plugin.video.drnu/buggalo.py
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons