The branch, frodo has been updated
via 143760d34bfb49e41b7b73e68854db1338a4a9d0 (commit)
from baf4d3c0fd2e29a22675f7fc1bffb22bc20ac1aa (commit)
- Log -----------------------------------------------------------------
http://xbmc.git.sourceforge.net/git/gitweb.cgi?p=xbmc/plugins;a=commit;h=143760d34bfb49e41b7b73e68854db1338a4a9d0
commit 143760d34bfb49e41b7b73e68854db1338a4a9d0
Author: beenje <[email protected]>
Date: Fri Apr 19 23:49:55 2013 +0200
[plugin.video.ted.talks] updated to version 4.1.9
diff --git a/plugin.video.ted.talks/addon.xml b/plugin.video.ted.talks/addon.xml
index 90e7a19..3b67f82 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.1.8"
provider-name="rwparris2, moreginger">
+<addon id="plugin.video.ted.talks" name="TED Talks" version="4.1.9"
provider-name="rwparris2, moreginger">
<requires>
<import addon="xbmc.python" version="2.1.0"/>
<import addon="script.module.simplejson" version="2.0.10"/>
diff --git a/plugin.video.ted.talks/changelog.txt
b/plugin.video.ted.talks/changelog.txt
index 56b4eaa..f25a03c 100644
--- a/plugin.video.ted.talks/changelog.txt
+++ b/plugin.video.ted.talks/changelog.txt
@@ -1,3 +1,6 @@
+[B]Version 4.1.9[/B]
+Fix playing talks where the title text has no colon (issue#38)
+
[B]Version 4.1.8[/B]
Allow video quality to be set (issue#37)
Playback of Vimeo-hosted talks (issue#24)
diff --git a/plugin.video.ted.talks/resources/lib/model/talk_scraper.py
b/plugin.video.ted.talks/resources/lib/model/talk_scraper.py
index acafe24..445af01 100644
--- a/plugin.video.ted.talks/resources/lib/model/talk_scraper.py
+++ b/plugin.video.ted.talks/resources/lib/model/talk_scraper.py
@@ -13,8 +13,9 @@ def get(html, video_quality='320kbps'):
"""
headline = xbmc_common.parseDOM(html, 'span',
attrs={'id':'altHeadline'})[0].split(':', 1)
- speaker = headline[0].strip()
- title = headline[1].strip()
+ # Cope with no ':' in title.
+ speaker = "Unknown" if len(headline) == 1 else headline[0].strip()
+ title = headline[0].strip() if len(headline) == 1 else headline[1].strip()
plot = xbmc_common.parseDOM(html, 'p', attrs={'id':'tagline'})[0]
url = None
diff --git a/plugin.video.ted.talks/resources/lib/model/talk_scraper_test.py
b/plugin.video.ted.talks/resources/lib/model/talk_scraper_test.py
index fc63ff2..7c94823 100644
--- a/plugin.video.ted.talks/resources/lib/model/talk_scraper_test.py
+++ b/plugin.video.ted.talks/resources/lib/model/talk_scraper_test.py
@@ -11,13 +11,16 @@ def get_HTML(url):
class TestTalkScraper(unittest.TestCase):
def test_get_ted_video(self):
-
self.assert_talk_details("http://www.ted.com/talks/ariel_garten_know_thyself_with_a_brain_scanner.html",
"http://download.ted.com/talks/ArielGarten_2011X.mp4?apikey=TEDDOWNLOAD",
u"Know thyself, with a brain scanner", u"Ariel Garten")
+
self.assert_talk_details("http://www.ted.com/talks/ariel_garten_know_thyself_with_a_brain_scanner.html",
"http://download.ted.com/talks/ArielGarten_2011X.mp4?apikey=TEDDOWNLOAD",
"Know thyself, with a brain scanner", "Ariel Garten")
+
+ # No ':' in title. Can't determine speaker.
+
self.assert_talk_details("http://www.ted.com/talks/tom_shannon_s_magnetic_sculpture.html",
"http://download.ted.com/talks/TomShannon_2003.mp4?apikey=TEDDOWNLOAD", "Tom
Shannon's anti-gravity sculpture", "");
def test_get_youtube_video(self):
-
self.assert_talk_details("http://www.ted.com/talks/bjarke_ingels_hedonistic_sustainability.html",
"plugin://plugin.video.youtube/?action=play_video&videoid=ogXT_CI7KRU",
u"Hedonistic sustainability", u"Bjarke Ingels")
+
self.assert_talk_details("http://www.ted.com/talks/bjarke_ingels_hedonistic_sustainability.html",
"plugin://plugin.video.youtube/?action=play_video&videoid=ogXT_CI7KRU",
"Hedonistic sustainability", "Bjarke Ingels")
def test_get_vimeo_video(self):
-
self.assert_talk_details("http://www.ted.com/talks/seth_godin_this_is_broken_1.html",
"plugin://plugin.video.vimeo?action=play_video&videoid=4246943", u"This is
broken", u"Seth Godin")
+
self.assert_talk_details("http://www.ted.com/talks/seth_godin_this_is_broken_1.html",
"plugin://plugin.video.vimeo?action=play_video&videoid=4246943", "This is
broken", "Seth Godin")
def assert_talk_details(self, talk_url, expected_video_url,
expected_title, expected_speaker):
video_url, title, speaker, plot = talk_scraper.get(get_HTML(talk_url))
-----------------------------------------------------------------------
Summary of changes:
plugin.video.ted.talks/addon.xml | 2 +-
plugin.video.ted.talks/changelog.txt | 3 +++
.../resources/lib/model/talk_scraper.py | 5 +++--
.../resources/lib/model/talk_scraper_test.py | 9 ++++++---
4 files changed, 13 insertions(+), 6 deletions(-)
hooks/post-receive
--
Plugins
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Xbmc-addons mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xbmc-addons