Alright hey everyone, today I am going to teach you how to find out if you are live on youtube or not. Now twitch has an api for this and so does google! Lets get into it!
First you are going to need to go to https://console.developers.google.com/cloud-resource-manager if it asks you to login, login to your google account.
Once you are on the website you are going to click “Create Project”
Once you have clicked on it name the project whatever you want.
Then click create!
Now go to https://console.developers.google.com/projectselector/apis/credentials?supportedpurview=project
Once there click “Select” and select the project you made.
Then it should bring you here.
Click create credentials and click API key. This will create a api key exclusive to that project.
It should bring you to something like this:
Copy the id and click “Close”.
Now head to https://console.developers.google.com/apis/library/youtube.googleapis.com/?project=[project name here] (enter the project name where it says “Project Name Here”) and click “Enable”! This will enable the youtube api!
Now get the channel id of the channel you want to check. Example: UCrZeCW9AijCnCEAaXMlTiTA
To find the id look in the url on the channel page. Example: youtube.com/channel/UCrZeCW9AijCnCEAaXMlTiTA ←
Now to create the link take this url: https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=[Channel’s Id Here]&type=video&eventType=live&key=[Key Here!]
And where it says “Channel’s Id Here” put the channel id there and remove the brackets. Where it says “[Key Here!]” put the api key you copied there and remove the brackets. Your url should end up something like this: https://www.googleapis.com/youtube/v3/search?part=snippet&channelId=UCrZeCW9AijCnCEAaXMlTiTA&type=video&eventType=live&key=AIzaSyDSXwBazcctYf-FLQIcL72jGmEzeBkISu4! Now make a script (MAKE SURE HTTPSERVICE IS ENABLED!!) and put this in it!
while wait(15) do
local String = game:GetService("HttpService"):GetAsync("URL HERE") -- Returns a string.
if string.find(String,"id") then -- When you are not streaming there will be no "id" in the string.
game.ServerStorage.YoutubeLive.Value = true -- Make a value in server storage, you can check from the client or something to show guis etc.
else
game.ServerStorage.YoutubeLive.Value = false
end
end
And thats it! Everything should work!
If it does not message me here on the fourms and I will try and help you!
- I understood everything!
- I wish there could be some more explaining…
- I did not get this at all.
0 voters