This script just stopped working for no apparent reason recently:
- Code: Select all
#! /usr/bin/env python2.5
# -*- coding: utf-8 -*-
import simplejson
import urllib2
DTVIP = "192.168.1.53"
url = "http://%s:8080/tv/getTuned?" % DTVIP
f = urllib2.urlopen(url)
simplejson_string = f.read()
f.close()
parsed_simplejson = simplejson.loads(simplejson_string)
try:
programTitle = parsed_simplejson['title']
indigo.variable.updateValue(1708209973, programTitle)
except:
indigo.variable.updateValue(1708209973, " ")
try:
majorCh = str(parsed_simplejson['major'])
indigo.variable.updateValue(564695813, majorCh)
except:
indigo.variable.updateValue(564695813, " ")
It populates some variables on the current channel and title.
Here's the log error:
- Code: Select all
Embedded script executor host started
Script Error embedded script: <urlopen error [Errno 64] Host is down>
Script Error Exception Traceback (most recent call shown last):
embedded script, line 9, at top level
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
return opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1227, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1197, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 64] Host is down>
Appreciate any help getting it working.
Thanks,
Carl