Jellyfin Forum
Is it possible to inject search results via api? - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Development (https://forum.jellyfin.org/f-development)
+--- Forum: Server Development (https://forum.jellyfin.org/f-server-development)
+--- Thread: Is it possible to inject search results via api? (/t-is-it-possible-to-inject-search-results-via-api)



Is it possible to inject search results via api? - void - 2025-01-03

As the title says I was wondering if it would be possible to inject search results via an api or plugin. I checked swagger and it didn't seem to have anything related to what I'm looking for.

Ideally I would like to have the server ping an endpoint to receive a search result json and then display said json to the user. If the user selects the provided item perhaps send a POST back to the external endpoint or even run a local command/bash script.

Is such a thing possible and what files would I have to modify to achieve something like this; are there any plugins that have something similar already implemented? I am a dev and would be willing to write something like this with a bit of direction, thanks in advance.


RE: Is it possible to inject search results via api? - TheDreadPirate - 2025-01-03

What are you trying to do?


RE: Is it possible to inject search results via api? - void - 2025-01-03

I would like to display external results and download (and ideally begin streaming) when the user hits play.

I have written an app to download music from sources like youtube, soundcloud, bandcamp, etc and would like to be able to use the app to pad my rather small music library on jellyfin. When a user submits a search, say for 'Daft Punk', the results would first return local items and then external (or if not possible they would be merged into the local library categories artists, albums, etc displaying in order of whatever is most similar to the query). When an external item is clicked jellyfin would curl my app (or communicate in some other way) to begin downloading the file and then play the result.

Most of the processing would be done externally and perhaps once the user clicks play jellyfin would POST the server with the selection via curl and would be returned a file url or filepath. Please let me know if you would like a more indepth explanation.


RE: Is it possible to inject search results via api? - qwerty12 - 2025-01-04

I am not a developer, so I wouldn't be able to tell you if Jellyfin actually can do this natively, but my amateur suggestions:
  • the Meilisearch Plugin for Jellyfin plugin, which I have never used, talks a little about how it intercepts searches so that it can send them off to an external service: https://github.com/arnesacnussem/jellyfin-plugin-meilisearch?tab=readme-ov-file#how-it-works
    I would guess the ActionFilter it talks about could be used to determine accesses to items with fake IDs that your service may return... An obvious hack, the author seems to be rather forthcoming about the fact that their approach isn't guaranteed to continue working for future Jellyfin versions
  • The plugin mentioned above implements a client-agnostic approach, but if you just plan to search in the browser via Jellyfin's web interface, it may be an easier task to modify and build your own jellyfin-web to hit up your app in addition when searching

Again, just some ideas on how you could possibly get started, but I know nothing about Jellyfin so take those ideas with a healthy dose of scepticism.