The branch, frodo has been updated
       via  e14d9dc6add19dc9e45a06d07f392d492727592b (commit)
      from  645157d79e1457328085c97c16ca08661a1f4f09 (commit)

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

commit e14d9dc6add19dc9e45a06d07f392d492727592b
Author: Martijn Kaijser <[email protected]>
Date:   Tue Jul 29 18:46:59 2014 +0200

    [plugin.video.metv] 1.1.1

diff --git a/plugin.video.metv/README.txt b/plugin.video.metv/README.txt
index a90dc92..cb5f6f4 100644
--- a/plugin.video.metv/README.txt
+++ b/plugin.video.metv/README.txt
@@ -4,5 +4,7 @@ plugin.video.metv
 
 XBMC Addon for MeTV website
 
+Version 1.1.1 Improved bitrate speeds for videos
+
 version 1.0.1 initial release
 
diff --git a/plugin.video.metv/addon.xml b/plugin.video.metv/addon.xml
index 11a2d0d..f62d997 100644
--- a/plugin.video.metv/addon.xml
+++ b/plugin.video.metv/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.metv"
        name="MeTV"
-       version="1.0.1"
+       version="1.1.1"
        provider-name="t1m">
   <requires>
     <import addon="xbmc.python" version="2.1.0"/>
@@ -17,7 +17,7 @@
     <platform>all</platform>
     <language>en</language>
     <license>GNU GENERAL PUBLIC LICENSE. Version 2, June 1991</license>
-    <forum></forum>
+    <forum>http://forum.xbmc.org/showthread.php?tid=193014</forum>
     <website>www.metvnetwork.com</website>
     <email></email>
     <source>https://github.com/learningit/plugin.video.metv/</source>
diff --git a/plugin.video.metv/changelog.txt b/plugin.video.metv/changelog.txt
index 721a94a..cb22bd8 100644
--- a/plugin.video.metv/changelog.txt
+++ b/plugin.video.metv/changelog.txt
@@ -1,3 +1,4 @@
+Version 1.1.1 Improved bitrate speeds for videos
 
 Version 1.0.1 Initial release
 
diff --git a/plugin.video.metv/default.py b/plugin.video.metv/default.py
index 07f526b..7aca65f 100644
--- a/plugin.video.metv/default.py
+++ b/plugin.video.metv/default.py
@@ -41,10 +41,9 @@ def demunge(munge):
             pass
         return munge
 
-def getRequest(url):
+def getRequest(url, user_data=None, headers = {'User-Agent':USER_AGENT, 
'Accept':"text/html", 'Accept-Encoding':'gzip,deflate,sdch', 
'Accept-Language':'en-US,en;q=0.8'}  ):
               log("getRequest URL:"+str(url))
-              headers = {'User-Agent':USER_AGENT, 'Accept':"text/html", 
'Accept-Encoding':'gzip,deflate,sdch', 'Accept-Language':'en-US,en;q=0.8'} 
-              req = urllib2.Request(url.encode(UTF8), None, headers)
+              req = urllib2.Request(url.encode(UTF8), user_data, headers)
 
               try:
                  response = urllib2.urlopen(req)
@@ -97,14 +96,31 @@ def getCats(cat_url):
                  
addLink(showurl.encode(UTF8),showname,showimg,showart,showdesc,GENRE_TV,'')
 
 
-def getShow(show_url, show_name):
-            if show_url.startswith('BADASS'):
-              show_url = METVBASE % (show_url.replace('BADASS',''))
+def getShow(mediaID, show_name):
+            if mediaID.startswith('BADASS'):
+              mediaID = METVBASE+mediaID.replace('BADASS','')
               pg = getRequest(show_url)
-              show_url = re.compile('mediaId=(.+?)&').findall(pg)[0]
-            show_url = 
'http://production-ps.lvp.llnw.net/r/PlaylistService/media/%s/getMobilePlaylistByMediaId?platform=MobileH264'
 % (show_url)
-            pg = getRequest(show_url)
-            finalurl = re.compile('"mobileUrl":"(.+?)"').findall(pg)[0]
+              mediaID = re.compile('mediaId=(.+?)&').findall(pg)[0]
+            in0 = '<tns:in0>%s</tns:in0>' % mediaID
+            in1 = '<tns:in1 xsi:nil="true" />'
+            SoapMessage = """<SOAP-ENV:Envelope 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";><SOAP-ENV:Body><tns:getPlaylistByMediaId
 
xmlns:tns="http://service.data.media.pluggd.com";>"""+in0+in1+"""</tns:getPlaylistByMediaId></SOAP-ENV:Body></SOAP-ENV:Envelope>"""
+            html = getRequest("http://ps2.delvenetworks.com/PlaylistService";, 
+                               user_data = SoapMessage, 
+                               headers={ "Host": "ps2.delvenetworks.com", 
+                               "User-Agent":"Mozilla/5.0 (Macintosh; U; Intel 
Mac OS X 10.6; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10",
+                               "Content-type": "text/xml; charset=\"UTF-8\"", 
"Content-length": "%d" % len(SoapMessage), 
+                               "Referer": 
"http://static.delvenetworks.com/deployments/player/player-3.27.1.0.swf?playerForm=Chromeless";,
 
+                               "X-Page-URL": "http://metvnetwork.com/video/";, 
"SOAPAction": "\"\""})
+            streams = re.compile('<Stream>(.+?)</Stream>').findall(html)
+            show_url=''
+            highbitrate = float(0)
+            for stream in streams:
+               (url, bitrate) = 
re.compile('<url>(.+?)</u.+?<videoBitRate>(.+?)</v').findall(stream)[0]
+               if (float(bitrate)) > highbitrate:
+                  show_url = url
+                  highbitrate = float(bitrate)
+            show_url  = show_url.split('mp4:',1)[1]
+            finalurl  = 'http://s2.cpl.delvenetworks.com/%s' % show_url
             xbmcplugin.setResolvedUrl(int(sys.argv[1]), True, 
xbmcgui.ListItem(path = finalurl))
 
 

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

Summary of changes:
 plugin.video.metv/README.txt    |    2 ++
 plugin.video.metv/addon.xml     |    4 ++--
 plugin.video.metv/changelog.txt |    1 +
 plugin.video.metv/default.py    |   36 ++++++++++++++++++++++++++----------
 4 files changed, 31 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to