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.
gtb
Expert
Posts: 3683
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

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

Postby gtb » Sun Jun 03, 2018 5:25 pm

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

*IMPORTANT NOTE* Most of these utilities utilize undocumented features/functions of the various HDHR components which have been reverse engineered. In addition to potentially failing to do the correct thing today, at any future point SiliconDust may decide to change or alter their systems such that these utilities fail to work at that time. Caveat Emptor. Because these use undocumented capabilities, some of which may be considered proprietary, trade secret, or under other covenants, if SiliconDust asks me to remove the public repo I will do so.

*MORE IMPORTANT NOTE* Some of these utilities (especially those that manipulate metadata) may be able to screw up your recordings in ways that may make them unplayable, or may result in future episodes not being record, or may cause duplicate recordings, or may cause the entire universe to explode. Please try not to make the universe explode.

Github repository: https://github.com/garybuhrmaster/HDHRUtil

More complete documentation on each script (typically including an example) can be found in the docs/ subdirectory of the repo

Quick summary of current utilities:

HDHRUtil-DVR-fileMetadata - Display, update, set a files metadata
HDHRUtil-DVR-fileImport - Import an existing file into a DVR file with specified metadata
HDHRUtil-Tuner-channelScan - Report status, or start or stop a channel scan
HDHRUtil-Tuner-channelSetting - Set the channel status for a HDHR device
HDHRUtil-Tuner-channelSettingDuplicate - Copy the channel status from one HDHR to another

in the importers/ subdirectory is an example script to import selected recordings from MythTV.

gtb
Expert
Posts: 3683
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

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

Postby gtb » Sun Jun 03, 2018 5:30 pm

reserved for future updates

gtb
Expert
Posts: 3683
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

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

Postby gtb » Sun Jun 03, 2018 5:31 pm

reserved for future updates

ebo
Posts: 494
Joined: Thu Jan 07, 2010 6:58 pm

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

Postby ebo » Mon Jun 04, 2018 7:31 pm

Since I'm not a coder, I don't know if the following suggestions are possible with variants of your scripts or even as they stand now, but they would be useful.

1) An additive scan of a user-selectable range of channels, i.e. keeping all previously-found channels. A special case would be to add a single channel, which could just be a range where the high and low channels are the same. Adding channels is useful where an antenna must be moved to get different channels. Setting a range helps where the local spread is much less than the US default of 2-69, 2-51 or (soon) 2-36.

2) The ability to remove unwanted channels found in a scan. Even better: a channel blacklist to keep those channels from showing up in future scans.

gtb
Expert
Posts: 3683
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

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

Postby gtb » Wed Jun 13, 2018 10:17 pm

Since I'm not a coder, I don't know if the following suggestions are possible with variants of your scripts or even as they stand now, but they would be useful.
As I understand your suggestion, those are functions of the actual device channel scan itself, and nothing these scripts can do about those functions. There have been suggestions that some changed scan functionality will be available RSN with some beta firmware. Perhaps some of those pending changes will help your use case (none of us will know until the firmware ships and people try it out).

rdoac
Posts: 26
Joined: Sun Feb 20, 2011 1:46 pm

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

Postby rdoac » Mon Jul 30, 2018 4:08 pm



in the importers/ subdirectory is an example script to import selected recordings from MythTV.
Thank you, thank you, thank you. Five years of recordings being uploaded into the new architecture now!

gtb
Expert
Posts: 3683
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

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

Postby gtb » Thu Aug 02, 2018 6:41 pm

Thank you, thank you, thank you. Five years of recordings being uploaded into the new architecture now!
Please let me (us) know how it works. It was intended as a sample (I never tried it at any scale, just onesies/twosies for the few recording I was still time-shifting).

rdoac
Posts: 26
Joined: Sun Feb 20, 2011 1:46 pm

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

Postby rdoac » Fri Aug 03, 2018 2:21 pm

It threw 1.2TB of recordings into the right place. I had a couple of errors with corrupted recordings being messed up in the DB and not existing which made it choke (it could probably just cycle over them). Am missing artwork, which is probably to be expected. But I'm happy with the results.

There was a typo in it which I had to edit. I think it was trying to search for the mythbackend on localhost. instead of localhost
Otherwise it's great.

goofnroxx
Posts: 27
Joined: Fri Jun 16, 2017 10:30 am

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

Postby goofnroxx » Thu Aug 09, 2018 10:45 am

Thanks for these scripts!

I successfully migrated all my MythTV recordings to SDDVR. I did tweak it a bit to add the SD SeriesID versus the MythTV SeriesID, and add the image link where I had the correct information. For the recordings where I had this information they look as if they were recorded by the SDDVR with the correct artwork and information.

Jeff

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

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

Postby bdbauer » Sun Aug 19, 2018 1:24 pm

Thanks for this - I've been thinking of writing a small perl or python script to add a DVR recording from TitanTV - basically a small Windows program associated with .tvpi files that will add the recording to the HDHR DVR. This allows adding a recording via the TitanTV grid. The code you have for discovery could come in handy.

I'm not sure the whole think will work all that well since I don't think the HDHR DVR supports a specific channel/time/duration, which is what TitanTV provides. I'd have to jury rig a search for the name, and assuming it was an exact match use that series ID with a specified start time.

gtb
Expert
Posts: 3683
Joined: Thu Oct 06, 2011 1:00 pm
Location: Sunnyvale, CA USA

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

Postby gtb » Mon Aug 27, 2018 10:39 am

I had a couple of errors with corrupted recordings being messed up in the DB and not existing which made it choke (it could probably just cycle over them).
I added a comment in the README that one should run the MythTV find_orphans.py script to first clean up your MythTV database (GIGO problem). Improved error handling may get done eventually, but likely not high on the list.
Am missing artwork, which is probably to be expected.
There is no good way to automate artwork for there is no good source of unencumbered artwork to try to do proper matching. It was my belief that it was better for individuals to choose how to acquire or reference artwork.
I think it was trying to search for the mythbackend on localhost. instead of localhost
I addressed that in some recent commit. But one can also (and I think I always did for my tests) explicitly specify the backend.

Glad it was useful to you.


Return to “Development Support”

Who is online

Users browsing this forum: No registered users and 2 guests