media.jellyfin#

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

Bases: Plugin

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: str | None = 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: int | None = 100, offset: int = 0, query: str | None = None, is_played: bool | None = None, is_favourite: bool | None = None, is_liked: bool | None = None, genres: Iterable[str] | None = None, tags: Iterable[str] | None = None, years: Iterable[int] | None = 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: int | None = 100, offset: int = 0, sort_desc: bool | None = None, query: str | None = None, collection: str | None = None, parent_id: str | None = None, has_subtitles: bool | None = None, minimum_community_rating: int | None = None, minimum_critic_rating: int | None = None, is_played: bool | None = None, is_favourite: bool | None = None, is_liked: bool | None = None, genres: Iterable[str] | None = None, tags: Iterable[str] | None = None, years: Iterable[int] | None = 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": 94,
  "critic_rating": 56,
  "file": "string",
  "has_subtitles": true,
  "id": "string",
  "image": "https://example.org",
  "title": "string",
  "url": "https://example.org",
  "year": 75
}
Schema for episodes:
{
  "community_rating": 22,
  "critic_rating": 86,
  "file": "string",
  "has_subtitles": true,
  "id": "string",
  "image": "https://example.org",
  "title": "string",
  "url": "https://example.org",
  "year": 93
}