occ-ai / obs-urlsource

OBS plugin to fetch data from a URL or file, connect to an API or AI service, parse responses and display text, image or audio on scene
https://obsproject.com/forum/resources/url-api-source-fetch-live-data-and-display-it-on-screen.1756/
GNU General Public License v2.0
130 stars 18 forks source link

Output to multiple sources #80

Closed benwa closed 2 months ago

benwa commented 3 months ago

I would like to pull one API request, and output different values to different text, image, and other sources. Alternatively, an option to cache results if the data source is the same for multiple urlsource entries, so I don't make multiple API calls.

royshil commented 3 months ago

There is a "Skip Same" option for the input to skip if the input is similar, but this is mostly for text input

Output to multiple sources is sort of difficult to implement, because it needs a complicated UI with a lot of selection dropdown etc.

What are you trying to do? maybe there's a simpler way?

benwa commented 3 months ago

My example is displaying D&D data from an API for a character and displaying it in different locations on the screen.

royshil commented 3 months ago

@benwa thats a great use case... have you thought about using an HTML overlay? it is possible to use javascript to extract the API data and populate an HTML page you bring up with a browser source

won't be as easy as dragging OBS sources, but it's a solution

benwa commented 3 months ago

I've tried for a bit to do just that, but the page is dynamically created with JS, not with static HTML DOM.

I'm not seeing the "Skip Similar" option, however.

royshil commented 3 months ago

Well... Another option is to use OCR on the browser source after all the data is loaded.

There's not a lot you can do if the website / service doesnt provide a proper API. Everything is going to be a hack. Many websites actually go to lengths to prevent people from scraping their data.

benwa commented 3 months ago

Now that's a good idea. And I see that you made that plug-in too! You're amazing! I'll try it out when I have some time soon.

royshil commented 2 months ago

91

royshil commented 2 months ago

@benwa please help test https://github.com/occ-ai/obs-urlsource/releases/tag/0.3.0-rc1 with multiple outputs 🙏

royshil commented 2 months ago

implemented and released