whf839 / xbmc-addons

Automatically exported from code.google.com/p/xbmc-addons
0 stars 0 forks source link

Ted Talks Fails due to TypeError #57

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Install the Ted Talks addon
2.Try get the newest talks

What is the expected output? What do you see instead?
Script Fails

What version of XBMC are you using? On what operating system?  What version
of the addon are you using?
Platform: Linux (Ubuntu 10.04 LTS, 2.6.32-23-generic i686). 
XBMC built on Jul  3 2010 (SVN:31595) 
Ted Talks Addon installed from Addon downloader.

Please provide any additional information below.

From xbmc.log:

07:45:40 T:2958400368 M:2460655616  NOTICE: [PLUGIN] 'TED Talks: version 2.1.5' 
initialized!
07:45:41 T:2958400368 M:2460528640  NOTICE: [TED Talks] resources.lib.util 
attempting to open http://www.ted.com/talks/list/page/
07:45:41 T:3078096752 M:2460049408   DEBUG: ------ Window Init (DialogBusy.xml) 
------
07:45:41 T:3078096752 M:2460049408   DEBUG: Alloc resources: 0.01ms (0.01 ms 
skin load)
07:45:42 T:2882292592 M:2459750400    INFO: Loading skin file: 
DialogProgress.xml
07:45:42 T:2882292592 M:2459750400   DEBUG: Load DialogProgress.xml: 4.36ms
07:45:42 T:2882292592 M:2459750400   DEBUG: DialogProgress::StartModal called
07:45:42 T:2882292592 M:2459750400   DEBUG: ------ Window Init 
(DialogProgress.xml) ------
07:45:42 T:2882292592 M:2459750400   DEBUG: Alloc resources: 0.79ms (0.01 ms 
skin load)
07:45:42 T:2958400368 M:2459750400  NOTICE: exceptions
07:45:42 T:2958400368 M:2459750400  NOTICE: ['__class__', '__delattr__', 
'__dict__', '__doc__', '__format__', '__getattribute__', '__getitem__', 
'__getslice__', '__hash__', '__init__', '__new__', '__reduce__', 
'__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', 
'__str__', '__subclasshook__', '__unicode__', 'args', 'errno', 'filename', 
'message', 'strerror']
07:45:42 T:2958400368 M:2459750400    INFO: -->Python script returned the 
following error<--
07:45:42 T:2958400368 M:2459750400   ERROR: Error Type: <type 
'exceptions.TypeError'>
07:45:42 T:2958400368 M:2459750400   ERROR: Error Contents: expected string or 
buffer
07:45:42 T:2958400368 M:2459750400   ERROR: Traceback (most recent call last):
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/default.py", line 27, in <module>
                                                ted_talks.Main()
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 176, in __init__
                                                self.checkMode()
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 235, in checkMode
                                                UI().newTalks()
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 109, in newTalks
                                                newTalks = TedTalks.NewTalks(self.main.args.url)
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 102, in __init__
                                                self.navItems = TedTalks().getNavItems(self.html)
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks_scraper.py", line 28, in getNavItems
                                                for liTag in BeautifulSoup(html, parseOnlyThese = paginationContainer).findAll('li'):
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/BeautifulSoup.py", line 1470, in __init__
                                                BeautifulStoneSoup.__init__(self, *args, **kwargs)
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/BeautifulSoup.py", line 1089, in __init__
                                                self._feed(isHTML=isHTML)
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/BeautifulSoup.py", line 1113, in _feed
                                                smartQuotesTo=self.smartQuotesTo, isHTML=isHTML)
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/BeautifulSoup.py", line 1721, in __init__
                                                self._detectEncoding(markup, isHTML)
                                              File "/home/yugge/.xbmc/addons/plugin.video.ted.talks/resources/lib/BeautifulSoup.py", line 1866, in _detectEncoding
                                                '^<\?.*encoding=[\'"](.*?)[\'"].*\?>').match(xml_data)
                                            TypeError: expected string or buffer
07:45:42 T:2958400368 M:2459750400    INFO: -->End of Python script error 
report<--
07:45:42 T:2958400368 M:2459750400    INFO: Python script stopped
07:45:42 T:2958400368 M:2459750400   DEBUG: Thread 2958400368 terminating
07:45:42 T:3078096752 M:2459877376   DEBUG: python thread 4 destructed
07:45:42 T:3078096752 M:2459877376   DEBUG: ------ Window Init 
(DialogKaiToast.xml) ------
07:45:42 T:3078096752 M:2459877376   DEBUG: Alloc resources: 0.01ms (0.01 ms 
skin load)
07:45:42 T:3078096752 M:2459877376   DEBUG: ------ Window Deinit 
(DialogBusy.xml) ------
07:45:42 T:2882292592 M:2460028928   DEBUG:  WaitOnScriptResult - plugin exited 
prematurely - terminating
07:45:42 T:2882292592 M:2460028928   DEBUG: CGetDirectory::DoWork retrieving 
plugin://plugin.video.ted.talks/?url=None&mode=newTalks&name=Newest+Talks&icon=N
one failed
07:45:42 T:2882292592 M:2460028928   DEBUG: CGetDirectory::OnJobComplete called
07:45:42 T:3078096752 M:2460028928   ERROR: GetDirectory - Error getting 
plugin://plugin.video.ted.talks/?url=None&mode=newTalks&name=Newest+Talks&icon=N
one
07:45:42 T:3078096752 M:2460028928   ERROR: 
CGUIMediaWindow::GetDirectory(plugin://plugin.video.ted.talks/?url=None&mode=new
Talks&name=Newest+Talks&icon=None) failed
07:45:42 T:3078096752 M:2460028928   DEBUG: CGUIMediaWindow::GetDirectory 
(plugin://plugin.video.ted.talks/)
07:45:42 T:3078096752 M:2460028928   DEBUG:   ParentPath = 
[addons://sources/video/]
07:45:42 T:2882292592 M:2460028928   DEBUG: CGetDirectory::DoWork retrieving 
plugin://plugin.video.ted.talks/
07:45:42 T:2882292592 M:2460028928   DEBUG: StartScript - calling plugin TED 
Talks('plugin://plugin.video.ted.talks/','0','')
07:45:42 T:2882292592 M:2460028928    INFO: initializing python engine.
07:45:42 T:2882292592 M:2460028928   DEBUG: new python thread created. id=5
07:45:42 T:2882292592 M:2460028928   DEBUG: WaitOnScriptResult - waiting on the 
TED Talks plugin...
07:45:42 T:2958400368 M:2460028928   DEBUG: thread start, auto delete: 0
07:45:42 T:2958400368 M:2460028928   DEBUG: Python thread: start processing
07:45:42 T:2958400368 M:2460028928  NOTICE: -->Python Interpreter Initialized<--
07:45:42 T:2958400368 M:2460028928   DEBUG: Process - The source file to load 
is /home/yugge/.xbmc/addons/plugin.video.ted.talks/default.py
07:45:42 T:2958400368 M:2460028928   DEBUG: Process - Setting the Python path 
to 
/home/yugge/.xbmc/addons/plugin.video.ted.talks:/usr/lib/python2.6/:/usr/lib/pyt
hon2.6/plat-linux2:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/lib-old:/usr/lib
/python2.6/lib-dynload
07:45:42 T:2958400368 M:2460028928   DEBUG: Process - Entering source directory 
/home/yugge/.xbmc/addons/plugin.video.ted.talks
07:45:42 T:2958400368 M:2460028928  NOTICE: [PLUGIN] 'TED Talks: version 2.1.5' 
initialized!
07:45:42 T:2882292592 M:2460028928   DEBUG: WaitOnScriptResult- plugin returned 
successfully
07:45:42 T:2882292592 M:2460028928   DEBUG: CGetDirectory::DoWork retrieving 
plugin://plugin.video.ted.talks/ succeeded
07:45:42 T:2882292592 M:2460028928   DEBUG: CGetDirectory::OnJobComplete called
07:45:42 T:2958400368 M:2460028928    INFO: Scriptresult: Success
07:45:42 T:3029633904 M:2460028928   DEBUG: thread start, auto delete: 0
07:45:42 T:2958400368 M:2460028928    INFO: Python script stopped
07:45:42 T:2958400368 M:2460028928   DEBUG: Thread 2958400368 terminating
07:45:42 T:3029633904 M:2460155904   DEBUG: Thread 3029633904 terminating
07:45:43 T:3078096752 M:2460729344   DEBUG: python thread 5 destructed
07:45:43 T:3078096752 M:2460729344   DEBUG: ------ Window Deinit 
(DialogProgress.xml) ------

Original issue reported on code.google.com by Yugl...@gmail.com on 5 Jul 2010 at 5:47

GoogleCodeExporter commented 9 years ago
This patch fixes it for me :)

Original comment by gm...@colin.guthr.ie on 17 Aug 2010 at 9:21

Attachments:

GoogleCodeExporter commented 9 years ago
I also noticed a second problem with it getting the list of speakers.
I'd get the following error:

22:28:36 T:2663181168 M:3032137728  NOTICE: [TED Talks] resources.lib.util 
attempting to open http://www.ted.com/speakers/atoz/page/10
22:28:36 T:2663181168 M:3032010752  NOTICE: [TED Talks] resources.lib.util 
attempting to open http://www.ted.com/speakers/atoz/page/11
22:28:37 T:2663181168 M:3032010752  NOTICE: /usr/lib/python2.6/urllib.py:1222: 
UnicodeWarning: Unicode equal comparison failed to convert both arguments to 
Unicode - interpreting them
 as being unequal
                                              res = map(safe_map.__getitem__, s)
22:28:37 T:2663181168 M:3032010752    INFO: -->Python script returned the 
following error<--
22:28:37 T:2663181168 M:3032010752   ERROR: Error Type: <type 
'exceptions.KeyError'>
22:28:37 T:2663181168 M:3032010752   ERROR: Error Contents: (u'\xf1',)
22:28:37 T:2663181168 M:3032010752   ERROR: Traceback (most recent call last):
                                              File "/home/media/.xbmc/addons/plugin.video.ted.talks/default.py", line 27, in <module>
                                                ted_talks.Main()
                                              File "/home/media/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 182, in __init__
                                                self.checkMode()
                                              File "/home/media/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 243, in checkMode
                                                UI().speakers()
                                              File "/home/media/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 131, in speakers
                                                self.addItem(speaker, isFolder = True)
                                              File "/home/media/.xbmc/addons/plugin.video.ted.talks/resources/lib/ted_talks.py", line 59, in addItem
                                                '&name='+urllib.quote_plus(info['Title'])
                                              File "/usr/lib/python2.6/urllib.py", line 1228, in quote_plus
                                                s = quote(s, safe + ' ')
                                              File "/usr/lib/python2.6/urllib.py", line 1222, in quote
                                                res = map(safe_map.__getitem__, s)
                                            KeyError: (u'\xf1',)
22:28:37 T:2663181168 M:3032010752    INFO: -->End of Python script error 
report<--
22:28:37 T:2663181168 M:3032010752    INFO: Python script stopped

The attached patch fixes this, but it's probably left someone out of the list :D

Original comment by gm...@colin.guthr.ie on 17 Aug 2010 at 9:34

Attachments: