Get the YouTube Video ID on `urlfetch`

Greetings guys,

Really finding the Nightbot super useful, thank you for your hard work.

I build some custom commands using the urlfetch and I run it via different YouTube live stream videos.

I was wondering if there is a way (via the headers or elsewhere) to identify on which YouTube Video ID the Nightbot command has been running from?

This will help us make the command behave differently on each channel/video.

Many thanks,

Nightbot doesn’t know what video id it’s on, sorry. We only know the live chat id, but there’s no way to reverse look up a video from that id.

Nightbot doesn’t know what video id it’s on, sorry. We only know the live chat id, but there’s no way to reverse look up a video from that id.

Well, this is great news! knowing the live chat id is sufficient for us to distinguish each live stream the command is being sent from.

Is there a quick way for us to query the live chat id of a specific live stream we have?

This will help us create a basic logic:
if live chat id = X command was from live stream #1
if live chat id = Y command was from live stream #2

That’s all we need :slight_smile:

Please advise and thanks again for your great assistance.

Many thanks,

I added a variable for this: $(chatid)

It will fetch Nightbot’s internal chat id for the message being processed. For YouTube this happens to be the liveChatId. I make no guarantees this wont break or change in the future.

It will fetch Nightbot’s internal chat id for the message being processed. For YouTube this happens to be the liveChatId. I make no guarantees this wont break or change in the future.

Thanks so much @night !

That will help us a lot differentiating between several live streams in the same channel, I believe it could be a great asset for other channels too.

Hopefully YouTube won’t break it in the future, question is – do you have the intentions to remove it if it’ll still be available on YouTube?

Thanks again,

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.