How do you use the HDHRUtil utilities?

Help and support with third-party TV software.
Windows Media Center, J River Media Center, Next PVR, MythTV, InstaTV, etc.
Post Reply
grumpygramp
Posts: 253
Joined: Sun May 03, 2015 2:42 pm

How do you use the HDHRUtil utilities?

Post by grumpygramp »

Can anyone point me in the direction of instructions or a guide on how to use the utilities at HDHRUtil that were created by gtb?
Sometimes I'm not very tech savvy. Thanks in advance.

signcarver
Expert
Posts: 9708
Joined: Wed Jan 24, 2007 1:04 am
Device ID: 10A05954 10802091 131B34B7 13231F92 1070A18E 1073ED6F 15300C36
x 22

Re: How do you use the HDHRUtil utilities?

Post by signcarver »

Did you read the docs? (I usually find it easiest to download the whole package to see them)
As I recall they are python scripts so how you run them may depend on your python install but most these days may allow such to just run (but when I just glanced at it, I don't believe a .py extension was used so you may need to do a bit more to actually get it to run).

What are you trying to accomplish?

grumpygramp
Posts: 253
Joined: Sun May 03, 2015 2:42 pm

Re: How do you use the HDHRUtil utilities?

Post by grumpygramp »

signcarver wrote: Wed May 05, 2021 9:30 am Did you read the docs? (I usually find it easiest to download the whole package to see them)
As I recall they are python scripts so how you run them may depend on your python install but most these days may allow such to just run (but when I just glanced at it, I don't believe a .py extension was used so you may need to do a bit more to actually get it to run).

What are you trying to accomplish?
Haven't had a chance to download yet; I'll do that tonight.

I was going to use HDHRUtil-Tuner-channelSettingDuplicate and try and check metadata with HDHRUtil-DVR-fileMetadata.

Ken.F
Posts: 2392
Joined: Fri Apr 05, 2013 9:20 am
Device ID: 1041A706, 1043EB32, 104BAD9E, 13168DC5, 1322A7AC
Location: West Rockhill, PA
x 10

Re: How do you use the HDHRUtil utilities?

Post by Ken.F »

Is there any way to return a value for a single item like EpisodeTitle or StartTime using HDHRUtil-DVR-fileMetadata? I've been saving the whole metadata report as a temporary .json file, then parse the .json file get the handful of values I want to use for variables in bash scripts, then delete the .json file. It does work but it seems a bit clunky.

For example I use this script to rename my recording .mpg and comskip .edl files:
renamer.sh

Code: Select all

#!/bin/bash

# bash script to rename .mpg and .edl files from recording metadata

    for f in *.mpg ; do
    HDHRUtil-DVR-fileMetadata --file "${f%.*}.mpg" > "${f%.*}.json"
showname=$(cat "${f%.*}.json" | jq -r '.Title')
episode=$(cat "${f%.*}.json" | jq -r '.EpisodeNumber')
title=$(cat "${f%.*}.json" | jq -r '.EpisodeTitle')
newname=""$showname" "$episode" "-" "$title""
    rm "${f%.*}.json"
echo "Renaming:"
echo "${f%.*}.mpg"
echo ""$newname".mpg"
    mv "${f%.*}.mpg" "$newname".mpg
echo ""
    if [[ -f "${f%.*}.edl" ]]; then
echo "Renaming:"
echo "${f%.*}.edl"
echo ""$newname".edl"
    mv "${f%.*}.edl" "$newname".edl
    fi
echo ""
done

Post Reply