2012-08-22, 17:15
I've been using buggalo to track errors and I've notice two common issues with the fetchPage function.
1. Here it looks like the connection times out at line 399 of CommonFunctions.py and there is no exception to handle the socket timeout.
Log:
2. For some odd reason, fetchPage returns without a 'content' key. I believe this happens when the statement at line 398 of CommonFunctions.py is not true.
Log:
Sorry, I don't have the full debug logs. Thanks again for this script.
1. Here it looks like the connection times out at line 399 of CommonFunctions.py and there is no exception to handle the socket timeout.
Log:
Code:
Type <class 'socket.timeout'>
Message timed out
Stacktrace File "/home/xbmc/.xbmc/addons/plugin.video.revision3/default.py", line 335, in <module>
build_main_directory(url)
File "/home/xbmc/.xbmc/addons/plugin.video.revision3/default.py", line 51, in build_main_directory
html = common.fetchPage({"link": url})['content']
File "/home/xbmc/.xbmc/addons/script.module.parsedom/lib/CommonFunctions.py", line 399, in fetchPage
ret_obj["content"] = con.read()
File "/usr/lib/python2.7/socket.py", line 351, in read
data = self._sock.recv(rbufsize)
File "/usr/lib/python2.7/httplib.py", line 541, in read
return self._read_chunked(amt)
File "/usr/lib/python2.7/httplib.py", line 592, in _read_chunked
value.append(self._safe_read(amt))
File "/usr/lib/python2.7/httplib.py", line 647, in _safe_read
chunk = self.fp.read(min(amt, MAXAMOUNT))
File "/usr/lib/python2.7/socket.py", line 380, in read
data = self._sock.recv(left)
2. For some odd reason, fetchPage returns without a 'content' key. I believe this happens when the statement at line 398 of CommonFunctions.py is not true.
Log:
Code:
Type <type 'exceptions.KeyError'>
Message 'content'
Stacktrace File "/storage/sdcard0/Android/data/org.xbmc.xbmc/files/.xbmc/addons/plugin.video.revision3/default.py", line 339, in <module>
get_video(url, name, plot, studio, episode, thumb, date)
File "/storage/sdcard0/Android/data/org.xbmc.xbmc/files/.xbmc/addons/plugin.video.revision3/default.py", line 231, in get_video
result = common.fetchPage({"link": url})['content']
Sorry, I don't have the full debug logs. Thanks again for this script.