Deleting recording

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.
Post Reply
JoeDonth
Posts: 16
Joined: Thu Dec 06, 2007 9:48 am
x 1

Deleting recording

Post by JoeDonth »

I am trying to delete a recording from my Servio device with:

Code: Select all

http://192.168.1.120:80/recorded/cmd?id=7fb746b2&cmd=delete
I am getting a 400 Bad request error. Any assistance would be appreciated.
Joe Donth

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

Re: Deleting recording

Post by signcarver »

double check it is actually there as I have seen things cache. Also make sure such request is a post not a get (typically just entering it in a browser will do a get)

JoeDonth
Posts: 16
Joined: Thu Dec 06, 2007 9:48 am
x 1

Re: Deleting recording

Post by JoeDonth »

I'll try a POST. Thanks.

JoeDonth
Posts: 16
Joined: Thu Dec 06, 2007 9:48 am
x 1

Re: Deleting recording

Post by JoeDonth »

That did the trick. Thank you very much!

bwsd19
Posts: 6
Joined: Fri Dec 18, 2020 5:55 am

Re: Deleting recording

Post by bwsd19 »

Hi, I'm attempting to do the same thing in python and getting the "400 Bad Request" response too. Can you provide additional info on how you got this to work and confirm that POST rather than GET was the solution? I'm new to python and post/get methods, so the issue may be there, but can you confirm that sending the CMDUrl string with '&cmd=delete' or '&cmd=delete&rerecord=1' (per https://info.hdhomerun.com/info/dvr_api ... recordings) is all that is required? For example, if the CMDUrl for an episode is "http://10.0.0.1:80/recorded/cmd?id=ca94db7c", then I just need to POST "http://10.0.0.1:80/recorded/cmd?id=ca94db7c&cmd=delete"?

Thanks.
FriendlyName "HDHomeRun SCRIBE QUATRO"
ModelNumber "HDVR-4US-1TB"
FirmwareName "hdhomerun_dvr_atsc"
FirmwareVersion "20200907"

JoeDonth
Posts: 16
Joined: Thu Dec 06, 2007 9:48 am
x 1

Re: Deleting recording

Post by JoeDonth »

A POST is required (and does work). Also you might have to clear the cache.

bwsd19
Posts: 6
Joined: Fri Dec 18, 2020 5:55 am

Re: Deleting recording

Post by bwsd19 »

Thanks for the quick reply.
Which cache are you referring to? If there's one on the Scribe, I haven't come across the command for that, would you mind sharing it? The python program is a stand-alone running on a raspberryPi, so I don't think there's a cache to clear on that side. It queries the Scribe to find the appropriate CMDUrl, and then tries to post the, so far unsuccessful, delete command.

Again, thanks.

bwsd19
Posts: 6
Joined: Fri Dec 18, 2020 5:55 am

Re: Deleting recording

Post by bwsd19 »

I got it working. Problem was on Python side. The post method I was using required a URL and then data to use with the post command. I was trying to put the 'cmd=delete' in the data section of the call, using CMDUrl as the URL. Solution was to simply append the command to the CMDUrl for the URL in the post call, and to pass an empty string for the data.

Thanks again for confirming POST was also a necessary ingredient.

Post Reply