NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Windows v
« Previous 1 … 14 15 16 17 18 … 101 Next »
Schedule recordings via command line?

 
  • 0 Vote(s) - 0 Average
Schedule recordings via command line?
JP23
Offline

Senior Member

Posts: 405
Threads: 98
Joined: Oct 2007
#1
2024-03-14, 02:47 PM
Hi,

I was just wondering if it's possible to schedule recording from command line?

I need to schedule quite a few manual recordings and would like to avoid endless GUI clicking if possible - is there any way to do this?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,823
Threads: 954
Joined: May 2006
#2
2024-03-14, 03:07 PM (This post was last modified: 2024-03-14, 03:08 PM by mvallevand.)
Possibly, you could use NScripthelper if you know the parameter.  Here is sub's documentation for calling methods https://forums.nextpvr.com/showthread.ph...#pid584338 and don't forget this if it fails https://forums.nextpvr.com/showthread.ph...#pid584347

For testing create a manual recording with via Kodi and the URL will be in the kodi.log.  Here is one here

Code:
http://172.16.3.105:8866/service?method=recording.recurring.save&recurring_id=0&name=Manual%20Name&channel_id=11044&start_time=1240428288&end_time=1240428288&keep=0&pre_padding=1&post_padding=2&day_mask=SAT:SUN:MON:TUE:WED:THU:FRI:&directory_id=Default&enabled=true

so replace http://172.16.3.105:8866/service? with service:method= will give you something like

Code:
NScripthelper "-service:method=recording.recurring.save&recurring_id=0&name=Manual%20Name&channel_id=11044&start_time=1240428288&end_time=1240428288&keep=0&pre_padding=1&post_padding=2&day_mask=SAT:SUN:MON:TUE:WED:THU:FRI:&directory_id=Default&enabled=true"

This is all untested so back up npvr.db3 and give it a try.

That's as far as I am willing to answer yes,  otherwise the answer is no.

Martin
JP23
Offline

Senior Member

Posts: 405
Threads: 98
Joined: Oct 2007
#3
2024-03-14, 08:39 PM
Thanks for your help Martin. I have been able to schedule a recording by the following command:

Code:
curl "http://10.0.0.9:80/service?method=recording.save&name=Test&recording_id=0&channel=8930&time_t=1710477900&duration=900&pre_padding=1&post_padding=3&directory_id=Default&sid=74ca4a07eb794a678e04658abe17510f"


Any idea where I can get the channel numbers as used here? This is channel 1222 in my EPG, but here it's 8930.

Having to use epochal time is a bit awkard.

Do you know what the 'sid' is - it wasn't in your example, but mine fails without it.
Seems to be the same every time though from the limited number of examples I've seen.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,823
Threads: 954
Joined: May 2006
#4
2024-03-14, 08:48 PM (This post was last modified: 2024-03-14, 08:48 PM by mvallevand.)
The sid is IP based security token as long as you don't logout or timeout it will be valid. NScripthelper doesn't need the sid not sure why you prefer curl.

To generate the sid I gave an example in python https://forums.nextpvr.com/showthread.ph...#pid589636.

You can get the oid from http://localhost:8866/service?method=channel.list

You might find clicking is easier at this point.

Martin
JP23
Offline

Senior Member

Posts: 405
Threads: 98
Joined: Oct 2007
#5
2024-03-15, 12:27 PM (This post was last modified: 2024-03-15, 01:19 PM by JP23.)
I just used the curl command because I found it in the Kodi logs, and I could execute it from the machine I was working on. I will try the other method too.

The use case is that I want to record some 7 or 8 hour long sports broadcasts from IPTV sources, but I don't find those recordings reliable. They often fail, get audio sync issues, or the timeline goes wrong and seeking stops working. I want to record them in 1 hour or maybe even 30 minute chunks, so I want to be able to just generate the necessary commands to schedule all those recordings.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,823
Threads: 954
Joined: May 2006
#6
2024-03-17, 02:31 PM (This post was last modified: 2024-03-17, 02:39 PM by mvallevand.)
With that use case I would copy the URL from a manual recording created in Kodi including the end time your want for the recording then paste curl URL into a batch file if you run from the same PC that you run Kodi. The channel_id, times and sid will be valid.

Then note the end time, change it to start plus 2000 or 300 and copy that command as many time as you need incrementing start and end by 2000 or 3000 to make the math simple until you pass the end time. Factor in changing the name and padding it might be easier than manually creating them.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Since v7: EPG mostly "no listings", and channels change during recordings :'( rightbryce 38 2,742 2025-05-19, 03:18 PM
Last Post: erik123
  Failed recordings "Operation timed out" Stanno 8 409 2025-04-27, 07:26 PM
Last Post: Nick017
  Can't delete scheduled recordings Druhl 3 161 2025-04-22, 09:10 PM
Last Post: mvallevand
  Manual Recurring Recordings jcole998 3 188 2025-04-17, 09:10 PM
Last Post: mvallevand
  NPVR Windows recordings folder cleanup.... Colincam 21 2,840 2025-04-16, 07:38 PM
Last Post: mvallevand
  Portions of recordings are missing MovieBuff 6 419 2025-04-14, 03:15 PM
Last Post: MovieBuff
  Recordings not displaying Jakesty 4 211 2025-04-12, 01:15 PM
Last Post: mvallevand
  Scheduled Late Night through-midnight recordings suddenly stop at midnight Andre_Mikulec 4 309 2025-03-29, 12:56 AM
Last Post: mvallevand
  postprocessing tsduck on recordings Druhl 3 271 2025-03-07, 02:24 AM
Last Post: mvallevand
  Deleting recordings leaves .MP4 files ronsfsd 8 539 2025-02-20, 04:53 PM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode