Skip to content

Commit cbaaa19

Browse files
authored
Add X-Plex-Language header to config (#1241)
1 parent fdc89c8 commit cbaaa19

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

docs/configuration.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ Section [header] Options
130130
Header value used for X_PLEX_IDENTIFIER to all Plex server and Plex client requests. This is generally
131131
a UUID, serial number, or other number unique id for the device (default: `result of hex(uuid.getnode())`).
132132

133+
**language**
134+
Header value used for X_PLEX_LANGUAGE to all Plex server and Plex client requests. This is an ISO 639-1
135+
language code (default: en).
136+
133137
**platform**
134138
Header value used for X_PLEX_PLATFORM to all Plex server and Plex client requests. Example platforms
135139
include: iOS, MacOSX, Android, LG (default: `result of platform.uname()[0]`).

plexapi/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
X_PLEX_DEVICE = CONFIG.get('header.device', X_PLEX_PLATFORM)
3131
X_PLEX_DEVICE_NAME = CONFIG.get('header.device_name', uname()[1])
3232
X_PLEX_IDENTIFIER = CONFIG.get('header.identifier', str(hex(getnode())))
33+
X_PLEX_LANGUAGE = CONFIG.get('header.language', 'en')
3334
BASE_HEADERS = reset_base_headers()
3435

3536
# Logging Configuration

plexapi/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def reset_base_headers():
6363
'X-Plex-Device': plexapi.X_PLEX_DEVICE,
6464
'X-Plex-Device-Name': plexapi.X_PLEX_DEVICE_NAME,
6565
'X-Plex-Client-Identifier': plexapi.X_PLEX_IDENTIFIER,
66+
'X-Plex-Language': plexapi.X_PLEX_LANGUAGE,
6667
'X-Plex-Sync-Version': '2',
6768
'X-Plex-Features': 'external-media',
6869
}

0 commit comments

Comments
 (0)