Example #1
0
# -*- coding: utf-8 -*-
import logging
import os
from logging.handlers import RotatingFileHandler
from platform import uname
from plexapi.config import PlexConfig, reset_base_headers
from plexapi.utils import SecretsFilter
from uuid import getnode

# Load User Defined Config
DEFAULT_CONFIG_PATH = os.path.expanduser('~/.config/plexapi/config.ini')
CONFIG_PATH = os.environ.get('PLEXAPI_CONFIG_PATH', DEFAULT_CONFIG_PATH)
CONFIG = PlexConfig(CONFIG_PATH)

# PlexAPI Settings
PROJECT = 'PlexAPI'
VERSION = '3.0.6'
TIMEOUT = CONFIG.get('plexapi.timeout', 30, int)
X_PLEX_CONTAINER_SIZE = CONFIG.get('plexapi.container_size', 100, int)
X_PLEX_ENABLE_FAST_CONNECT = CONFIG.get('plexapi.enable_fast_connect', False, bool)

# Plex Header Configuation
X_PLEX_PROVIDES = CONFIG.get('header.provides', 'controller')
X_PLEX_PLATFORM = CONFIG.get('header.platform', CONFIG.get('header.platorm', uname()[0]))
X_PLEX_PLATFORM_VERSION = CONFIG.get('header.platform_version', uname()[2])
X_PLEX_PRODUCT = CONFIG.get('header.product', PROJECT)
X_PLEX_VERSION = CONFIG.get('header.version', VERSION)
X_PLEX_DEVICE = CONFIG.get('header.device', X_PLEX_PLATFORM)
X_PLEX_DEVICE_NAME = CONFIG.get('header.device_name', uname()[1])
X_PLEX_IDENTIFIER = CONFIG.get('header.identifier', str(hex(getnode())))
BASE_HEADERS = reset_base_headers()
Example #2
0
# -*- coding: utf-8 -*-
import logging, os
from logging.handlers import RotatingFileHandler
from platform import uname
from plexapi.config import PlexConfig, reset_base_headers
from uuid import getnode


# Load User Defined Config
CONFIG_PATH = os.path.expanduser('~/.config/plexapi/config.ini')
CONFIG = PlexConfig(CONFIG_PATH)

# Core Settings
PROJECT = 'PlexAPI'                                 # name provided to plex server
VERSION = '2.0.0a'                                  # version of this api
TIMEOUT = CONFIG.get('plexapi.timeout', 30, int)     # request timeout
X_PLEX_CONTAINER_SIZE = 50                          # max results to return in a single search page 

# Plex Header Configuation
X_PLEX_PROVIDES = 'player,controller'                                          # one or more of [player, controller, server]
X_PLEX_PLATFORM = CONFIG.get('headers.platorm', uname()[0])                    # Platform name, eg iOS, MacOSX, Android, LG, etc
X_PLEX_PLATFORM_VERSION = CONFIG.get('headers.platform_version', uname()[2])   # Operating system version, eg 4.3.1, 10.6.7, 3.2
X_PLEX_PRODUCT = CONFIG.get('headers.product', PROJECT)                        # Plex application name, eg Laika, Plex Media Server, Media Link
X_PLEX_VERSION = CONFIG.get('headers.version', VERSION)                        # Plex application version number
X_PLEX_DEVICE = CONFIG.get('headers.platform', X_PLEX_PLATFORM)                # Device make, eg iPhone, FiteTV, Linux, etc.
X_PLEX_DEVICE_NAME = uname()[1]                                                # Device name, hostname or phone name, etc.
X_PLEX_IDENTIFIER = CONFIG.get('headers.identifier', str(hex(getnode())))      # UUID, serial number, or other number unique per device
BASE_HEADERS = reset_base_headers()

# Logging Configuration
log = logging.getLogger('plexapi')
Example #3
0
# -*- coding: utf-8 -*-
import logging, os
from logging.handlers import RotatingFileHandler
from platform import uname
from plexapi.config import PlexConfig, reset_base_headers
from uuid import getnode


# Load User Defined Config
CONFIG_PATH = os.path.expanduser('~/.config/plexapi/config.ini')
CONFIG = PlexConfig(CONFIG_PATH)

# Core Settings
PROJECT = 'PlexAPI'                                 # name provided to plex server
VERSION = '2.0.2'                                   # version of this api
TIMEOUT = CONFIG.get('plexapi.timeout', 30, int)    # request timeout
X_PLEX_CONTAINER_SIZE = 50                          # max results to return in a single search page

# Plex Header Configuation
X_PLEX_PROVIDES = 'controller'                                                 # one or more of [player, controller, server]
X_PLEX_PLATFORM = CONFIG.get('headers.platorm', uname()[0])                    # Platform name, eg iOS, MacOSX, Android, LG, etc
X_PLEX_PLATFORM_VERSION = CONFIG.get('headers.platform_version', uname()[2])   # Operating system version, eg 4.3.1, 10.6.7, 3.2
X_PLEX_PRODUCT = CONFIG.get('headers.product', PROJECT)                        # Plex application name, eg Laika, Plex Media Server, Media Link
X_PLEX_VERSION = CONFIG.get('headers.version', VERSION)                        # Plex application version number
X_PLEX_DEVICE = CONFIG.get('headers.platform', X_PLEX_PLATFORM)                # Device make, eg iPhone, FiteTV, Linux, etc.
X_PLEX_DEVICE_NAME = uname()[1]                                                # Device name, hostname or phone name, etc.
X_PLEX_IDENTIFIER = CONFIG.get('headers.identifier', str(hex(getnode())))      # UUID, serial number, or other number unique per device
BASE_HEADERS = reset_base_headers()

# Logging Configuration
log = logging.getLogger('plexapi')