How to update Plex's HDHR/DVR/EPG/XMLTV URL

Just adding a note for future users, in case they would like to change the HDHR/DVR endpoint URL, or the corresponding XMLTV URL.

I needed to make this edit today (I wanted to change the endpoint URL without remapping all my channels), and noticed there is no way to do so from the WebUI.

If anyone is in the same boat, here’s the trick:

  1. Stop the server
  2. Find your library sqlite DB. On Linux, mine is under ../Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db
  3. Make a backup
  4. Open the database with a SQLite editor
  5. Navigate to the media_provider_resources table, this is where DVR and XMLTV settings are stored
  6. The DVR and XMLTV settings are managed by two separate rows in this table, one with the ‘identifier’ of “tv.plex.grabbers.hdhomerun” (this is the DVR setting), and one with the ‘identifier’ of “tv.plex.providers.epg.xmltv” (this is the XMLTV setting). If you have multiple DVRs or XMLTVs configured, you will need to look at the ‘uri’ fields to find which rows contain a url you want to change.
  7. Update the ‘uri’ field of the DVR setting row, changing it from your old HDHR URL to your new one. This URL typically ends with /hdhr.
  8. Update the ‘uri’ field of the XMLTV setting row.

:warning: Note: This row needs to be updated in two locations.

  • In the first location, the URL is url-encoded once (http://your-url.com/epg.xml.gzhttp%3A%2F%2Fyour-url.com%2Fepg.xml.gz).
  • In the second spot, the URL is encoded twice (http://your-url.com/epg.xml.gzhttp%253A%252F%252Fyour-url.com%252Fepg.xml.gz)

Only replace the domain (& port if applicable) portion of the XMLTV setting. Leave the remaining path of the URL the same when you make changes, as that part is what Plex uses to refer to the DVR ID.

You can save the database and restart the server, it should work using the new URL now, and will display the updated URL in the web UI.

If you copied the database file off the server and back onto it, make sure the database has the right permissions before restarting the server.

TL;DR: Stop the server and edit com.plexapp.plugins.library.dbmedia_provider_resources table. Update the uri field for rows with the identifier tv.plex.grabbers.hdhomerun (DVR URL) and tv.plex.providers.epg.xmltv (XMLTV URL—change the domain only, in both the once-encoded and double-encoded occurrences).