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

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"

No worries there -- *.running files are only present if you had background tasks going when you restart the container.

I've added a couple a couple of nice scripts courtesy of @mjitkop to olivetin-for-channels.

The first will output a complete list of channels in a CSV file format, including which of your sources has that channel. Pull it into a spreadsheet program for best viewing, sorting, etc.

The second will output a complete list of your recorded movies, also in CSV format. The output from both scripts can be found in directory you have bound to /config on your docker host (for me it's /data/olivetin).

Also as requested by @chDVRuser and @themediaguy respectively, I've added "SeriesID" and "Genres" to the JSON data sent to Channels DVR for manual recordings. SeriesID is automatically set as "manual/channel" where channel is the channel you specified for recording. Genres is a new field when adding a manual recording. Multiple Genres can be used -- comma separated.

bnhf/olivetin:latest and bnhf/olivetin:test are now the same, with updates pushed moments ago.

3 Likes

Very nice! I've now updated back to olivetin:latest and it seems to be working well... I tested the new scripts and set up the two "running" scripts and will keep an eye on things in the days ahead. This is so great. Thanks again @bnhf!

1 Like

The two new scripts work great. Thanks @bnhf & @mjitkop.

I'm not seeing a new field for genres in creating a new manual recording.

1 Like

Hmm, just a guess but was your "UPDATE_SCRIPTS" env var set to "true" when you updated? Asking because my OliveTin now has the new genre field:

OK, I see it now. It was a browser caching issue.

Wow, this is my first time using this script, and can immediately see it will be incredibly useful.
Thanks so much for this @mjitkop!

I think people are going to like this one too, and I'd set it up to run "cron-style", which should minimize concerns about missed channel lineup change updates.

@mjitkop What are you using here to generate the e-mails? I have something similar in my APC UPS suite of containers, and as I recall I'm using postfix, libsasl2-modules and mailutils -- with Gmail's app-specific SMTP server. Are you doing something similar?