From ffeac69b151a35033b5965297eec74b3e17b0f37 Mon Sep 17 00:00:00 2001 From: joncrall Date: Mon, 8 Jan 2024 01:19:53 -0500 Subject: [PATCH] Add identify method --- jellyfin_apiclient_python/api.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/jellyfin_apiclient_python/api.py b/jellyfin_apiclient_python/api.py index b003942..a44b11e 100644 --- a/jellyfin_apiclient_python/api.py +++ b/jellyfin_apiclient_python/api.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- +""" +For API info see: + https://api.jellyfin.org/ +""" from typing import List from datetime import datetime import requests @@ -853,6 +857,24 @@ def get_now_playing(self, session_id): now_playing['PlayState'] = play_state return now_playing + def identify(client, item_id, provider_ids): + """ + Remote search for item metadata given one or more provider id. + + This method requires the user have appropriate permissions + + Args: + item_id (str): item uuid to identify + + provider_ids (Dict): + maps providers to the content id. (E.g. {"Imdb": "tt1254207"}) + + References: + https://api.jellyfin.org/#tag/ItemLookup/operation/ApplySearchCriteria + """ + body = {'ProviderIds': provider_ids} + return client.jellyfin.items('/RemoteSearch/Apply/' + item_id, action='POST', params=None, json=body) + class API(InternalAPIMixin, BiggerAPIMixin, GranularAPIMixin, SyncPlayAPIMixin):