A pretty darn good VCR "plus" script that works on all HDHomeRun devices, and is free to use! An OSX faceless/background script that makes recording TV shows and Movies on HDHomeRun very easy.
I wanted a quick way to record a TV show, without setting up a large system, like Plex or HDHomeRuns' own DVR software. I call it a VCR app, as while it does use guide data to pull name / season / episode number / episode name / show length, it does not present like a normal DVR. It is more of a Smart VCR
When you first run this, OSX will prompt multiple times for various system permissions. Please grant all of these.
Let's start with "Add", as this is the main function.
Once you select your channel, you will see a screen that details the shows that are on in the next ~ 4 hours.
You will notice that there is a "Manual Add" option. This will allow you to select a time past the 4 hours of guide data provided. If you wish to follow this route, you can skip to https://github.com/identd113/hdhr_VCR-AS#manual-add
Select a show, and click "Next"
You will then select where you want the file to be saved. The default location is "/Volumes/", but you will need to select a specific location. Any attempts to select "/Volumes/" as the destination will re prompt you for a valid location.
If you own a "Extend" device, or a device that has transcode capabilities, you can select which profile you wish to use.
If you wish to schedule a recording outside of the 4 hour guide window, you can select Manual Add, and add this show/series.
You will then be asked to specify a time, it is done a bit strangely. We use 24 hour decimal time
You will now have the ability to set the recordings name. The name provided is just temporary, as we will try to pull the guide data right before the recording starts.
This allows you to set up a recording up to a week in advance.
"You told me you would tell me what "Run" is for?
The button that shows "Run" in almost all dialogs, will drop you back into the idle() handler. This can be used to go back, or start over, for example if entering the incorrect information when adding a show. This allows the script to run as needed. It is important to know that the idle() is NOT running when a dialog is open. If a dialog stays open forever, we will never be able to record, or update anything in the script. Because of this, dialogs have a timeout of 60 seconds, before auto closing. The choose from list dialog can NOT be dismissed automatically. Our use case is the show info list.
"I did that, but nothing happens!"
That is accurate. When the script is configured with a show, it is faceless, and you do not need to do anything, other than allow it to run.
"I want to add or edit a show"
If you click the icon in the Dock, you will be presented with the main window, so you can do such things.
"How do I know something is happening?
We use notifications to alert the user to recordings being started, in progress, and completing. This may cause lots of notifications to occur, if a lot of shows are scheduled. If there is a better way to be able to tell the user something, let me know.
"I need to quit the script, but I have a recording in progress"
If you want to quit the script, the best way to do so is being in a "run" state (faceless) and then issuing a command q, or selecting "Quit" from the hdhr_VCR File menu.
In almost every case, you should choose "No".
Uses records to store complex data sets.
This is an example of a what data of a show recording contains:
{show_title:Curious George S01E21 Surprise Quints; Muddy Monkey, show_time:16, show_length:30, show_air_date:Monday, Tuesday, Wednesday, Thursday, Friday, show_transcode:None, show_temp_dir:alias Raid3:DVR Tests:, show_dir:alias Raid3:DVR Tests:, show_channel:2.4, show_active:true, show_id:0489dfb9fd492970694c13d25e2f457a, show_recording:false, show_last:date Tuesday, June 15, 2021 at 4:30:00 PM, show_next:date Wednesday, June 16, 2021 at 4:00:00 PM, show_end:date Wednesday, June 16, 2021 at 4:30:00 PM, notify_upnext_time:missing value, notify_recording_time:missing value, show_is_series:true, hdhr_record:105404BE}
Example of a tuner record:
{hdhr_lineup_update:missing value, hdhr_guide_update:missing value, discover_url:http://10.0.1.101/discover.json, lineup_url:http://10.0.1.101/lineup.json, device_id:DEADBEEF, does_transcode:1, hdhr_lineup:missing value, hdhr_guide:missing value, hdhr_model:missing value, channel_mapping:missing value, BaseURL:http://10.0.1.101, statusURL:http://10.0.1.101/status.json}
The hdhr_guide and hdhr_lineup contain the entire json result of the lineup, and guide data. We use this as a cache, so we only make a "new" API call every 2 hours, or when a show starts recording.
The "heavy lifting" is done with curl, which downloads the data to a local drive. The script manages the show and device logic.
If there are multiple HDHR device on the network, you will be asked which one you want to use when adding a show.
When adding a show, we will attempt to write a test file to that location (and remove it) right away, so we can get through any of the OS X disk access prompts. This file is written/removed every 5 minutes during a recording. This will update the file size, as seen in Finder.
We use notifications to alert the user to imminent events
If the system is restarting or shutting down, we will see that, and not prompt the user cancel the recordings, they will just be canceled.
hdhr_VCR now has a logger, which by default is named hdhr_VCR.log, that gives us more information of what is happening, without flooding the notifications.
I hope this can be collaborative project, so other options that you use can be added.
-MikeW