NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 2 3 4 5 … 93 Next »
Script Helper Utility

 
  • 0 Vote(s) - 0 Average
Script Helper Utility
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#1
2020-04-25, 03:06 PM (This post was last modified: 2020-04-25, 05:08 PM by JavaWiz.)
After moving to v5, I noticed some of the NScriptHelper utility output was in xml format, which was difficult to parse in batch cmd files.  

I wrote a small python utility to make several of the calls easier to use in scripts (cmd, bash, ...).  Sharing in case anyone else finds it useful... 
  • It is not compatible with Python2, must be Python3
  • the -h command line switch will display a help page of options (see below)

EDIT: Added the Python script (missed in 1st post)

Code:
c:\Users\Public\NPVR-data\scripts\Utilities>python3 -m NPvrHelper -h
usage: NPvrHelper.py [-h] [-v] [--server SERVER] [--pin PIN] [--status] [--pending] [--isrecording] [--isinuse]

NextPVR Helper

optional arguments:
  -h, --help       show this help message and exit
  -v, --verbose    Enable debug logging.
  --server SERVER  Target NextPVR Server[:port] (default localhost:8866)
  --pin PIN        NextPVR security PIN
  --status         List tuner(s) status
  --pending        List pending recordings
  --isrecording    List in-process recordings
  --isinuse        List tuner in use status

example of commands:

Code:
c:\Users\Public\NPVR-data\scripts\Utilities>python3 -m NPvrHelper --server Nirvana --status
21 - HDHomeRun 1318E35A-0
      \\NAS-Office\PVR\TVShows\Ghost in the Shell (2017)\Ghost.in.the.Shell.(2017).ts
22 - HDHomeRun 1318E35A-1
23 - HDHomeRun 1318E35A-2
      LIVE&e:\adamico\Videos\Captures\live-ESPN-5280-1.ts


c:\Users\Public\NPVR-data\scripts\Utilities>python3 -m NPvrHelper --server Nirvana --isrecording
HDHomeRun 1318E35A-0 - RECORDING: Ghost.in.the.Shell.(2017)


c:\Users\Public\NPVR-data\scripts\Utilities>python3 -m NPvrHelper --server Nirvana --isinuse
HDHomeRun 1318E35A-0 - IS In Use
HDHomeRun 1318E35A-1 - NOT In Use
HDHomeRun 1318E35A-2 - IS In Use


c:\Users\Public\NPVR-data\scripts\Utilities>python3 -m NPvrHelper --server Nirvana --pending
04/25/20 10:53AM -> 12:15PM [SYFY  ] Ghost in the Shell
04/26/20 08:00PM -> 09:00PM [WCWJDT] Batwoman: S01E17 - A Narrow Escape
04/27/20 08:00PM -> 09:01PM [WFOX  ] 9-1-1: S03E16 - The One That Got Away
04/27/20 10:00PM -> 11:14PM [AMC   ] Dispatches From Elsewhere: S01E10 - The Boy
04/29/20 09:01PM -> 10:00PM [WJAX  ] SEAL Team: S03E19 - In the Blind
04/30/20 10:00PM -> 11:00PM [WTLV  ] Blindspot: S05E01 - I Came to Sleigh
05/01/20 08:00PM -> 09:00PM [WTLV  ] The Blacklist: S07E17 - Brothers
05/01/20 08:00PM -> 09:00PM [WJAX  ] MacGyver: S04E12 - Loyalty + Family + Rogue + Hellfire
05/03/20 08:00PM -> 09:00PM [WCWJDT] Batwoman: S01E18 - If You Believe in Me, I'll Believe in You
05/04/20 08:00PM -> 09:01PM [WFOX  ] 9-1-1: S03E17 - Powerless
05/06/20 10:00PM -> 11:00PM [WJAX  ] SEAL Team: S03E20 - No Choice in Duty
05/07/20 09:00PM -> 10:00PM [WTLV  ] Blindspot: S05E02 - We Didn't Start the Fire
05/08/20 08:00PM -> 09:00PM [WTLV  ] The Blacklist: S07E18 - Roy Cain
05/08/20 08:00PM -> 09:00PM [WJAX  ] MacGyver: S04E13 - Save + The + Dam + World


Attached Files
.zip   NPvrHelper.zip (Size: 2.54 KB / Downloads: 7)
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#2
2020-05-24, 02:38 PM
Updated script
  • added return codes for each function, in a cmd file, this provides the ability to check %ERRORLEVEL% rather than having to parse the output of the command.
  •     ie if you call with --isinuse, will return False (0) if no tuners are in use, or True (1) if at least 1 tuner in use.
  • better error handling
  • cosmetic output changes.


Attached Files
.zip   NPvrHelper.zip (Size: 3.06 KB / Downloads: 12)
Graham
Offline

Posting Freak

UK
Posts: 4,058
Threads: 102
Joined: Dec 2005
#3
2020-05-25, 11:00 AM
(2020-04-25, 03:06 PM)JavaWiz Wrote: I wrote a small python utility to make several of the calls easier to use in scripts (cmd, bash, ...).  Sharing in case anyone else finds it useful... 

There is now this ... https://github.com/sub3/NextPVR/wiki/nscripthelper

You might want to put a description of your scripts at the end of the nscripthelper page or as a new page.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Helper functions and objects mvallevand 7 3,042 2012-02-22, 01:12 AM
Last Post: sub
  NSIS installer script for a NPVR plugin? McBainUK 6 3,218 2011-12-10, 03:23 PM
Last Post: mvallevand
  (Yet Another) Rename Helper script for GBPVR & NPVR pvruser 2 2,718 2011-07-22, 01:27 AM
Last Post: pvruser
  WinLIRC Telnet Changer Perl Script/Exe for IR Blasting hokiee 3 3,516 2011-02-20, 07:46 PM
Last Post: hokiee
  XP: blocking suspend to run script:solution pBS 1 2,897 2009-09-26, 02:20 AM
Last Post: pBS
  Channel Only Utility jwjames83 0 1,399 2009-04-30, 08:43 PM
Last Post: jwjames83
  Who would be interested in helping with a plugin install utility? mkenyon2 35 9,478 2009-02-28, 12:25 AM
Last Post: reven
  GB-PVR XBMC Script jangeador 4 6,168 2008-05-31, 05:30 PM
Last Post: jangeador
  Utility: convert2dvd-win32 gnutech 5 3,000 2008-02-20, 01:09 AM
Last Post: zehd
  ComskipHelper utility ZaDDaZ 56 17,149 2006-09-09, 10:54 AM
Last Post: Pioneer4x4

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

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

Linear Mode
Threaded Mode