erengy / anisthesia

Media detection library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Media detection over HTTP

erengy opened this issue · comments

Anisthesia currently has the following strategies for media detection:

  • open_files: Lists files opened by a media player process.
  • window_title: Reads the window title of a media player.
  • ui_automation: Reads the address bar and the tabs of a web browser.

These methods either do not work or are not reliable for some media players/servers such as Plex (erengy/taiga#115), Kodi (erengy/taiga#192), Emby (erengy/taiga#268, erengy/taiga#1007) and Jellyfin. In order to support them, we need to be able to work with HTTP APIs.

Here lies the problem. Quoting from erengy/taiga#115 (comment):

Anisthesia doesn't have the capabilities to communicate over HTTP, parse JSON/XML documents, etc. C++'s standard library doesn't come with those, embedding them into the library is a bad idea, and I'd rather avoid introducing third-party dependencies...

I see two options:

  1. Introduce dependencies to Anisthesia (e.g. hypr, json, pugixml)
  2. Offload implementation details to applications (e.g. Taiga)

Either way, adding Anisthesia to your project becomes more complicated. For the first option, you would need to compile the dependencies too. For the second option, you would be responsible for handling the HTTP requests, etc.

The first option is probably easier for me personally, since I'd just use the same libraries for both Anisthesia and Taiga. But I'm not sure which one would be the best choice overall.