flexget.components.emby.api_emby module#

class flexget.components.emby.api_emby.EmbyApi(auth)[source]#

Bases: EmbyApiBase

Class to interact with Emby API.

Parameters:

auth (EmbyAuth)

static get_auth(**kwargs)[source]#
Return type:

EmbyAuth

static get_type(**kwargs)[source]#
Return type:

bool

static has_providers_search_arg(**kwargs)[source]#
Return type:

bool

Parameters:

args (dict)

static request_emby(endpoint, auth, method, emby_connect=False, **kwargs)[source]#
Parameters:
static search(**kwargs)[source]#
static search_list(**kwargs)[source]#
static set_common_search_arg(args)[source]#
Parameters:

args (dict)

static set_providers_search_arg(args, **kwargs)[source]#
Parameters:

args (dict)

static strtotime(date)[source]#
Return type:

datetime

EMBY_EXTRA_FIELDS = ['DateCreated', 'Path', 'ProviderIds', 'PremiereDate', 'MediaSources', 'Video3DFormat', 'Overview']#
_abc_impl = <_abc._abc_data object>#
_last_auth = None#
auth = None#
class flexget.components.emby.api_emby.EmbyApiBase[source]#

Bases: ABC

Base Class to all API integratios.

static merge_field_map(dst, *arg, **kwargs)[source]#

Merge field maps from clild and parent class.

Parameters:
static update_using_map(target, field_map, source_item, **kwargs)[source]#

Update based on field map with source.

Parameters:

field_map (dict)

EMBY_PREF = 'emby_'#
_abc_impl = <_abc._abc_data object>#
class flexget.components.emby.api_emby.EmbyApiEpisode(**kwargs)[source]#

Bases: EmbyApiMedia

Episode.

static is_type(**kwargs)[source]#
Return type:

bool

static parse_string(string)[source]#

Return Relevant Information from string.

Parameters:

string (str)

static search(**kwargs)[source]#
Return type:

EmbyApiEpisode

to_dict()[source]#
Return type:

dict

TYPE = 'episode'#
_abc_impl = <_abc._abc_data object>#
_season = None#
_series = None#
property ep_aired_date: datetime#
property ep_id: str#
property ep_imdb_id: str#
property ep_name: str#
property ep_overview: str#
property ep_page: str#
property ep_photo: str#
property ep_tmdb_id: str#
property ep_tvdb_id: str#
episode = None#
field_map = {'episode': ['episode', 'IndexNumber']}#
field_map_up = {'aired_date': 'ep_aired_date', 'base_name': 'ep_name', 'ep_id': 'ep_id', 'ep_imdb_id': 'ep_imdb_id', 'ep_name': 'ep_name', 'ep_tmdb_id': 'ep_tmdb_id', 'ep_tvdb_id': 'ep_tvdb_id', 'episode': ['episode', 'series_episode'], 'id': 'ep_id', 'imdb_id': 'ep_imdb_id', 'page': 'ep_page', 'photo': 'ep_photo', 'tmdb_id': 'ep_tmdb_id', 'tvdb_id': 'ep_tvdb_id'}#
property fullname: str#
property season: EmbyApiSeason#
property series: EmbyApiSeries#
class flexget.components.emby.api_emby.EmbyApiFavoriteList(**kwargs)[source]#

Bases: EmbyApiListBase

Favorite media list.

static is_type(**kwargs)[source]#
_add(item)[source]#
Parameters:

item (EmbyApiMedia)

_remove(item)[source]#
Parameters:

item (EmbyApiMedia)

get(item)[source]#

Get Item from list.

get_items()[source]#
_abc_impl = <_abc._abc_data object>#
property created#
class flexget.components.emby.api_emby.EmbyApiLibrary(**kwargs)[source]#

Bases: EmbyApiListBase

Library List.

static _get_list_data(auth, **kwargs)[source]#
static is_type(**kwargs)[source]#
static library_refresh(auth)[source]#
_add(item)[source]#
_remove(item)[source]#
get(item)[source]#

Get Item from list.

get_items()[source]#
_abc_impl = <_abc._abc_data object>#
property created#
property fullname#
property immutable#
class flexget.components.emby.api_emby.EmbyApiList(**kwargs)[source]#

Bases: EmbyApiBase, MutableSet

Class to interface lists.

static get_api_list(**kwargs)[source]#
Return type:

EmbyApiListBase

add(item)[source]#

Add an element.

Return type:

None

discard(item)[source]#

Remove an element. Do not raise an exception if absent.

Return type:

None

get(item)[source]#
Return type:

None

_abc_impl = <_abc._abc_data object>#
_items = None#
_list = None#
auth = None#
field_map = {'id': ['library_id', 'id', 'Id'], 'name': ['library_name', 'list', 'name', 'Name']}#
id = None#
property immutable#
name = None#
class flexget.components.emby.api_emby.EmbyApiListBase(**kwargs)[source]#

Bases: EmbyApiBase

Base class to all API Lists.

abstractmethod static is_type(**kwargs)[source]#
abstractmethod _add(item)[source]#
Parameters:

item (EmbyApiMedia)

abstractmethod _remove(item)[source]#
Parameters:

item (EmbyApiMedia)

add(entry)[source]#

Add a item to list.

Parameters:

entry (Entry)

contains(item)[source]#

Check if list contains item.

get(item)[source]#

Get Item from list.

Return type:

EmbyApiMedia

abstractmethod get_items()[source]#
remove(entry)[source]#

Remove a item from list.

Parameters:

entry (Entry)

set_list_search_args(args)[source]#
Parameters:

args (dict)

_abc_impl = <_abc._abc_data object>#
_index = 0#
_internal_items = None#
_iterator = 10#
_len = 0#
_name = None#
allow_create = False#
auth = None#
property created#
favorite = None#
field_map = {'_name': ['library_name', 'list', 'name', 'Name'], 'favorite': ['favorite'], 'id': ['library_id', 'id', 'Id'], 'sort': ['sort'], 'types': ['types'], 'watched': ['watched']}#
property fullname#
id = None#
property immutable#
property index#
property iterator#
property len#
property name#
property next_index#
sort = None#
types = None#
watched = None#
class flexget.components.emby.api_emby.EmbyApiMedia(**kwargs)[source]#

Bases: EmbyApiBase

Basic media.

classmethod get_from_child(child)[source]#
Parameters:

child (EmbyApiMedia)

Return type:

EmbyApiMedia

static cast(**kwargs)[source]#
Return type:

EmbyApiMedia

static get_mtype(**kwargs)[source]#
Return type:

str

static parse_string(string)[source]#

Return Relevant Information from string.

Parameters:

string (str)

static search(**kwargs)[source]#
Return type:

EmbyApiMedia

_get_parents()[source]#
Return type:

dict

get_library()[source]#
Return type:

EmbyApiLibrary

to_dict()[source]#
Return type:

dict

to_entry()[source]#
Return type:

Entry

TYPE = 'unknown'#
_abc_impl = <_abc._abc_data object>#
aired_date = None#
audio = None#
auth = None#
base_name = None#
created_date = None#
property download_url: str#
favorite = None#
field_map = {'aired_date': ['aired_date', 'PremiereDate'], 'base_name': ['base_name', 'name', 'Name', 'title'], 'created_date': ['created_date', 'DateCreated'], 'favorite': ['favorite', 'UserData.IsFavorite'], 'format_3d': ['format_3d', 'Video3DFormat'], 'id': ['id', 'Id'], 'imdb_id': ['imdb_id', 'ProviderIds.Imdb'], 'mtype': ['mtype', 'Type'], 'overview': ['overview', 'Overview'], 'path': ['path', 'Path'], 'photo_tag': ['photo_tag', 'ImageTags.Primary'], 'playcount': ['playcount', 'UserData.PlayCount'], 'search_string': ['search_string'], 'tmdb_id': ['tmdb_id', 'ProviderIds.Tmdb'], 'tvdb_id': ['tvdb_id', 'ProviderIds.Tvdb'], 'watched': ['watched', 'UserData.Played'], 'year': ['ProductionYear']}#
field_to_dic = {}#
property file_extension: str#
property filename: str#
format_3d = None#
property fullname: str#
property host: str#
id = None#
imdb_id = None#
property imdb_url: str#
library = None#
property library_name: str#
media_sources_raw = None#
mtype = None#
property name: str#
overview = None#
property page: str#
path = None#
property photo: str#
photo_tag = None#
playcount = None#
quality = None#
source_id = None#
subtitles = None#
tmdb_id = None#
tvdb_id = None#
watched = None#
property year: int#
class flexget.components.emby.api_emby.EmbyApiMovie(**kwargs)[source]#

Bases: EmbyApiMedia

Movie.

static is_type(**kwargs)[source]#
Return type:

bool

static parse_string(string)[source]#

Return Relevant Information from string.

Parameters:

string (str)

static search(**kwargs)[source]#
Return type:

EmbyApiMovie

to_dict()[source]#
Return type:

dict

TYPE = 'movie'#
_abc_impl = <_abc._abc_data object>#
field_map_up = {'aired_date': 'movie_aired_date', 'base_name': 'movie_name', 'id': 'movie_id', 'imdb_id': 'movie_imdb_id', 'movie_id': 'movie_id', 'movie_imdb_id': 'movie_imdb_id', 'movie_name': 'movie_name', 'movie_tmdb_id': 'movie_tmdb_id', 'movie_tvdb_id': 'movie_tvdb_id', 'movie_year': 'movie_year', 'overview': 'movie_overview', 'page': 'movie_page', 'photo': 'movie_photo', 'tmdb_id': 'movie_tmdb_id', 'tvdb_id': 'movie_tvdb_id', 'year': 'movie_year'}#
property fullname#
property movie_aired_date: datetime#
property movie_id: str#
property movie_imdb_id: str#
property movie_name: str#
property movie_overview: str#
property movie_page: str#
property movie_photo: str#
property movie_tmdb_id: str#
property movie_tvdb_id: str#
property movie_year: int#
class flexget.components.emby.api_emby.EmbyApiPlayList(**kwargs)[source]#

Bases: EmbyApiListBase

Playlist lists.

static _get_list_data(auth, **kwargs)[source]#
static create(item, **kwargs)[source]#
static is_type(**kwargs)[source]#
_add(item)[source]#
Parameters:

item (EmbyApiMedia)

_remove(item)[source]#
contains(item)[source]#

Check if list contains item.

destroy()[source]#
fill_items()[source]#
get(item)[source]#

Get Item from list.

get_items()[source]#
_abc_impl = <_abc._abc_data object>#
allow_create = True#
property fullname#
playlist_bind = {}#
class flexget.components.emby.api_emby.EmbyApiRootList(**kwargs)[source]#

Bases: EmbyApiListBase

Root Media List.

static is_type(**kwargs)[source]#
_add(item)[source]#
Parameters:

item (EmbyApiMedia)

_remove(item)[source]#
Parameters:

item (EmbyApiMedia)

get_items()[source]#
_abc_impl = <_abc._abc_data object>#
property created#
class flexget.components.emby.api_emby.EmbyApiSeason(**kwargs)[source]#

Bases: EmbyApiMedia

Season.

static is_type(**kwargs)[source]#
Return type:

bool

static parse_string(string)[source]#

Return Relevant Information from string.

Parameters:

string (str)

static search(**kwargs)[source]#
Return type:

EmbyApiSeason

to_dict()[source]#
Return type:

dict

TYPE = 'season'#
_abc_impl = <_abc._abc_data object>#
_series = None#
field_map = {'season': ['season', 'IndexNumber']}#
field_map_up = {'base_name': 'season_name', 'id': ['season_id', 'SeasonId'], 'imdb_id': 'season_imdb_id', 'page': 'season_page', 'photo': 'season_photo', 'season': ['season', 'series_season'], 'season_id': ['season_id', 'SeasonId'], 'season_imdb_id': 'season_imdb_id', 'season_name': 'season_name', 'season_tmdb_id': 'season_tmdb_id', 'season_tvdb_id': 'season_tvdb_id', 'tmdb_id': 'season_tmdb_id', 'tvdb_id': 'season_tvdb_id'}#
property fullname: str#
season = None#
property season_id: str#
property season_imdb_id: str#
property season_name: str#
property season_page: str#
property season_photo: str#
property season_tmdb_id: str#
property season_tvdb_id: str#
property series: EmbyApiSeries#
property series_overview: str#
class flexget.components.emby.api_emby.EmbyApiSeries(**kwargs)[source]#

Bases: EmbyApiMedia

Series.

static is_type(**kwargs)[source]#
Return type:

bool

static parse_string(string, force_parse=False)[source]#

Return Relevant Information from string.

Parameters:

string (str)

static search(**kwargs)[source]#
Return type:

EmbyApiSeries

to_dict()[source]#
Return type:

dict

TYPE = 'series'#
_abc_impl = <_abc._abc_data object>#
field_map_up = {'aired_date': 'series_aired_date', 'base_name': ['series_name', 'series_name', 'SeriesName'], 'id': 'series_id', 'imdb_id': 'series_imdb_id', 'overview': 'series_overview', 'page': 'series_page', 'photo': 'series_photo', 'series_id': ['series_id', 'SeriesId'], 'series_imdb_id': 'series_imdb_id', 'series_name': ['series_name', 'series_name', 'SeriesName'], 'series_tmdb_id': 'series_tmdb_id', 'series_tvdb_id': 'series_tvdb_id', 'tmdb_id': 'series_tmdb_id', 'tvdb_id': 'series_tvdb_id'}#
property fullname: str#
property series_aired_date: datetime#
property series_id: str#
property series_imdb_id: str#
property series_name: str#
property series_overview: str#
property series_page: str#
property series_photo: str#
property series_tmdb_id: str#
property series_tvdb_id: str#
property series_year: int#
class flexget.components.emby.api_emby.EmbyApiWatchedList(**kwargs)[source]#

Bases: EmbyApiListBase

Watched Media List.

static is_type(**kwargs)[source]#
_add(item)[source]#
Parameters:

item (EmbyApiMedia)

_remove(item)[source]#
Parameters:

item (EmbyApiMedia)

get(item)[source]#

Get Item from list.

get_items()[source]#
_abc_impl = <_abc._abc_data object>#
property created#
class flexget.components.emby.api_emby.EmbyAuth(**kwargs)[source]#

Bases: EmbyApiBase

Manage API Authorizations.

static get_last_auth()[source]#
add_token_header(header, emby_connect=False)[source]#

Add data to request header.

Parameters:

header (dict)

Return type:

dict

check_token_data(token_data, login_type)[source]#

Check saved tokens.

get_user_by_name(name)[source]#

Get user by username.

Parameters:

name (str)

Return type:

dict

is_connect_server()[source]#

Check if it’s a connect server, if it’s a url assumed not a emby connect.

Returns:

bool: Is emby connect server

Return type:

bool

login(optional=False)[source]#

Login user to API.

logout()[source]#

Logout user from API.

save_token_data()[source]#

Save token data to Data Base.

EMBY_CLIENT = 'Flexget'#
EMBY_DEF_HOST = 'http://localhost:8096'#
EMBY_DEVICE = 'Flexget Plugin'#
EMBY_DEVICE_ID = 'flexget_plugin'#
EMBY_VERSION = '3.19.24.dev'#
_abc_impl = <_abc._abc_data object>#
_apikey = None#
_can_download = None#
_connect_token = ''#
_connect_username = ''#
_host_name = ''#
_lanurl = None#
_last_auth = None#
_logged = False#
_login_type = None#
_password = None#
_serverid = ''#
_token = ''#
_userid = ''#
_username = None#
_wanurl = None#
property can_download: bool#
field_map = {'_apikey': 'apikey', '_password': 'password', '_username': 'username', 'host': 'host', 'return_host': 'return_host'}#
host = 'http://localhost:8096'#
property host_name: str#
property lanurl: str#
property logged: bool#
return_host = None#
property server_id: str#
property token: str#
property uid: str#
property username: str#
property wanurl: str#