a script to see if something is recording
a script to see if something is recording
Hi
Is it possible with a batch script see if something is recording on Argus-TV servern.
Right now I have a script on my workstation so after I have move the file that I have recording to a folder I run the script
The script open TS-doctor and extract the subtitle of the file that I have recording, after that is use MKVmerge to join the TS file and the SRT file to a MKV file and when it done it clean all old files and move the new MKV file back to the server that I also running Plex server.
Why I do this is because Plex have very hard time to understand the swedish subtitle in the TS file so it does not show any subtitle but with my script and with TS-doctor and MKVmerge I now can easy watch what I have recording
But now I like to make it automatic with a script that run ever night and first it have to see if that is nothing is recording or going to record, after that is going to start running my script.
Is it possible with a batch script see if something is recording on Argus-TV servern.
Right now I have a script on my workstation so after I have move the file that I have recording to a folder I run the script
The script open TS-doctor and extract the subtitle of the file that I have recording, after that is use MKVmerge to join the TS file and the SRT file to a MKV file and when it done it clean all old files and move the new MKV file back to the server that I also running Plex server.
Why I do this is because Plex have very hard time to understand the swedish subtitle in the TS file so it does not show any subtitle but with my script and with TS-doctor and MKVmerge I now can easy watch what I have recording
But now I like to make it automatic with a script that run ever night and first it have to see if that is nothing is recording or going to record, after that is going to start running my script.
Re: a script to see if something is recording
Argus TV has a REST API and a wrapper for .Net so if your scripting language can't consume that kind of service, you'll have to create a small programme that can be called from your script to make the call.
FWIW here's the code for a C# console app that checks if there's a recording running or scheduled within whatever number of hours provided as the fourth argument (or now if there's no fourth argument).
ConsoleAppName.exe serverName portNumber serviceTransport numberOfHours
e.g. ConsoleAppName.exe MyServer 49943 Http 3
I don't know enough about bat files to tell you if or how if could be called from one. The programme writes either true or false to the standard output so you might have to change the last line to give you whatever output you need.
Hope this helps.
FWIW here's the code for a C# console app that checks if there's a recording running or scheduled within whatever number of hours provided as the fourth argument (or now if there's no fourth argument).
ConsoleAppName.exe serverName portNumber serviceTransport numberOfHours
e.g. ConsoleAppName.exe MyServer 49943 Http 3
Code: Select all
static void Main(string[] args)
{
if (args.Length < 3)
return;
if (!Proxies.IsInitialized)
{
Proxies.Initialize(new ServerSettings()
{
ServerName = args[0],
Port = int.Parse(args[1]),
Transport = (ServiceTransport)Enum.Parse(typeof(ServiceTransport), args[2])
});
}
int hours = 0;
if (args.Length > 3)
int.TryParse(args[3], out hours);
UpcomingRecording upcomingRecording = Proxies.ControlService.GetNextUpcomingRecording(true).Result;
Console.WriteLine((upcomingRecording.ActualStartTime.CompareTo(DateTime.Now.AddHours(hours))) < 0);
}
Hope this helps.
Last edited by tomper on Mon Sep 04, 2017 8:08 pm, edited 5 times in total.
Re: a script to see if something is recording
Thanks for the replay
Ahh have never work in C#, only some in VB.NET
Hmm have to see what I can do about it.
Ahh have never work in C#, only some in VB.NET
Hmm have to see what I can do about it.
Re: a script to see if something is recording
Hi, can't you solve this with running a post script after the recording? You can configure this in Argus
Re: a script to see if something is recording
well what I can understand I can run a script after it have recording (I have try but never got it to work)
But not sure if that is good if it going to recording some other program after the first one is finnish recording.
If the script start to run after the first recording it going to be wrong when it find the the tv show it still recording.
But not sure if that is good if it going to recording some other program after the first one is finnish recording.
If the script start to run after the first recording it going to be wrong when it find the the tv show it still recording.
Re: a script to see if something is recording
If you configure ArgusTV to pass the path of the completed recording as a parameter then you could create a script that only processes that file.
You would have to process the file on the server though.
Re: a script to see if something is recording
hmm yes that I can do but then somehow I need to send info about the file from argustv server to the script
Re: a script to see if something is recording
Check https://www.argus-tv.com/wiki/index.php ... g_Commands foray the parameters that you can pass to a script
Re: a script to see if something is recording
hmm trying to understand how to use the Processing command.
I know how to use parameters to insert data in a batch file
So somehow I need to make it like this in processing
runfile.bat "%%FILE%%"
When %%FILE%% is the patch and filename to the recording .TS file
But not sure how to set it up
I mean Name I understand and going to write "Convert"
but Path and Arguments?
I did try something easy that add info in a text file but did not got it to work, nothing happend
That I did try was this
The bat file is on the server where Argus TV servern is.
I have to se "" at the %%FILE% becurse the filename have space
the batch file is very simple
just trying to add the address and filename in a text file but not even a text file is created.
/UPDATE
Got it to work like that I have write, is just that even if the script is simple it take sometime to run the processing
I know how to use parameters to insert data in a batch file
So somehow I need to make it like this in processing
runfile.bat "%%FILE%%"
When %%FILE%% is the patch and filename to the recording .TS file
But not sure how to set it up
I mean Name I understand and going to write "Convert"
but Path and Arguments?
I did try something easy that add info in a text file but did not got it to work, nothing happend
That I did try was this
Code: Select all
Name: Convert
Path: D:\script.bat
Arguments: "%%FILE%%"
The bat file is on the server where Argus TV servern is.
I have to se "" at the %%FILE% becurse the filename have space
the batch file is very simple
Code: Select all
@echo off
@echo %~1 >>test.txt
/UPDATE
Got it to work like that I have write, is just that even if the script is simple it take sometime to run the processing
Re: a script to see if something is recording
It feel like it not always run the scripit
Have notice I can manuelly run Post Processing of a recording file but it does look like nothing happend.
Sometime it have run the script but not always.
Have notice I can manuelly run Post Processing of a recording file but it does look like nothing happend.
Sometime it have run the script but not always.
Who is online
Users browsing this forum: No registered users and 4 guests