The branch, eden-pre has been updated
       via  fb86fb2ca2253c036c1d22710b4617be4b5b2430 (commit)
       via  f9c112a2d14780561f01acf9411feba67745ce03 (commit)
      from  51bc1d88e41e6087ece32602577e9cec228fdce9 (commit)

- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=fb86fb2ca2253c036c1d22710b4617be4b5b2430

commit fb86fb2ca2253c036c1d22710b4617be4b5b2430
Author: spiff <[email protected]>
Date:   Fri Jan 13 20:34:41 2012 +0100

    [plugin.video.dr.dk.live] updated to version 2.1.0

diff --git a/plugin.video.dr.dk.live/addon.py b/plugin.video.dr.dk.live/addon.py
index f316fea..0a3dc47 100644
--- a/plugin.video.dr.dk.live/addon.py
+++ b/plugin.video.dr.dk.live/addon.py
@@ -1,12 +1,33 @@
+#
+#      Copyright (C) 2012 Tommy Winther
+#      http://tommy.winther.nu
+#
+#  This Program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2, or (at your option)
+#  any later version.
+#
+#  This Program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  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
+#
 import sys
 import os
-import cgi as urlparse
+import urlparse
+import urllib2
 
-import xbmc
 import xbmcaddon
 import xbmcgui
 import xbmcplugin
 
+import buggalo
+
 from channels import CHANNELS, CATEGORIES, QUALITIES
 
 TITLE_OFFSET = 31000
@@ -29,7 +50,11 @@ class DanishLiveTV(object):
             if not os.path.exists(icon):
                 icon = ICON
 
-            url = channel.get_url(quality)
+            idx = None
+            if channel.get_config_key():
+                idx = int(ADDON.getSetting(channel.get_config_key()))
+
+            url = channel.get_url(quality, idx)
             if url:
                 title = ADDON.getLocalizedString(TITLE_OFFSET + 
channel.get_id())
                 description = ADDON.getLocalizedString(DESCRIPTION_OFFSET + 
channel.get_id())
@@ -55,24 +80,48 @@ class DanishLiveTV(object):
 
         xbmcplugin.endOfDirectory(HANDLE)
 
-
-    def playChannel(self, name):
+    def playChannel(self, id):
         try:
             quality = QUALITIES[int(ADDON.getSetting('quality'))]
         except ValueError:
             quality = QUALITIES[0] # fallback for old settings value
 
         for channel in CHANNELS:
-            if channel.get_name() == name:
+            if str(channel.get_id()) == id:
                 url = channel.get_url(quality)
                 if url:
-                    icon = os.path.join(ADDON.getAddonInfo('path'), 
'resources', 'logos', channel.get_logo())
-                    item = xbmcgui.ListItem(channel.get_name(), 
iconImage=icon, thumbnailImage=icon)
+                    icon = os.path.join(ADDON.getAddonInfo('path'), 
'resources', 'logos', '%d.png' % channel.get_id())
+                    if not os.path.exists(icon):
+                        icon = ICON
+
+                    title = ADDON.getLocalizedString(TITLE_OFFSET + 
channel.get_id())
+                    item = xbmcgui.ListItem(title, iconImage=icon, 
thumbnailImage=icon, path=url)
                     item.setProperty('Fanart_Image', FANART)
                     item.setProperty('IsLive', 'true')
 
-                    p = xbmc.Player()
-                    p.play(url, item)
+                    xbmcplugin.setResolvedUrl(HANDLE, True, item)
+                    break
+
+    def imInDenmark(self):
+        try:
+            u = 
urllib2.urlopen('http://www.dr.dk/nu/api/estoyendinamarca.json')
+            response = u.read()
+            u.close()
+
+            imInDenmark = 'true' == response
+        except urllib2.URLError:
+            # If an error occurred assume we are not in Denmark
+            imInDenmark = False
+
+        if not imInDenmark and ADDON.getSetting('warn.if.not.in.denmark') == 
'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)
+            if xbmcgui.Dialog().yesno(heading, line1, line2, line3, nolabel, 
yeslabel):
+                ADDON.setSetting('warn.if.not.in.denmark', 'false')
 
 
 if __name__ == '__main__':
@@ -84,14 +133,18 @@ if __name__ == '__main__':
     FANART = os.path.join(ADDON.getAddonInfo('path'), 'fanart.jpg')
     ICON = os.path.join(ADDON.getAddonInfo('path'), 'icon.png')
 
-    danishTV = DanishLiveTV()
-    if PARAMS.has_key('playChannel'):
-        danishTV.playChannel(PARAMS['playChannel'][0])
-    elif PARAMS.has_key('category'):
-        danishTV.showChannels(int(PARAMS['category'][0]))
-    elif ADDON.getSetting('group.by.category') == 'true':
-        danishTV.showCategories()
-    else:
-        danishTV.showChannels()
-
+    try:
+        danishTV = DanishLiveTV()
+        if PARAMS.has_key('playChannel'):
+            danishTV.playChannel(PARAMS['playChannel'][0])
+        elif PARAMS.has_key('category'):
+            danishTV.showChannels(int(PARAMS['category'][0]))
+        elif ADDON.getSetting('group.by.category') == 'true':
+            danishTV.imInDenmark()
+            danishTV.showCategories()
+        else:
+            danishTV.imInDenmark()
+            danishTV.showChannels()
+    except Exception:
+        buggalo.onExceptionRaised()
 
diff --git a/plugin.video.dr.dk.live/addon.xml 
b/plugin.video.dr.dk.live/addon.xml
index 9acca15..a58e7f4 100644
--- a/plugin.video.dr.dk.live/addon.xml
+++ b/plugin.video.dr.dk.live/addon.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <addon
-       id="plugin.video.dr.dk.live" version="2.0.4" name="Danish Live TV" 
provider-name="twinther [[email protected]]">
+       id="plugin.video.dr.dk.live" version="2.1.0" name="Danish Live TV" 
provider-name="twinther [[email protected]]">
        <requires>
                <import addon="xbmc.python" version="2.0"/>
        </requires>
diff --git a/plugin.video.dr.dk.live/changelog.txt 
b/plugin.video.dr.dk.live/changelog.txt
index 3b8b3e8..c328763 100644
--- a/plugin.video.dr.dk.live/changelog.txt
+++ b/plugin.video.dr.dk.live/changelog.txt
@@ -1,3 +1,9 @@
+[B]Version 2.1.0 - 2012-01-13[/B]
+- Updated TV2/Regionerne with the changes after January, 11th
+- Added danskespil.dk Lotto
+- Added secondary streams for DRs channel
+- Show warning if not in Denmark
+
 [B]Version 2.0.4 - 2011-12-04[/B]
 - Added more of the TV2/Regions channels and Folketinget TV
 - Added setting to group channels
diff --git a/plugin.video.dr.dk.live/channels.py 
b/plugin.video.dr.dk.live/channels.py
index 5aaae66..d9f1ea6 100644
--- a/plugin.video.dr.dk.live/channels.py
+++ b/plugin.video.dr.dk.live/channels.py
@@ -1,4 +1,22 @@
-__author__ = 'tommy'
+#
+#      Copyright (C) 2012 Tommy Winther
+#      http://tommy.winther.nu
+#
+#  This Program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2, or (at your option)
+#  any later version.
+#
+#  This Program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  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
+#
 
 Q_BEST = 0   # 1700 kb/s
 Q_HIGH = 1   # 1000 kb/s
@@ -15,9 +33,10 @@ CATEGORY_MISC = 30203
 CATEGORIES = {CATEGORY_DR : list(), CATEGORY_TV2_REG : list(), CATEGORY_MISC : 
list()}
 
 class Channel(object):
-    def __init__(self, id, category):
+    def __init__(self, id, category, config_key = None):
         self.id = id
         self.category = category
+        self.config_key = config_key
         self.urls = dict()
 
         CHANNELS.append(self)
@@ -29,14 +48,22 @@ class Channel(object):
         if medium: self.urls[Q_MEDIUM] = medium
         if low: self.urls[Q_LOW] = low
 
-    def get_url(self, quality):
+    def get_url(self, quality, idx = 0):
         if self.urls.has_key(quality):
-            return self.urls[quality]
+            urls = self.urls[quality]
         elif quality == Q_BEST and self.urls.has_key(Q_HIGH):
-            return self.urls[Q_HIGH]
+            urls = self.urls[Q_HIGH]
         else:
             return None
 
+        if type(urls) == list:
+            if len(urls) > idx:
+                return urls[idx]
+            else:
+                return urls[0]
+        else:
+            return urls
+
     def get_id(self):
         return self.id
 
@@ -46,75 +73,80 @@ class Channel(object):
     def get_description(self):
         return ''
 
+    def get_config_key(self):
+        return self.config_key
+
 # http://dr.dk/nu/embed/live?height=467&width=830
 # DR1
-Channel(1, CATEGORY_DR).add_urls(
-    high   = 'rtmp://rtmplive.dr.dk/live/livedr01astream3 live=1',
-    medium = 'rtmp://rtmplive.dr.dk/live/livedr01astream2 live=1',
-    low    = 'rtmp://rtmplive.dr.dk/live/livedr01astream1 live=1')
+Channel(1, CATEGORY_DR, "dr1.stream").add_urls(
+    high   = ['rtmp://rtmplive.dr.dk/live/livedr01astream3 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr01bstream3 live=1'],
+    medium = ['rtmp://rtmplive.dr.dk/live/livedr01astream2 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr01bstream2 live=1'],
+    low    = ['rtmp://rtmplive.dr.dk/live/livedr01astream1 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr01bstream1 live=1'])
 # DR2
-Channel(2, CATEGORY_DR).add_urls(
-    high   = 'rtmp://rtmplive.dr.dk/live/livedr02astream3 live=1',
-    medium = 'rtmp://rtmplive.dr.dk/live/livedr02astream2 live=1',
-    low    = 'rtmp://rtmplive.dr.dk/live/livedr02astream1 live=1')
+Channel(2, CATEGORY_DR, "dr2.stream").add_urls(
+    high   = ['rtmp://rtmplive.dr.dk/live/livedr02astream3 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr02bstream3 live=1'],
+    medium = ['rtmp://rtmplive.dr.dk/live/livedr02astream2 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr02bstream2 live=1'],
+    low    = ['rtmp://rtmplive.dr.dk/live/livedr02astream1 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr02bstream1 live=1'])
 # DR Update
-Channel(3, CATEGORY_DR).add_urls(
-    high   = 'rtmp://rtmplive.dr.dk/live/livedr03astream3 live=1',
-    medium = 'rtmp://rtmplive.dr.dk/live/livedr03astream2 live=1',
-    low    = 'rtmp://rtmplive.dr.dk/live/livedr03astream1 live=1')
+Channel(3, CATEGORY_DR, "drupdate.stream").add_urls(
+    high   = ['rtmp://rtmplive.dr.dk/live/livedr03astream3 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr03bstream3 live=1'],
+    medium = ['rtmp://rtmplive.dr.dk/live/livedr03astream2 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr03bstream2 live=1'],
+    low    = ['rtmp://rtmplive.dr.dk/live/livedr03astream1 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr03bstream1 live=1'])
 # DR K
-Channel(4, CATEGORY_DR).add_urls(
-    high   = 'rtmp://rtmplive.dr.dk/live/livedr04astream3 live=1',
-    medium = 'rtmp://rtmplive.dr.dk/live/livedr04astream2 live=1',
-    low    = 'rtmp://rtmplive.dr.dk/live/livedr04astream1 live=1')
+Channel(4, CATEGORY_DR, "drk.stream").add_urls(
+    high   = ['rtmp://rtmplive.dr.dk/live/livedr04astream3 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr04bstream3 live=1'],
+    medium = ['rtmp://rtmplive.dr.dk/live/livedr04astream2 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr04bstream2 live=1'],
+    low    = ['rtmp://rtmplive.dr.dk/live/livedr04astream1 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr04bstream1 live=1'])
 # DR Ramasjang
-Channel(5, CATEGORY_DR).add_urls(
-    high   = 'rtmp://rtmplive.dr.dk/live/livedr05astream3 live=1',
-    medium = 'rtmp://rtmplive.dr.dk/live/livedr05astream2 live=1',
-    low    = 'rtmp://rtmplive.dr.dk/live/livedr05astream1 live=1')
+Channel(5, CATEGORY_DR, "drramasjang.stream").add_urls(
+    high   = ['rtmp://rtmplive.dr.dk/live/livedr05astream3 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr05bstream3 live=1'],
+    medium = ['rtmp://rtmplive.dr.dk/live/livedr05astream2 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr05bstream2 live=1'],
+    low    = ['rtmp://rtmplive.dr.dk/live/livedr05astream1 live=1', 
'rtmp://rtmplive.dr.dk/live/livedr05bstream1 live=1'])
 # DR HD
-Channel(6, CATEGORY_DR).add_urls(
-    best   = 'rtmp://livetv.gss.dr.dk/live/livedr06astream3 live=1',
-    medium = 'rtmp://livetv.gss.dr.dk/live/livedr06astream2 live=1',
-    low    = 'rtmp://livetv.gss.dr.dk/live/livedr06astream1 live=1')
+Channel(6, CATEGORY_DR, "drhd.stream").add_urls(
+    best   = ['rtmp://livetv.gss.dr.dk/live/livedr06astream3 live=1', 
'rtmp://livetv.gss.dr.dk/live/livedr06bstream3 live=1'],
+    medium = ['rtmp://livetv.gss.dr.dk/live/livedr06astream2 live=1', 
'rtmp://livetv.gss.dr.dk/live/livedr06bstream2 live=1'],
+    low    = ['rtmp://livetv.gss.dr.dk/live/livedr06astream1 live=1', 
'rtmp://livetv.gss.dr.dk/live/livedr06bstream1 live=1'])
 
 # TV2 Fyn
 Channel(100, CATEGORY_TV2_REG).add_urls(
-    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2fyn_1000 live=1')
+    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2fyn_1000 live=1'
+)
 # TV2 Lorry
 Channel(101, CATEGORY_TV2_REG).add_urls(
     best   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry_2000 live=1',
     high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry_1000 live=1',
-    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry_300 live=1')
-# Lorry+
+    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry_300 live=1'
+)
+# TV2 Syd
 Channel(102, CATEGORY_TV2_REG).add_urls(
-    best   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry-plus_2000 
live=1',
-    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry-plus_1000 
live=1',
-    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2lorry-plus_300 live=1')
+    best   = 'rtmp://80.63.11.91:1935/live/_definst_/tvsyd_2000 live=1',
+    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tvsyd_1000 live=1',
+    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tvsyd_300 live=1'
+)
 # TV2 Midtvest
-Channel(103, CATEGORY_TV2_REG).add_urls(
-    high   = 'http://ms1.tvmidtvest.dk/frokosttv')
+#Channel(103, CATEGORY_TV2_REG).add_urls(
+#    high   = 'http://ms1.tvmidtvest.dk/frokosttv')
 # TV2 Nord
-Channel(104, CATEGORY_TV2_REG).add_urls(
-    best   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord_2000 live=1',
-    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord_1000 live=1',
-    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord_300 live=1')
-# TV2 NordPlus
 Channel(105, CATEGORY_TV2_REG).add_urls(
     best   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord-plus_2000 live=1',
     high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord-plus_1000 live=1',
-    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord-plus_300 live=1')
+    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2nord-plus_300 live=1'
+)
 # TV2 East
 Channel(106, CATEGORY_TV2_REG).add_urls(
-    high   = 'rtmp://tv2regup1.webhotel.net/videostreaming/ playpath=tv2east 
live=1')
-# Kanal east
-Channel(107, CATEGORY_TV2_REG).add_urls(
-    high   = 'rtmp://tv2regup1.webhotel.net/videostreaming/ playpath=kanaleast 
live=1')
+    best   = 'rtmp://tv2regup1.webhotel.net/videostreaming/ playpath=tv2east 
live=1'
+)
 # TV2 OJ
-Channel(108, CATEGORY_TV2_REG).add_urls(
-    best   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2oj_2000 live=1',
-    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2oj_1000 live=1',
-    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2oj_300 live=1')
+#Channel(108, CATEGORY_TV2_REG).add_urls(
+#    best   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2oj_2000 live=1',
+#    high   = 'rtmp://80.63.11.91:1935/live/_definst_/tv2oj_1000 live=1',
+#    medium = 'rtmp://80.63.11.91:1935/live/_definst_/tv2oj_300 live=1'
+# )
+# TV2 Bornholm
+#Channel(109, CATEGORY_TV2_REG).add_urls(
+#    best   = 'mms://itv02.digizuite.dk/tv2b'
+#)
 
 # http://www.24nordjyske.dk/webtv_high.asp
 # 24 Nordjyske
@@ -126,3 +158,7 @@ Channel(200, CATEGORY_MISC).add_urls(
 # Folketinget
 Channel(201, CATEGORY_MISC).add_urls(
     best   = 'rtmp://ftflash.arkena.dk/webtvftlivefl/ playpath=mp4:live.mp4 
pageUrl=http://www.ft.dk/webTV/TV_kanalen_folketinget.aspx live=1')
+# danskespil lotto
+Channel(202, CATEGORY_MISC).add_urls(
+    best   = 'rtmp://lvs.wowza.jay.net/webstream/lotto live=1'
+)
\ No newline at end of file
diff --git a/plugin.video.dr.dk.live/resources/language/Danish/strings.xml 
b/plugin.video.dr.dk.live/resources/language/Danish/strings.xml
index aa8210a..56f137a 100644
--- a/plugin.video.dr.dk.live/resources/language/Danish/strings.xml
+++ b/plugin.video.dr.dk.live/resources/language/Danish/strings.xml
@@ -3,6 +3,13 @@
     <string id="30100">Generelt</string>
     <string id="30101">Kvalitet</string>
     <string id="30102">Grupper kanalerne</string>
+    <string id="30103">DRs kanaler</string>
+    <string id="30104">Har du problemer med at afspille en af DRs 
kanaler,</string>
+    <string id="30105">så prøv at skifte til den sekundære stream eller 
omvendt.</string>
+    <string id="30106">Primær stream</string>
+    <string id="30107">Sekundær stream</string>
+    <string id="30108">Advarsler</string>
+    <string id="30109">Advar hvis ikke i Danmark</string>
 
     <string id="30110">Bedste (op til 2 mbit/s)</string>
     <string id="30111">Høj (1 mbit/s)</string>
@@ -21,17 +28,16 @@
     <string id="31006">DR HD</string>
 
     <string id="31100">TV 2/FYN</string>
-    <string id="31101">TV2/Lorry</string>
-    <string id="31102">Lorry+</string>
+    <string id="31101">Lorry</string>
+    <string id="31102">TV SYD</string>
     <string id="31103">TV/MIDT-VEST</string>
-    <string id="31104">TV2 Nord</string>
-    <string id="31105">TV2 NordPlus</string>
+    <string id="31105">TV2/Nord</string>
     <string id="31106">TV2 ØST</string>
-    <string id="31107">Kanal ØST</string>
     <string id="31108">TV 2 | ØSTJYLLAND</string>
 
     <string id="31200">24 Nordjyske</string>
     <string id="31201">Folketinget TV</string>
+    <string id="31202">danskespil.dk Lotto</string>
 
     <string id="32001">DR1 er den første tv-kanal i Danmark. Oprindelig hed 
kanalen Danmarks Radio eller DR efter mediehuset, der producerede den (går 
også under navnet 1'eren i daglig tale, efter TV 2 begyndte i 1988). Navnet 
blev ændret til DR1 efter lanceringen af DRs anden tv-kanal, DR2, i 
1996.</string>
     <string id="32002">DR2 er DR's anden licensfinansierede tv-kanal og 
søsterkanal til den bredere og mere folkelige DR1.</string>
@@ -49,4 +55,25 @@
     <string id="32108">Se alle TV 2 | ØSTJYLLANDs nyhedsudsendelser kl. 
16.05, 18.10, 19.30 og 22.22</string>
 
     <string id="32200">24NORDJYSKE giver dig væsentlige og gode historier fra 
Nordjylland. Du kan tænde, når det passer dig og få vigtige nyheder, gode 
oplevelser og serviceinformationer.[CR][CR]Hvert kvarter i morgen- og dagtimer 
og hvert tyvende minut begynder nyhedssløjfen -og kører dermed i ring. 
Nyhedssløjfen opdateres hver gang der sker noget nyt i Nordjylland.</string>
+
+    <string id="99970">Advarsel!</string>
+    <string id="99971">Det ser ud til du ikke befinder dig i Danmark.</string>
+    <string id="99972">En eller flere kanaler vil måske ikke kunne 
afspilles</string>
+    <string id="99973">eller der kan opstå andre uventede fejl.</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 --gitid="99995">Tak!</string>tring>ring>ersonlige 
oplysninger.</string>nd. Du kan tænde, når det passer dig og få vigtige 
nyheder, gode oplevelser og serviceinformationer.[CR][CR]Hvert kvarter i 
morgen- og dagtimer og hvert tyvende minut begynder nyhedssløjfen -og kører 
dermed i ring. Nyhedssløjfen opdateres hver gang der sker noget nyt i 
Nordjylland.</string>`r³++$y 
ÿÀ?4-+uz³++04-+Ø44-+¨94-+€š´++xDÐ,+ y
 ÿpy ÿk³++à!à!@$y ÿ°$y 
ÿH°,+€y ÿ’r³++†³++@$y ÿ`r³++$y 
ÿp$y ÿh$y ÿ8›Ô++Œp˜°$y 
ÿuz³++€š´++€y ÿPy 
ÿk³++GHIJKMNOP@$y 
ÿ°$y ÿHņ,+ y ÿ’r³++†³++@$y 
ÿ0?4-+uz³++PÐ,+ ùc,+04-+Ø44-+¨94-+€š´++Hņ,+
 y ÿ`y ÿk³++8ņ,+ y ÿy 
ÿk³++(ņ,+ y ÿÀy ÿk³++ņ,+ y 
ÿðy ÿk³++ ¨>4-+uz³++¨94-+py 
ÿŠHd,+ey³++Ø44-+y 
ÿyHd,+ey³++04-+Ày 
ÿZHd,+ey³++Øôc,+PÐ,+ ùc,+04-+ØTÐ,+Ø44-+¨94-+€š´++8›Ô++½/,+°$y
 ÿp‹c,+py ÿ@y 
ÿk³++5678:<=>?@BD@$y 
ÿ°$y ÿà½,,+°$y ÿuz³++•Ô++ðy 
ÿ½/,+ey³++•Ô++Õ_@fÆS Qöl±íÁÓû++°$y 
ÿà½,,+€y ÿPy ÿk³++u]ÞÓ     
4Q ÷U^Qʉ§¶uª¹ñìò*ēv@$y ÿ°$y ÿHù++T5,+ð%y 
ÿ¦`—-+¦`—-+¦2,+$y ÿ°%y ÿh$y ÿÐ y 
ÿ_Ð,+uz³++ØTÐ,+0'y ÿ¢`—-+&y ÿ!y 
ÿÿÿÿÿÿÿÿÿ¢`—-+¸$y ÿ 
a/plugin.video.dr.dk.live/resources/language/English/strings.xml 
b/plugin.video.dr.dk.live/resources/language/English/strings.xml
index d590d0d..52c79a9 100644
--- a/plugin.video.dr.dk.live/resources/language/English/strings.xml
+++ b/plugin.video.dr.dk.live/resources/language/English/strings.xml
@@ -2,6 +2,14 @@
 <strings>
     <string id="30100">General</string>
     <string id="30101">Quality</string>
+    <string id="30102">Group channels</string>
+    <string id="30103">DRs channels</string>
+    <string id="30104">If you have problems with watching some of DRs 
channels,</string>
+    <string id="30105">then try switching to the secondary stream or 
vice-versa.</string>
+    <string id="30106">Primær stream</string>
+    <string id="30107">Sekundær stream</string>
+    <string id="30108">Warnings</string>
+    <string id="30109">Warn when not in Denmark</string>
 
     <string id="30110">Best (up to 2 mbit/s)</string>
     <string id="30111">High (1 mbit/s)</string>
@@ -20,15 +28,35 @@
     <string id="31006">DR HD</string>
 
     <string id="31100">TV 2/FYN</string>
-    <string id="31101">TV2/Lorry</string>
-    <string id="31102">Lorry+</string>
+    <string id="31101">Lorry</string>
+    <string id="31102">TV SYD</string>
     <string id="31103">TV/MIDT-VEST</string>
-    <string id="31104">TV2 Nord</string>
-    <string id="31105">TV2 NordPlus</string>
+    <string id="31105">TV2/Nord</string>
     <string id="31106">TV2 ØST</string>
-    <string id="31107">Kanal ØST</string>
     <string id="31108">TV 2 | ØSTJYLLAND</string>
 
     <string id="31200">24 Nordjyske</string>
     <string id="31201">Folketinget TV</string>
-</strings>
\ No newline at end of file
+    <string id="31202">danskespil.dk Lotto</string>
+
+    <string id="99970">Warning!</string>
+    <string id="99971">It looks like you are not in Denmark.</string>
+    <string id="99972">One or more channels may not be playable</string>
+    <string id="99973">or other unexpected errors may occur.</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.dr.dk.live/resources/logos/100.png 
b/plugin.video.dr.dk.live/resources/logos/100.png
index 210a06b..1c1c736 100644
Binary files a/plugin.video.dr.dk.live/resources/logos/100.png and 
b/plugin.video.dr.dk.live/resources/logos/100.png differ
diff --git a/plugin.video.dr.dk.live/resources/logos/101.png 
b/plugin.video.dr.dk.live/resources/logos/101.png
index d642f06..13c5087 100644
Binary files a/plugin.video.dr.dk.live/resources/logos/101.png and 
b/plugin.video.dr.dk.live/resources/logos/101.png differ
diff --git a/plugin.video.dr.dk.live/resources/logos/102.png 
b/plugin.video.dr.dk.live/resources/logos/102.png
index a53cf96..5debce9 100644
Binary files a/plugin.video.dr.dk.live/resources/logos/102.png and 
b/plugin.video.dr.dk.live/resources/logos/102.png differ
diff --git a/plugin.video.dr.dk.live/resources/logos/105.png 
b/plugin.video.dr.dk.live/resources/logos/105.png
index 736868f..240b98e 100644
Binary files a/plugin.video.dr.dk.live/resources/logos/105.png and 
b/plugin.video.dr.dk.live/resources/logos/105.png differ
diff --git a/plugin.video.dr.dk.live/resources/logos/106.png 
b/plugin.video.dr.dk.live/resources/logos/106.png
index a34ab44..2827dd4 100644
Binary files a/plugin.video.dr.dk.live/resources/logos/106.png and 
b/plugin.video.dr.dk.live/resources/logos/106.png differ
diff --git a/plugin.video.dr.dk.live/resources/settings.xml 
b/plugin.video.dr.dk.live/resources/settings.xml
index 60e29af..6478d1b 100644
--- a/plugin.video.dr.dk.live/resources/settings.xml
+++ b/plugin.video.dr.dk.live/resources/settings.xml
@@ -4,5 +4,18 @@
                <setting id="quality" label="30101" type="enum" default="0" 
lvalues="30110|30111|30112|30113" />
         <setting id="group.by.category" label="30102" type="bool" 
default="false" />
        </category>
+    <category label="30103">
+        <setting type="lsep" label="30104" />
+        <setting type="lsep" label="30105" />
+        <setting id="dr1.stream" label="31001" type="enum" default="0" 
lvalues="30106|30107" />
+        <setting id="dr2.stream" label="31002" type="enum" default="0" 
lvalues="30106|30107" />
+        <setting id="drupdate.stream" label="31003" type="enum" default="0" 
lvalues="30106|30107" />
+        <setting id="drk.stream" label="31004" type="enum" default="0" 
lvalues="30106|30107" />
+        <setting id="drramasjang.stream" label="31005" type="enum" default="0" 
lvalues="30106|30107" />
+        <setting id="drhd.stream" label="31006" type="enum" default="1" 
lvalues="30106|30107" />
+    </category>
+    <category label="30108">
+        <setting id="warn.if.not.in.denmark" label="30109" type="bool" 
default="true" />
+    </category>
 </settings>
 

http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=f9c112a2d14780561f01acf9411feba67745ce03

commit f9c112a2d14780561f01acf9411feba67745ce03
Author: spiff <[email protected]>
Date:   Fri Jan 13 20:30:40 2012 +0100

    [plugin.video.yousee.tv] updated to version 2.0.1

diff --git a/plugin.video.yousee.tv/addon.py b/plugin.video.yousee.tv/addon.py
index dbf39e4..adf5deb 100644
--- a/plugin.video.yousee.tv/addon.py
+++ b/plugin.video.yousee.tv/addon.py
@@ -1,3 +1,22 @@
+#
+#      Copyright (C) 2012 Tommy Winther
+#      http://tommy.winther.nu
+#
+#  This Program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2, or (at your option)
+#  any later version.
+#
+#  This Program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  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
+#
 import os
 import sys
 import urlparse
@@ -5,6 +24,7 @@ import urllib2
 import StringIO
 
 import ysapi
+import buggalo
 
 import xbmc
 import xbmcaddon
@@ -38,7 +58,9 @@ class YouSeeTv(object):
         xbmcplugin.endOfDirectory(HANDLE)
 
     def showLiveTVChannels(self):
-        api = ysapi.YouSeeLiveTVApi()
+        if not self._checkLogin():
+            return
+        api = ysapi.YouSeeLiveTVApi(CACHE_PATH)
         channels = api.allowedChannels()
         if not channels:
             self._showError()
@@ -63,22 +85,31 @@ class YouSeeTv(object):
         xbmcplugin.endOfDirectory(HANDLE, succeeded = len(channels) > 0)
 
     def playLiveTVChannel(self, channelId):
-        api = ysapi.YouSeeLiveTVApi()
-        json = api.streamUrl(channelId)
-        if not json or not json.has_key('url') or not json['url']:
+        if not self._checkLogin():
+            return
+
+        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']:
             xbmcplugin.setResolvedUrl(HANDLE, False, xbmcgui.ListItem())
 
-            if json and json.has_key('error'):
-                self._showError(json['error'])
+            if stream and stream.has_key('error'):
+                self._showError(stream['error'])
             else:
                 self._showError()
             return
 
-        item = xbmcgui.ListItem(path = json['url'])
+        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)
         xbmcplugin.setResolvedUrl(HANDLE, True, item)
 
     def showMovieGenres(self):
-        api = ysapi.YouSeeMovieApi()
+        if not self._checkLogin():
+            return
+        api = ysapi.YouSeeMovieApi(CACHE_PATH)
         genres = api.genres()
         if not genres:
             self._showError()
@@ -94,14 +125,15 @@ class YouSeeTv(object):
         xbmcplugin.endOfDirectory(HANDLE)
 
     def showMoviesInGenre(self, genre):
-        api = ysapi.YouSeeMovieApi()
+        if not self._checkLogin():
+            return
+        api = ysapi.YouSeeMovieApi(CACHE_PATH)
         moviesInGenre = api.moviesInGenre(genre)
         if not moviesInGenre:
             self._showError()
             xbmcplugin.endOfDirectory(HANDLE, False)
             return
 
-
         for movie in moviesInGenre['movies']:
             self._addMovieDirectoryItem(movie)
 
@@ -110,7 +142,9 @@ class YouSeeTv(object):
 
 
     def showMovieThemes(self):
-        api = ysapi.YouSeeMovieApi()
+        if not self._checkLogin():
+            return
+        api = ysapi.YouSeeMovieApi(CACHE_PATH)
         themes = api.themes()
         if not themes:
             self._showError()
@@ -127,7 +161,9 @@ class YouSeeTv(object):
         xbmcplugin.endOfDirectory(HANDLE)
 
     def showMoviesInTheme(self, theme):
-        api = ysapi.YouSeeMovieApi()
+        if not self._checkLogin():
+            return
+        api = ysapi.YouSeeMovieApi(CACHE_PATH)
         moviesInTheme= api.moviesInTheme(theme)
         if not moviesInTheme:
             self._showError()
@@ -141,10 +177,12 @@ class YouSeeTv(object):
         xbmcplugin.endOfDirectory(HANDLE)
 
     def searchMovies(self):
+        if not self._checkLogin():
+            return
         kbd = xbmc.Keyboard('', 'Search movies')
         kbd.doModal()
         if kbd.isConfirmed():
-            api = ysapi.YouSeeMovieApi()
+            api = ysapi.YouSeeMovieApi(CACHE_PATH)
             movies = api.search(kbd.getText())
             if not movies:
                 self._showError()
@@ -158,8 +196,22 @@ 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']
         infoLabels['plot'] = movie['summary_medium']
         infoLabels['plotoutline'] = movie['summary_short']
         infoLabels['year'] = movie['year']
@@ -169,14 +221,16 @@ 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'):
+            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 + '?movie=' + movie['url_id']
-        xbmcplugin.addDirectoryItem(HANDLE, url, item, isFolder = False)
+        url = PATH + '?orderMovie=' + movie['id']
+        xbmcplugin.addDirectoryItem(HANDLE, url, item)
 
     def _anyChannelIconsMissing(self, channels):
         for channel in channels:
@@ -221,6 +275,34 @@ 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':
+            heading = ADDON.getLocalizedString(99970)
+            line1 = ADDON.getLocalizedString(99971)
+            line2 = ADDON.getLocalizedString(99972)
+            line3 = ADDON.getLocalizedString(99973)
+            nolabel = ADDON.getLocalizedString(99974)
+            yeslabel = ADDON.getLocalizedString(99975)
+            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)
@@ -229,7 +311,9 @@ class YouSeeTv(object):
         line3 = ADDON.getLocalizedString(39003)
         xbmcgui.Dialog().ok(title, line1, line2, line3)
 
-    def _showError(self, description = 'Ukendt fejl'):
+    def _showError(self, description = None):
+        if description is None:
+            description = ADDON.getLocalizedString(30053)
         xbmcgui.Dialog().ok(ADDON.getLocalizedString(30050), 
ADDON.getLocalizedString(30051),
             ADDON.getLocalizedString(30052), description)
 
@@ -247,27 +331,37 @@ if __name__ == '__main__':
     if not os.path.exists(CACHE_PATH):
         os.makedirs(CACHE_PATH)
 
-    ytv = YouSeeTv()
-    if PARAMS.has_key('area') and PARAMS['area'][0] == 'livetv':
-        ytv.showLiveTVChannels()
-    elif PARAMS.has_key('channel'):
-        ytv.playLiveTVChannel(PARAMS['channel'][0])
-
-    elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-genre':
-        ytv.showMovieGenres()
-    elif PARAMS.has_key('genre'):
-        ytv.showMoviesInGenre(PARAMS['genre'][0])
-
-    elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-theme':
-        ytv.showMovieThemes()
-    elif PARAMS.has_key('theme'):
-        ytv.showMoviesInTheme(PARAMS['theme'][0])
-
-    elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-search':
-        ytv.searchMovies()
-
-    elif ADDON.getSetting('hide.movie.area') == 'true':
-        ytv.showLiveTVChannels()
-    else:
-        ytv._showWarning()
-        ytv.showOverview()
+    try:
+        ytv = YouSeeTv()
+        if PARAMS.has_key('area') and PARAMS['area'][0] == 'livetv':
+            ytv.showLiveTVChannels()
+        elif PARAMS.has_key('channel'):
+            ytv.playLiveTVChannel(PARAMS['channel'][0])
+
+        elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-genre':
+            ytv.showMovieGenres()
+        elif PARAMS.has_key('genre'):
+            ytv.showMoviesInGenre(PARAMS['genre'][0])
+
+        elif PARAMS.has_key('area') and PARAMS['area'][0] == 'movie-theme':
+            ytv.showMovieThemes()
+        elif PARAMS.has_key('theme'):
+            ytv.showMoviesInTheme(PARAMS['theme'][0])
+
+        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()
+
+        else:
+            ytv._showWarning()
+            ytv.isYouSeeIP()
+            ytv.showOverview()
+
+    except Exception:
+        buggalo.onExceptionRaised()
\ No newline at end of file
diff --git a/plugin.video.yousee.tv/addon.xml b/plugin.video.yousee.tv/addon.xml
index 8f9b87f..a7f5e6c 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.0" name="YouSee web-tv" 
provider-name="twinther [[email protected]]">
+<addon id="plugin.video.yousee.tv" version="2.0.1" 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 56bc6f8..e961800 100644
--- a/plugin.video.yousee.tv/changelog.txt
+++ b/plugin.video.yousee.tv/changelog.txt
@@ -1,3 +1,7 @@
+[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
+
 [B]Version 2.0.0 - 2011-12-01[/B]
 - Complete rewrite using official YouSee API
 - Login is no longer possible, so you need to be using your YouSee internet 
connection.
diff --git a/plugin.video.yousee.tv/resources/language/Danish/strings.xml 
b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
index 668d841..acfdff0 100644
--- a/plugin.video.yousee.tv/resources/language/Danish/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/Danish/strings.xml
@@ -8,12 +8,40 @@
     <string id="30050">Ups, det er pinligt...</string>
     <string id="30051">Streamen kunne ikke afspilles!</string>
     <string id="30052">Fejlen fra serveren er:</string>
+    <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>
+
+    <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="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 79ce614..55f85da 100644
--- a/plugin.video.yousee.tv/resources/language/English/strings.xml
+++ b/plugin.video.yousee.tv/resources/language/English/strings.xml
@@ -8,12 +8,40 @@
     <string id="30050">Oops, sorry about that...</string>
     <string id="30051">The stream could not be started!</string>
     <string id="30052">The error from the server is:</string>
+    <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>
+
+    <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="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/resources/settings.xml 
b/plugin.video.yousee.tv/resources/settings.xml
index 2657f76..5dad4c7 100644
--- a/plugin.video.yousee.tv/resources/settings.xml
+++ b/plugin.video.yousee.tv/resources/settings.xml
@@ -2,6 +2,13 @@
 <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" />
+    </category>
 </settings>
 
diff --git a/plugin.video.yousee.tv/ysapi.py b/plugin.video.yousee.tv/ysapi.py
index 1a9ad97..50072b1 100644
--- a/plugin.video.yousee.tv/ysapi.py
+++ b/plugin.video.yousee.tv/ysapi.py
@@ -1,10 +1,33 @@
-"""
-https://docs.google.com/document/d/1_rs5BXklnLqGS6g6eAjevVHsPafv4PXDCi_dAM2b7G0/edit?pli=1
-"""
-
+#
+#      Copyright (C) 2012 Tommy Winther
+#      http://tommy.winther.nu
+#
+#  This Program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2, or (at your option)
+#  any later version.
+#
+#  This Program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  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
+#
+# 
https://docs.google.com/document/d/1_rs5BXklnLqGS6g6eAjevVHsPafv4PXDCi_dAM2b7G0/edit?pli=1
+#
 import cookielib
+import urllib
 import urllib2
 import simplejson
+import os
+import re
+import uuid
+
+import xbmc
 
 API_URL = 'http://api.yousee.tv/rest'
 API_KEY = 'HCN2BMuByjWnrBF4rUncEfFBMXDumku7nfT3CMnn'
@@ -14,38 +37,62 @@ AREA_MOVIE = 'movie'
 AREA_PLAY = 'play'
 AREA_USERS = 'users'
 AREA_TVGUIDE = 'tvguide'
+AREA_SYSTEM = 'system'
+AREA_CONTENT = 'content'
+
+METHOD_GET = 'get'
+METHOD_POST = 'post'
 
 class YouSeeApi(object):
     COOKIE_JAR = cookielib.LWPCookieJar()
+    COOKIES_LWP = 'cookies.lwp'
+
+    def __init__(self, dataPath):
+        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)
 
-    def __init__(self):
-        print 'YouSeeApi.__init__'
-        print self.COOKIE_JAR
         
urllib2.install_opener(urllib2.build_opener(urllib2.HTTPCookieProcessor(self.COOKIE_JAR)))
 
-    def _invoke(self, area, function, params = None):
+    def _invoke(self, area, function, params = None, method = METHOD_GET):
         url = API_URL + '/' + area + '/' + function
-        if params:
+        if method == METHOD_GET and params:
             for key, value in params.items():
                 url += '/' + key + '/' + str(value)
         url += '/format/json'
 
-        print 'Invoking URL: %s' % url
+        xbmc.log('Invoking URL: %s' % re.sub('/password/([^/]+)/', 
'/password/****/', url), xbmc.LOGDEBUG)
 
         try:
             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))
             u = urllib2.urlopen(r)
             json = u.read()
             u.close()
+
+            self.COOKIE_JAR.save(self.cookieFile, ignore_discard=True, 
ignore_expires=True)
         except urllib2.HTTPError, error:
             json = error.read()
 
         try:
             return simplejson.loads(json)
-        except simplejson.JSONDecodeError, error:
+        except simplejson.JSONDecodeError:
             return None
 
 class YouSeeLiveTVApi(YouSeeApi):
+    def channel(self, id):
+        """
+        Returns metadata for channel based on channel id.
+
+        @param id: channel id
+        @return:
+        """
+        return self._invoke(AREA_LIVETV, 'channel', {
+            'id' : id
+        })
     def popularChannels(self):
         """
         Returns list of channels sorted by popularity.
@@ -128,6 +175,70 @@ class YouSeeMovieApi(YouSeeApi):
             '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
+        })
+
+    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):
         """
@@ -168,10 +279,29 @@ class YouSeeUsersApi(YouSeeApi):
     def transactions(self):
         return self._invoke(AREA_USERS, 'transactions')
 
+    def isYouSeeIP(self):
+        return self._invoke(AREA_USERS, 'isyouseeip') == 1
+
+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 areas: movie)
+        @return:
+        """
+        return self._invoke(AREA_CONTENT, 'teasers', {
+            'area' : area
+        })
+
+
 if __name__ == '__main__':
-    api = YouSeeLiveTVApi()
-#    json = api.allowedChannels()
-    json = api.streamUrl(1)
+    api = YouSeeLiveTVApi('/tmp')
+    json = api.channel(1)
 
 #    api = YouSeeTVGuideApi()
 #    json = api.programs(1)

-----------------------------------------------------------------------

Summary of changes:
 plugin.video.dr.dk.live/addon.py                   |   93 ++++++++---
 plugin.video.dr.dk.live/addon.xml                  |    2 +-
 .../buggalo.py                                     |    4 +-
 plugin.video.dr.dk.live/changelog.txt              |    6 +
 plugin.video.dr.dk.live/channels.py                |  138 ++++++++++------
 .../resources/language/Danish/strings.xml          |   37 ++++-
 .../resources/language/English/strings.xml         |   40 ++++-
 plugin.video.dr.dk.live/resources/logos/100.png    |  Bin 41351 -> 50149 bytes
 plugin.video.dr.dk.live/resources/logos/101.png    |  Bin 48345 -> 52995 bytes
 plugin.video.dr.dk.live/resources/logos/102.png    |  Bin 41639 -> 45332 bytes
 plugin.video.dr.dk.live/resources/logos/105.png    |  Bin 38515 -> 42117 bytes
 plugin.video.dr.dk.live/resources/logos/106.png    |  Bin 54246 -> 51006 bytes
 plugin.video.dr.dk.live/resources/settings.xml     |   13 ++
 plugin.video.yousee.tv/addon.py                    |  174 +++++++++++++++-----
 plugin.video.yousee.tv/addon.xml                   |    2 +-
 .../buggalo.py                                     |    4 +-
 plugin.video.yousee.tv/changelog.txt               |    4 +
 .../resources/language/Danish/strings.xml          |   28 +++
 .../resources/language/English/strings.xml         |   28 +++
 plugin.video.yousee.tv/resources/settings.xml      |    7 +
 plugin.video.yousee.tv/ysapi.py                    |  158 ++++++++++++++++--
 21 files changed, 596 insertions(+), 142 deletions(-)
 copy {plugin.video.drnu => plugin.video.dr.dk.live}/buggalo.py (97%)
 copy {plugin.video.drnu => plugin.video.yousee.tv}/buggalo.py (97%)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to