The branch, dharma has been updated
       via  64dae9a9fd8569ecd573c871a8a7d45814d6f4ac (commit)
      from  bfc79030217067bf4a9f932e211a6c23ef0fa281 (commit)

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

commit 64dae9a9fd8569ecd573c871a8a7d45814d6f4ac
Author: spiff <[email protected]>
Date:   Fri Apr 13 18:33:52 2012 +0200

    [plugin.video.brt] updated to version 1.2.6

diff --git a/.gitignore b/.gitignore
index 1cf24e4..9083954 100644
--- a/.gitignore
+++ b/.gitignore
@@ -71,6 +71,8 @@ plugin.video.nos/.git
 plugin.audio.groove/description.xml
 plugin.video.brt/.git
 plugin.video.brt/.project
+plugin.video.brt/.pydevproject
+plugin.video.brt/.settings
 plugin.video.4players/.git
 plugin.video.hockeystreams/.git
 plugin.video.hockeystreams/.idea
diff --git a/plugin.video.brt/ClientService.py 
b/plugin.video.brt/ClientService.py
index c144e64..3c22fc3 100644
--- a/plugin.video.brt/ClientService.py
+++ b/plugin.video.brt/ClientService.py
@@ -27,6 +27,45 @@ proxy = 
'ivsmedia.iptv-distribution.net'#'ivsmedia.iptv-distribution.net'
 port = 80
 
 
+def SetSett(sess):
+    try:
+        # new XBMC 10.05 addons:
+        import xbmcaddon
+    except ImportError:
+        # old XBMC - create fake xbmcaddon module with same interface as new 
XBMC 10.05
+        class xbmcaddon:
+            """ fake xbmcaddon module """
+            __version__ = "(old XBMC)"
+            class Addon:
+                """ fake xbmcaddon.Addon class """
+                def __init__(self, id):
+                    self.id = id
+    
+                def getSetting(self, key):
+                    return xbmcplugin.getSetting(key)
+    
+                def openSettings(self):
+                    xbmc.openSettings()
+                def setSetting(self, key, value):
+                    return xbmcplugin.setSetting(key, value)
+    
+    addon = xbmcaddon.Addon("plugin.video.brt")
+    quality = ['HQ', 'SQ']
+    q = int(addon.getSetting('quality'))
+    region = ['EU_RST', 'NA_PST', 'NA_EST','AU_EST']
+    r = int(addon.getSetting('region'))
+    server = ['1','7']
+    s = int(addon.getSetting('server'))
+    req = '<s:Envelope 
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/";><s:Body>' \
+          '<SetSettings 
xmlns="http://ivsmedia.iptv-distribution.net";><sessionID>' + sess + 
'</sessionID>' \
+          '<cs 
xmlns:d4p1="http://schemas.datacontract.org/2004/07/IVS.Media.Client"; 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance";>' \
+          '<d4p1:adultEnabled>false</d4p1:adultEnabled><d4p1:clientServices 
/><d4p1:language>rus</d4p1:language>' \
+          '<d4p1:playerType 
xmlns:d5p1="http://schemas.datacontract.org/2004/07/IVS.Common"; i:nil="true" 
/><d4p1:streamPreference 
xmlns:d5p1="http://schemas.datacontract.org/2004/07/IVS.Common.Server";>' \
+          '<d5p1:balancingArea i:nil="true" /><d5p1:cdn><d5p1:id>' + server[s] 
+ '</d5p1:id><d5p1:name i:nil="true" /></d5p1:cdn>' \
+          '<d5p1:qualityPreset>' + quality[q] + 
'</d5p1:qualityPreset><d5p1:shiftTimeZoneName>' + region[r] + 
'</d5p1:shiftTimeZoneName></d4p1:streamPreference>' \
+          '<d4p1:timeZoneName>' + region[r] + 
'</d4p1:timeZoneName></cs></SetSettings></s:Body></s:Envelope>'
+    Request(req, 'SetSettings')
+
 def Login(Username = '',Password = ''):
     x = Content.Application().ClientAppSettings
     x.clientCredential.UserLogin = Username
diff --git a/plugin.video.brt/addon.xml b/plugin.video.brt/addon.xml
index e7bb332..8e7ee20 100644
--- a/plugin.video.brt/addon.xml
+++ b/plugin.video.brt/addon.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <addon id="plugin.video.brt"
-       version="1.2.5"
+       version="1.2.6"
        name="BestRussianTV"
        provider-name="BestRussianTV.com">
     <requires>
diff --git a/plugin.video.brt/brtv.py b/plugin.video.brt/brtv.py
index d333e84..07d27f2 100644
--- a/plugin.video.brt/brtv.py
+++ b/plugin.video.brt/brtv.py
@@ -21,7 +21,7 @@ import os
 import sys, datetime, time, calendar, thread, threading
 import xbmc, xbmcgui, xbmcplugin, urllib
 import ClientService, ContentService, MediaService, Content, GetBest, 
RusKeyboard, ArcSearch, VodSearch
-import archive, vod, asx, radio
+import archive, vod, asx, radio, livetv
 from BeautifulSoup import BeautifulSoup
 
 try:
@@ -217,27 +217,21 @@ try:
     xbmcplugin21 @@ try:eautifulSoupiaService, Content, GetBest, 
RusKeyboard, ArcSearch, 
VodSearchpe>'</d5p1:shiftTimeZoneName></d4p1:streamPreference>' 
\ract.org/2004/07/IVS.Common.Server">' 
\P_Y?ÿ€°…B+@TY?ÿSY?ÿk ÓƒB+6 
èè!è!à^Y?ÿP_Y?ÿxTð„B+@UY?ÿ’‚ÓƒB+† ÓƒB+à^Y?ÿ`‚ÓƒB+_Y?ÿÀOT…B+uŠÓƒB+@T…B+ØDT…B+¨IT…B+€ªÔƒB+xTð„B+@UY?ÿTY?ÿk ÓƒB+à!à!à^Y?ÿP_Y?ÿHЄB+
 
VY?ÿ’‚ÓƒB+† ÓƒB+à^Y?ÿ`‚ÓƒB+_Y?ÿ_Y?ÿ_Y?ÿ8«ôƒB+Œp˜P_Y?ÿuŠÓƒB+€ªÔƒB+
 
VY?ÿðTY?ÿk ÓƒB+GHIJKMNOPà^Y?ÿP_Y?ÿHÕ¦„B+ÀWY?ÿ’‚ÓƒB+† ÓƒB+à^Y?ÿ0OT…B+uŠÓƒB+`ð„B+ 
        
„„B+@T…B+ØDT…B+¨IT…B+€ªÔƒB+HÕ¦„B+ÀWY?ÿVY?ÿk ÓƒB+8Õ¦„B+ÀWY?ÿ0VY?ÿk ÓƒB+(Õ¦„B+ÀWY?ÿ`VY?ÿk ÓƒB+Õ¦„B+ÀWY?ÿVY?ÿk ÓƒB+
  
¨NT…B+uŠÓƒB+¨IT…B+QY?ÿŠX„„B+e‰ÓƒB+ØDT…B+0WY?ÿyX„„B+e‰ÓƒB+@T…B+`WY?ÿZX„„B+e‰ÓƒB+Ø„„B+`ð„B+ 
        
„„B+@T…B+Ødð„B+ØDT…B+¨IT…B+€ªÔƒB+8«ôƒB+ÍO„B+P_Y?ÿp›ƒ„B+YY?ÿàWY?ÿk ÓƒB+5678:<=>?@BDà^Y?ÿP_Y?ÿàÍL„B+P_Y?ÿuŠÓƒB+¥ôƒB+WY?ÿÍO„B+e‰ÓƒB+¥ôƒB+Õ_@fÆS
 Qöl±íÁã„B+P_Y?ÿàÍL„B+ 
ZY?ÿðXY?ÿk ÓƒB+u]ÞÓ      
4Q ÷U^Qʉ§¶uª¹ñìò*ēvà^Y?ÿP_Y?ÿH„B+dU„B+`Y?ÿ¦p·…B+¦p·…B+¶R„B+_Y?ÿP`Y?ÿ_Y?ÿp[Y?ÿoð„B+uŠÓƒB+Ødð„B+ÐaY?ÿ¢p·…B+ `Y?ÿ0\Y?ÿÿÿÿÿÿÿÿÿ¢p·…B+X_Y?ÿ.endOfDirectory(int(sys.argv[1]))
     
     
- elif mode == "setting":
+ elif mode == "setting": 
     addon.openSettings()
+    ClientService.SetSett(SessionID())
     xbmc.executebuiltin('XBMC.Resolution(' + addon.getSetting('resolution') + 
')')
 
- elif mode == 'LiveTV':
-    datnow = ContentService.GetUTC()
-    channels = Content.Channels()
-    sessID = SessionID()
-    channels.Invoke(ContentService.GetClientChannel(sessID, type = 'LiveTV', 
pagItems = '13', pagNum = page))
-    for channel in channels.items:
-        playnow  = ContentService.NowPlay(sessID, channel.id, datnow)
+ elif mode == 'LiveTV': 
+    #datnow = ContentService.GetUTC()
+    #channels = Content.Channels()
+    #sessID = SessionID()
+    #channels.Invoke(ContentService.GetClientChannel(sessID, type = 'LiveTV', 
pagItems = '13', pagNum = page))
+    channels = livetv.LoadTV(SessionID())
+    for channel in channels:
         icon = getImage(channel.id, '4')
-        name = channel.name + ' - ' + playnow.time + ' ' + playnow.name
-        
-        addItem(name, 'LiveStream', False, channel.id, playnow.description, 
icon)
-    if int(channels.TPage) > int(page):
-        p = int(page) + 1
-        print channels.TPage + ' - ' + page
-        addItem("...Следующая страница...","LiveTV",True, 
icon=os.path.join(iconpath, 'icon_tv_live.png'), page=str(p))
-    if int(channels.TPage) == int(page) or int(channels.TPage) > int(page):
-        addItem("На главную", "", True, "0")    
+        name = channel.name + '  ' + channel.times + '  ' + channel.descr
+        addItem(name, 'LiveStream', False, channel.id, channel.descr, icon)   
     xbmcplugin.endOfDirectory(int(sys.argv[1]))
     
  elif mode == 'LiveStream':    
diff --git a/plugin.video.brt/livetv.py b/plugin.video.brt/livetv.py
index 3052db3..582d99e 100644
--- a/plugin.video.brt/livetv.py
+++ b/plugin.video.brt/livetv.py
@@ -19,7 +19,35 @@
 
 import httplib, urllib, urllib2, re
 import xml.parsers.expat
-import config
+import config1
+from BeautifulSoup import BeautifulSoup, BeautifulStoneSoup
+
+class Channel:
+    def __init__(self, id, name, descr, times):
+        self.id = id
+        self.name = name
+        self.descr = descr
+        self.times = times
+        
+def LoadTV(sess):
+    url = '/handlers/boxee/channelhandler.ashx?sid=' + sess
+    conn = httplib.HTTPConnection('ivsmedia.iptv-distribution.net')
+    conn.request('GET', url)
+    response = conn.getresponse()
+    data = response.read()
+    soup = BeautifulStoneSoup(data)
+    items = soup.findAll("item")
+    #items = soup("item")
+    #items = soup.findAll('item')
+    channels = []
+    for item in items:
+            sup = BeautifulSoup(item.prettify())
+            name = sup('title')[0].text.encode('utf-8')
+            id = item.find('link').string.strip()
+            descr = 
sup('description')[0].text.encode('utf-8')#item.find('description').string.strip()
+            times = 
sup('media:category')[0].text.encode('utf-8')#item.find('media:category').string.strip()
+            channels.append(Channel(str(id), str(name), str(descr), 
str(times)))
+    return channels
 
 class GetChannels:
     req = \

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

Summary of changes:
 .gitignore                        |    2 +
 plugin.video.brt/ClientService.py |   39 +++++++++++++++++++++++++++++++++++++
 plugin.video.brt/addon.xml        |    2 +-
 plugin.video.brt/brtv.py          |   30 +++++++++++-----------------
 plugin.video.brt/livetv.py        |   30 +++++++++++++++++++++++++++-
 5 files changed, 83 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to