- 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's showing this error in the log.
- Code: Select all
Action Group DTV State Value Script All
Script Error embedded script: HTTP Error 403: Forbidden.
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 126, in urlopen
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 400, in open
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 513, in http_response
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 438, in error
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 521, in http_error_default
HTTPError: HTTP Error 403: Forbidden.
All the other commands using the plugin are working fine.
Any help greatly appreciated.
Thanks,
Carl