[ANSWERED] DirecTV Script Issue

Posted on
Fri Sep 22, 2017 3:11 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

[ANSWERED] DirecTV Script Issue

This script had been working fine til I had to swap out my DirecTV box.

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

Posted on
Fri Sep 22, 2017 3:27 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: DirecTV Script Issue

Did the IP address of the box change?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Sep 22, 2017 5:42 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: DirecTV Script Issue

It did, but I changed it back to the one I had setup in Indigo.
As I mentioned, all the other commands using the plugin work just fine.

Maybe the port changed? Thing is I don't see anywhere in the DTV setup to set a port number.

Thanks,

Carl
Attachments
Error.jpg
Error.jpg (124.46 KiB) Viewed 3548 times

Posted on
Fri Sep 22, 2017 6:12 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: DirecTV Script Issue

I'm confused. You're talking about the DirecTV plugin, but this script is talking to the DTV box directly, not using any plugin.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Sep 22, 2017 6:19 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: DirecTV Script Issue

That makes two of us. I believe it was a few years ago that Matt or Jay helped write that bit of code for me.
Hoping they might recall how it worked.

Thanks,

Carl

Posted on
Fri Sep 22, 2017 6:23 pm
FlyingDiver offline
User avatar
Posts: 7189
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: DirecTV Script Issue

You said you changed out the receiver? Same or different model? Maybe the "getTuned" command isn't available on the new box.

Open a browser window and try this url: "http:/192.168.1.53:8080/tv/getTuned?" What do you get back?

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Fri Sep 22, 2017 6:29 pm
ckeyes888 offline
Posts: 2417
Joined: Nov 26, 2009
Location: Kalispell, MT

Re: DirecTV Script Issue

Doh. Got it working by setting the "current channel" setting to "allow" an external connection.

Carl

Posted on
Sat Sep 23, 2017 7:48 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: DirecTV Script Issue

Technically, this thread shouldn't be under this plugin's forum since it's not about the plugin, but since they're related I'll leave it here. I don't recall anything about this script, but I also don't recall much about this plugin. I haven't had DIRECTV in quite a long time so I don't have occasion to deal with it (which is why we open sourced it).

When things break after replacing hardware, it's usually a good idea to look closely at the replacement hardware as the most likely source of the issue.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest