How to create a Manual Time/Channel based recording job

I have been through exactly what you are going through. I will provide the steps.

Step 1.

You need a program on your machine called CURL. There is an old version that is included with Windows, but I think I got an updated version somewhere on the Internet.

The version I'm using is 7.55.1. I don't know if the old version will work or not.

More to follow.

Step 2.

You have to build a text file with the information on the program you want to record. The file should have a file extension of ".json".

The following is an example of one of my files. It includes a bunch of information that is not required. To know what is not required, you can use trial and error, or look at old posts in this forum.


{
"Name":"My Program Name",
"Time": 1633816860,
"Duration": 3300,
"Channels": ["6073"],
"Airing": {
"Source": "None",
"Channel": "6073",
"Time": 1633816860,
"Duration": 3300,
"Title": "My Program Name",
"EpisodeTitle": "Saturday 10/09/21",
"Summary": "",
"Image": "https://tmsimg.fancybits.co/assets/p8529464_b_h9_ag.jpg?w=720\u0026h=540",
"Categories":["Episode","Series"],
"SeriesID":"",
"ProgramID":"",
"SeasonNumber": 2021,
"EpisodeNumber": 282,
"Raw": ""
}}

Notes:
Time is "Unix Epoch Time" which is the UTC number of seconds from 1/1/1970. Look this up on the internet for any further explanation.

Duration is number of seconds.

Step 3:

You now pass the information to the server using CURL and the file you created with something like this:

Curl -XPOST --data-binary @My_File.json "http://192.168.0.232:8089/dvr/jobs/new"

Replace file name and the IP address of your channels server.

Final question: Do you still want to do this?

No program that you did not write yourself has all the features you would like. The developers decide what features they want to include and (more importantly) what features they want to support.

Channels does not support manual recordings. With most products that would be the end of it, but because the developers and users are willing to provide internal information, it can be done. It all depends on how much you want it and how much time you are willing to put into learning things you never thought you needed to learn.

Channels is not perfect, but it is way better than anything else.

curl is included with Windows 10, just make sure you type curl.exe not just curl

Ok I created a text file putting all the info from the time to the channel and saved it but you didn't say where I was supposed to save the .json file to. I tried c but windows said that I don't have permission to save to c which is the drive windows is on. I tried putting it on the drive that the dvr saves to and I'm not sure how I point to it. I tried downloading curl for windows and it has an excusable called curl.exe but clicking on it does nothing at least nothing I can see. Do you have a place that you know of where I can download it to get it to show? I really want to be able to do manual recordings but after 2 hours of working on it I fear I still no closer to being able to do it. God what I would give for a YouTube video showing in real time how to do manual recording. Oh and I did type curl - - help into windows command prompt and got a return of a bunch of information so I think I do have curl already. You didn't say how I was supposed to get to curl to type in the information so I guessed command prompt. Also I tried typing the string in as you had it in the command prompt Curl:X-POST - - data-binary @My_File.json http:10.0.0.84:8089/dvr/jobs/new
I only had to change the ip as that's where my dvr is running. I named the file the same as what you had so I didn't have to worry about changing it and got curl is not recognized as an internal or external command in the command prompt response

I got it to work! I figured out what was wrong. You had curl: - XPOST the line of what I was supposed to type in and after I removed the : after curl it worked and scheduled the recording. Thank you for your help on this!

I fixed the typo for future reference. Sorry about the colon.

I'm still trying to set up a manual recording but I'me having an issue I can't seem to figure out. I get an {"error":"invalid job"} message when I run the CURL command. The Channels log shows the following error:

2021/11/24 05:33:40.935819 invalid character 'â' looking for beginning of value

My json file looks like this:

{
"Name": “recording name”,
"Time": 2016300140,
"Duration": 3600,
"Channels": [“6000”],
"Airing": {
"Source": "manual",
"Channel": “6000”,
"Time": 2016300140,
"Duration": 3600,
"Title": “recording name”,
"Summary": "recording description (optional)”,
"Image": "https://tmsimg.fancybits.co/assets/p9467679_st_h6_aa.jpg",
"Raw": ""
}
}

Any ideas?

--Chris

I see some curly or “smart” quotes in there (“” vs ""). You may want to consider using a text editor that doesn't insert them automatically (or disable this feature).

Thank you @nriley that was it. I cut and pasted JSON from another place and did not see the curly quotes. I was wondering why my syntax coloring on my text editor was not working. That explains it. Much appreciated.

1 Like

I know this is an old thread but I would love to see your Automator action for the manual recordings.

The automator workflow has just one action in it - to run an AppleScript. The AppleScript has a few lines at the top that you will need to edit:

  • property DVRAddress : the IP address of your Channels server
  • property DateFormat : the date format you want to use to input dates / times
  • property MinsBefore : the number of minutes to add before the start of the recording
  • property MinsAfter : the number of minutes to add after the end of the recording
  • property RecImage : the URL of the image to be used for the recording in the library

The date format is currently set to a UK 24-hour format (%d/%m/%Y %H:%M %Z). There are a couple of examples in there that you can use instead for a US 12 or 24-hour clock.

When run, the script will ask you for:

  • a title for the recording
  • the channel number
  • the start date / time (inc. time zone), according to the chosen date / time format
  • the recording duration in hours / minutes (the script will add on the minutes before / after)
  • a final confirmation of the scheduled recording

I've zipped the workflow file, but should work fine once extracted. The download link is: Dropbox - Channels Manual Record (Workflow).zip - Simplify your life

Let me know if you have any questions!

1 Like

This worked perfectly! Thanks so much.

1 Like

This should be much easier now with latest prerelease.

1 Like

Excellent

I was able to use this script in Windows WSL ( What is Windows Subsystem for Linux | Microsoft Learn ). A couple of minor changes were needed. I needed to make the first line #!/bin/bash, and there needed to be a space in front of the ] on line 5. WSL installs Ubuntu by default, so maybe that's why.

In any case it works great!

I needed to do this in order to record a show whose guide data was incorrect. You never know if the guide will be updated between the time the recording is scheduled and airtime...

You're right, there should be a space there; I'll correct my original post.

However changing the shebang to /bin/bash should not be necessary, as /bin/sh should always point to a POSIX compliant shell interpreter. (I believe Debian-based OSes use dash as their primary shell and sh, which has some issues with POSIX compliance.)

If you really want to ensure bash as your interpreter, your shebang should really be:

#!/usr/bin/env bash

(I know in today's world of zsh, fish, and others, that strict Unix/POSIX compliance and portability is difficult to comprehend; but having a single script that works everywhere still should have some importance.)

I should also note, that my original post was with GNU date, most commonly found on Linux OSes. BSD date is quite different, and needs different parameters. The script could be made to check for the difference, but I presently don't have the motivation (and my BSD date modifications have been posted elsewhere on this forum already). (For those curious, OSes using BSD userlands include TrueNAS Core (and its earlier incarnations FreeNAS), FreeBSD, and macOS, among others.)

Thanks to all the information I got mostly from this thread, I have created a GUI for this.

Obviously, some of you in this thread are perfectly comfortable with CLI and you don't need a UI.

For all other people who would prefer a UI, take a look at this:

2 Likes

Easy to record as a Movie instead of a Show Episode. Not sure if it will be added to OliveTin for Channels though.

1 Like

Added. :slight_smile: