The branch, eden has been updated
via cbf677907de8625a9724c99b0661ad72458a780c (commit)
via bb75214eb460bd29671cce5cd2d79de4c96f3571 (commit)
from c15451ec0fe2d21c60e73e05ca88860b9b00db4b (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=cbf677907de8625a9724c99b0661ad72458a780c
commit cbf677907de8625a9724c99b0661ad72458a780c
Author: spiff <[email protected]>
Date: Tue Mar 6 08:39:51 2012 +0100
[plugin.audio.radio_de] updated to version 1.0.6
diff --git a/plugin.audio.radio_de/addon.py b/plugin.audio.radio_de/addon.py
index 177dcfc..ad7501e 100644
--- a/plugin.audio.radio_de/addon.py
+++ b/plugin.audio.radio_de/addon.py
@@ -7,7 +7,7 @@ __id__ = 'plugin.audio.radio_de'
class Plugin_mod(Plugin):
- def add_items(self, iterable, view_mode=None, sort_method_ids=[]):
+ def add_items(self, iterable, view_mode=None):
items = []
urls = []
for i, li_info in enumerate(iterable):
@@ -20,8 +20,9 @@ class Plugin_mod(Plugin):
if view_mode:
xbmc.executebuiltin('Container.SetViewMode(%s)' % view_mode)
xbmcplugin.addDirectoryItems(self.handle, items, len(items))
- for id in sort_method_ids:
- xbmcplugin.addSortMethod(self.handle, id)
+ xbmcplugin.addSortMethod(self.handle,
+ xbmcplugin.SORT_METHOD_UNSORTED,
+ label2Mask="%X")
xbmcplugin.endOfDirectory(self.handle)
return urls
@@ -170,8 +171,9 @@ def show_mystations():
language = __get_language()
stations = []
for station_id in my_station_ids:
- stations.append(scraper.get_station_by_station_id(language,
- station_id))
+ station = scraper.get_station_by_station_id(language, station_id)
+ if station:
+ stations.append(station)
items = __format_stations(stations)
__log('show_mystations end')
return plugin.add_items(items)
@@ -283,4 +285,4 @@ def __log(text):
xbmc.log('%s addon: %s' % (__addon_name__, text))
if __name__ == '__main__':
- plugin.run()
+ plugin.run()
\ No newline at end of file
diff --git a/plugin.audio.radio_de/addon.xml b/plugin.audio.radio_de/addon.xml
index 7543773..bfca5cb 100644
--- a/plugin.audio.radio_de/addon.xml
+++ b/plugin.audio.radio_de/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.audio.radio_de" name="Radio" version="1.0.5"
provider-name="Tristan Fischer ([email protected])">
+<addon id="plugin.audio.radio_de" name="Radio" version="1.0.6"
provider-name="Tristan Fischer ([email protected])">
<requires>
<import addon="xbmc.python" version="2.0"/>
<import addon="script.module.xbmcswift" version="0.2.0"/>
diff --git a/plugin.audio.radio_de/changelog.txt
b/plugin.audio.radio_de/changelog.txt
index ca04ebc..c760588 100644
--- a/plugin.audio.radio_de/changelog.txt
+++ b/plugin.audio.radio_de/changelog.txt
@@ -1,3 +1,8 @@
+1.0.6 (05.03.2012)
+ - Fixed: error if a station was added to the list of mystations but has
become unavailable
+ - Improved error catching
+ - Improved: Show bitrate in "kbit/s", not "B"
+
1.0.5 (26.02.2012)
- Fixed .m3u playlists with empty lines (thx to Malte_Schroeder)
diff --git a/plugin.audio.radio_de/resources/lib/scraper.py
b/plugin.audio.radio_de/resources/lib/scraper.py
index f95fa04..9074688 100644
--- a/plugin.audio.radio_de/resources/lib/scraper.py
+++ b/plugin.audio.radio_de/resources/lib/scraper.py
@@ -2,7 +2,7 @@
import simplejson as json
from urllib import urlencode
-from urllib2 import urlopen, Request, HTTPError
+from urllib2 import urlopen, Request, HTTPError, URLError
MAIN_URLS = {'english': 'http://rad.io/info',
'german': 'http://radio.de/info',
@@ -105,14 +105,13 @@ def get_station_by_station_id(language, station_id):
__log('get_station_by_station_id started with language=%s, station_id=%s'
% (language, station_id))
path = 'broadcast/getbroadcastembedded'
- if not station_id:
- raise
gets = {'broadcast': station_id}
station = __get_json(path, gets, language)
- if station['streamURL'][-3:] in ('m3u', 'pls'):
- station['streamURL'] = __resolve_playlist(station['streamURL'])
- __log('get_station_by_station_id end')
- return station
+ if 'streamURL' in station:
+ if station['streamURL'][-3:] in ('m3u', 'pls'):
+ station['streamURL'] = __resolve_playlist(station['streamURL'])
+ __log('get_station_by_station_id end')
+ return station
def __get_json(path, gets, language):
@@ -126,24 +125,17 @@ def __get_json(path, gets, language):
full_url = '%s/%s?%s' % (MAIN_URL, path, urlencode(gets))
else:
full_url = '%s/%s' % (MAIN_URL, path)
- req = Request(full_url)
- req.add_header('User-Agent', USER_AGENT)
- __log('__get_json opening url=%s' % full_url)
- response = urlopen(req).read()
- __log('__get_json ended with %d bytes result' % len(response))
- return json.loads(response)
+ response = __urlopen(full_url)
+ try:
+ json_data = json.loads(response)
+ except TypeError:
+ json_data = None
+ return json_data
def __resolve_playlist(playlist_url):
__log('__resolve_playlist started with playlist_url=%s' % playlist_url)
- req = Request(playlist_url)
- req.add_header('User-Agent', USER_AGENT)
- __log('__resolve_playlist opening url=%s' % playlist_url)
- try:
- response = urlopen(req).read()
- except HTTPError, error:
- __log('__resolve_playlist ERROR: %s' % error)
- return playlist_url
+ response = __urlopen(playlist_url)
stream_url = None
if playlist_url.endswith('m3u'):
__log('__resolve_playlist found .m3u file')
@@ -164,5 +156,21 @@ def __resolve_playlist(playlist_url):
return stream_url
+def __urlopen(url):
+ __log('__urlopen opening url=%s' % url)
+ req = Request(url)
+ req.add_header('User-Agent', USER_AGENT)
+ try:
+ response = urlopen(req).read()
+ except HTTPError, error:
+ __log('__urlopen HTTPError: %s' % error)
+ return
+ except URLError, error:
+ __log('__urlopen URLError: %s' % error)
+ return
+ __log('__urlopen ended with %d bytes result' % len(response))
+ return response
+
+
def __log(text):
print 'Radio.de scraper: %s' % text
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=bb75214eb460bd29671cce5cd2d79de4c96f3571
commit bb75214eb460bd29671cce5cd2d79de4c96f3571
Author: spiff <[email protected]>
Date: Tue Mar 6 08:36:39 2012 +0100
[plugin.video.svtplay] updated to version 2.0.2
diff --git a/plugin.video.svtplay/addon.xml b/plugin.video.svtplay/addon.xml
index 9b266d9..38fcc00 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="2.0.1"
+ version="2.0.2"
provider-name="nilzen">
<requires>
<import addon="xbmc.python" version="2.0"/>
diff --git a/plugin.video.svtplay/changelog.txt
b/plugin.video.svtplay/changelog.txt
index 520dafe..0c4689a 100644
--- a/plugin.video.svtplay/changelog.txt
+++ b/plugin.video.svtplay/changelog.txt
@@ -1,3 +1,7 @@
+Version 2.0.2
+-------------
+- Updated SWF-player URL
+
Version 2.0.1
-------------
- Added swf verification
@@ -26,4 +30,4 @@ Version 1.0.1
Version 1.0.0
-------------
-- Initial release
\ No newline at end of file
+- Initial release
diff --git a/plugin.video.svtplay/default.py b/plugin.video.svtplay/default.py
index 845e1a8..ac76e51 100644
--- a/plugin.video.svtplay/default.py
+++ b/plugin.video.svtplay/default.py
@@ -1,12 +1,14 @@
# -*- coding: utf-8 -*-
import os
+import sys
import urllib
import urllib2
+import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
-from xml.dom.minidom import parse, parseString
+from xml.dom.minidom import parseString
__settings__ = xbmcaddon.Addon(id='plugin.video.svtplay')
__language__ = __settings__.getLocalizedString
@@ -55,11 +57,11 @@ def deviceconfiguration(node=None, target="", path=""):
if target == path:
- type = outline.getAttribute("type")
+ outline_type = outline.getAttribute("type")
if path + title == "Karusellen" \
or path + title == "Hjälpmeny" \
- or not (type == "rss" or type == "menu"):
+ or not (outline_type == "rss" or outline_type ==
"menu"):
continue
thumbnail = outline.getAttributeNS(NS_PLAYOPML,
"thumbnail")
@@ -111,9 +113,9 @@ def title_list(ids="", url="", offset=1, list_size=0):
if thumbnail_nodes:
thumb = thumbnail_nodes[0].getAttribute("url")
- id = get_node_value(item, "titleId", NS_PLAYRSS)
+ title_id = get_node_value(item, "titleId", NS_PLAYRSS)
- params = { "mode": MODE_VIDEO_LIST, "ids": id }
+ params = { "mode": MODE_VIDEO_LIST, "ids": title_id }
list_size += 1
offset += 1
@@ -136,7 +138,6 @@ def video_list(ids="", url="", offset=1, list_size=0):
thumb = get_media_thumbnail(item)
title = get_node_value(media, "title", NS_MEDIA)
description = get_node_value(item, "description")
- pubDate = get_node_value(item, "pubDate")
# TODO: parse date/time
# TODO: add label "date" (string (%d.%m.%Y /
01.01.2009) - file date)
@@ -182,12 +183,10 @@ def teaser_list(ids="", url="", offset=1, list_size=0):
if list_size < SETTINGS_MAX_ITEMS_PER_PAGE:
- media = get_media_content(item)
- thumb = get_media_thumbnail(item)
title = unicode(get_node_value(item,
"title")).encode('utf-8')
- id = get_node_value(item, "titleId", NS_PLAYRSS)
+ title_id = get_node_value(item, "titleId", NS_PLAYRSS)
- params = { "mode": MODE_VIDEO_LIST, "ids": id }
+ params = { "mode": MODE_VIDEO_LIST, "ids": title_id }
list_size += 1
offset += 1
@@ -242,25 +241,25 @@ def get_media_thumbnail(node):
return None
def get_media_content(node, settings_bitrate = SETTINGS_HIGHEST_BITRATE):
-
+
group = node.getElementsByTagNameNS(NS_MEDIA, "group")
if group:
content_list = group[0].getElementsByTagNameNS(NS_MEDIA,
"content");
else:
content_list = node.getElementsByTagNameNS(NS_MEDIA, "content");
-
+
content = None
-
+
for c in content_list:
if not c.getAttribute("bitrate"):
continue
bitrate = float(c.getAttribute("bitrate"))
- type = c.getAttribute("type")
+ mime_type = c.getAttribute("type")
- if type == 'application/vnd.apple.mpegurl':
+ if mime_type == 'application/vnd.apple.mpegurl':
continue
if (not content and bitrate <= settings_bitrate) or (content
and bitrate > float(content.getAttribute("bitrate")) and bitrate <=
settings_bitrate):
@@ -275,9 +274,9 @@ def get_media_content(node, settings_bitrate =
SETTINGS_HIGHEST_BITRATE):
continue
framerate = float(c.getAttribute("framerate"))
- type = c.getAttribute("type")
+ mime_type = c.getAttribute("type")
- if type == 'application/vnd.apple.mpegurl':
+ if mime_type == 'application/vnd.apple.mpegurl':
continue
if not content or framerate >
float(content.getAttribute("framerate")):
@@ -310,7 +309,7 @@ def add_directory_item(name, params={}, thumbnail=None,
isFolder=True,
url = params["url"]
if url.find('rtmp') == 0:
- url += "
swfUrl=http://svtplay.se/flash/svtplayer-2011.18.swf swfVfy=1"
+ url += "
swfUrl=http://svtplay.se/flash/svtplayer-2012.1.swf swfVfy=1"
if not infoLabels:
infoLabels = { "Title": name }
@@ -335,13 +334,13 @@ def add_subtitles(listItem, subtitles):
for i in range(len(subtitles)):
listItem.setProperty("upnp:subtitle:" + str(i+1), subtitles[i])
-def parameters_string_to_dict(str):
+def parameters_string_to_dict(param_string):
params = {}
- if str:
+ if param_string:
- pairs = str[1:].split("&")
+ pairs = param_string[1:].split("&")
for pair in pairs:
@@ -357,7 +356,6 @@ def search(mode,url):
if searchString == "":
xbmcgui.Dialog().ok( __language__( 30301 ), __language__( 30302
) )
elif searchString:
- latestSearch = __settings__.setSetting( "latestSearch",
searchString )
dialogProgress = xbmcgui.DialogProgress()
dialogProgress.create( "", __language__( 30303 ) , searchString)
#The XBMC onscreen keyboard outputs utf-8 and this need to be
encoded to unicode
-----------------------------------------------------------------------
Summary of changes:
plugin.audio.radio_de/addon.py | 14 ++++---
plugin.audio.radio_de/addon.xml | 2 +-
plugin.audio.radio_de/changelog.txt | 5 ++
plugin.audio.radio_de/resources/lib/scraper.py | 50 ++++++++++++++----------
plugin.video.svtplay/addon.xml | 2 +-
plugin.video.svtplay/changelog.txt | 6 ++-
plugin.video.svtplay/default.py | 42 +++++++++----------
7 files changed, 69 insertions(+), 52 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons