EmbyPy Connector

class embypy.utils.Connector(url, **kargs)[source]

Class responsible for comunication with emby

Parameters:
  • url (str) – url to connect to
  • address-remote (str, optional) – alt url to connect to, pulic facing (see notes)
  • ssl (str, optional) – path to ssl certificate - for self signed certs
  • userid (str, optional) – emby id of the user you wish to connect as
  • api-key (str) – api key generated by emby, used for authentication
  • token (str) – similar to api key, but is meant for user logins
  • username (str, optional) – username for login (see notes)
  • password (str, optional) – password for login (see notes)
  • device_id (str) – device id as registered in emby
  • timeout (int) – number of seconds to wait before timeout for a request
  • tries (int) – number of times to try a request before throwing an error
  • jellyfin (bool) – if this is a jellyfin (false = emby) server

Notes

This class/object should NOT be used (except internally).

Tf a address-remote url is given, then that will be used for output, such as the embypy.objects.EmbyObject.url atribute.

url will always be used when making requests - thus I recomend using the local address for url and the remote address for address-remote

Jellyfin and emby have some url differences right now, so set jellyfin’s url scheme to true/false [or None (default) for auto-detect]

get_url(path='/', websocket=False, remote=True, attach_api_key=True, userId=None, pass_uid=False, **query)[source]

construct a url for an emby request

Parameters:
  • path (str) – uri path(excluding domain and port) of get request for emby
  • websocket (bool, optional) – if true, then ws(s) are used instead of http(s)
  • remote (bool, optional) – if true, remote-address is used (default True)
  • attach_api_key (bool, optional) – if true, apikey is added to the query (default True)
  • userId (str, optional) – uid to use, if none, default is used
  • pass_uid (bool, optional) – if true, uid is added to the query (default False)
  • query (karg dict) – additional parameters to set (part of url after the ?)
  • See (Also) –
  • -------- – get : getJson : post : delete :
Returns:

Return type:

full url

add_on_message(func)[source]

add function that handles websocket messages