The branch, frodo has been updated
       via  006e8d242741cef08a3942762bed92619873c6dc (commit)
       via  1116c0613c8c348023bd2854b518b68009c36198 (commit)
      from  5e00d80fce6a5b4fe2c0187b2ce72a924c67c8c1 (commit)

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

commit 006e8d242741cef08a3942762bed92619873c6dc
Author: beenje <bee...@xbmc.org>
Date:   Mon Apr 1 22:00:37 2013 +0200

    [plugin.video.svtplay] updated to version 3.3.0

diff --git a/plugin.video.svtplay/README.md b/plugin.video.svtplay/README.md
index 1311f80..d29dfd1 100644
--- a/plugin.video.svtplay/README.md
+++ b/plugin.video.svtplay/README.md
@@ -1,4 +1,4 @@
-#XBMC SVT Play addon
+# XBMC SVT Play addon
 
 With this addon you can stream content from SVT Play (svtplay.se).
 The plugin fetches the video URL from the SVT Play website and feeds it to the 
XBMC video player. HLS (m3u8) is the preferred video format by the plugin.
@@ -15,8 +15,10 @@ It requires XBMC 12.0 (frodo) to function.
   * By default the addon only displays episodes of a program. If this option 
is enable, the addon will show one section with episodes and one with clips (if 
available) for the program. If this setting is not enabled clips can only be 
found by using the search feature.
 * (Advanced) Don't use avc1.77.30 streams
   * Forces the addon to choose the stream that supports the highest bandwidth 
but does not use the avc1.77.30 profile.
+* (Advanced) Set bandwidth manually
+  * Forces the addon to choose stream according to the set bandwidth. This 
option can be used to force lower resolution streams on devices with lower 
bandwidth capacity (i.e mobile devices). This option can only be used if "Don't 
use avc1.77.30 streams" is disabled.
 
-##Known issues:
+## Known issues:
 
 * Video playback may stutter on Apple TV2  and Raspberry Pi due to the use of 
the h264 profile avc1.77.30
   * Use the advanced plugin option "Don't use avc1.77.30 streams" to 
workaround this issue. This will force SD content only. Note that HD video is 
not supported on Apple TV 2 anymore due to changes by SVT.
diff --git a/plugin.video.svtplay/addon.xml b/plugin.video.svtplay/addon.xml
index 06af377..9c76319 100644
--- a/plugin.video.svtplay/addon.xml
+++ b/plugin.video.svtplay/addon.xml
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <addon id="plugin.video.svtplay"
        name="SVT Play"
-       version="3.2.2"
+       version="3.3.0"
        provider-name="nilzen">
   <requires>
     <import addon="script.module.parsedom" version="1.2.0"/>
diff --git a/plugin.video.svtplay/changelog.txt 
b/plugin.video.svtplay/changelog.txt
index 4f2232d..4271229 100644
--- a/plugin.video.svtplay/changelog.txt
+++ b/plugin.video.svtplay/changelog.txt
@@ -1,3 +1,7 @@
+Version 3.3.0
+-------------
+- Add possibility to set a fixed bandwidth for the plugin (linqcan)
+
 Version 3.2.2
 -------------
 - Fix broken category listing due to site change (linqcan)
diff --git a/plugin.video.svtplay/default.py b/plugin.video.svtplay/default.py
index 8f92ca5..a5836be 100644
--- a/plugin.video.svtplay/default.py
+++ b/plugin.video.svtplay/default.py
@@ -67,6 +67,13 @@ if settings.getSetting("alpha") == "true":
 
 MAX_DIR_ITEMS = int(float(settings.getSetting("diritems")))
 
+BW_SELECT = False
+if settings.getSetting("bwselect") == "true":
+  BW_SELECT = True
+
+LOW_BANDWIDTH  = int(float(settings.getSetting("bandwidth")))
+HIGH_BANDWIDTH = svt.getHighBw(LOW_BANDWIDTH)
+LOW_BANDWIDH   = LOW_BANDWIDTH
 
 def viewStart():
 
@@ -453,6 +460,8 @@ def startVideo(url):
 
   if extension == "HLS" and HLS_STRIP:
     videoUrl = hlsStrip(videoUrl)
+  elif extension == "HLS" and BW_SELECT: 
+    videoUrl = getStream(videoUrl)
 
   if extension == "F4M":
     videoUrl = videoUrl.replace("/z/", 
"/i/").replace("manifest.f4m","master.m3u8")
@@ -467,7 +476,7 @@ def startVideo(url):
 
   if videoUrl:
     
-    if args and not HLS_STRIP:
+    if args and not (HLS_STRIP or BW_SELECT):
       common.log("Appending arguments: "+args)
       videoUrl = videoUrl + args
 
@@ -539,7 +548,6 @@ def hlsStrip(videoUrl):
     lines = ufile.readlines()
 
     newplaylist = "#EXTM3U\n"
-    header = ""
     hlsurl = ""
     bandwidth = 0
     foundhigherquality = False
@@ -551,11 +559,10 @@ def hlsStrip(videoUrl):
         hlsurl = line
       if "EXT-X-STREAM-INF" in line: # The header
         if not "avc1.77.30" in line:
-          match = re.match(r'.*BANDWIDTH=(\d+),.*CODECS=\"(.+?),.+',line)
+          match = re.match(r'.*BANDWIDTH=(\d+).+',line)
           if match:
             if bandwidth < int(match.group(1)):
               foundhigherquality = True
-              header = line
               bandwidth = int(match.group(1))
           continue
 
@@ -563,16 +570,38 @@ def hlsStrip(videoUrl):
       return None
 
     ufile.close()
-    newpath = os.path.join(xbmc.translatePath("special://temp"),"svt.m3u8")
-    newfile = open(newpath, 'w')
-    newplaylist += header + hlsurl
+    hlsurl = hlsurl.rstrip()
+    common.log("Returned stream url : " + hlsurl)
+    return hlsurl
+
 
-    try:
-        newfile.write(newplaylist)
-    finally:
-        newfile.close()
+def getStream(url):
+  """
+  Returns a stream matching the set bandwidth
+  """
+  
+  f = urllib.urlopen(url)
+  lines = f.readlines()
+  
+  marker = "#EXT-X-STREAM-INF"
+  found = False
 
-    return newpath
+  for line in lines:
+    if found:
+      # The stream url is on the line proceeding the header
+      hlsurl = line
+      break
+    if marker in line: # The header
+      match = re.match(r'.*BANDWIDTH=(\d+)000.+',line)
+      if match:
+        if LOW_BANDWIDTH < int(match.group(1)) < HIGH_BANDWIDTH:
+          common.log("Found stream with bandwidth " + match.group(1) + " for 
selected bandwidth " + str(LOW_BANDWIDTH))
+          found = True
+  
+  f.close()
+  hlsurl = hlsurl.rstrip()
+  common.log("Returned stream url: " + hlsurl)
+  return hlsurl
 
 
 def addDirectoryItem(title, params, thumbnail = None, folder = True, live = 
False, info = None):
diff --git a/plugin.video.svtplay/resources/language/English/strings.xml 
b/plugin.video.svtplay/resources/language/English/strings.xml
index ba3c9e7..d2deb2d 100644
--- a/plugin.video.svtplay/resources/language/English/strings.xml
+++ b/plugin.video.svtplay/resources/language/English/strings.xml
@@ -23,6 +23,8 @@
   <string id="30504">Hide sign language interpreted programs</string>
   <string id="30505">Don't use avc1.77.30 streams</string>
   <string id="30506">Show both clips and episodes for programs</string>
+  <string id="30507">Set bandwidth manually</string>
+  <string id="30508">Bandwidth</string>
   <string id="40001">General</string>
   <string id="40002">Advanced</string>
 </strings>
diff --git a/plugin.video.svtplay/resources/language/Swedish/strings.xml 
b/plugin.video.svtplay/resources/language/Swedish/strings.xml
index 7e70bb5..fa59714 100644
--- a/plugin.video.svtplay/resources/language/Swedish/strings.xml
+++ b/plugin.video.svtplay/resources/language/Swedish/strings.xml
@@ -23,6 +23,8 @@
   <string id="30504">Dölj teckentolkade program</string>
   <string id="30505">Använd inte avc1.77.30 videoströmmar</string>
   <string id="30506">Visa både klipp och avsnitt för program</string>
+  <string id="30507">Ställ in bandbredd manuellt</string>
+  <string id="30508">Bandbredd</string>
   <string id="40001">Allmänt</string>
   <string id="40002">Avancerat</string>
 </strings>
diff --git a/plugin.video.svtplay/resources/lib/svt.py 
b/plugin.video.svtplay/resources/lib/svt.py
index f803c83..cb02ac5 100644
--- a/plugin.video.svtplay/resources/lib/svt.py
+++ b/plugin.video.svtplay/resources/lib/svt.py
@@ -7,7 +7,9 @@ import urllib
 common = CommonFunctions
 
 BASE_URL = "http://www.svtplay.se";
-SWF_URL = "http://www.svtplay.se/public/swf/video/svtplayer-2013.02.swf";
+SWF_URL = "http://www.svtplay.se/public/swf/video/svtplayer-2013.05.swf";
+
+BANDWIDTH = [300,500,900,1600,2500,5000]
 
 URL_A_TO_O = "/program"
 URL_CATEGORIES = "/kategorier"
@@ -289,3 +291,10 @@ def getPage(url):
   Wrapper, calls helper.getPage
   """
   return helper.getPage(BASE_URL + url) 
+
+def getHighBw(low):
+  """
+  Returns the higher bandwidth boundary
+  """
+  i = BANDWIDTH.index(low)
+  return BANDWIDTH[i+1]
diff --git a/plugin.video.svtplay/resources/settings.xml 
b/plugin.video.svtplay/resources/settings.xml
index 02a8e24..3e1283a 100644
--- a/plugin.video.svtplay/resources/settings.xml
+++ b/plugin.video.svtplay/resources/settings.xml
@@ -10,5 +10,7 @@
   </category>
   <category label="40002">
     <setting id="hlsstrip" type="bool" label="30505" default="false" />
+    <setting id="bwselect" type="bool" label="30507" default="false" 
enable="eq(-1,false)" />
+    <setting id="bandwidth" type="select" label="30508" default="2500" 
values="300|500|900|1600|2500" enable="eq(-1,true) + eq(-2,false)" />
   </category>
 </settings>

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

commit 1116c0613c8c348023bd2854b518b68009c36198
Author: beenje <bee...@xbmc.org>
Date:   Mon Apr 1 22:00:32 2013 +0200

    [plugin.video.collegehumor] updated to version 2.2.0

diff --git a/plugin.video.collegehumor/addon.py 
b/plugin.video.collegehumor/addon.py
index 82dd20e..b2fe8e1 100644
--- a/plugin.video.collegehumor/addon.py
+++ b/plugin.video.collegehumor/addon.py
@@ -34,7 +34,7 @@ def show_categories():
             page='1',
         ),
     } for category in categories]
-    return plugin.add_items(items)
+    return plugin.finish(items)
 
 
 @plugin.route('/category/<category>/<page>/')
@@ -78,7 +78,7 @@ def show_videos(category, page):
                 page=prev_page
             ),
         })
-    return plugin.add_items(items)
+    return plugin.finish(items)
 
 
 @plugin.route('/watch/<url>/')
diff --git a/plugin.video.collegehumor/addon.xml 
b/plugin.video.collegehumor/addon.xml
index 803c0bd..2891e72 100644
--- a/plugin.video.collegehumor/addon.xml
+++ b/plugin.video.collegehumor/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.collegehumor" name="CollegeHumor" version="2.1.0" 
provider-name="Tristan Fischer (sph...@dersphere.de)">
+<addon id="plugin.video.collegehumor" name="CollegeHumor" version="2.2.0" 
provider-name="Tristan Fischer (sph...@dersphere.de)">
     <requires>
         <import addon="xbmc.python" version="2.1.0"/>
         <import addon="script.module.beautifulsoup" version="3.0.8"/>
@@ -11,6 +11,10 @@
     <extension point="xbmc.addon.metadata">
         <language>en</language>
         <platform>all</platform>
+        <website>http://www.collegehumor.com</website>
+        <source>https://github.com/dersphere/plugin.video.collegehumor</source>
+        <forum>http://forum.xbmc.org/showthread.php?tid=110950</forum>
+        <email>sph...@dersphere.de</email>
         <summary lang="ar">مشاهدة فيديو من 
www.collegehumor.com</summary>
         <summary lang="be">Watch videos from www.collegehumor.com</summary>
         <summary lang="bg">Гледайте видеа от 
www.collegehumor.com</summary>
diff --git a/plugin.video.collegehumor/changelog.txt 
b/plugin.video.collegehumor/changelog.txt
index 62c25f3..75917a4 100644
--- a/plugin.video.collegehumor/changelog.txt
+++ b/plugin.video.collegehumor/changelog.txt
@@ -1,19 +1,24 @@
-2.1.0
+2.2.0 (01.04.2013)
+ Added back "MusicVideos" Category
+ Fixed all items where shown twice
+ Removed debud prints
+
+2.1.0 (11.03.2013)
  Only show original content
  Fixed playback
  changed from xbmcswift to xbmcswift2 v2.4.0
  code cleanup
  added translations
 
-2.0.0
+2.0.0 (07.10.2012)
  Rewrite of most code
  Fix all playback URLs
  New Icon
 
-1.0.2
+1.0.2 (07.11.2011)
  changes for eden
 
-0.0.2
+0.0.2 (07.11.2011)
  dharma released version
  Fixed a small typo
 
diff --git a/plugin.video.collegehumor/resources/lib/scraper.py 
b/plugin.video.collegehumor/resources/lib/scraper.py
index c967dfb..8fcfbcf 100644
--- a/plugin.video.collegehumor/resources/lib/scraper.py
+++ b/plugin.video.collegehumor/resources/lib/scraper.py
@@ -39,10 +39,8 @@ def get_categories():
     categories = []
     for a in tree.find('ul', {'data-role': 'listview'}).findAll('a'):
         if 'playlist' in a['href']:
-            print 'Skipping Playlist'
             continue
-        elif 'video' in a['href']:
-            print 'Skipping'
+        elif a['href'].startswith('/video'):
             continue
         categories.append({
             'title': a.string,
@@ -59,7 +57,6 @@ def get_videos(category, page=1):
     elements = tree.find('ul', {'data-role': 'listview'}).findAll('a')
     for a in elements:
         if 'playlist' in a['href']:
-            print 'Skipping Playlist'
             continue
         videos.append({
             'title': a.h3.string,
@@ -87,7 +84,6 @@ def get_video_file(link):
 
 
 def __get_tree(url, data_dict=None, mobile=True):
-    print 'Opening url: %s' % url
     if data_dict:
         post_data = urlencode(data_dict)
     else:

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

Summary of changes:
 plugin.video.collegehumor/addon.py                 |    4 +-
 plugin.video.collegehumor/addon.xml                |    6 ++-
 plugin.video.collegehumor/changelog.txt            |   13 +++--
 plugin.video.collegehumor/resources/lib/scraper.py |    6 +--
 plugin.video.svtplay/README.md                     |    6 ++-
 plugin.video.svtplay/addon.xml                     |    2 +-
 plugin.video.svtplay/changelog.txt                 |    4 ++
 plugin.video.svtplay/default.py                    |   53 +++++++++++++++-----
 .../resources/language/English/strings.xml         |    2 +
 .../resources/language/Swedish/strings.xml         |    2 +
 plugin.video.svtplay/resources/lib/svt.py          |   11 ++++-
 plugin.video.svtplay/resources/settings.xml        |    2 +
 12 files changed, 83 insertions(+), 28 deletions(-)


hooks/post-receive
-- 
Plugins

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
Xbmc-addons mailing list
Xbmc-addons@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xbmc-addons

Reply via email to