UK EPG, any scripts that I can run to force a full EPG download

My Plex server currently only downloads a couple of days of EPG in the UK, used to be two weeks, but if I do a full download, then I get a lot more than the next two days.

Does anyone know any way to have a script that every-night, would force a full download?

Ideally, I would like Plex to fix this, as well as the current issue that Plex thinks channels are HD channels when they are not in the UK, but as no response to this from Plex I’m looking for a workaround :frowning:

I’ve found the Refresh EPG call, I’ve created a python 3 script for it, but it should be trivial to convert to another language. Just get a plexToken and your DVRID

import requests

plexToken = ""
DVRID = "16"
plexURL = ""

refreshEPG = plexURL + "/livetv/dvrs/"+DVRID+"/reloadGuide?X-Plex-Token=" +plexToken

res = requests.post(refreshEPG)
if res.status_code == 200:
	print(" Refreshing EPG")
else:
	print(" Error Returned : "+str(res.status_code))

Just to mention, it looks like I am having the same problem (also UK).

Thanks for this, got everything working except cannot work out what the DVRID is for my server. How do I find this, and thanks again for the script?

I notice that Plex does have a Scheduled Task that Perform refresh of program guide data would be nice if a Scheduled Task for a full EPG download could be included as an option.

Just have a look at the guide in Plex Web and it’s in the URL, mine looks like this

/provider/tv.plex.providers.epg.onconnect%3A16

1 Like

Thanks it all works.

1 Like

I’ve tried this but I’m getting a “404 404 Not Found” error.

The URL I’m posting is http://localhost:32400/livetv/dvrs/A2/reloadGuide?X-Plex-Token=xxx

I have replaced the real token with “xxx”.

When I’m put the same URL in a browser I get the same result. Has the syntax for the EPG refresh URL changed?

I know I’m using the correct token because when I access http://localhost:32400/library/sections?X-Plex-Token=xxx from the script it works.

I’m also using the correct DVRID of “A2” as the URL for the Guide is …/provider/tv.plex.providers.epg.onconnect%3A2

I am wondering if someone could write a “Dummies” guide to implementing this. The issue of the EPG failing to update is widespread across the UK and clearly Plex are not interested in either fixing it or giving the option for a full reload in the scheduled tasks.

I’m sure a lot of users would like to implement this fix but are at a loss in how to apply a script, token, etc.

Hopefully someone can give some simple instructions to implement this.

Thanks

2 Likes

If there are widespread issues, would like to see evidence of them - so please screenshots / logs with debug logging enabled beforehand

It is now designed to gradually build the EPG incrementally after the initial load - with an incremental refresh every 4 hours adding another 4 hours set of guide data. Incremental updates were introduced to reduce the load on the backend systems

for logs see
https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/
https://support.plex.tv/articles/200250417-plex-media-server-log-files/

Thanks for the reply SA2000.

I’m happy to supply logs, screenshots etc. I have recently completed a manual refresh so at the moment there is no issue. From experience I expect the first issues to arise tomorrow at 6.00am - it usually starts with the BBC channels and then spreads to other channels.

I will grab the logs and screenshots tomorrow and upload them.

It’s not just affecting the UK but in UK DVR Guide only giving one week ahead for main channels it’s been reported that users in US and AUS see the same issue.

I even added log extracts to that other thread: UK DVR Guide only giving one week ahead for main channels

The code still works, but be mindful that these Plex token change overtime, so make sure that you have the current Plex Token in your script and the DVRID for you system is not “A2” but just the number “2”, i.e. ignore %3A.

If anyone is good with Python, would be great if you could adapt the script so that it always get the correct Plex Token when it runs :smile:

Thanks @Trotter999 - I changed the DVRID to “2” but I’m still getting the same error:

http://localhost:32400/livetv/dvrs/2/reloadGuide?X-Plex-Token=xxx
INFO sending request to refresh EPG
ERROR 404 Not Found
INFO Done

I also checked if the Plex token had changed and I’m still getting the same error when using the URL directly in a browser.

It works on my server, this is the python script that I am using, replaced my specific ID items with xxx

import requests

plexToken = "xxx"
DVRID = "xxx"
plexURL = "https://xxx"

refreshEPG = plexURL + "/livetv/dvrs/"+DVRID+"/reloadGuide?X-Plex-Token=" +plexToken

res = requests.post(refreshEPG)
if res.status_code == 200:
	print(" Refreshing EPG")
else:
	print(" Error Returned : "+str(res.status_code))

It could be timeouts on accessing the provider - point me to post where the issue has been described and full logs zip provided. Unfortunately I cannot and do not investigate issues from log extracts and need to see the whole picture - so full logs zip please - ideally going back to the time the server was last launched

See
https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/
https://support.plex.tv/articles/200250417-plex-media-server-log-files/

I found the URL by looking in developer tools on Chrome, so I’d recommend checking yours manually.

Using Chrome…
Head to Live TV & DVR in settings
Press Ctrl, Shift, I to open the developer tools
Change to the Network tab
Hit refresh EPG in the Plex Settings
Look for the URL in Developer Tools
Use that in the script

Good luck :slight_smile:

This morning I have “To Be Announced” from 6.00am on Saturday. Screenshots and Logs uploaded. I will do another screenshot/upload this afternoon and this evening as Plex should have tried to update the EPG further over these periods. If you require anything else let me know.

Plex Media (4.8 MB)

@sa2000 - let me monitor and provide you with a complete set of logs; as I’m running a guide refresh daily I want to wait a few days before grabbing the logs as otherwise I won’t be able to tell if the issue is still there or not.

Thanks @mcqweb - I checked in Developer mode and found this URL:

http://127.0.0.1:32400/livetv/dvrs/2/reloadGuide?X-Plex-Product=Plex%20Web&X-Plex-Version=3.69.1&X-Plex-Client-Identifier=xxx&X-Plex-Platform=Safari&X-Plex-Platform-Version=12.0&X-Plex-Sync-Version=2&X-Plex-Device=OSX&X-Plex-Device-Name=Safari&X-Plex-Device-Screen-Resolution=1280x833%2C1920x1080&X-Plex-Token=xxx&X-Plex-Language=en-GB

This means what I’ve been using in my script is correct. Still getting the 404 even when using the exact same URL in my script or browser.

Just remembered - it needs to be a POST request, not a GET, that’s likely what your problem is