moreginger / xbmc-plugin.video.ted.talks

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

TED Talks plugin fails scraping altHeadline #44

Closed bcopy closed 10 years ago

bcopy commented 10 years ago

The TED Talks systematically fails when playing a video, trying to scrape altHeadline - none of the videos work.

Environment : Openelec 3.10.11 on Raspberry Pi

Stacktrace :

22:46:22 T:2743112800  NOTICE: [PLUGIN] 'TED Talks: version 4.1.9' initialized!
22:46:24 T:2743112800  NOTICE: [TED Talks] resources.lib.model.fetcher attempting to open http://feedproxy.google.com/~r/TEDTalks_video/~3/A36XNujmG1I/toni_griffin_a_new_vision_for_rebuilding_detroit.html with data
22:46:25 T:2743112800  NOTICE: exceptions
22:46:25 T:2743112800  NOTICE: ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', '__getslice__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__', '__unicode__', '__weakref__', 'args', 'errno', 'filename', 'message', 'reason', 'strerror']
22:46:25 T:2743112800   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
   - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <type 'exceptions.IndexError'>
    Error Contents: string index out of range
    Traceback (most recent call last):
      File "/storage/.xbmc/addons/plugin.video.ted.talks/default.py", line 17, in <module>
        ted_talks.Main(args_map=args_map).run()
      File "/storage/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 346, in run
        modes[mode].run(self.args_map)
      File "/storage/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 172, in run
        self.run_internal(args)
      File "/storage/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 190, in run_internal
        self.ui.playVideo(args['url'], args['icon'])
      File "/storage/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 73, in playVideo
        title, url, subs, info_labels = self.ted_talks.getVideoDetails(url=url, video_quality=settings.video_quality, subs_language=subs_language)
      File "/storage/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 51, in getVideoDetails
        video_url, title, speaker, plot = talk_scraper.get(talk_html, video_quality)
      File "/storage/.xbmc/addons/plugin.video.ted.talks/resources/lib/model/talk_scraper.py", line 15, in get
        headline = xbmc_common.parseDOM(html, 'span', attrs={'id':'altHeadline'})[0].split(':', 1)
    IndexError: string index out of range
    -->End of Python script error report<--
22:46:25 T:3045659152   ERROR: Playlist Player: skipping unplayable item: 0, path [plugin://plugin.video.ted.talks/?url=http%3A%2F%2Ffeedproxy.google.com%2F%7Er%2FTEDTalks_video%2F%7E3%2FA36XNujmG1I%2Ftoni_griffin_a_new_vision_for_rebuilding_detroit.html&mode=playVideo&icon=http%3A%2F%2Fimages.ted.com%2Fimages%2Fted%2Ff5ebbf91eb093a2da2cfe1941724a3e55d222713_480x360.jpg]
moreginger commented 10 years ago

It is working fine on XBMC 12.2 (running on Fedora). I suppose either parseDOM behavior has changed, or you are seeing different HTML pages to me. It could be that fetching page is completely failing?

Can you provide a link to the OpenELEC build you used? I think 3.10.11 is a Linux kernel number, not the OpenELEC build number (?).

bcopy commented 10 years ago

the OpenELEC version is official version 3.2.0

OpenELEC:~ $ cat /etc/release
RPi.arm-3.2.0
OpenELEC:~ $ cat /etc/version
3.2.0
OpenELEC:~ $ cat /etc/issue
##############################################
# OpenELEC - The living room PC for everyone #
# ...... visit http://www.openelec.tv ...... #
##############################################

OpenELEC (official) Version: 3.2.0
bcopy commented 10 years ago

I cannot reproduce the problem with OPENELEC 3.2.4 and a fresh reinstall ( I suspect the openelec 2.x autoupdate messed with my installation ).

Please close the case.