OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

Just have to provide Airing.Categories: ["Movie"]

{
  "Name": "Elf (2003)  Movie Categories at 1752",
  "Time": 1699235520,
  "Duration": 60,
  "Channels": ["6034"],
  "Airing": {
    "Source": "manual",
    "Channel": "6034",
    "Time": 1699235520,
    "Duration": 60,
    "Title": "Elf (2003)  Movie Categories at 1752",
    "Categories": ["Movie"]
  }
}

I don't see a Categories option in OliveTin.

OliveTin for Channels would have to be modified.

1 Like

OliveTin updated to support manual recording of Movies. It's now required to select the recording "type" in the bottom field -- TV Series or Movie:

Pull the updated bnhf/olivetin, :latest or :test tag -- they're both the same at present.

1 Like

Thank you sir!

Latest list of OliveTin-for-Channels features posted here:

Also, I'm thinking about adding an action button to reboot HDHomeRun tuners from a dropdown list. Does that have appeal?

For the "Ping Channels DVR Server" Action, I think I'm going to change it from a ping of the host to a curl of the main Channels DVR webpage.

This seems preferable as it confirms Channels DVR itself is running, rather than simply that the host computer is responding. So unless there's anyone that has a specific use-case for the ping approach, we'll go from a core test of this:

pingDVR=$(ping -q -c 1 -W 2 $channelsHost)

to this:

curlDVR=$(curl --fail --output /dev/null --max-time 5 http://$dvr)

As before, multiple DVRs are supported, as is Tailscale. Same healthchecks.io tie-in, so you'll know immediately (based on your test interval) if the curl fails via e-mail or whatever other integrations you've configured.

1 Like

@bnhf I've been using olive tin for awhile and have not had issues. But now I cannot get generate Twit data or fix thumbnails to work. I tried stopping with an interval 0. Then I try to start with an interval and a healthchecks URL. I get the "success" notification and stdout says exit code zero but the icon never turns green and it seems to not be running. Any ideas?

First thing I'd suggest is to pull the most recent version of :latest -- which I pushed 4 days ago. Make sure you allow yamls and scripts to update (UPDATE_YAMLS=true and UPDATE_SCRIPTS=true)

I just tried TWiT.tv myself, and it's working here. The resulting TWiT.tv guide data file now goes into a folder named host-port_data, now that multiple DVRs are supported.

I forgot to mention I have been pulling "latest" and I do have UPDATE_YAMLS=true and UPDATE_SCRIPTS=true.

Can you post the output from stderr after you try to run the Action? That should give me an idea of what's going on.

Here is stderr:

+ dvr=ical_2_xmltv
++ echo ical_2_xmltv
++ awk -F: '{print $1}'
+ channelsHost=ical_2_xmltv
++ awk -F: '{print $2}'
++ echo ical_2_xmltv
+ channelsPort=
+ backgroundScript=1h
+ firstChar=1
+ runInterval=https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ healthchecksIO=
+ [[ '' == \h\t\t\p\s\:\/\/\h\c\-\p\i\n\g\.\c\o\m\/\y\o\u\r\_\c\u\s\t\o\m\_\u\u\i\d ]]
++ awk '{print $2}'
++ grep '[1]h.* ical_2_xmltv'
++ ps -ef
+ runningScriptPID=
+ [[ -n '' ]]
+ backgroundArguments='ical_2_xmltv https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b '
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/ical_2_xmltv-_1h_latest.log
+ trap finish EXIT
+ main
+ scriptRun
+ case "$runInterval" in
+ [[ -n '' ]]
+ echo 'Background script initiated, with https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b between runs for ical_2_xmltv'
+ grep -q '(.*) #1h' /config/config.yaml
+ nohup /config/1h.sh ical_2_xmltv https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#1h title/s/#/(18Nov23_05:25) #/' /config/config.yaml
+ sed -i '/#1h icon/s|img src = .* width|img src = "icons/channels.png" width|' /config/config.yaml
+ sed -i '/#1h interval default/s/default: .* #/default: https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b #/' /config/config.yaml
sed: -e expression #1, char 55: unknown option to `s'
+ [[ -n '' ]]
+ echo 'ical_2_xmltv 1h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b '
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ serverHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ serverPort=8089
++ ps -ef
++ grep '[1]h.* cjynas:8089'
++ awk '{print $2}'
+ activeProcess=
+ [[ -n '' ]]
+ exit 0
+ finish
+ echo -e 'foreground.sh is exiting for 1h with exit code 0'
+ cp /config/config.yaml /config/temp.yaml
+ cp /config/temp.yaml /config/config.yaml
+ sleep 1
+ '[' -f /config/ical_2_xmltv-_1h_latest.log ']'
+ cat /config/ical_2_xmltv-_1h_latest.log

Looks like I didn't push the latest scripts I'm using through to the repo. I'll fix that now and let you know when you can try it again. Shouldn't be long...

Give it a try now if you would please... :latest and :test have both been updated, and are the same currently.

EDIT: Hold tight there's still an issue. Not sure how this happened. :frowning:

1 Like

@cyoungers

Could you give it a go now please?

The Delete Recording Log Files Action needs some documentation (it uses the same launch script as the two scripts we've been addressing), specifically on how to set up the volume mounts for multiple DVRs -- but otherwise I think we should be back on track.

1 Like

Well it appears that both twit and fix thumbs are running. I see the icon go green and I see that healthchecks got a ping. However at least with fix thumbnails, it appears that it is not running as my video filenames still have filenames with [] and (). It is not easy for me to figure out if Twit guide data got updated.

Could you post stdout and stderr for both please?

For fix thumbs:

Background script initiated, with 30m between runs for cjynas:8089
Using healthcheck.io pings to https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 to confirm functionality
Background fix_thumbnails process running for cjynas:8089
foreground.sh is exiting for fix_thumbnails with exit code 0
+ dvr=cjynas:8089
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ channelsHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ channelsPort=8089
+ backgroundScript=fix_thumbnails
+ firstChar=f
+ runInterval=30m
+ healthchecksIO=https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140
+ [[ https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 == \h\t\t\p\s\:\/\/\h\c\-\p\i\n\g\.\c\o\m\/\y\o\u\r\_\c\u\s\t\o\m\_\u\u\i\d ]]
++ ps -ef
++ grep '[f]ix_thumbnails.* cjynas:8089'
++ awk '{print $2}'
+ runningScriptPID=
+ [[ -n '' ]]
+ backgroundArguments='cjynas:8089 30m https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140'
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/cjynas-8089_fix_thumbnails_latest.log
+ trap finish EXIT
+ main
+ scriptRun
+ case "$runInterval" in
+ [[ -n '' ]]
+ echo 'Background script initiated, with 30m between runs for cjynas:8089'
+ grep -q '(.*) #fix_thumbnails' /config/config.yaml
+ nohup /config/fix_thumbnails.sh cjynas:8089 30m https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#fix_thumbnails title/s/#/(18Nov23_08:20) #/' /config/config.yaml
+ sed -i '/#fix_thumbnails icon/s|img src = .* width|img src = "icons/channels.png" width|' /config/config.yaml
+ sed -i '/#fix_thumbnails interval default/s/default: .* #/default: 30m #/' /config/config.yaml
+ [[ -n https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 ]]
+ echo 'Using healthcheck.io pings to https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 to confirm functionality'
+ sed -i '/#fix_thumbnails healthchecks default/s|default: .* #|default: https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140 #|' /config/config.yaml
+ echo 'cjynas:8089 fix_thumbnails 30m https://hc-ping.com/33f47a5b-d148-4819-b391-044712cc6140'
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ awk -F: '{print $1}'
++ echo cjynas:8089
+ serverHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ serverPort=8089
++ ps -ef
++ grep '[f]ix_thumbnails.* cjynas:8089'
++ awk '{print $2}'
+ activeProcess=829
+ [[ -n 829 ]]
+ echo 'Background fix_thumbnails process running for cjynas:8089'
+ exit 0
+ finish
+ echo -e 'foreground.sh is exiting for fix_thumbnails with exit code 0'
+ cp /config/config.yaml /config/temp.yaml
+ cp /config/temp.yaml /config/config.yaml
+ sleep 1
+ '[' -f /config/cjynas-8089_fix_thumbnails_latest.log ']'
+ cat /config/cjynas-8089_fix_thumbnails_latest.log

For Twit:

Background script initiated, with 2h between runs for cjynas:8089
Using healthcheck.io pings to https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b to confirm functionality
Downloading latest iCal data for cjynas:8089...
Background ical_2_xmltv process running for cjynas:8089
foreground.sh is exiting for ical_2_xmltv with exit code 0
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ channelsHost=cjynas
++ echo cjynas:8089
++ awk -F: '{print $2}'
+ channelsPort=8089
+ backgroundScript=ical_2_xmltv
+ firstChar=i
+ runInterval=2h
+ healthchecksIO=https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ [[ https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b == \h\t\t\p\s\:\/\/\h\c\-\p\i\n\g\.\c\o\m\/\y\o\u\r\_\c\u\s\t\o\m\_\u\u\i\d ]]
++ ps -ef
++ grep '[i]cal_2_xmltv.* cjynas:8089'
++ awk '{print $2}'
+ runningScriptPID=
+ [[ -n '' ]]
+ backgroundArguments='cjynas:8089 2h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b'
+ greenIcon='"icons/channels.png"'
+ purpleIcon='"https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png"'
+ logFile=/config/cjynas-8089_ical_2_xmltv_latest.log
+ trap finish EXIT
+ main
+ scriptRun
+ case "$runInterval" in
+ [[ -n '' ]]
+ echo 'Background script initiated, with 2h between runs for cjynas:8089'
+ grep -q '(.*) #ical_2_xmltv' /config/config.yaml
+ nohup /config/ical_2_xmltv.sh cjynas:8089 2h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b
+ [[ 1 == \1 ]]
++ date +%d%b%y_%H:%M
+ sed -i '/#ical_2_xmltv title/s/#/(18Nov23_08:20) #/' /config/config.yaml
+ sed -i '/#ical_2_xmltv icon/s|img src = .* width|img src = "icons/channels.png" width|' /config/config.yaml
+ sed -i '/#ical_2_xmltv interval default/s/default: .* #/default: 2h #/' /config/config.yaml
+ [[ -n https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b ]]
+ echo 'Using healthcheck.io pings to https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b to confirm functionality'
+ sed -i '/#ical_2_xmltv healthchecks default/s|default: .* #|default: https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b #|' /config/config.yaml
+ echo 'cjynas:8089 ical_2_xmltv 2h https://hc-ping.com/af4d7b89-7446-46dc-9d56-52e653f6c34b'
+ runningScripts
+ servers=($CHANNELS_DVR $CHANNELS_DVR_ALTERNATES)
+ for server in "${servers[@]}"
++ echo cjynas:8089
++ awk -F: '{print $1}'
+ serverHost=cjynas
++ awk -F: '{print $2}'
++ echo cjynas:8089
+ serverPort=8089
++ ps -ef
++ grep '[i]cal_2_xmltv.* cjynas:8089'
++ awk '{print $2}'
+ activeProcess=776
+ [[ -n 776 ]]
+ echo 'Background ical_2_xmltv process running for cjynas:8089'
+ exit 0
+ finish
+ echo -e 'foreground.sh is exiting for ical_2_xmltv with exit code 0'
+ cp /config/config.yaml /config/temp.yaml
+ cp /config/temp.yaml /config/config.yaml
+ sleep 1
+ '[' -f /config/cjynas-8089_ical_2_xmltv_latest.log ']'
+ cat /config/cjynas-8089_ical_2_xmltv_latest.log

@cyoungers

Could you exec into the OliveTin container and ping cjynas please? Just want to be sure it resolves.

Yup, the ping to cjynas did not resolve. While I was having issues with the periodic tasks I tried the tailscale magic dns and set my server to cjynas. I should have not changed configuration while trying to fix the initial problem. I changed back to using the ip number directly and now the fix thumbs is working! Thanks for the help. I'll have to investigate why tailscale is not working for me in olivetin.