Python script: channel list -> CSV file to easily see where channels are available

I wanted to have a clear overview of channel overlaps between the different sources so I wrote a python script that generates a CSV file with the information.
If you open the CSV file with a spreadsheet program, you can format the display nicely and add filters.

For example:

7 channels are available in 4 different sources:

60 channels are available in 3 sources (showing the first 10):


You may want to add some de-dupe if you haven't already (I have not read your code), but channels 6700-6999 are all FTA internet streams added with every TVE source.

Also, you may want to also consolidate by TMS/TVC ID ... those are actually the same channels/feeds/streams.

FAST providers that users add via M3U/"Custom Channels" can have wildly different data associated with them. Also, some of those providers regularly change their available feeds. (Primarily Pluto, but all FAST providers are guilty.)

Are you up to supporting a moving target?


These are all very good points. :slight_smile:

Now that you mention it, I will add another column for the FTA channels with numbers 6700-6999 and not list them in my DIRECTV TVE source.

Right now, I chose the easy way and just compared the guide names (which I convert to uppercase to ignore differences in casing.)
I agree with you about the TMS/TVC IDs but it was more of a fun challenge that I gave myself to write this script. It is not meant to be "professional" so I'm going to leave the logic as is.
Unless maybe if there is a demand for it, which I doubt. :laughing:

This is not something that I will run everyday. I was just curious about finding the overlaps and, with more than 1,000 channels, I decided to automate the process.

Thank you for your suggestions, they are all very good. :+1:

Please share this Python script. I've been wanting to do this for some time.

1 Like

Sure. I just need to clean up the code a little bit and then I will provide a link to download it. :slight_smile:

Here it is, @cyoungers, from my Google Drive: - Google Drive

(Note to self: look into using GitHub at some point)

As suggested by @racameron, I added a column for the free channels so it's clearer now instead of having them included with the TVE channels.

In the process of refactoring the code, I also found a bug that I fixed.
With the fix, some channel results are different now and more accurate in terms of how many times they appear in different sources. For example, it turns out that QVC is not the only channel that is available in 4 different sources now. I will fix my first post.

Usage of the script:

PS C:\Users\mjitk\Documents\Scripts> python -h
usage: [-h] [-i IP_ADDRESS] [-p PORT_NUMBER] [-v]

Channels DVR channel list -> CSV file.

  -h, --help            show this help message and exit
  -i IP_ADDRESS, --ip_address IP_ADDRESS
                        IP address of the Channels DVR server
  -p PORT_NUMBER, --port_number PORT_NUMBER
                        Port number of the Channels DVR server
  -v, --version         Print the version number

If no options are specified, the default URL will be used:
PS C:\Users\mjitk\Documents\Scripts> python
Using Channels DVR server at:

Getting the details of all the sources from Channels DVR...
Got 10 sources.

Writing the channel information to the CSV file...
Channel information available in channels_dvr_channel_list_20230519_172942.csv

I hope this works for you.
Let me know about your experience with it.

Thanks. I'm getting an error when I try to run the script.

python3 -i -p 8089
Using Channels DVR server at:

Getting the details of all the sources from Channels DVR...
Traceback (most recent call last):
  File "/Documents/Channels/", line 351, in <module>
    sources = get_source_info_from_channels_dvr_api(server_ip_address, server_port_number)
  File "/Documents/Channels/", line 300, in get_source_info_from_channels_dvr_api
    return [Source(source) for source in devices]
  File "/Documents/Channels/", line 300, in <listcomp>
    return [Source(source) for source in devices]
  File "/Documents/Channels/", line 56, in __init__
    self.channels  = self._get_channels()
  File "/Documents/Channels/", line 69, in _get_channels
    number = int(channel['GuideNumber'])
ValueError: invalid literal for int() with base 10: '4.1'

Oh I see. Sorry about that. I know how to fix it.
I'm away from my computer at this time. I will fix it as soon as I get the chance later today.

Please try the new version of the script, @cyoungers (same link).

I don't have an OTA source and I didn't plan for channel numbers to contain decimal points, which is typical of OTA channel numbers.
The bug should be fixed now. :slight_smile:

By the way, you don't need to specify the port number because you are using the default one.

This command should work for you:

python3 -i

Works great. Thanks for the update. This is so useful for me for creating channel collections and getting the big picture of the sources.

1 Like