HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Want to write your own code to work with a HDHomeRun or work with the HDHomeRun DVR? We are happy to help with concepts, APIs, best practices.
airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Sat Jan 05, 2019 11:39 am

tried from cli on rec.engine:
> curl http://127.0.0.1:4999/recorded_files.json
curl: (7) Failed to connect to 127.0.0.1 port 4999: Connection refused
tried opening livetv in vlc:
Last edited by airdrummer on Sat Jan 05, 2019 11:59 am, edited 1 time in total.

Online
signcarver
Expert
Posts: 7994
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 131B34B7 13231F92 1070A18E 1073ED6F

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby signcarver » Sat Jan 05, 2019 11:45 am

And is the storage engine on that machine (since you are using "local host") and monitoring that port? What does the engine's log say. What happens if you use the "real" ip address?

bdbauer
Posts: 75
Joined: Mon Jul 09, 2018 10:07 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby bdbauer » Sat Jan 05, 2019 11:56 am

Code: Select all

curl http://127.0.0.1:4999/recorded_files.json curl: (7) Failed to connect to 127.0.0.1 port 4999: Connection refused
That didn't work on my Shield, either - basically it's telling you that port 4999 is wrong. I went to my.hdhomerun.com (on my PC) and clicked on "HDHomeRun Record" - it sent me to port 53123 on the recording engine. Yours might use the same port, or you can use the same method I used to get the right port.

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Sat Jan 05, 2019 12:16 pm

I went to my.hdhomerun.com (on my PC) and clicked on "HDHomeRun Record" - it sent me to port 53123 on the recording engine.
ahhh, so that's the seekrit incantation...mine's 10.0.1.224:46737

Code: Select all

> curl http://127.0.0.1:46737/recorded_files.json
returns all recordings:-)

and in VLC opening http://10.0.1.224:46737/auto/v507?Clien ... sionID=456 shows pausable livetv:-)

thanx 4 sharing that...i assume the port changes on every reboot, eh?

Online
signcarver
Expert
Posts: 7994
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 131B34B7 13231F92 1070A18E 1073ED6F

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby signcarver » Sat Jan 05, 2019 12:47 pm

Depends on where you run your engine but I suggest configuring port in the config or registry entry... see viewtopic.php?f=92&t=21009 on how to set a fixed port.

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Sat Jan 05, 2019 1:07 pm

...configuring port in the config or registry entry... see viewtopic.php?f=92&t=21009 on how to set a fixed port.
ok, thx...curl http://ipv4-api.hdhomerun.com/discover also returns that info

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

finally got vlc working

Postby airdrummer » Mon Jan 07, 2019 1:31 pm

i found the sekrit incantation for live tv:
http://10.0.1.224:34597/auto/v634?Clien ... ssionID=16
vlc plays/pauses, but i'm still working on seeking...i can drag the ptr, but jumps aren't working...i've coded some keystrokes for +30/-7secs for viewing recordings, but vlc knows how long the file is, which of course isn't known for the stream...

i'm digging into https://github.com/Silicondust/document ... ki/Live-TV
Seeking:
- Close the existing HTTP connection that is streaming video.
- Issue a new HTTP request specifying the desired starting byte offset in the RANGE header. The ClientID and SessionID parameters of the URL must be the same as the original HTTP request.
anyone got a handle on this?

MatthewLundberg
Posts: 43
Joined: Mon May 08, 2017 3:57 pm

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby MatthewLundberg » Tue Jan 08, 2019 8:03 am

@airdrummer

That's the reason for this other thread: viewtopic.php?f=125&t=70411
Kodi wants the same information.

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Tue Jan 08, 2019 9:44 pm

thanx 4 the link

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Wed Jan 09, 2019 10:38 am

I think the easiest way to manage recordings is with the DVR UI: https://github.com/demonrik/HDHR-DVRUI
thanx! i finally got php working on my dvr server (2006 c2d minimac...yeah, i know;-) and HDHR-DVRUI is an excellent replacement for the HDHR app (which doesn't run on osx.10.6...yeah, i know;-)

the only problem is the play links try to d/l the file in the browser, but i want it to play on VLC on my dvr mac hooked up to the tv, not on my laptop/phone...wtf wants to watch hdtv on a tiny screen when i have a 70";-)my hdhr record engine's storage is shared via nfs, & VLC works great playing files...it's set up to jump +30/-7secs based on file length, but that doesn't work on streams, of course, so i'll be forking demonrik's code for my setup.

and of course, live tv is also a problem, as is scheduling...i'll be implementing a titantv .tvvi(live) & .tvpi(sched) interface like my eyetv's...

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Tue Jan 15, 2019 2:56 pm

playing recorded files directly in VLC is a much better experience than streaming...my record engine's storage is nfs-mounted, easily accessible...but it would b nice to map recIDs to filenames...is there any hdhr 'fu 4 that?

demonrik
Posts: 1056
Joined: Mon May 04, 2015 10:03 am
Device ID: 10736454, 1073A35A, 1075C377

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby demonrik » Tue Jan 15, 2019 4:42 pm

playing recorded files directly in VLC is a much better experience than streaming...my record engine's storage is nfs-mounted, easily accessible...but it would b nice to map recIDs to filenames...is there any hdhr 'fu 4 that?
I have another project hdhr2plex https://github.com/demonrik/hdhr2plex
I've not been able to keep on top of it though, so is a little dead. I keep failing to restart it.
But code might be interesting..
Basically it reads the meta data of the .mpg file from SD recording, and then tries to match up with info on thetvdb.com and then rename the file appropriately so it works with plex.
Was able to do in-situ file rename, archiving, and more.
On my list to revive this soon and update to new tvdb interface

airdrummer
Posts: 71
Joined: Tue Jan 08, 2013 8:39 am

Re: HDHRUtil utilities - A few useful (python3) scripts for those using the HDHR ecosystem

Postby airdrummer » Wed Jan 16, 2019 8:03 am

thx i'll check it out (figuratively&literally;-)


Return to “Development Support”

Who is online

Users browsing this forum: No registered users and 1 guest