media.jellyfin

media.jellyfin

class platypush.plugins.media.jellyfin.MediaJellyfinPlugin(server: str, api_key: str, username: Optional[str] = None, **kwargs)[source]

Plugin to interact with a Jellyfin media server.

Note: As of February 2022, this plugin also works with Emby media server instances. Future back-compatibility if the two APIs diverge, however, is not guaranteed.

__init__(server: str, api_key: str, username: Optional[str] = None, **kwargs)[source]
Parameters:
  • server – Jellyfin base server URL (including http:// or https://).

  • api_key – Server API key. You can generate one from http(s)://your-server/web/index.html#!/apikeys.html.

  • username – Customize results for the specified user (default: user associated to the API token if it’s a user token, or the first created user on the platform).

get_artists(limit: Optional[int] = 100, offset: int = 0, query: Optional[str] = None, is_played: Optional[bool] = None, is_favourite: Optional[bool] = None, is_liked: Optional[bool] = None, genres: Optional[Iterable[str]] = None, tags: Optional[Iterable[str]] = None, years: Optional[Iterable[int]] = None) Iterable[dict][source]

Get a list of artists on the server.

Parameters:
  • limit – Maximum number of items to return (default: 100).

  • offset – Return results starting from this (0-based) index (default: 0).

  • query – Filter items by this term.

  • is_played – Return only played items (or unplayed if set to False).

  • is_liked – Return only liked items (or not liked if set to False).

  • is_favourite – Return only favourite items (or not favourite if set to False).

  • genres – Filter results by (a list of) genres.

  • tags – Filter results by (a list of) tags.

  • years – Filter results by (a list of) years.

Returns:

[
  {
    "id": "Artist ID",
    "image": "Artist main image (URL)",
    "name": "Artist name"
  }
]

get_collections() Iterable[dict][source]

Get the list of collections associated to the user on the server (Movies, Series, Channels etc.)

Returns:

[
  {
    "id": "Collection ID",
    "image": "Collection image (URL)",
    "name": "Collection name",
    "type": "Collection type (movies, music, series etc.)"
  }
]

search(limit: Optional[int] = 100, offset: int = 0, sort_desc: Optional[bool] = None, query: Optional[str] = None, collection: Optional[str] = None, parent_id: Optional[str] = None, has_subtitles: Optional[bool] = None, minimum_community_rating: Optional[int] = None, minimum_critic_rating: Optional[int] = None, is_played: Optional[bool] = None, is_favourite: Optional[bool] = None, is_liked: Optional[bool] = None, genres: Optional[Iterable[str]] = None, tags: Optional[Iterable[str]] = None, years: Optional[Iterable[int]] = None) Iterable[dict][source]

Perform a search on the server.

Parameters:
  • limit – Maximum number of items to return (default: 100).

  • offset – Return results starting from this (0-based) index (default: 0).

  • sort_desc – Return results in descending order if true, ascending if false.

  • query – Filter items by this term.

  • collection – ID/name of the collection to search (Movies, TV, Channels etc.)

  • parent_id – Filter items under the specified parent ID.

  • has_subtitles – Filter items with/without subtitles.

  • minimum_community_rating – Filter by minimum community rating.

  • minimum_critic_rating – Filter by minimum critic rating.

  • is_played – Return only played items (or unplayed if set to False).

  • is_liked – Return only liked items (or not liked if set to False).

  • is_favourite – Return only favourite items (or not favourite if set to False).

  • genres – Filter results by (a list of) genres.

  • tags – Filter results by (a list of) tags.

  • years – Filter results by (a list of) years.

Returns:

The list of matching results.

Schema for artists:
{
  "id": "Artist ID",
  "image": "Artist main image (URL)",
  "name": "Artist name"
}
Schema for collections:
{
  "id": "Collection ID",
  "image": "Collection image (URL)",
  "name": "Collection name",
  "type": "Collection type (movies, music, series etc.)"
}
Schema for movies:
{
  "community_rating": 18,
  "critic_rating": 55,
  "file": "string",
  "has_subtitles": true,
  "id": "string",
  "image": "https://example.org",
  "title": "string",
  "url": "https://example.org",
  "year": 11
}
Schema for episodes:
{
  "community_rating": 63,
  "critic_rating": 85,
  "file": "string",
  "has_subtitles": true,
  "id": "string",
  "image": "https://example.org",
  "title": "string",
  "url": "https://example.org",
  "year": 93
}