Detecting broken links and stream errors
#1
I'm new to Python and Add-on development. In the last few days, I was able to throw together a simple add-on that basically reads off an XML from a web server, and then adds items to a play list. I use xbmcplugin.addDirectoryItem to add folders and video links to the list. When a user selects a link, I would like to make Python detect stream errors or dead links, and then report it back to the server. Is this possible??

I think can use the following to report the dead link to the server:

Code:
deadlink = 'some dead link goes here';
url='http://mydomain.com/xbmc/report.php?url=' + deadlink
req = urllib2.Request(url)
response = urllib2.urlopen(req)
link=response.read()
response.close()

But I don't know how to catch an error when the user can't play a link so that I can trigger the code. I know every time I hit a play issue, it logs to xbmc.log, so I'm hoping there's a way to leverage that function.

Any assistance is greatly appreciated.
Reply

Logout Mark Read Team Forum Stats Members Help
Detecting broken links and stream errors0