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

OliveTin scout here :slight_smile: I’m not sure if it’s been mentioned before but perhaps this lesser-known tip warrants inclusion in OliveTin, either as an informational snippet, or the basis for a plugin that helps us customize our channel logos? Unless there’s a better way…

Regardless, kudos to @kennyb3653 for sharing it!

1 Like

That would be awesome. For what it is worth, I did use OliveTin, using the "Generate a Channels DVR
M3U Playlist" button. I took the generated playlist from the logs, pulling out and using only the six channels I needed. I did only minor tweaks then to each one, before putting them as a "Logos" source. For example, one channel came in the OliveTin log like this:

#EXTINF:-1 channel-id="abc-wmar" tvg-id="5985" tvg-chno="5985" tvg-logo="https://tmsimg.fancybits.co/assets/s28708_h3_aa.png?w=360&h=270" tvc-guide-stationid="21230" tvg-name="WMARDT" group-title="HD",ABC
http://192.168.7.180:8089/devices/ANY/channels/5985/hls/master.m3u8?

All I did was replace the part after "tvg-logo" with a link to my logo, and deleted the m3u8 address at the end. So the end result was something like this:

#EXTINF:-1 channel-id="abc-wmar" tvg-id="5985" tvg-chno="5985" tvg-logo="http://www.mywebsite.com/images/tvlogos/wmar.png?w=360&h=270" tvc-guide-stationid="21230" tvg-name="WMARDT" group-title="HD",ABC
1 Like

I've been noodling this around for the last couple of days, and here's an approach that I think could be good:

  • Create a "Channel Collection" that contains the channels for which you'd like to use custom logos

  • Collect the custom logos you'd like to use and name them with their Channels DVR "tvg-id"

  • Upload those logos using the existing DVR - Manage - Images feature of Channels DVR

  • Use the "Generate a Channels DVR M3U Playlist" OliveTin Action, with the collection name you chose and a filter of "logos".

  • This will generate an M3U that will contain just the channels who's logos you want to override, and will have those logos set to the matching logo name from those uploaded images.

  • This M3U can be used via copy-and-paste, or can also be made available on a URL via the OliveTin companion static-file-server container

How does that process flow sound @Fofer and @cyberskier?

2 Likes

I would have to test it. I just output all my channels from OliveTin, pulled out the ones I wanted and put those into their own custom channel (so copy and paste), and deleted the last line, which was the m3u8 link, if I recall. I then uploaded the logos to my web server, and pasted the link to the logo after “ tvg-logo” for each channel.

2 Likes

Sounds like a great approach to me!

@Fofer @cyberskier I've added this Custom Channel Logos "trick" to the latest build of OliveTin, bnhf/olivetin:latest and bnhf/olivetin:2024.02.21.

The process is as described a couple of posts back, with much more detail and screenshots to be found here:

1 Like

New OliveTin-for-Channels pushed today with tags :latest and :2024.02.23. Total update for all sample docker-composes for every extension somebody might want to use with Channels (that I could think of). All examples are for use with Portainer-Stacks! I also posted them all here:

1 Like

So dumb/newbie question: How do I get the client names to input as variables for the “send message” feature? My guess would be from the client section of the DVR, but I have some client names with spaces in them.

(I believe I’ve otherwise figured out how to add the CHANNELS_CLIENTS variable, but just don’t know where to find the client names)

Thanks!

2 Likes

The way I set this up, any message is sent to ALL defined clients. My thinking was, if the message is intended for just one person, put their name(s) in the title. Overall, I've been trying to keep the data required for individual actions as streamlined as possible.

Thanks. But don’t I first have to define those clients in Portainer in an environment variable? Or can I just not do that, and it goes to all clients by default?

For sure. It's a space separated list of either hostnames or IP addresses:

     - CHANNELS_CLIENTS=${CHANNELS_CLIENTS} # Space separated list of Channels DVR clients you'd like notifications sent to in the form hostname or IP

OK, thanks. I'm on an eero network, so I can find the hostnames in the eero app, I believe.

I finally installed OliveTin for Channels and I can see the interface. :grinning:
However, it doesn't see my DVR. :frowning_face:

Everything is running on a single computer with Windows 11.

This is my customized Portainer-Stack (I removed things that I didn't think were relevant to my configuration):

version: '3.9'
services:
  olivetin:
    image: bnhf/olivetin:${TAG} # Add the tag like latest or test to the environment variables below
    container_name: olivetin
    ports:
      - 1337:1337
    environment:
      - CHANNELS_DVR=${CHANNELS_DVR} # Add your Channels DVR server in the form hostname:port or ip:port
      - CHANNELS_CLIENTS=${CHANNELS_CLIENTS} # Space separated list of Channels DVR clients you'd like notifications sent to in the form hostname or IP
      - UPDATE_YAMLS=${UPDATE_YAMLS} # Set this to true to update config.yaml
      - UPDATE_SCRIPTS=${UPDATE_SCRIPTS} # Set this to true to update all included scripts
      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc
    volumes:
      - ${HOST_DIR}/olivetin:/config # Add the parent directory on your Docker you'd like to use
    restart: unless-stopped

  static-file-server:
    image: halverneus/static-file-server:latest
    container_name: static-file-server
    ports:
      - 8080:8080
    environment:
      - FOLDER=${FOLDER}
    volumes:
      - ${HOST_DIR}/olivetin/data:${FOLDER}
    restart: unless-stopped

#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/dvr inside the container. Set ${HOST_DIR} to channels-dvr (HOST_DIR=channels_dvr) in that example
  #channels-dvr:
    #external: true

Environment variables:

TAG=latest
CHANNELS_DVR=127.0.0.1:8089
CHANNELS_CLIENTS=
UPDATE_YAMLS=true
UPDATE_SCRIPTS=true
TZ=US/Eastern
HOST_DIR=D:\
FOLDER=/web

Obviously, I messed up somewhere.

Result of the Ping action:

Sat Feb 24 12:16:27 EST 2024
  % 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: (7) Failed to connect to 127.0.0.1 port 8089: Connection refused
HTTP Status: 000
Effective URL: http://127.0.0.1:8089/
One time run mode used...
foreground.sh is exiting for pingcdvr with exit code 0

Try exec'ing into the container (use the "Quick Action" button for that purpose in Portainer-Containers), and see if you can ping 127.0.0.1 and localhost. Also, try the hostname and IP of this PC -- that should give us a baseline of what's working.

EDIT: I don't have Channels installed on my Windows 11 PC, but I do have OliveTin there for testing, and I was able to reach the PC on all 4 addresses.

EDIT2: OK, so I tried the curl command I use with another open port on my Windows 11 PC. 127.0.0.1 and localhost both failed, but nuc12-pc and 192.168.110.237 both succeeded. Not sure why this is the case, but there are some idiosyncrasies with the whole Docker/WSL/Windows thing. So, I'd suggest trying either your system's LAN hostname or IP address to see if you have better results.

Is there a post/location where I can get/install Olive Tin For Channels, with installation instructions?

First post in this thread should do the trick. Let me know if you have any questions.

I'm a docker novice but I installed docker a while back for play but didn't do/try/learn much. I've been instead surviving by writing bash scripts using cygwin on Windows to wget/manipulate stuff from my CDVR server, but that's about it. I see the advantages of the OliveTin For channels setup and want to get involved.

My CDVR server runs on a dedicated i7 Windows laptop separate from my main PC. My first decision point will be should I install docker/OTFC on the PC hosting my server, or, on my main PC? Maybe with the correct environment variables it won't matter. I suppose the docker-compose is like an installation script that pulls from a repository somewhere?

It shouldn't matter where you install it, but containers can be a bit like potato chips -- it's hard to limit yourself to one. :slight_smile: In other words, make sure that whatever system you choose is available 24/7 as you're very likely to have multiple containers running to which Channels needs full-time access.

Docker is a Linux thing at heart, but can be run on Windows systems using the Windows Subsystem for Linux (WSL2) as a backend. Most people go with Docker Desktop as a starting point -- for that Windows look-and-feel. You'll also need to install Portainer, which can be done from the command line of whatever WSL2 distro you choose -- or it can be installed as an extension to Docker Desktop, from its GUI.

Docker-compose is essentially a more elegant way to deploy containers using the YAML scripting language. And yes, the containers themselves are download from one of several "container hubs", based on the "image" statement in each docker-compose.

Thanks for the suggestions. I will try later in the evening. :crossed_fingers:

I am able to connect locally but not from another machine do I have to change the network to bridge or host ?