Python script: Channels DVR movie list -> CSV file

I have written a Python script that uses the Channels DVR API to retrieve the list of movies from the library and writes this list to a CSV file.

Here it is from my Google Drive:

Maybe later I may consider putting in GitHub but not sure if it's really worth it.

Precondition to run this script: this may be obvious but since this is a Python script, you must have Python installed on your system.

I have tested it on my computer with the following specs:

  • Windows 11 Home 10.0.22621.1265
  • Python 3.10.4

How to use this script:

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

Channels DVR movie 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, use the default URL:

If you provide the IP address, it needs to be in quotes: -i "".
If you provide the port number, it just needs to be an integer value: -p 8090.

If you call this script on the same machine where the Channels DVR server is running too, no need to specify any options.

On Windows, you should be able to just double click on it in Windows Explorer, as long as *.py files are registered in Windows to be opened with Python by default.


PS C:\Users\mjitk\Documents\Scripts> python .\
Using Channels DVR server at:

Getting the list of movies from Channels DVR...
Got 1480 movies.

Writing the list of movies to the CSV file...
Movie list available in channels_dvr_movie_list_20230306_180057.csv

PS C:\Users\mjitk\Documents\Scripts>

After some manual formatting of the CSV file in Microsoft Excel, it looks like this:

I am not an expert with Python and I'm not ashamed to admit that I used Google and ChatGPT to write some parts of this script.

I'm sure there are ways to improve/optimize this script.
Let me know if you have any comments, questions, or bug reports.
I will do my best to support it as much as possible.

I hope it works for you! :slight_smile: