Random Linux

Linux, video games and web hosting

It’s safe to say that I spend a lot of time on the command line, and really prefer to do as much as possible from there.  So, it only makes since to be able to control my DVR from the command line too.  So, I created dtv.py, the DirecTV command line remote.  As of now, you can operate almost all of the buttons that would be on the remote, as well as get information about different channels and see a scrolling list of what is on all of the channels



[wpdm_package id=’61561′]


You will need to edit the following line in the script to add the IP address of the DirecTV box to the script.


####### Put the IP of your DVR here! #######

boxip = ‘’

You can also set your favorite channels for the -f flag in the favorites section of the script.

## Put your favorite channels here, seperated by spaces ##

favs = ‘2 13 20 26 39 249’


Here are the different commands that you can run as of now.


usage: dtv.py [-h] [-v] [-i channel] [-c] [-t channel] [-a start,end]
[-b BUTTON] [-f] [--devlist]
optional arguments:

-h, –help show this help message and exit
-v, –version show program’s version number and exit
-i channel, –info channel
Shows info for a channel.
-c, –current Shows info for currently tuned channel
-t channel, –tune channel
Tune to a channel
-a start,end, –all start,end
Show a scrolling list what what’s on a range of
channels. Must specify a comma separated start and end
-b BUTTON, –button BUTTON
Press a button as you would on a physical remote. Can
use a comma to separate button presses
-f, –favs Show what is on your favorite channels
–devlist Show list of options available from the DVR. Only good
for development


There is more to come and feature requests are very welcome!

February 23rd, 2013

Posted In: How To

Tags: , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *