SceneSwitcher icon indicating copy to clipboard operation
SceneSwitcher copied to clipboard

ADD Automatic Twitch GameName Changer

Open cyclemat opened this issue 3 years ago • 2 comments

is it possible to intigrate an function to set the Twitch game section automatic with the scene so when the scene change the game name change ?

i and many friends have on scene per game with backgrount for it so the desktop never show but is was cool when you change to a scene the gamename change on twitch

cyclemat avatar Oct 21 '21 18:10 cyclemat

Thanks for the suggestion! I will look into it.

As a note: It might be already possible using the "Run" action to run a curl command, but that will probably be rather complicated. https://discuss.dev.twitch.tv/t/using-curl-to-set-game-category-using-channel-update/25184/3

WarmUpTill avatar Oct 21 '21 21:10 WarmUpTill

have found a plugin that works but 10 moths not updated and its shows only like a poc no dock only a frame window and more problem here is he try to read the gamename but many games like beta games have other name in the programm title so you must give the game manually in

https://github.com/GhBogdan97/obs-twitch-category-manager

cyclemat avatar Oct 27 '21 14:10 cyclemat

yes pls!

markonop93 avatar Aug 10 '23 21:08 markonop93

I finally found some time to look into this. A build with the functionality to change the stream title and stream category can be found here: https://github.com/WarmUpTill/SceneSwitcher/actions/runs/5880188307?pr=823

Twitch

Unfortunately I ran into some linking issues on MacOS due to dependencies to OpenSSL and thus this functionality is not available for this version of the plugin for now.

Please let me know if this works as expected or if you are facing issues! And sorry for taking forever to get around to this!

WarmUpTill avatar Aug 16 '23 15:08 WarmUpTill

Thanks! Things I've noticed so far:

  • OBS Studio crashed the first time I tried to request a token and browser said it was redirecting me. I clicked the Account name and Token unenterable fields beforehand, which was the only difference to when it worked fine the 2nd time
  • categories load extremely slowly the 1st time OBS is launch, hanging OBS for 15-20 seconds
  • some categories like Duelyst II are missing https://www.twitch.tv/directory/game/Duelyst%20II
  • OBS crashed at least once when attempting to switch category (stream was offline)
  • Twtitch typo in action dropdown

No problems with setting the title I noticed. Too bad that the internal OBS widget doesn't refresh with these though as it's a bit cumbersome to test when offline.

Destroy666x avatar Aug 16 '23 18:08 Destroy666x

Actually, the Duelyst II category shows but couldn't be searched the 1st few times I tried. Now search started working. Or it didn't show before maybe, I don't know, I browsed once and didn't notice it on the list at least.

Destroy666x avatar Aug 16 '23 19:08 Destroy666x

Thanks a lot for your tests!

OBS Studio crashed the first time I tried to request a token and browser said it was redirecting me. I clicked the Account name and Token unenterable fields beforehand, which was the only difference to when it worked fine the 2nd time

OBS crashed at least once when attempting to switch category (stream was offline)

Can you please share the crash logs?

categories load extremely slowly the 1st time OBS is launch, hanging OBS for 15-20 seconds

Yeah there is not much I can do here unfortunately :( That is just how long it takes to fetch all of the games supported by Twitch. They are cached afterwards, which is why it only takes so long for the first time.

Twtitch typo in action dropdown

Cheers :)

WarmUpTill avatar Aug 16 '23 19:08 WarmUpTill

Can you please share the crash logs?

Which ones are these? If you mean OBS ->Help -> Crahs reports -> crashes folder, I don't see anything there, other than one very old file.

Yeah there is not much I can do here unfortunately :( That is just how long it takes to fetch all of the games supported by Twitch. They are cached afterwards, which is why it only takes so long for the first time.

I see, that's not great job by Twitch API then.

Destroy666x avatar Aug 16 '23 19:08 Destroy666x

Which ones are these? If you mean OBS ->Help -> Crahs reports -> crashes folder, I don't see anything there, other than one very old file.

Yeah correct. What exactly happened when OBS crashed? Did the program exit on its own? Did the window not react to inputs anymore?

I see, that's not great job by Twitch API then.

Not really their fault. There are just too many games :D Maybe I can add an option to only fetch the top 500 most played games instead of all of them to speed things up.

WarmUpTill avatar Aug 16 '23 19:08 WarmUpTill

What exactly happened when OBS crashed?

The window closed in the background and I had to relaunch it with "OBS is still running" popup displayed (but only the processes were running, UI wasn't in task bar/tray/anywhere).

For the token registration one, it also didn't register the token then. For the category one, it was changed. No crashes since then, let's see if it'll happen when live :P

Not really their fault. There are just too many games :D

I guess, but even for that big of data it's quite slow, I assume it loads also more data than the names? Is it this? https://dev.twitch.tv/docs/api/reference/#search-categories

Ah no, I see it's /helix/games/top, one of the files wasn't loaded in diff which I didn't notice. That's maybe also why Duelyst II wasn't available. And I guess these won't be either: https://discuss.dev.twitch.tv/t/is-it-possible-to-get-the-id-or-list-of-all-non-game-related-categories-created-by-twitch-just-chatting-art-etc/43321/3

Maybe I can add an option to only fetch the top 500 most played games instead of all of them to speed things up.

Or perhaps cross-session cache that you can manuall refresh could work.

Destroy666x avatar Aug 16 '23 19:08 Destroy666x

I reworked the category selection to support displaying a dialog which shows the current amount of categories fetched and offers the option to stop fetching more games.

A new build will be available here in a few minutes: https://github.com/WarmUpTill/SceneSwitcher/actions/runs/5907294035?pr=823

Let me know what you think!

WarmUpTill avatar Aug 18 '23 21:08 WarmUpTill

looks very good that is THE thing good work in the moment i didnt have time to stream so i had testet not in live mode but its looks very good !

cyclemat avatar Aug 18 '23 22:08 cyclemat

Nice much more clear/cleaner solution :)

The only bad thing now is that not all games are loaded. Again it missed Duelyst II when I tested few times. It appeared on 7th try, each time it fetched different number of games, which I guess is the problem (don't know if with the API or fetching algorithm).

Also, I livestreamed with previous version for few hours + 2 stream category change actions and had 0 crashes. So I guess they just happened at the start.

Destroy666x avatar Aug 19 '23 02:08 Destroy666x

Again it missed Duelyst II when I tested few times.

I think the problem is that categories with no viewers are not returned by the "Get Top Games" query, which is quite annoying. I will see if I can find a workround.

WarmUpTill avatar Aug 19 '23 17:08 WarmUpTill

I added a small search button to manually search for additional categories:

Capture

Couldn't really think of a better solution.

A build will be available here in a few minutes: https://github.com/WarmUpTill/SceneSwitcher/actions/runs/5951391271?pr=823

Let me know if you run into any issues! :)

WarmUpTill avatar Aug 23 '23 12:08 WarmUpTill

Something seems not right. I can't get search results to display. And search results number went down from 5 to 0 in a matter of minute of trying few times, for "just" keyword.

Unless it adds the found games to the list. But then no idea why it was like 5 -> 3 -> 1 -> 1 -> 0

Destroy666x avatar Aug 23 '23 15:08 Destroy666x

Unless it adds the found games to the list. But then no idea why it was like 5 -> 3 -> 1 -> 1 -> 0

That is indeed how it works. It simply adds the new categories to the list. I probably need to make that more clear.

The progress dialog only displays the number of new items inserted. So if you have already searched for a given term then it likely won't any new entries. (Unless the Twitch API would abort the previous search due to e.g. rate limiting)

WarmUpTill avatar Aug 23 '23 17:08 WarmUpTill

Ok, seems to work fine then from what I see, except some cases like mentioned 3 new reported results for the same search which got 5 items before.

Destroy666x avatar Aug 23 '23 18:08 Destroy666x

A new build, which displays another dialog when the search is done and informs that the new results were added to the list, can be found here in a few minutes: ~https://github.com/WarmUpTill/SceneSwitcher/actions/runs/5955422627~ https://github.com/WarmUpTill/SceneSwitcher/actions/runs/5955838687?pr=823

except some cases like mentioned 3 new reported results for the same search which got 5 items before.

I see that as well. To be honest I am not sure what is causing this. Maybe it is some race condition on my end that I simply have not found yet.

WarmUpTill avatar Aug 23 '23 19:08 WarmUpTill

Ah ok 👍

Destroy666x avatar Aug 23 '23 20:08 Destroy666x

except some cases like mentioned 3 new reported results for the same search which got 5 items before.

If I am not misinterpreting my test results, it seems like the /helix/search/categories Twitch API simply returns different results for the same query occasionally. The amount of items returned by the query seems to always stay the same, but order and sometimes the content seem to differ, which leads to the strange behaviour you observed.

So unfortunately there is not much that can be done about that besides searching for the same term multiple times.


If no other issues popped up on your end I will merge the changes to the main branch :)

WarmUpTill avatar Aug 25 '23 22:08 WarmUpTill

I now also added the option to start a commercial.

image

Unfortunately, I am not able to test it as I don't have access to a live partner or affiliate account on Twitch. Would you be able to test this, in case you have the option to do so?

Note that you will have to request a new token with the corresponding permission to start commercials.

A build with this feature is available here: https://github.com/WarmUpTill/SceneSwitcher/actions/runs/6064476012

WarmUpTill avatar Sep 06 '23 10:09 WarmUpTill

@WarmUpTill I see that was merged into master, if you could update https://github.com/WarmUpTill/SceneSwitcher/pull/855 with master changes then I'll gladly test!

Destroy666x avatar Sep 06 '23 13:09 Destroy666x

Thanks!

A rebased build of #855 will be available here in a few minutes: https://github.com/WarmUpTill/SceneSwitcher/actions/runs/6101694126?pr=855

WarmUpTill avatar Sep 06 '23 19:09 WarmUpTill

@WarmUpTill the duration is in mins, right? Could be labeled better is my small suggestion for now. I'll test if it works on tomorrow's stream

Destroy666x avatar Sep 06 '23 20:09 Destroy666x

the duration is in mins, right?

It is in seconds.

Could be labeled better is my small suggestion for now.

Yes, you are right.

WarmUpTill avatar Sep 07 '23 04:09 WarmUpTill

Seemed to work fine for me @WarmUpTill

Destroy666x avatar Sep 09 '23 02:09 Destroy666x

Great! Thanks a lot for your help in getting this tested!

WarmUpTill avatar Sep 09 '23 05:09 WarmUpTill