Curl CMD to delete M3U from DVR

Is there a command to delete an M3U from channels DVR ... ? I have a NUC that just runs M3U but if it goes down or cannot be accessed I would like a CMD to delete the M3U from my main Channels DVR.

If you can access the server enough to send a command to remove a source, why can't you access it via a browser and do the same from the web UI? I don't understand this request. Can you clarify what you are actually asking.

(And AIUI, if you were to open the console while removing the source in the web UI, the endpoints are exposed. Are you saying this is not the case?)

I have a low powered NUC Running with all the tuners allocated to it feeding M3U to My Main Channels DVR, Plex SageTV and EMBY.

MY main DVR has the M3U as the first device coming from the NUC .. then all the other devices. If any device on my DVR system goes down I get a text message.

I guess you are saying that if the M3U is down and my main DVR cannot access it will look at the other devices in sequence to tune the channels. My Thinking is that I have to remove it.

Min DVR below.

It should.

But that wasn't what I was saying. What I was saying is that if you need to remove the source, why can't you do it from the web UI?

I have my system automated .... so action is taken If I am unable to be near a PC etc... Even my tuners are attached to a power strip that pings them and if the ping fails 10x it will power cycle. Just wanted a cmd ... so if the NUC is inaccessible it would remove the M3U ... I will test to see if I need it removed or will it fall back to the tuners.

My Background is disaster recovery so Redundancy and Quick action is drilled into me.

As usual, the normal caveat applies. The API isn't public and is subject to change.

# get a list of your sources to find the name of the source
curl 127.0.0.1:8089/devices

# find the DeviceID from the previous result for your source and remove "M3U-" from it and use it in the next step.
#EX: DeviceID: M3U-mystreams

# delete the source
curl -X DELETE 127.0.0.1:8089/providers/m3u/sources/mystreams
1 Like

Normally I would say "see what the web UI does, and you'll figure it out", but I decided to be nice since I've had some coffee: DELETE /providers/m3u/sources/XXX.

1 Like

Thanks guys much appreciated ...

To add it back when the server is online, you can try:

PUT /providers/m3u/sources/XXX
{
  "name": "XXX",
  "type": "HLS",
  "source": "URL",
  "url": "http://X.X.X.X/playlist.m3u",
  "text": "",
  "refresh": "",
  "limit": "",
  "satip": "",
  "numbering":"ignore",
  "xmltv_url":"http://X.X.X.X/epg.xml",
  "xmltv_refresh": ""
}

Not sure if you can just omit the empty values, but that's the payload the server uses when you create a custom channel from the web UI. I would suggest you manually delete and re-add your "AllChannels" source, and what payload the server uses to create your entry. As for changing its priority, again play with it while the inspector is open to see what the server is doing.

1 Like

Channels DVR has become necessity in our household that if things do not work I catch hell ... This info will help me plug up one of the holes in my Channels DVR network.

BTW the delete worked will get back when I finish testing the put back and priority.

I have not issued a payload like the above to channels dvr ... So maybe you can direct me on how to issue the payload ... only if you have time.

cat source.json
{
  "name": "XXX",
  "type": "HLS",
  "source": "URL",
  "url": "http://X.X.X.X/playlist.m3u",
  "text": "",
  "refresh": "",
  "limit": "",
  "satip": "",
  "numbering":"ignore",
  "xmltv_url":"http://X.X.X.X/epg.xml",
  "xmltv_refresh": ""
}

curl -XPUT --data-binary "@source.json" http://X.X.X.X:8089/providers/m3u/sources/XXX

For another example of how it might be done, here's a link to my script for creating date/time–based manual recording: manual.sh

Thanks I can work with that.