Updated video shout out player for streamer bot!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this episode an updated video shout out that's both easier to implement and with additional functionality i've been able to have a preferred age of clip so you can see here he's picking up a random clip and it's within a certain page hello and welcome to stream robot bytes where i cover how to set up and to make the most of the awesome stream robot there is one video per topic to make it easy as possible to follow and find when relevant sample import code will be provided to make it even easier for you to get started and add functionality to your stream so let's get started with the topic for this video firstly we'll need to set up obs for the new video shout outs if you have this setup already there's actually no changes you need to do here you can use the same scene and source you had before but if you're new either use an existing scene or create a new scene so i'm using my alert scene which is nested into other scenes here we're going to create a source use the button here make it easier there we go and browser and we call this shout outs so it's worth what uh noting you need to take note of the scene and the source name do not select the logo file that needs to be blank the url needs to be about column blank the width is 800 as default but height needs to be reduced to 450 to match the size of the videos that are done through shout outs controlling audio by obs is probably a good option here and that's all we need to do to control the audio you may want to look at the audio mixer for this source and look at the advanced audio properties i'd recommend monitor only mute output and that means that both you and the stream should hear it you may want to mute it also as well so you can do that by muting that source too and that's it you've got the obs side set up configuring them the fail shout out you might want to change the wording but there's no other configuration you need there the video shout outs unlike before we don't need to go into the execute code for this to work we just need to set up the three options at the top here the first one being the the browser source and this is shout outs as we set up before in obs the scene it's not my scene it's alerts will be set up so we're going to put that in there so set that to alerts there the shout out file you can download this onto your computer and point it at that but the the easiest way to set that is to open up in a web browser from your local machine and copy what's in address bar it'll be file can slash and you'll see that format in the message here if you want to run it locally there's no reason to do so you can leave it there and so if there's any updates to that page you'll automatically get now them final option here this is new this is where you tell the bots the preferred maximum age of a clip so here it's 30 days so we ideally want to get a clip of the streamer we're shouting out that's how to clip within 30 days we can increase this or decrease this now if we decreased it say to one day and they've not streamed in that last day the bot's going to detect that but it's going to fall back and then try and just pick any clip so you want to be considerate of the age if it's a command just for shouting out raiders maybe a smaller number would be better for a raid shout out for example thank you for that and so it's going to edit the properties here the queue is blocking so that's a blocking queue which means if we do multiple shadow types it'll wait for one to finish before it does the next finally we need to set up a command and i'd call that command new so the action of course is going to be the video shout out and i'm going to limit that to moderators and now it's test so i'm going to use the command we set up uso i'm going to set the streamer i pick myself of course it's going to show the display picture for a second pull in a random clip [Music] i'm going to do another one afterwards as well you can see it's uh it's all plain clip for the length of the clip only it keeps it working for that duration so the shout out is recommended to be in a queue let's just run it like this for now see another clip and finally i'm going to go through the video shout outs and to explain what it's doing so we're setting globals for the shout out source in the browser and the scene this is an easy way so you can configure it here without having to change the code again doing the same for the shadow type file and the option of the number of days that we want to have the clips within first thing we're doing is we're getting the target information so this is getting information from twitch so we can get things like the display picture which we'll use if that's not retrieved correctly then we're going to fail because it's not going to be a case of this isn't a streamer and if the game is set it's unlikely it's a streamer as well we then pull in the custom shout out if the custom share type code isn't put in place then we send a message which is a typical shout out message which you can also customize finally we execute the code so this is the shop code again we don't need to do anything with apart from the default references it just works so what we're doing here is we're pulling in the variables that we've defined in the actions so the shout out scene the browser source and the shoutout file putting some details like a target user which is actually going to be the pull from the twitch get information from user and then we're going to do the clips within days this line isn't there and it won't be there when i do the final imports that's a something i left in by mistake we're going to create two dates and times so we're going to do the current time now and then the start date which is going to be now but we change the start date to be back in time by the number of days so we end up having two dates of the range that we want to so if you want to customize this further maybe you want to just get old clips you can look for clips maybe between 30 days and a year or is there any clips over a year old so what it does then once you've got the date range we're going to call the all the get clips for user and put it into the resultant all clips now we pass in the user name here the start date and the current date now we may put in a poor number so we don't actually have any clips returned we need to handle that so if the eclipse account of them is zero then we'll just do a standard get the clips and if after that we still get zero actually that streamer doesn't have any clips at all and then we need to fall back out we then pick a random number of between zero which is where the random clips um the all the clips numbers start on the list of them starts at zero and it picks up between that and the total number of clips and then we say the random clip is something for more clips from that random number which is injected in here [Music] we then set the arguments or the details we may need at some point now you can use these arguments within later functions if you want to do to extend on top of this so i've got broadcasted the title the url duration the user who created the clip the view count of the clip and the thumbnail url as well of the clip it's got a lot of information there's some additional parts here which um we may need to use in the future depending on if how twitch changes apis so that's there just in case we then are building up a url so the random clip embed url which is also in settings we we pull that in um sorry nope we get the random url yep so the the random clip.url we then start changing around for use later on now the video player file we've already defined that up top here from the global settings and then we add things like the user for the broadcaster name the image the target profile image url the video url and the thumbnail url as well the last thing we do is we need to work out the delay to pass along because the video player itself has an idea of the length of time but we can actually do some more fun things with um with knowing the timing and passing it on correctly so we create a delay start with the 700 which is uh the approximate time it takes for everything to start up and load in loading the clip and then we get the duration which is in seconds multiply it by 1000 to make it milliseconds so the delay is the amount of time that the web page needs to wait so what we can do is after that delay rather than showing the last screen of the video we can hide everything so it looks really clean we then push to obs go to this scene which is the browser for the shout out within um the source which is the actual browser source there lividio player file which we built up here then we wait for two two seconds above the time of that just to make sure there's no problems with loading and finishing and finally we set the browser source back to about blank and finished the function there which then completes the action please like and subscribe to be notified more videos like this if there's a topic you'd like covered please do let me know in the comments or on discord check out my twitch stream to see the bot in action and for other examples the links to my twitch social media and to stream about can be found at vrflab.com additional links to others that provide stream robot content can be also found in the description finally thank you nate for making a great box and please consider supporting his patreon which is linked from streamr dot bot
Info
Channel: VRFlad
Views: 9,314
Rating: undefined out of 5
Keywords: #StreamingTips, #StreamerBot, #OBS, #SLOBS, #twitch bot, #live streaming, #twitch
Id: dEHoDO2Z8bI
Channel Id: undefined
Length: 12min 31sec (751 seconds)
Published: Thu Jan 13 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.