That looks really great. Have to got a link to the project?
Wow, OliveTin is one cool tool I didn't know existed.
Could see it it saving lots of manual work.
Like search for station id's and create a custom channel m3u when trying to find which one matches a stream.
I've had to do that all manually, like finding the right one for Dabl Guide data doesn't match what's playing - #2 by chDVRuser
#EXTM3U
#EXTINF:-1 channel-number="1011" tvc-guide-stationid="112157" channel-id="DABL" tvg-name="DABL",DABL
http://192.168.1.4:8089/devices/ANY/channels/6781/stream.mpg?format=ts
#EXTINF:-1 channel-number="1012" tvc-guide-stationid="120761" channel-id="DABLHD" tvg-name="DABLHD",DABLHD
http://192.168.1.4:8089/devices/ANY/channels/6781/stream.mpg?format=ts
#EXTINF:-1 channel-number="1013" tvc-guide-stationid="112158" channel-id="DABLP" tvg-name="DABLP",DABLP
http://192.168.1.4:8089/devices/ANY/channels/6781/stream.mpg?format=ts
#EXTINF:-1 channel-number="1014" tvc-guide-stationid="120762" channel-id="DABLPHD" tvg-name="DABLPHD",DABLPHD
http://192.168.1.4:8089/devices/ANY/channels/6781/stream.mpg?format=ts
#EXTINF:-1 channel-number="1015" tvc-guide-stationid="130094" channel-id="DABLSTR" tvg-name="DABLSTR",DABLSTR
http://192.168.1.4:8089/devices/ANY/channels/6781/stream.mpg?format=ts
#EXTINF:-1 channel-number="1016" tvc-guide-stationid="131032" channel-id="DABLPP" tvg-name="DABLPP",DABLPP
http://192.168.1.4:8089/devices/ANY/channels/6781/stream.mpg?format=ts
and previously for some FrndlyTV channels Frndly TV for Channels - #694 by chDVRuser
I haven't built the Channels specific version yet -- I'm looking for input at this stage on what to include.
If you have specific scripts, use cURL commands, or have command line stuff you execute every now-and-then related to Channels DVR let me know. Things that are useful enough to CDVR users will be added!
Yeah, it's super easy to use -- for example here's the yaml and a sample script for what I've done so far:
actions:
- title: Find Gracenote Station IDs
icon: '<img src = "https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png" width = "48px"/>'
shell: /config/stationid.sh "{{ station }}"
arguments:
- name: station
type: ascii_sentence
- title: Turn Off Comskip by Channel
icon: '<img src = "https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png" width = "48px"/>'
shell: /config/setcomskipignore.sh {{ channel }}
arguments:
- name: channel
type: ascii_sentence
- title: List Channels with Comskip Off
icon: '<img src = "https://community-assets.getchannels.com/original/2X/5/55232547f7e8f243069080b6aec0c71872f0f537.png" width = "48px"/>'
shell: /config/listcomskipignore.sh
And, here's an example script -- notice I lifted the main cURL/jq command right from your recent Windows script :
#! /bin/bash
stationName=$(echo "$1" | sed 's/ /%20/g; s/^/%22/; s/$/%22/')
curl http://$CHANNELS_DVR/tms/stations/$stationName \
| jq --raw-output "sort_by(.type, .name) | .[] | \"type: \(.type), name: \(.name), callSign: \(.callSign), stationId: \(.stationId), logo: \(.preferredImage.uri)\""
But it's simpler because it's Docker, and there's a basic UI to drive input.
I've forked the OliveTin project, and I'll add whatever dependencies are required for CDVR users, along with a representative config.yaml and some simple scripts like the above.
Looks too easy. Just write some shell script and prompt for input.
Not sure if you want to add the latest addition, the affiliate call sign
I will, thanks. Let me know if you have other stuff you've written or use that you think would be good.
I'm pretty sure the recent @mjitkop Python script for adding manual recordings would be pretty easy to add, as OliveTin supports drop-down-style fields as well. Hopefully he'll see this and weigh-in. Doing it this way would address inevitable dependency issues people have, and provide a decent, consistent interface for use.
Totally agree. Fits what docker containers were made to do.
For anyone that wants to get going with this before I build the first Channels-specific version, here's a docker-compose suitable for Portainer-Stacks:
version: '3.9'
services:
olivetin:
image: jamesread/olivetin:latest
container_name: olivetin
ports:
- 1337:1337
environment:
- CHANNELS_DVR=${CHANNELS_DVR}
volumes:
- /data/olivetin:/config # replace host path or volume as needed
restart: unless-stopped
Add your Channels DVR server hostname:port or ip:port to the environemnt section, and you'll be good to go. If you need to temporarily add dependencies, exec into the container as root and do a microdnf update
, followed by a microdnf install <your_package_name>
. Your package will be present until the next container restart.
Let me know of anything you want included package-wise in the Channels specific fork I'll build. This will also include a Channels-oriented config.yaml file and whatever scripts we've come up with.
And here are the 3 scripts I've done so far, which as you can see are dead simple. They're stored in the bound /data/olivetin directory for persistence:
stationid.sh:
#! /bin/bash
stationName=$(echo "$1" | sed 's/ /%20/g; s/^/%22/; s/$/%22/')
curl http://$CHANNELS_DVR/tms/stations/$stationName \
| jq --raw-output "sort_by(.type, .name) | .[] | \"type: \(.type), name: \(.name), callSign: \(.callSign), stationId: \(.stationId), affiliate: \(.affiliateCallSign), logo: \(.preferredImage.uri)\""
setcomskipignore.sh:
#! /bin/bash
channel=$1
curl -XPUT http://$CHANNELS_DVR/comskip/ignore/channel/$channel
listcomskipignore.sh:
#! /bin/bash
curl http://$CHANNELS_DVR/settings \
| jq 'to_entries | map(select(.key | test("comskip.ignore.channel.\\d+"))) | from_entries'
Basic, but very effective combined with OliveTin!
Hey this is super cool, I'm definitely down to try it. Seems like a great way to organize the snippets of code and scripts I have scattered about.
How about adding this good one too, would it work? It's made in Ruby. Could it run on a recurring schedule?
Incorporating this one as a docker would make things a lot easier for folks too:
Are these the sorts of miscellaneous scripts and tricks you mean? Thanks for making and sharing this! Inspiring!
Absolutely.
ChatGPT translated the Ruby script easily enough to Bash, but I'm not sure about having it be a cron job. I'll have to think about the options. But it could definitely be run on demand:
#!/bin/bash
# Define server URL and video group
server_url="http://YOUR_IP:8089"
video_group="VIDEO_GROUP_ID"
# Retrieve source files using curl and parse JSON
source_files=$(curl -s "${server_url}/dvr/groups/${video_group}/files")
# Iterate through each file
for file in $(echo "$source_files" | jq -c '.[]'); do
# Extract file_id, title, and yt_match from JSON
file_id=$(echo "$file" | jq -r '.ID')
title=$(echo "$file" | jq -r '.Airing.EpisodeTitle')
yt_match=$(echo "$title" | grep -oE '_\((\d{4}-\d{2}-\d{2})\))?_?\[([^]]+)\]')
if [[ -n $yt_match ]]; then
yt_date=$(echo "$yt_match" | sed -E 's/_\((\d{4}-\d{2}-\d{2})\))?_?\[([^]]+)\]/\1/')
yt_id=$(echo "$yt_match" | sed -E 's/_\((\d{4}-\d{2}-\d{2})\))?_?\[([^]]+)\]/\2/')
yt_thumbnail_url="https://i3.ytimg.com/vi/${yt_id}/maxresdefault.jpg"
new_title=$(echo "$title" | sed -E "s/$yt_match//")
# Construct the JSON package
package='{"Thumbnail": "'$yt_thumbnail_url'", "Airing": {"EpisodeTitle": "'$new_title'"'
if [[ -n $yt_date ]]; then
package+=', "OriginalDate": "'$yt_date'"'
fi
package+='}}'
# Make a PUT request using curl to update the file
curl -X PUT -H "Content-Type: application/json" -d "$package" "${server_url}/dvr/files/${file_id}"
fi
done
This looks doable too, as we'd certainly have Python in the container, and the dependencies look modest.
This would be awesome too! Getting that to run on macOS was not for the faint of heart
Since you've made a way for users to set and lists comskip ignore channels, should be easy to add an option to remove those. Don't know if you want to present the current list and have them check one or multiples to remove, or just have them enter the channel number.
This looks great.
It's funny because I recently posted the following in GUI app to make it easy to schedule manual recordings :
So this is perfect!
Sadly, though, life is very busy for me right now and I don't know when I will have time to get to it.
If somebody wants to take my code and integrate it into OliveTin, be my guest!
This looks pretty cool @bnhf. I'm having trouble getting the container to start in Portainer on my Synology NAS. I'm doing something stupid but I can't figure it out. The container log shows that it cannot find the config.yaml file for some reason.
level="error" msg="Config file error at startup. Config File \"config.yaml\" Not Found in \"[/ /config /etc/OliveTin]\""
This is what my compose says:
volumes:
- /volume1/data/olivetin:/config # replace host path or volume as needed
Here is the olivetin config directory when I shell into the NAS:
Chris@CJYNAS:/volume1/data/olivetin$ pwd
/volume1/data/olivetin
Chris@CJYNAS:/volume1/data/olivetin$ ls -las
total 20
0 drwxrwxrwx+ 1 Chris users 158 Sep 24 05:04 .
0 drwxrwxrwx+ 1 root root 62 Sep 24 05:07 ..
4 -rwxrwxrwx+ 1 Chris users 305 Sep 24 05:54 compose.txt
4 -rwxrwxrwx+ 1 Chris users 828 Sep 24 04:56 config.yaml
0 drwxrwxrwx+ 1 root users 276 Sep 24 05:04 @eaDir
4 -rwxrwxrwx+ 1 Chris users 144 Sep 24 04:59 listcomskipignore.sh
4 -rwxrwxrwx+ 1 Chris users 89 Sep 24 04:59 setcomskipignore.sh
4 -rwxrwxrwx+ 1 Chris users 332 Sep 24 04:58 stationid.sh
Anyone have any ideas why olivetin cannot see the config.yaml file?
That's an issue I'll address when I build the Channels specific version. config.yaml needs to exist in the generic version for the container to start. You can take the one I posted earlier in the thread, and put it in your bound data directory, and then start the container.
Not sure. YAML files aren't executable, but that's the only thing that jumps out at me so far.
EDIT: Maybe permissions? Try adding user: root
to your docker-compose
Yup, that was it. Added root permissions in the compose. Here is my compose now that is working. Thanks for the help.
version: '3.9'
services:
olivetin:
image: jamesread/olivetin:latest
container_name: olivetin
user: root
ports:
- 1337:1337
environment:
- CHANNELS_DVR=${CHANNELS_DVR}
volumes:
- /volume1/data/olivetin:/config # replace host path or volume as needed
restart: unless-stopped
EDIT: Well the container starts but I'm getting an error that it cannot write to the destination. Where is the CURL output going?
exit status 127
/config/listcomskipignore.sh: line 4: jq: command not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (23) Failure writing output to destination
Another EDIT: I see the message that jq cannot be found. I'm able to execute the listcomskipignore.sh successfully if I shell into the NAS. For some reason the scope of "jq" running in Portainer is not valid.
Another example of something I'll be doing for the Channels specific version -- which is to add dependencies we'd need. Exec into the container and run microdnf update
followed by microdnf install jq