NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Wishlist v
1 2 3 4 5 … 194 Next »
API Access Without Authentication for Specific Devices/IPs

 
  • 0 Vote(s) - 0 Average
API Access Without Authentication for Specific Devices/IPs
krasty633
Offline

Junior Member

Switzerland
Posts: 3
Threads: 1
Joined: Nov 2025
#1
2025-11-23, 12:56 PM
Hello NextPVR Team,

I am using NextPVR in a Docker environment and would like to access the recording.list API method automatically. Currently, this is only possible with a valid session, which makes automated access difficult.

Feature request:
Please allow specific devices or IP addresses to access the API without additional authentication, or alternatively provide a permanent API token for a device.

Purpose:
To query recording status for monitoring or similar automation tasks


Thank you for considering this request!
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 54,343
Threads: 972
Joined: May 2006
#2
2025-11-23, 03:18 PM
Did you to get a token is pretty simple with most languages so I don't see the need to fully open API access. There is already Home Assistant integration (untested) here https://github.com/breendan/ha-nextpvr that shows how to get the tuners status in python in more detail then I ever coded.

I do see use case to easily get the recording status remotely using the current unautenticated access logic but the current call http://localhost:8866/services/service?m...ormat=json can return username and passwords so a safer method would be better However I would caution that any automation or action that could shutdown or restart the server could in theory corrupt files and the database even when not recording so better to manually check before doing maintenance.

I like the thought of permanent tokens but I still think that some two factor is necessary

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 107,240
Threads: 774
Joined: Nov 2003
#3
2025-11-23, 11:33 PM
There was a <PermanentSIDs> setting you could specify in config.xml, but checking it just now, it looks like it only applies to very specific scenarios, so not usable for that.

If you'd been running natively, without docker, you could likely have already had it work automatically by specifying whatever made up sid, because there is rules about requests about auto allowing from 127.0.0.1
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 107,240
Threads: 774
Joined: Nov 2003
#4
2025-11-23, 11:38 PM
Can your just run nscripthelper to give you the info?

This will basically do the request for you, and make sure it has a valid sid etc, and return xml.
krasty633
Offline

Junior Member

Switzerland
Posts: 3
Threads: 1
Joined: Nov 2025
#5
2025-11-24, 10:32 PM (This post was last modified: 2025-11-24, 10:35 PM by krasty633.)
(2025-11-23, 11:38 PM)sub Wrote: Can your just run nscripthelper to give you the info?

This will basically do the request for you, and make sure it has a valid sid etc, and return xml.

Thank you very much for your suggestions.

I am currently following the Home Assistant approach, which would cover my needs perfectly.
Unfortunately, no matter what I try, logging in with PIN does not work.
I've been using NextPVR for a while now and everything else works fine.

I have "Allow remote Access" and "Allow unauthenticated access for streaming Live TV / Recordings" enabled.
And i have also changed the admin password several times and that works fine.

I also try to reset the PIN to 0000 in the config.xml file, I believe the default value is <PinMD5>4A7D1ED414474E4033AC29CCB8653D9B</PinMD5>

I also purchased the “NextPVR” app from the Apple Store, but logging in with a PIN does not work there either.

Do you have any other idea what I can try or reset?
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 54,343
Threads: 972
Joined: May 2006
#6
2025-11-24, 10:45 PM
If you run not using private IP you need to use a PIN other than "0000" If it is coming from Docker it is probably 172.17

If you send the zipped NextPVR logs would help. I will check his python too.

Martin
krasty633
Offline

Junior Member

Switzerland
Posts: 3
Threads: 1
Joined: Nov 2025
#7
2025-11-24, 10:53 PM
(2025-11-24, 10:45 PM)mvallevand Wrote: If you run not using private IP you need to use a PIN other than "0000"  If it is coming from Docker it is probably 172.17

If you send the zipped NextPVR logs would help.  I will check his python too.

Martin

I only use NextPVR on my local network, no external access or VPN.
I use unraid, and I have assigned a fixed IP address to the docker container (custom network).


Attached Files
.zip   logs-20251124-1448.zip (Size: 457.3 KB / Downloads: 1)
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 54,343
Threads: 972
Joined: May 2006
#8
2025-11-24, 11:24 PM
I don't have ha but I tested this with his login class and it worked

Code:
from nextpvr_api import NextPVRApi
import aiohttp
import asyncio

async def main():
    session = aiohttp.ClientSession()
    obj = NextPVRApi(session,'172.16.3.62', "0000")
    await obj.login()
    devices = await obj.get_devices()
    for device in devices:
        print (device['oid'], device['status'])
    inuse = await obj.devices_in_use()
    print (len(inuse))
    session.connector.close()
    await session.close()

asyncio.run(main())

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Selection of specific days in Recurring Recordings Bobins 0 930 2025-06-16, 09:22 PM
Last Post: Bobins
  Execute command to specific device when stream is exited boukmandutty 6 1,893 2023-06-09, 12:09 PM
Last Post: mvallevand
  Archive Feature Access magiver01 5 2,261 2022-04-10, 10:39 AM
Last Post: mvallevand
  Suggestion: disable specific recurring schedule janoonk 8 3,636 2021-06-02, 01:57 AM
Last Post: sub
  Multiple IPTV Devices mvallevand 12 7,776 2020-08-11, 12:20 AM
Last Post: mvallevand
  Devices Info Option to show only those with channels. GuruSR 0 1,936 2016-04-06, 07:19 PM
Last Post: GuruSR
  Setting to cause warning when canceling specific instance of recurring recording BrettB 1 1,947 2015-10-27, 10:13 PM
Last Post: johnsonx42
  Channel specific Audio stream shaunpatrick77 2 2,185 2015-04-11, 12:47 AM
Last Post: shaunpatrick77
  Streaming & DB Access. skl111 13 5,815 2012-10-02, 08:49 PM
Last Post: skl111
  Access PIP from guide or other gui option fuzzweed 2 1,826 2012-08-09, 05:31 AM
Last Post: fuzzweed

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

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

Linear Mode
Threaded Mode