2017-01-23 05:15:51 +00:00
|
|
|
Configuration
|
|
|
|
=============
|
2017-02-20 19:56:46 +00:00
|
|
|
Python-PlexAPI will work fine without any configuration. However, sometimes there are things you
|
|
|
|
may wish to alter for more control of the default behavior. The default configuration file path
|
|
|
|
is :samp:`~/.config/plexapi/config.ini` which can be overridden by setting the environment variable
|
2017-11-22 07:37:34 +00:00
|
|
|
:samp:`PLEXAPI_CONFIG_PATH` with the file path you desire. All configuration variables in this file
|
2017-02-20 19:56:46 +00:00
|
|
|
are optional. An example config.ini file may look like the following with all possible value specified.
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
.. code-block:: ini
|
|
|
|
|
|
|
|
# ~/.config/plexapi/config.ini
|
|
|
|
[plexapi]
|
|
|
|
container_size = 50
|
|
|
|
timeout = 30
|
|
|
|
|
|
|
|
[auth]
|
|
|
|
myplex_username = johndoe
|
|
|
|
myplex_password = kodi-stinks
|
|
|
|
server_baseurl = http://127.0.0.1:32400
|
|
|
|
server_token = XBHSMSJSDJ763JSm
|
2017-02-22 06:24:56 +00:00
|
|
|
client_baseurl = http://127.0.0.1:32433
|
|
|
|
client_token = BDFSLCNSNL789FH7
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2019-06-19 19:08:31 +00:00
|
|
|
[header]
|
2017-02-20 03:18:23 +00:00
|
|
|
identifier = 0x485b314307f3L
|
|
|
|
platorm = Linux
|
|
|
|
platform_version = 4.4.0-62-generic
|
|
|
|
product = PlexAPI
|
|
|
|
version = 3.0.0
|
|
|
|
|
|
|
|
[log]
|
|
|
|
backup_count = 3
|
|
|
|
format = %(asctime)s %(module)12s:%(lineno)-4s %(levelname)-9s %(message)s
|
|
|
|
level = INFO
|
|
|
|
path = ~/.config/plexapi/plexapi.log
|
|
|
|
rotate_bytes = 512000
|
2022-03-17 20:14:18 +00:00
|
|
|
show_secrets = false
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
Environment Variables
|
|
|
|
---------------------
|
2017-02-20 19:56:46 +00:00
|
|
|
All configuration values can be set or overridden via environment variables. The environment variable
|
|
|
|
names are in all upper case and follow the format :samp:`PLEXAPI_<SECTION>_<NAME>`. For example, if
|
|
|
|
you wish to set the log path via an environment variable, you may specify: `PLEXAPI_LOG_PATH="/tmp/plexapi.log"`
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
Section [plexapi] Options
|
|
|
|
-------------------------
|
|
|
|
**container_size**
|
2017-02-20 19:56:46 +00:00
|
|
|
Default max results to return in on single search page. Looping through result pages is done
|
2017-11-22 07:37:34 +00:00
|
|
|
internally by the API. Therefore, tuning this setting will not affect usage of plexapi. However,
|
2017-02-20 19:56:46 +00:00
|
|
|
it help improve performance for large media collections (default: 50).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**timeout**
|
2017-02-20 19:56:46 +00:00
|
|
|
Timeout in seconds to use when making requests to the Plex Media Server or Plex Client
|
|
|
|
resources (default: 30).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2023-07-28 01:24:04 +00:00
|
|
|
**autoreload**
|
|
|
|
By default PlexAPI will automatically :func:`~plexapi.base.PlexObject.reload` any :any:`PlexPartialObject`
|
|
|
|
when accessing a missing attribute. When this option is set to `false`, automatic reloading will be
|
|
|
|
disabled and :func:`~plexapi.base.PlexObject.reload` must be called manually (default: true).
|
|
|
|
|
2018-09-14 18:28:35 +00:00
|
|
|
**enable_fast_connect**
|
|
|
|
By default Plex will be trying to connect with all available connection methods simultaneously,
|
|
|
|
combining local and remote addresses, http and https, and be waiting for all connection to
|
|
|
|
establish (or fail due to timeout / any other error), this can take long time when you're trying
|
|
|
|
to connect to your Plex Server outside of your home network.
|
|
|
|
|
|
|
|
When the options is set to `true` the connection procedure will be aborted with first successfully
|
2023-07-28 01:24:04 +00:00
|
|
|
established connection (default: false).
|
2018-09-14 18:28:35 +00:00
|
|
|
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
Section [auth] Options
|
|
|
|
----------------------
|
|
|
|
**myplex_username**
|
2017-02-20 19:56:46 +00:00
|
|
|
Default MyPlex (plex.tv) username to use when creating a new :any:`MyPlexAccount` object. Specifying
|
|
|
|
this along with :samp:`auth.myplex_password` allow you to more easily connect to your account and
|
|
|
|
remove the need to hard code the username and password in any supplemental scripts you may write. To
|
|
|
|
create an account object using these values you may simply specify :samp:`account = MyPlexAccount()`
|
|
|
|
without any arguments (default: None).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**myplex_password**
|
2017-02-20 19:56:46 +00:00
|
|
|
Default MyPlex (plex.tv) password to use when creating a new :any:`MyPlexAccount` object. See
|
|
|
|
`auth.myplex_password` for more information and example usage (default: None).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2017-02-20 19:56:46 +00:00
|
|
|
WARNING: When specifying a password or token in the configuration file, be sure lock it down
|
2017-11-22 07:37:34 +00:00
|
|
|
(permission 600) to ensure no other users on the system can read them. Or better yet, only specify
|
2017-02-20 19:56:46 +00:00
|
|
|
sensitive values as a local environment variables.
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**server_baseurl**
|
2017-02-20 19:56:46 +00:00
|
|
|
Default baseurl to use when creating a new :any:`PlexServer` object. Specifying this along with
|
|
|
|
:samp:`auth.server_token` allow you to more easily connect to a server and remove the need to hard
|
|
|
|
code the baseurl and token in any supplemental scripts you may write. To create a server object using
|
|
|
|
these values you may simply specify :samp:`plex = PlexServer()` without any arguments (default: None).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**server_token**
|
2017-02-20 19:56:46 +00:00
|
|
|
Default token to use when creating a new :any:`PlexServer` object. See `auth.server_baseurl` for more
|
|
|
|
information and example usage (default: None).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2017-02-20 19:56:46 +00:00
|
|
|
WARNING: When specifying a password or token in the configuration file, be sure lock it down
|
2017-11-22 07:37:34 +00:00
|
|
|
(permission 600) to ensure no other users on the system can read them. Or better yet, only specify
|
2017-02-20 19:56:46 +00:00
|
|
|
sensitive values as a local environment variables.
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2017-02-22 06:24:56 +00:00
|
|
|
**client_baseurl**
|
|
|
|
Default baseurl to use when creating a new :any:`PlexClient` object. Specifying this along with
|
|
|
|
:samp:`auth.client_token` allow you to more easily connect to a client and remove the need to hard
|
|
|
|
code the baseurl and token in any supplemental scripts you may write. To create a client object using
|
|
|
|
these values you may simply specify :samp:`client = PlexClient()` without any arguments (default: None).
|
|
|
|
|
|
|
|
**client_token**
|
|
|
|
Default token to use when creating a new :any:`PlexClient` object. See `auth.client_baseurl` for more
|
|
|
|
information and example usage (default: None).
|
|
|
|
|
|
|
|
WARNING: When specifying a password or token in the configuration file, be sure lock it down
|
2017-11-22 07:37:34 +00:00
|
|
|
(permission 600) to ensure no other users on the system can read them. Or better yet, only specify
|
2017-02-22 06:24:56 +00:00
|
|
|
sensitive values as a local environment variables.
|
|
|
|
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
Section [header] Options
|
|
|
|
------------------------
|
|
|
|
**device**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_DEVICE to all Plex server and Plex client requests. Example devices
|
|
|
|
include: iPhone, FireTV, Linux (default: `result of platform.uname()[0]`).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**device_name**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_DEVICE_NAME to all Plex server and Plex client requests. Example device
|
|
|
|
names include: hostname or phone name (default: `result of platform.uname()[1]`).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**identifier**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_IDENTIFIER to all Plex server and Plex client requests. This is generally
|
|
|
|
a UUID, serial number, or other number unique id for the device (default: `result of hex(uuid.getnode())`).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2023-09-17 21:51:54 +00:00
|
|
|
**language**
|
|
|
|
Header value used for X_PLEX_LANGUAGE to all Plex server and Plex client requests. This is an ISO 639-1
|
|
|
|
language code (default: en).
|
|
|
|
|
2017-11-22 07:37:34 +00:00
|
|
|
**platform**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_PLATFORM to all Plex server and Plex client requests. Example platforms
|
|
|
|
include: iOS, MacOSX, Android, LG (default: `result of platform.uname()[0]`).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**platform_version**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_PLATFORM_VERSION to all Plex server and Plex client requests. This is
|
2017-11-22 07:37:34 +00:00
|
|
|
generally the server or client operating system version: 4.3.1, 10.6.7, 3.2 (default: `result of
|
2017-02-20 19:56:46 +00:00
|
|
|
platform.uname()[2]`).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**product**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_PRODUCT to all Plex server and Plex client requests. This is the Plex
|
|
|
|
application name: Laika, Plex Media Server, Media Link (default: PlexAPI).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**provides**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_PROVIDES to all Plex server and Plex client requests This is generally one
|
|
|
|
or more of: controller, player, server (default: PlexAPI).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**version**
|
2017-02-20 19:56:46 +00:00
|
|
|
Header value used for X_PLEX_VERSION to all Plex server and Plex client requests. This is the Plex
|
|
|
|
application version (default: plexapi.VERSION).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
Section [log] Options
|
|
|
|
---------------------
|
|
|
|
**backup_count**
|
|
|
|
Number backup log files to keep before rotating out old logs (default 3).
|
|
|
|
|
|
|
|
**format**
|
|
|
|
Log file format to use for plexapi logging. (default:
|
|
|
|
'%(asctime)s %(module)12s:%(lineno)-4s %(levelname)-9s %(message)s').
|
|
|
|
Ref: https://docs.python.org/2/library/logging.html#logrecord-attributes
|
|
|
|
|
|
|
|
**level**
|
|
|
|
Log level to use when for plexapi logging (default: INFO).
|
|
|
|
|
|
|
|
**path**
|
2017-11-22 07:37:34 +00:00
|
|
|
File path to save plexapi logs to. If not specified, plexapi will not save logs to an output
|
2017-02-20 19:56:46 +00:00
|
|
|
file (default: None).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
|
|
|
**rotate_bytes**
|
2017-02-20 19:56:46 +00:00
|
|
|
Max size of the log file before rotating logs to a backup file (default: 512000 equals 0.5MB).
|
2017-02-20 03:18:23 +00:00
|
|
|
|
2022-03-17 20:14:18 +00:00
|
|
|
**show_secrets**
|
2017-02-20 19:56:46 +00:00
|
|
|
By default Plex will hide all passwords and token values when logging. Set this to 'true' to enable
|
|
|
|
logging these secrets. This should only be done on a private server and only enabled when needed
|
|
|
|
(default: false).
|