The branch, eden has been updated
       via  373fdc64abb56f76cee6808f8d5b2c49600c4998 (commit)
      from  35ff1834f0cbf1334fac8b954bf529d9414c8d3e (commit)

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

commit 373fdc64abb56f76cee6808f8d5b2c49600c4998
Author: spiff <[email protected]>
Date:   Mon Aug 27 16:27:11 2012 +0200

    [plugin.video.manoto] updated to version 0.0.4

diff --git a/plugin.video.manoto/LICENSE.txt b/plugin.video.manoto/LICENSE.txt
old mode 100644
new mode 100755
diff --git a/plugin.video.manoto/addon.xml b/plugin.video.manoto/addon.xml
old mode 100644
new mode 100755
index 7130f9c..a245f6e
--- a/plugin.video.manoto/addon.xml
+++ b/plugin.video.manoto/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>

 <addon id="plugin.video.manoto"

        name="Manoto TV"

-       version="0.0.3"

+       version="0.0.4"

        provider-name="babak">

   <requires>

     <import addon="xbmc.python" version="2.0"/>

diff --git a/plugin.video.manoto/default.py b/plugin.video.manoto/default.py
index 5f42069..f77be77 100644
--- a/plugin.video.manoto/default.py
+++ b/plugin.video.manoto/default.py
@@ -4,119 +4,121 @@ from BeautifulSoup import BeautifulSoup
 

 addon = xbmcaddon.Addon('plugin.video.manoto')

 profile = xbmc.translatePath(addon.getAddonInfo('profile'))

+
 

-

-__settings__ = xbmcaddon.Addon(id='plugin.video.manoto')

+__settings__ = xbmcaddon.Addon(id='plugin.video.manoto')
 __language__ = __settings__.getLocalizedString

-

+
 home = __settings__.getAddonInfo('path')

 icon = xbmc.translatePath(os.path.join(home, 'icon.png'))

-

+
 

 if (__settings__.getSetting('username') == "") or 
(__settings__.getSetting('password') == ""):

        xbmc.executebuiltin("XBMC.Notification(" + 
__settings__.getAddonInfo('name') + "," + __language__(30000) + 
",10000,"+icon+")")

-       __settings__.openSettings()

-

-cj = cookielib.CookieJar()

+       __settings__.openSettings()
+
+cj = cookielib.CookieJar()
 opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))

-

-domain = 'www.manoto1.com'

-

-# Thanks to micahg!

-def getStreamsFromPlayList(playlist):

-       """

-        Get the streams from the playlist

-        

-        @param playlist: The playlist URI

-        """

-        # create the request

-        req = urllib2.Request(playlist)

-

-        # request the games        

-        try:

-               resp = urllib2.urlopen(req)

-        except urllib2.URLError, ue:

-               print("URL error trying to open playlist")

-               return None

-        except urllib2.HTTPError, he:

-               print("HTTP error trying to open playlist")

-               return None

-        

-        # store the base URI from the playlist

-        prefix=playlist[0:string.rfind(playlist,'/') + 1]

-        lines = string.split(resp.read(), '\n')

-

-        # parse the playlist file

-        streams = {}

-        bandwidth = ""

-        for line in lines:

-            

-               # skip the first line

-               if line == "#EXTM3U":

-                       continue

-            

-               # is this a description or a playlist

-               idx = string.find(line, "BANDWIDTH=")

-               if idx > -1:

-                       # handle the description

-                       bandwidth = line[idx + 10:len(line)].strip()

-               elif len(line) > 0 and len(bandwidth) > 0:

-                       # add the playlist

-                       streams[bandwidth] = (prefix + line).strip()

-

-       return streams

-

-

-def loginAndParse():

-       url = 'http://' + domain + '/live'

-       

-       resp = opener.open(url)

-       html_data = resp.read()

-

-       soup = BeautifulSoup(html_data)

-       eventVal = soup.find('input',id='__EVENTVALIDATION',type='hidden')

-       viewState = soup.find('input',id='__VIEWSTATE',type='hidden')

-

+
+domain = 'www.manoto1.com'
+
+# Thanks to micahg!
+def getStreamsFromPlayList(playlist):
+       """
+        Get the streams from the playlist
+        
+        @param playlist: The playlist URI
+        """
+        # create the request
+        req = urllib2.Request(playlist)
+
+        # request the games        
+        try:
+               resp = urllib2.urlopen(req)
+        except urllib2.URLError, ue:
+               print("URL error trying to open playlist")
+               return None
+        except urllib2.HTTPError, he:
+               print("HTTP error trying to open playlist")
+               return None
+        
+        # store the base URI from the playlist
+        prefix=playlist[0:string.rfind(playlist,'/') + 1]
+        lines = string.split(resp.read(), '\n')
+
+        # parse the playlist file
+        streams = {}
+        bandwidth = ""
+        for line in lines:
+            
+               # skip the first line
+               if line == "#EXTM3U":
+                       continue
+            
+               # is this a description or a playlist
+               idx = string.find(line, "BANDWIDTH=")
+               if idx > -1:
+                       # handle the description
+                       bandwidth = line[idx + 10:len(line)].strip()
+               elif len(line) > 0 and len(bandwidth) > 0:
+                       # add the playlist
+                       streams[bandwidth] = (prefix + line).strip()
+
+       return streams
+
+
+def loginAndParse():
+       url = 'http://' + domain + '/live'
+       
+       resp = opener.open(url)
+       html_data = resp.read()
+
+       soup = BeautifulSoup(html_data)
+       eventVal = soup.find('input',id='__EVENTVALIDATION',type='hidden')
+       viewState = soup.find('input',id='__VIEWSTATE',type='hidden')
+
        params = 
'__EVENTARGUMENT=&__EVENTTARGET=ctl00%%24ContentPlaceHolderMainContent%%24lbtnEnter&__EVENTVALIDATION=%s&__VIEWSTATE=%s&ctl00%%24ContentPlaceHolderMainContent%%24txtUsername=%s&ctl00%%24ContentPlaceHolderMainContent%%24txtPassword=%s'
 % (urllib.quote(eventVal['value']), urllib.quote(viewState['value']), 
urllib.quote(__settings__.getSetting('username')), 
urllib.quote(__settings__.getSetting('password')))

-       

-       resp = opener.open('http://www.manoto1.com/LiveStream.aspx', params)    

-

-       resp = opener.open(url)

-       html_data = resp.read()

-

-       soup = BeautifulSoup(html_data)

-       stream = soup.find('source', type='video/mp4'); 

-       

-       if stream is None or stream['src'] is None:

-               return False

-       

-       streams = getStreamsFromPlayList(stream['src'])

-       

-       if streams == None:

-               xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))

-               return False

-    

-       bitrates = []

-       for k in streams.keys():

-               bitrates.append(int(k))

-       bitrates.sort()

-       bitrates.reverse()

-

-       for bitrate in bitrates:

-               stream_id = str(bitrate)

-               title = str(int(bitrate) / int(1000)) + " Kbps"

-               li = xbmcgui.ListItem(title)

-               li.setInfo( type="Video", infoLabels={"Title" : title})

-               li.setThumbnailImage(icon)

-               xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),

-                                           url=streams[stream_id],

-                                           listitem=li,

-                                           isFolder=False)

-

-       xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))

-

-       return True

-

-while not loginAndParse():

-               xbmc.executebuiltin("XBMC.Notification(" + 
__settings__.getAddonInfo('name') + "," + __language__(30001) + 
",10000,"+icon+")")

-               __settings__.openSettings()

+       
+       resp = opener.open('http://www.manoto1.com/LiveStream.aspx', params)    
+
+       resp = opener.open(url)
+       html_data = resp.read()
+
+       soup = BeautifulSoup(html_data)
+       stream = soup.find('source', type='video/mp4'); 
+       
+       if stream is None or stream['src'] is None:
+                xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
+               return False
+       
+       streams = getStreamsFromPlayList(stream['src'])
+       
+       if streams == None:
+               xbmc.executebuiltin("XBMC.Notification(" + 
__settings__.getAddonInfo('name') + "," + __language__(30002) + 
",30000,"+icon+")")
+               xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
+               return True
+    
+       bitrates = []
+       for k in streams.keys():
+               bitrates.append(int(k))
+       bitrates.sort()
+       bitrates.reverse()
+
+       for bitrate in bitrates:
+               stream_id = str(bitrate)
+               title = str(int(bitrate) / int(1000)) + " Kbps"
+               li = xbmcgui.ListItem(title)
+               li.setInfo( type="Video", infoLabels={"Title" : title})
+               li.setThumbnailImage(icon)
+               xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
+                                           url=streams[stream_id],
+                                           listitem=li,
+                                           isFolder=False)
+
+       xbmcplugin.endOfDirectory(handle=int(sys.argv[1]))
+
+       return True
+
+while not loginAndParse():
+       xbmc.executebuiltin("XBMC.Notification(" + 
__settings__.getAddonInfo('name') + "," + __language__(30001) + 
",10000,"+icon+")")
+       __settings__.openSettings()
diff --git a/plugin.video.manoto/resources/language/English/strings.xml 
b/plugin.video.manoto/resources/language/English/strings.xml
index 204789e..ce404f8 100644
--- a/plugin.video.manoto/resources/language/English/strings.xml
+++ b/plugin.video.manoto/resources/language/English/strings.xml
@@ -2,6 +2,7 @@
 <strings>
        <string id="30000">Enter username and password.</string>
        <string id="30001">INVALID username and/or password.</string>
+        <string id="30002">NO stream is available at the moment.</string>
         <string id="30011">Username</string>
         <string id="30012">Password</string>
 </strings>
diff --git a/plugin.video.manoto/resources/settings.xml 
b/plugin.video.manoto/resources/settings.xml
old mode 100644
new mode 100755
index 0126633..2df430d
--- a/plugin.video.manoto/resources/settings.xml
+++ b/plugin.video.manoto/resources/settings.xml
@@ -1,4 +1,4 @@
 <settings>

-   <setting id="username" type="text"  label="30011" default=""/>

-   <setting id="password" type="text"  label="30012" default=""/>

-</settings>

+   <setting id="username" type="text"  label="30011" default=""/>
+   <setting id="password" type="text"  label="30012" default=""/>
+</settings>

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

Summary of changes:
 plugin.video.manoto/addon.xml                      |    2 +-
 plugin.video.manoto/default.py                     |  216 ++++++++++----------
 .../resources/language/English/strings.xml         |    1 +
 plugin.video.manoto/resources/settings.xml         |    6 +-
 4 files changed, 114 insertions(+), 111 deletions(-)
 mode change 100644 => 100755 plugin.video.manoto/LICENSE.txt
 mode change 100644 => 100755 plugin.video.manoto/addon.xml
 mode change 100644 => 100755 plugin.video.manoto/resources/settings.xml


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to