The branch, frodo has been updated
via 345da9557226b61394d15dbbf77ca992f1bd2645 (commit)
via 093233690941b877b3f3e1251fc6f78e258e87f4 (commit)
from 5e07b2c663bc2ce6ff5788f01dc42364b39eaa2b (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=345da9557226b61394d15dbbf77ca992f1bd2645
commit 345da9557226b61394d15dbbf77ca992f1bd2645
Author: sphere <[email protected]>
Date: Wed Apr 9 08:13:56 2014 +0200
[plugin.video.ted.talks] updated to version 4.2.4
diff --git a/plugin.video.ted.talks/addon.xml b/plugin.video.ted.talks/addon.xml
index 65c2300..16938aa 100644
--- a/plugin.video.ted.talks/addon.xml
+++ b/plugin.video.ted.talks/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.ted.talks" name="TED Talks" version="4.2.3"
provider-name="rwparris2, moreginger">
+<addon id="plugin.video.ted.talks" name="TED Talks" version="4.2.4"
provider-name="rwparris2, moreginger">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.elementtree" version="1.2.7"/>
diff --git a/plugin.video.ted.talks/changelog.txt
b/plugin.video.ted.talks/changelog.txt
index e7ea746..ebf0515 100644
--- a/plugin.video.ted.talks/changelog.txt
+++ b/plugin.video.ted.talks/changelog.txt
@@ -1,5 +1,8 @@
+[B]Version 4.2.4[/B]
+Fix issue attempting to show subtitles when there aren't any (issue#50
issue#51)
+
[B]Version 4.2.3[/B]
-Fix workaround for newest talks with Python <2.7 [issue#41]
+Fix workaround for newest talks with Python <2.7 (issue#41)
[B]Version 4.2.2[/B]
Fix issue that stopped plugin loading (issue#47)
diff --git a/plugin.video.ted.talks/resources/lib/model/subtitles_scraper.py
b/plugin.video.ted.talks/resources/lib/model/subtitles_scraper.py
index 144178d..3c9d4a4 100644
--- a/plugin.video.ted.talks/resources/lib/model/subtitles_scraper.py
+++ b/plugin.video.ted.talks/resources/lib/model/subtitles_scraper.py
@@ -35,10 +35,9 @@ def __get_languages__(talk_json):
'''
return [l['languageCode'] for l in talk_json['languages']]
-def get_subtitles(talk_id, language):
+def get_subtitles(talk_id, language, logger):
url = 'http://www.ted.com/talks/subtitles/id/%s/lang/%s' % (talk_id,
language)
subs = json.loads(urllib.urlopen(url).read())
-
captions = []
for caption in subs['captions']:
captions += [{'start': caption['startTime'], 'duration':
caption['duration'], 'content': caption['content']}]
@@ -53,19 +52,25 @@ def get_subtitles_for_talk(talk_json, accepted_languages,
logger):
try:
languages = __get_languages__(talk_json)
+
+ if len(languages) == 0:
+ msg = 'No subtitles found'
+ logger(msg, msg)
+ return None
+
+ language_matches = [l for l in accepted_languages if l in languages]
+ if not language_matches:
+ msg = 'No subtitles in: %s' % (",".join(accepted_languages))
+ logger(msg, msg)
+ return None
+
+ raw_subtitles = get_subtitles(talk_id, language_matches[0], logger)
+ if not raw_subtitles:
+ return None
+
+ return format_subtitles(raw_subtitles, int(float(intro_duration) *
1000))
+
except Exception, e:
+ # Must not fail!
logger('Could not display subtitles: %s' % (e), __friendly_message__)
return None
- if len(languages) == 0:
- msg = 'No subtitles found'
- logger(msg, msg)
- return None
-
- language_matches = [l for l in accepted_languages if l in languages]
- if not language_matches:
- msg = 'No subtitles in: %s' % (",".join(accepted_languages))
- logger(msg, msg)
- return None
-
- raw_subtitles = get_subtitles(talk_id, language_matches[0])
- return format_subtitles(raw_subtitles, int(float(intro_duration) * 1000))
diff --git
a/plugin.video.ted.talks/resources/lib/model/subtitles_scraper_test.py
b/plugin.video.ted.talks/resources/lib/model/subtitles_scraper_test.py
index a75be5b..8761343 100644
--- a/plugin.video.ted.talks/resources/lib/model/subtitles_scraper_test.py
+++ b/plugin.video.ted.talks/resources/lib/model/subtitles_scraper_test.py
@@ -3,6 +3,8 @@ import subtitles_scraper
import urllib
import tempfile
import talk_scraper
+import time
+import sys
class TestSubtitlesScraper(unittest.TestCase):
@@ -25,7 +27,7 @@ World
''', formatted_subs)
def test_get_subtitles_bad_language(self):
- subs = subtitles_scraper.get_subtitles('1253', 'panda')
+ subs = subtitles_scraper.get_subtitles('1253', 'panda', None)
# It returns the English subtitles :(
self.assertEqual('You all know the truth of what I\'m going to say.',
subs[0]['content'])
@@ -44,6 +46,20 @@ Vous savez tous que ce que je vais dire est vrai.
2'''))
+ def test_get_subtitles_for_newest_talk(self):
+ '''
+ Newest talk often won't have subtitles when first made available.
+ When this is the case we must return None and not throw.
+ '''
+ from rss_scraper import NewTalksRss
+ newest_talk = sorted(NewTalksRss(None).get_new_talks(), key=lambda t:
time.strptime(t['date'], "%d.%m.%Y"), reverse=True)[0]
+
+ talk_json = self.__get_talk_json__(newest_talk['link'])
+ subs = subtitles_scraper.get_subtitles_for_talk(talk_json, ['en'],
lambda m1, m2: sys.stdout.write('%s\n%s' % (m1, m2)))
+ if subs:
+ print "Newest Talk (%s) has subtitles: test ineffective" %
(newest_talk['title'])
+
+
def __get_talk_json__(self, url):
html = urllib.urlopen(url).read()
foo, fi, fo, fum, talk_json = talk_scraper.get(html)
diff --git a/plugin.video.ted.talks/resources/lib/plugin.py
b/plugin.video.ted.talks/resources/lib/plugin.py
index 2ec3403..1dc6392 100644
--- a/plugin.video.ted.talks/resources/lib/plugin.py
+++ b/plugin.video.ted.talks/resources/lib/plugin.py
@@ -26,6 +26,6 @@ def init():
def report(gnarly_message, friendly_message=None):
import xbmc
- print "[%s] %s" % (__plugin__, gnarly_message)
+ xbmc.log("[%s] %s" % (__plugin__, gnarly_message), level=xbmc.LOGNOTICE)
if friendly_message:
xbmc.executebuiltin('Notification("%s","%s",)' % (__pluginLS__,
friendly_message))
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=093233690941b877b3f3e1251fc6f78e258e87f4
commit 093233690941b877b3f3e1251fc6f78e258e87f4
Author: sphere <[email protected]>
Date: Wed Apr 9 08:12:36 2014 +0200
[plugin.video.yousee.tv] updated to version 3.0.4
diff --git a/plugin.video.yousee.tv/addon.py b/plugin.video.yousee.tv/addon.py
index 58f0f99..4efc193 100644
--- a/plugin.video.yousee.tv/addon.py
+++ b/plugin.video.yousee.tv/addon.py
@@ -93,13 +93,22 @@ class YouSeeTv(object):
for idx in range(0, len(lines)):
pos = lines[idx].rfind('BANDWIDTH')
if pos >= 0:
- bitrate = int(lines[idx][pos + 10:])
+ bandwidth = lines[idx][pos + 10:]
+ pos = bandwidth.find(',')
+ if pos >= 0:
+ bandwidth = bandwidth[:pos]
+ print bandwidth
+ bitrate = int(bandwidth)
if bitrate > bestBitrate:
bestBitrate = bitrate
- path = lines[idx+1]
-
- host = url[0:url.find('/', 8)]
- return host + path
+ path = lines[idx + 1]
+
+ if path[0] == '/': # absolute path
+ host = url[0:url.find('/', 8)]
+ playUrl = host + path
+ else: # relative
+ playUrl = url[0:url.rfind('/') + 1] + path
+ return playUrl
def _anyChannelIconsMissing(self, channels):
for channel in channels:
diff --git a/plugin.video.yousee.tv/addon.xml b/plugin.video.yousee.tv/addon.xml
index 9e48a6a..0f0802e 100644
--- a/plugin.video.yousee.tv/addon.xml
+++ b/plugin.video.yousee.tv/addon.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<addon id="plugin.video.yousee.tv" version="3.0.3" name="YouSee web-tv"
provider-name="twinther">
+<addon id="plugin.video.yousee.tv" version="3.0.4" name="YouSee web-tv"
provider-name="twinther">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.buggalo" version="1.1.5"/>
diff --git a/plugin.video.yousee.tv/changelog.txt
b/plugin.video.yousee.tv/changelog.txt
index e958101..50e2fd7 100644
--- a/plugin.video.yousee.tv/changelog.txt
+++ b/plugin.video.yousee.tv/changelog.txt
@@ -1,3 +1,6 @@
+[B]Version 3.0.4 - 2014-04-08[/B]
+- Fixed playback of YouBio
+
[B]Version 3.0.3 - 2014-03-07[/B]
- Hide encrypted channels
-----------------------------------------------------------------------
Summary of changes:
plugin.video.ted.talks/addon.xml | 2 +-
plugin.video.ted.talks/changelog.txt | 5 ++-
.../resources/lib/model/subtitles_scraper.py | 35 +++++++++++--------
.../resources/lib/model/subtitles_scraper_test.py | 18 +++++++++-
plugin.video.ted.talks/resources/lib/plugin.py | 2 +-
plugin.video.yousee.tv/addon.py | 19 ++++++++---
plugin.video.yousee.tv/addon.xml | 2 +-
plugin.video.yousee.tv/changelog.txt | 3 ++
8 files changed, 61 insertions(+), 25 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons