moreginger / xbmc-plugin.video.ted.talks

GNU General Public License v2.0
18 stars 20 forks source link

Fix occasional test failure in CI #58

Closed moreginger closed 6 years ago

moreginger commented 8 years ago

Sometimes, subtitles_scraper_test#test_get_subtitles_for_newest_talk fails with

ERROR: Newest talk often won't have subtitles when first made available.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/moreginger/xbmc-plugin.video.ted.talks/resources/lib/model/subtitles_scraper_test.py", line 58, in test_get_subtitles_for_newest_talk
    talk_json = self.__get_talk_json__(newest_talk['link'])
  File "/home/travis/build/moreginger/xbmc-plugin.video.ted.talks/resources/lib/model/subtitles_scraper_test.py", line 66, in __get_talk_json__
    foo, fi, fo, fum, talk_json = talk_scraper.get(html)
  File "/home/travis/build/moreginger/xbmc-plugin.video.ted.talks/resources/lib/model/talk_scraper.py", line 47, in get
    headline = xbmc_common.parseDOM(html, 'span', attrs={'id':'altHeadline'})[0].split(':', 1)
IndexError: list index out of range

https://travis-ci.org/moreginger/xbmc-plugin.video.ted.talks/builds/142895951 https://travis-ci.org/moreginger/xbmc-plugin.video.ted.talks/builds/144026321

moreginger commented 8 years ago

The actual error occurs in Vimeo fallback code that I have no evidence is still required (the video for which it was originally required is now hosted on YouTube, see #24 for the original issue). I'm going to cull this and and some debug code to find out why it followed this path.

moreginger commented 8 years ago

Debug output from https://travis-ci.org/moreginger/xbmc-plugin.video.ted.talks/builds/146518315:

broken.txt

Totally different HTML that doesn't include a video link. Video links are contained in this resource: https://embed-ssl.ted.com/talks/tom_shannon_s_magnetic_sculpture?abby[talktalk]=d&ga=www.ted.com

Are they A-B testing? Can the plugin reasonably support both modes? Needs some thought. This change will make loading the video quite a lot harder if they push it out mainstream.

moreginger commented 6 years ago

No longer a problem?