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

At a high level what I'm seeing looks like once I have started the OliveTin container, its view of the CDVR logfile never updates. In other words, it looks like starting the container takes a snapshot of the CDVR server log file (xxx.xxx.xxx.xxx:8089/admin/log) but after that the container's view of the logfile never updates, even though I can easily force new log entries as seen via the CDVR admin web UI at xxx.xxx.xxx.xxx:8089/admin/log.

During these tests I am getting the OliveTin container's view of the log both through the files as visible via docker desktop and via a root console session.

I have also done some testing of the OliveTin E-mail Log Alerts script and confirmed that the following test:

 if [ -s $logFile ]; then {

for my installation is only true after script initiation but never thereafter. I have also confirmed that if I force the test to be true using various artificial means, multiple emails come through, confirming my email setup is fine and it is the test that is keeping things from working as they should.

The are possible related reports on the web that depending on the platform, containers sometimes fail to update when editing a mounted file because of the way i-nodes versus filenames work. Assessing these reports against what's going on with OliveTin is difficult for me because I don't know behind the scenes how CDVR server is updating the log. If however this truly is the root cause, it is consistent with the fact that the script works for some people but not others.

Now that @maddox has help me figure out how to use wget to get the CDVR logs

https://community.getchannels.com/t/can-i-wget-the-cdvr-log-file-using-wsl/40879

...I'm going to try wget as an alternate way of tracking logfile changes in the log alerter.sh script, as opposed to

tail -f $cdvrLogFile | grep --line-buffered -E "$grepFilters" >> $logFile &

Hopefully @mjitkop, who I think wrote the original e-mail alerter script, is keeping an eye on this discussion because as a novice I wouldn't trust me to do anything that gets officially sent anywhere.

Actually, no, not exactly.

I wrote the script for channel lineup changes that has a feature to get notified by email but it's all written in Python.

The alert script is not from me. I believe @bnhf implemented it all and I think it is a shell script.

Unfortunately, your issue is beyond my expertise and I have no clue how to even investigate it.

I hope with @bnhf's lead and help from other forum members your issue will be solved soon. :crossed_fingers:

Thanks, right. I stand corrected.

2 Likes

I think this is very likely the issue, as the original problem with this script (which was cross-platform), had to do with the i-node changing for the temporary file I was using. This would cause tail to fail after the first e-mail on all platforms.

I'll continue to investigate if there's another way to get tail-like functionality without using tail...

Thanks for the update.

I think tail -f is working it's just that it's input is always the same. I plan to try something like this:

wget log (time 1)  | filter | tail > snapshot1
....
wget log (time 2)  | filter |tail > snapshot2

 [if snapshot2 entries newer that snapshot 1] generate and email report

As part of this exercise I learned about the watch command, maybe that could be useful.

@skipt I'm wondering if accessing the CDVR log file via a Samba share might be a workaround to this issue.

To do this, you'd first need to set up the directory containing the log file as a network share. I share mine as //media-server6/ChannelsDVR:

Next, create a volume in Portainer pointing to this share. This would look something like this, though you'd need to add username and password:

Then stop your OliveTin Portainer stack and bind this newly created volume instead of your current directory binding. To do this you'd need uncomment some of the lines in the second volumes: section like so:

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
  channels-dvr-logs:
    external: true

and then change the value of LOGS_SHARE like so:

LOGS_SHARE=channels-dvr-logs

I have some confidence this approach will work, as the tail -f WSL2 bug appears to be confined to synchronization of files between WSL2 and the host Windows filesystem.

I will try this so I can learn something and be compatible with your current code. But I plan to take my time for fear of taking 2 steps backward.

In the meantime the following from a console gives a real-time display of log changes filtered for the last 10 [TVE] log messages:

watch "wget -q -O - http://xxx.xxx.xxx.xxx:8089/log | egrep \\\\[TVE | tail"

Pretty cool.

1 Like

When I edit the second volumes:section, is that done in portainer or in docker--and which file is it?

It's done in your Portainer OliveTin stack -- just like any other changes to your OliveTin environment. Stop the stack, make the changes, click Update the stack. Just like you'd do if you're updating OliveTin to the latest version.

1 Like
Stop the stack, make the changes, click *Update the stack* .

After the above I get error

failed to deploy a stack: time="2024-08-21T21:37:40Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string." time="2024-08-21T21:37:40Z" level=warning msg="The \"DOMAIN\" variable is not set. Defaulting to a blank string." validating /data/compose/2/docker-compose.yml: services.channels-dvr-logs Additional property external is not allowed

Admittedly I did not select the option to re-pull, because it's been several days since I worked on this and I thought I should stick with the same image/container I had been using. If I should select the re-pull option please let me know.

Also, when editing the stack in portainer to bind the newly created volume, I don't see a save button for the edits. I never saw any indication that the edits were saved.

I have been working on slimming down the number of channels which appear in my ChannelsDVR guide by blocking them from each source.

I found the Olive tin action of "Create Channels List in csv format" very helpful in determining all of the channels I receive from several sources. I imported into a spreadsheet to help facilitate the weeding out process.

Now that I have blocked many/most of the channels from each source, it would be nice to have an action which would create an abbreviated, filtered channels list leaving out the blocked channels.

In addition, it would be nice also include an action which creates an even shorter filtered list of only "favorited" channels.

Perhaps there is already a way to accomplish what I hope to do. :pray:

Yes. Look at channel collections. :slightly_smiling_face:

1 Like

Thank you!

That's exactly what I have as my final goal...to create channel collections of several categories. Classic Movies, Classic TV shows, Western Movies, Local Channels, Weather, News, etc...

What I'm hoping to find is an intermediate step for creating a list of all of my non-blocked and/or favorited channels. I intend to print the list and highlight, in different colors, which channels to include in each channel collection. (I'm kinda' an old analog type of guy who is used to stuff being on paper.)

This afternoon, I just went through the spreadsheet which I created from the all-encompassing .csv channel list, and hid all of the rows for blocked channels. It was tedious. But, I managed to get it done. Next, I pull out my trusty highlighter set... :crayon:

Cool. I'm glad channel collections will bring some joy to your life. :slight_smile: If you take a look at all the great features that Channels DVR has to offer, you will be amazed. :smiley:

By the way, I'm also glad that you found the OliveTin action "Create Channels List in csv format" useful. Guess who wrote the script that generates this CSV file? :grin:

@bnhf had the great idea (and the skills!) to create OliveTin, which made it possible to integrate into a single tool scripts from users who have created them over the years. :+1:

Sorry about that.

I'm working on a Chrome extension project now in my spare time that will provide, among other features, this feature to generate this CSV file.
Now that you mentioned your wish to be able to filter blocked/unblocked/favorited channels, this is a great idea to add as an option in the script. I will look into it.
Don't get too excited though because I don't know when I will have enough time to work on it. So I can't provide an ETA.

This error would suggest that you didn't create a volume called channels-dvr-logs in Portainer-Volumes that connects to the SMB (Samba) share that I wanted you to set up.

You might want to review this post regarding setting up the share, creating a Portainer volume pointing to it, and then editing your Portainer-Stack to connect it to OliveTin:

I agree with you that Channels DVR is a great program with many amazing features. Some, which have been recently added and updated, I still need to study and start using. Channels Collections have been my way of organizing content by category so far.

@mjitkop, I have made use of your "create channels list in csv format" script a few times already. It has served me well. Since my stroke a few years ago, I get easily overwhelmed by too much information. So, it was rewarding to print out all of what amounted to 23 pages, and scratch out about 75% of the channels with pencil. Now, I'm down to 6 pages. (about 400 channels remain in this cut)

OliveTin created by @bnhf is a fantastic compilation of so many tools. It is like my swiss army knife for Channels. Getting Portainer up and running has saved me from losing my mind in dealing with containers. Through OliveTin, I have used the Project One-Click actions to create most of my sources.

This Channels Community, and the official Channels DVR support network, has some brilliant and very helpful folks. While I am not very good with scripts or programming, I hope to offer some help in suggesting and testing new features. I'm a retired engineer looking to entertain and exercise my mind. :brain: :muscle: Feel free to hit me up if you need anything.

4 Likes

New bnhf/olivetin:latest (aka bnhf/olivetin:2024.08.31) pushed this morning incorporating the latest changes to the Samsung-TVPlus-for-Channels container. Multiple regions and the new playlist URL supported.

Also, beginning with this update to the Docker Compose, I'm adding a comment line to the yaml with the date of the most recent update to the compose itself. This will be reflected across all uses of the compose including the docker-compose for every Channels-related extension thread, OliveTin-for-Channels and Project One-Click.

For example, here's what a typical yaml will look like as a date is added to each (which will happen over time):

version: '3.9'
services:
  # 2024.08.31
  # GitHub home for this project: https://github.com/matthuisman/samsung-tvplus-for-channels
  # Docker Hub home for this project: https://hub.docker.com/r/matthuisman/samsung-tvplus-for-channels
  samsung-tvplus-for-channels:
    image: matthuisman/samsung-tvplus-for-channels:${TAG}
    container_name: samsung-tvplus-for-channels
    ports:
      - ${HOST_PORT}:80 # Use the same port number the container is using, or optionally change it if the port is already in use on your host
    environment:
      - REGIONS=${REGIONS} # Comma separated list of regions to use. us,kr,it,in,gb,fr,es,de,ch,ca,at or all supported.
      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc
    restart: unless-stopped

  # Default Environment variables can be found below under stderr -- copy and paste into Portainer-Stacks Environment variables section in Advanced mode
2 Likes

How do you add a manual recording with an OTA channel?
I get an error message 'invalid argument' entering channel number as 2.1 or 2-1.

Thanks.

1 Like

@bnhf will have to change the type for channel in the config.yaml from an int to float or something else that will accept 2.1

      - name: channel
        type: int
        description: The channel number to use for the recording.
1 Like

Thanks