A different DVR Schedule view

I should have realized that. I assume (I'm not fluent in Python) that it's pulling the schedule from /dvr/jobs

def getJobs():
        result = requests.get(channels_dvr + "dvr/jobs")

and that has DeviceID = null until the recording actually starts and then it appears in recorded jobs /dvr/files.

So it sounds like that idea went up in smoke. Thanks for checking.

I'm trying to work out how to map the channel number to the deviceID... but I don't know if it will work for what you want or not... would replicating the "Source" selector from the guide accomplish what you're looking for? I think I might be able to accomplish that...

6 posts were split to a new topic: How can I record Cook's Country and America's Test Kitchen?

Thanks, but I wouldn't bother unless you're looking for a real challenge.
The only "Source" in the scheduled jobs json is for the EPG provider tms (Tribune Media Services) Gracenote.

To map channel numbers to source Devices would require looking up the channel number in /devices, but ignoring those listed as hidden or not enabled.
That would get you the DeviceID's having that channel number.
On top of that, Channels DVR could have multiple "potential candidate" channels to record the job from as listed in the scheduled job json
"Channels": ["1290","1190","1090","790"] see this post Sport Program Priority Not Recorded - #23 by chDVRuser

Yeah — that’s the approach I took… it wasn’t difficult to match everything up… I finished it last night. I’ll push the changes to GitHub later today…

I didn’t do anything (yet) with the potential channels list… only the channel selected to record on…

1 Like

Starting to go off-topic. Please start another topic unless you're discussing the OP's schedule viewer.

Posted the update -- I added a source selector to the top and colorized the sources in the display... not sure what I'm going to do with content that has multiple potential sources... for now it's using the source matched to the channel found in "Airing" in the json.

Thanks. I'll have to give your code a try this weekend when I can get python3 running in a container.

So - a few modifications were made... The list can be filtered by assigned source with a dropdown selector similar to what is seen on the html guide page, each source shows as a different color, and the current time is displayed as well to see progress within active recordings:

For me, this has been a fun exercise that has helped me to understand the channels-dvr interface... Hopefully somebody else can find it useful...

2 Likes

Anyone have a suggestion on what the slimmest container image is I could use to run this?
alpine, slim-bullseye, slim-buster?
https://hub.docker.com/_/python/

Alpine is usually the smallest.

1 Like

OK I'll try the latest stable Alpine version.

Just wanted to let the OP know I'm not a developer, or versed in Python.
The only Python I ever ran was the original pyTiVo on Python v2 on my old, retired Win-7 PC.

I plan to bind mount /usr/src in the container to a local directory on the machine I run it on and put the channels-dvr-gantt.py script there to easily edit/replace and run it interactively in the container to test.

Has anyone else run this yet?
I've read that Python is a pain with dependencies, but not sure what that would mean trying to run it in a container.

I'm running on Debian 11 with standard python3 install from apt repository... I don't believe there are any dependencies outside of the standard install... I'm not a docker guy... if I want space to run something in I spin up a full VM (I run proxmox on an ancient dell desktop, and it's more than powerful enough to run everything for my testing... including channels). :smile:

Thanks, will give it a try this weekend running interactively in a Python3 container.

Not running for me.
Spun up a container with Alpine 3.15 and Python 3.10.1

/usr/src/app # ls -l
total 16
-rwxrwxrwx 1 1026 users 8083 Jan 8 12:32 channels-dvr-gantt.py

/usr/src/app # python --version
Python 3.10.1

/usr/src/app # python channels-dvr-gantt.py
Traceback (most recent call last):
File "/usr/src/app/channels-dvr-gantt.py", line 5, in
import requests
ModuleNotFoundError: No module named 'requests'

You need the alpine package py3-requests

Is that a container image or what?
How do I install it?

apk update && apk install py3-requests

/usr/src/app # apk update && apk install py3-requests
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
v3.15.0-184-g273f76be99 [https://dl-cdn.alpinelinux.org/alpine/v3.15/main]
v3.15.0-185-gbcd59a6d7f [https://dl-cdn.alpinelinux.org/alpine/v3.15/community]
OK: 15847 distinct packages available
ERROR: 'install' is not an apk command. See 'apk --help'.

sorry it's apk add py3-requests

each linux distribution has its own way of installing package. alpine uses apk.

https://wiki.alpinelinux.org/wiki/Alpine_Linux_package_management