Automated YouTube chat Browser source

jimpalompa

New Member
I'm looking for some sort of way to automatically update a Browser source URL whenever I start a new stream on YouTube. I can see that the built in YouTube chat dock in OBS automatically gets updated to the correct current chat url when a new stream is started.

Today I have to manually copy the current chat URL ("Copy current address" from the chat dock) and paste it into my Browser source, whenever I want to display my Browser source, that shows chat on my scenes.

Is there any way via a script to automatically update the Browser source URL from the chat dock, whenever the URL in the dock is changed?
 

Attachments

  • chat-dock.png
    chat-dock.png
    34.6 KB · Views: 502

ultra_artu

New Member
any updates on how the script works, recently looking into a way to update the url with my youtube chat since I multistream
 

jimpalompa

New Member
any updates on how the script works, recently looking into a way to update the url with my youtube chat since I multistream
Good timing, I've made an improved version of the script. I'm just waiting for it to be approved by the staff here.

In the meantime you can find it here, it's straight forward : ) Have fun!

 

ultra_artu

New Member
Good timing, I've made an improved version of the script. I'm just waiting for it to be approved by the staff here.

In the meantime you can find it here, it's straight forward : ) Have fun!

oh thx I mistaken this for OBS docks url updater since most software I've tested multi chat to display youtube chat on have a limited quota like streamer. bot
 

nimuewindthorn

New Member

Method 1: OBS Lua or Python Script to Change Browser Source​


OBS supports scripting with Lua and Python, and you can use these to update the URL of a Browser Source.


However, to do this automatically, you need to detect or fetch the current YouTube live chat URL. OBS does not provide direct access to the URL used in the dock, so this requires external logic.

Method 2: Use YouTube API to Detect Live Chat ID​


Here is a semi-automated solution using the YouTube Data API:


Step-by-step:​


  1. Get your API Key from Google Cloud Console.
  2. Use the API to:
    • Query your current active livestream.
    • Get the liveChatId for that stream.
  3. Construct the YouTube Live Chat URL like this:
    arduino
    CopyEdit
  4. Use an OBS script to update the Browser Source URL with this new chat URL.
 
Top