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

Thanks -- that's just what I need. Would you think most people would want to update all of their groups on a schedule -- with an on demand option? It'd be easiest to just do them all either way.

Could you link me to those scripts -- assuming you've posted them of course. :slight_smile: Now that I have a reasonably generic foreground script to launch background scripts, we should be able to add them to olivetin-for-channels.

Yes. Only videos with specifically-formatted filenames will work with this script anyway, so might as well apply it to all groups, by default. I think that’s what most people would want and expect anyway, as it would be easier than manually selecting each group that the script will interact with, or removing groups that it won't.

@Fofer @cyoungers

I built a version of OliveTin with the test flag (bnhf/olivetin:test) that should work for updating YouTube thumbnails for all of your video_groups, on a recurring schedule. Very similar to the TWiT.tv guide update routine -- in fact they both use the same front-end shell script.

If one or both of you could give it a try, as I'm not using this feature so I don't have any live data to use. It works with the sample JSON, but there's nothing like an actual test. Be sure to use a different healthchecks.io URL, as the idea is to be able to identify each background job.

I actually got an e-mail from them today, as I don't have the TWiT.tv script running anymore, and here's what it looks like:

screenshot-mail.google.com-2023.09.28-16_13_57

Cool, thanks I will give it a whirl tonight. What’s the easiest way to install that “test flag” version instead of the version I have currently, while retaining my setup? I have Portainer running so I’m assuming it’s an easy switchover?

It's definitely easy: Stop your olivetin stack. Change latest to test in your docker-compose. Click on Update and re-pull and redeploy for good measure. All your persistent data will be preserved.

EDIT: You will need to restart the TWiT.tv guide data background script. This will be true any time the container or docker host is restarted

Do you have to kill the background script or will it terminate with the olivetin stack restart?

It's running in the container, so yes, restarting the container will nuke it.

I have the test image running with fix thumbnails running every hour. I disabled the script that I have been running to do this same function. It will take some time for my other scripts to grab some YT videos that will need their thumbs fixed. I'll let you know.

This brings up another question. Each time I restart olivetin I have to go back in a restart any recurring tasks and associate the correct healthchecks.io links? Today it is the TWIT guide and fixthumbnails that are recurring.

I was just pondering the same thing. It wouldn't be difficult to keep track of what's running in the background and restart it with the same parameters on restart. Seems worth doing, what do you think?

1 Like

Yes please!
And is there any way to indicate on the actions page that an item already has a process running? Like note the PID and then check that the PID is still running when the action page refreshes.

I love that idea -- but I'll have to see if it's supported in OliveTin. If not, I'll submit it as a feature request to the developer.

EDIT: I wonder if I could do something as simple as add a "(running)" to the button description? OliveTin can be a tad unpredictable about changing the config.yaml on-the-fly -- but I'll try it.

At first, I replied that I had never posted my scripts and later realized that it was not true.
I kind of forgot this post:

The other one, though, never posted anywhere.
I'll work on it next week because I am away now and through the weekend.

P.S. The script that monitors lineup changes is not robust enough with its current design. If the script is stopped and lineup changes are made during that time, it will not report the changes once the script is restarted.
This is due to the fact that the lineup references are not saved to a file, they are only maintained in the script for as long as the script is running.
This is something I've been meaning to improve but never got the time to do it.

There are also other scripts that I almost forgot about:

Ok, great, thanks, I've updated to the "test" version and it appears to be working well for me. I've got "Fix YouTube Thumbnails" running every 2 hours as well as "Generate Twit.tv Guide Data" every 3 days, along with healthchecks to keep tabs on both.

Yes please! And if OliveTin can display what the current parameters are as well, that would be very helpful.

While mine's running every 2 hours and I think that's fine for my needs... for troubleshooting and when I'm feeling impatient, an on-demand button to fix thumbnails right now would be useful indeed.

My scripts downloaded a YouTube video overnight but fixthumbnails does not appear to be working. I searched the container logs and did not see anything.

I ran it again by doing a one time run. Still not seeing the video names get fixed. And nothing in the container log indicating it ran. The logs from fixthumbnails sees to indicate it ran.

1 Like

I found that issue this morning. It'll be fixed in the next build, but in the meantime if you could edit the config.yaml "Fix YouTube Thumbnails" section to confirm. Under "Shell:" where it has fix_thumbnails.sh as an argument, that should just be fix_thumbnails (so delete the ".sh" portion).

That fixed it. Looks like it ran fine.

@cyoungers @Fofer

I believe I've addressed all of the wish list items for any scripts that we run "cron style". Here's what I added:

  • Background scripts active when a container restarts, or host reboots, will be re-executed with their last used parameters on startup
  • The OliveTin action button will show (Running!) for any scripts currently executing in the background
  • Your last used parameters will become the defaults, e.g. "once" would become "72h", and the placeholder healthchecks.io URL will be replaced with your actual "ping" URL
  • You can now run something once even if there's an active background process for it

The scripts I'm using for this are universal, so everything should work the same with the thumbnail fix, but all my testing was done with the twit guide data.

Re-pull and redeploy bnhf/olivetin:test and let me know how it goes.

1 Like

Pulled the latest and started twit and fix thumbs repeating tasks and it seems to be running fine. I'll know more tomorrow when my scripts pull down more YT files. Nice that they indicate that a background task is running. Thanks @bnhf for all the work.

Looking at the container logs I notice an error message. Here is a snippet from the log. Wondering about the "cannot access '*.running': No such file or directory" message. Probably an ignore kind of message but thought I'd point it out.

No existing /config/stationid.sh found or UPDATE_SCRIPTS set to true
ls: cannot access '*.running': No such file or directory
level="info" msg="OliveTin initializing" commit="86e5dfe" date="2023-03-24T23:32:48Z" version="2023.03.25"