The branch, dharma has been updated
via 81b0ea77ef9f86a4fea0b589976af57614f31fa7 (commit)
from 64be9521e7ff81df08a4c723742c4f95eb43e3d6 (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=81b0ea77ef9f86a4fea0b589976af57614f31fa7
commit 81b0ea77ef9f86a4fea0b589976af57614f31fa7
Author: spiff <[email protected]>
Date: Thu Oct 13 17:04:33 2011 +0200
[plugin.video.hockeystreams] updated to version 1.7.1
diff --git a/plugin.video.hockeystreams/addon.xml
b/plugin.video.hockeystreams/addon.xml
index 05b69e8..9dc85a0 100644
--- a/plugin.video.hockeystreams/addon.xml
+++ b/plugin.video.hockeystreams/addon.xml
@@ -2,7 +2,7 @@
<addon
id="plugin.video.hockeystreams"
name="Hockeystreams"
- version="1.7.0"
+ version="1.7.1"
provider-name="wotever"
>
<requires>
diff --git a/plugin.video.hockeystreams/default.py
b/plugin.video.hockeystreams/default.py
index 5c6c708..58b64aa 100644
--- a/plugin.video.hockeystreams/default.py
+++ b/plugin.video.hockeystreams/default.py
@@ -16,10 +16,8 @@ cookiepath = __datapath__
__plugin__ = "Hockeystreams"
__author__ = "wotever"
-__version__ = "1.7.0"
-__url__ = "http://code.google.com/p/xbmc-hockeystreams/"
-__svn__ = "http://xbmc-hockeystreams.googlecode.com/svn/trunk/"
-__svn_revision__ = "$Revision$"
+__version__ = "1.7.1"
+__url__ = "https://github.com/jlongman/xbmc-hockeystreams-plugin/"
__settings__ = xbmcaddon.Addon(id='plugin.video.hockeystreams')
__dbg__ = __settings__.getSetting("debug") == "true"
@@ -246,9 +244,10 @@ def LIVE_GAMES(mode):
if (__dbg__):
print ("hockeystreams: enter live games")
html = urllib.urlopen("http://www4.hockeystreams.com/rss/streams.php")
- games = hs_rss.get_rss_streams(html, __dbg__)
+ games = hs_rss.get_rss_streams(html, _debug_ = __dbg__)
for gameName, url, date, real_date in sorted(games, key = lambda game:
game[3]):
- gameName = gameName + " " + date.split(' - ', 1)[1]
+ if '-' in date:
+ gameName = gameName + " " + date.split(' - ', 1)[1]
addDir(gameName, url, mode, '', 1, gamename = gameName, fullDate =
real_date)
def LAST_15_GAMES(mode):
@@ -256,7 +255,7 @@ def LAST_15_GAMES(mode):
if (__dbg__):
print ("hockeystreams: enter live games")
html = urllib.urlopen("http://www6.hockeystreams.com/rss/archives.php")
- games = hs_rss.get_archive_rss_streams(html, __dbg__)
+ games = hs_rss.get_archive_rss_streams(html, _debug_ = __dbg__)
for gameName, url, date, real_date in sorted(games, key = lambda game:
game[3], reverse=True):
gameName = gameName + " " + date
url = hockeystreams + url
diff --git a/plugin.video.hockeystreams/hs_rss.py
b/plugin.video.hockeystreams/hs_rss.py
index 8327630..fa504e8 100644
--- a/plugin.video.hockeystreams/hs_rss.py
+++ b/plugin.video.hockeystreams/hs_rss.py
@@ -14,40 +14,54 @@ def getText(nodelist):
return ''.join(rc)
-def get_archive_rss_streams(rssBody, __debug__):
- return get_rss_streams(rssBody, False, __debug__)
+def get_archive_rss_streams(rssBody, _debug_):
+ return get_rss_streams(rssBody, False, _debug_)
-def get_rss_streams(rssBody, live = True, __debug__ = False):
+def get_rss_streams(rssBody, live = True, _debug_ = False):
+ print "get_rss_streams: debug = " + str(_debug_)
gameDom = minidom.parse(rssBody)
games = []
for game in gameDom.getElementsByTagName('item'):
title = getText(game.getElementsByTagName('title')[0].childNodes)
description =
getText(game.getElementsByTagName('description')[0].childNodes)
- if __debug__:
+ if _debug_:
print "title " + title + " description " + description
- date, rest = description.split('<', 1)
- date = date.strip()
- if __debug__:
- print "date " + date + "rest " + rest
if live:
- url = re.search( 'href="(http://.*?[0-9]+/)[a-z_]+"',
rest).group(1)
- if "Final" in date:
- real_date = time.strptime(date, "%m/%d/%Y - Final")
+ date, rest = description.strip().split('<a', 1)
+ date = date.strip()
+ if date.endswith('-'): #ongoing
+ date = date[:-2]
+ if date.endswith(','): #final
+ date = date[:-1]
+ else:
+ date, rest = description.strip().split(' ', 1)
+ date = date.strip()
+ if _debug_:
+ print "date " + date + " rest " + rest
+ links = game.getElementsByTagName('link')
+ if len(links) > 0 and len(links[0].childNodes) > 0:
+ url = getText(links[0].childNodes)
+ else:
+ if live:
+ url = re.search('href="(http://.*?[0-9]+/)[a-z_]+"',
rest).group(1)
else:
+ url = re.search('href="(/.*?/[0-9]+/)[a-z_]+"', rest).group(1)
+ if _debug_:
+ print "url " + url
+
+ if "Final" in date:
+ real_date = time.strptime(date, "%m/%d/%Y - Final")
+ else:
+ try:
+ real_date = time.strptime(date, "%m/%d/%Y - %I:%M %p")
+ except:
try:
- real_date = time.strptime(date, "%m/%d/%Y - %I:%M %p")
+ real_date = time.strptime(date, "%m/%d/%Y")
except:
real_date = datetime.date.today()
- else:
- url = re.search( 'href="(/.*?/[0-9]+/)[a-z_]+"', rest).group(1)
- real_date = time.strptime(date, "%m/%d/%Y")
-
- if __debug__:
- print "url " + url
games.append(
(title, url, date, real_date )
)
-
return games
-----------------------------------------------------------------------
Summary of changes:
plugin.video.hockeystreams/addon.xml | 2 +-
plugin.video.hockeystreams/changelog.txt | 4 ++
plugin.video.hockeystreams/default.py | 13 +++----
plugin.video.hockeystreams/hs_rss.py | 52 +++++++++++++++++++-----------
4 files changed, 44 insertions(+), 27 deletions(-)
create mode 100644 plugin.video.hockeystreams/changelog.txt
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons