Plex: Add Accept: "application/json" header so plex returns json again

I think the plex api default used to be JSON, which is why it worked, but I guess they changed it to XML. Adding this header asks for JSON response again.
This commit is contained in:
IRHM
2026-07-26 01:30:24 +01:00
committed by momi
parent 217be719e4
commit 39b82335eb
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -2,6 +2,10 @@
These changes are awaiting release: These changes are awaiting release:
## Fixed
- Plex Login: Request JSON from plex api so that it doesn't return XML.
# [4.1.0] - 2026-07-19T14:18:00Z # [4.1.0] - 2026-07-19T14:18:00Z
## Changed ## Changed
+3
View File
@@ -68,6 +68,9 @@ export function preparePlexAuth(): Plex {
// Don't really want to give all the possible headers, // Don't really want to give all the possible headers,
// trying to minimize it to what gets it working. // trying to minimize it to what gets it working.
headers: { headers: {
// So plex api returns json.
Accept: "application/json",
// Plex product specific headers:
"X-Plex-Product": "Watcharr", "X-Plex-Product": "Watcharr",
"X-Plex-Client-Identifier": clientId, "X-Plex-Client-Identifier": clientId,
"X-Plex-Version": "Plex OAuth", "X-Plex-Version": "Plex OAuth",