New Twitch Clip Created Alert


#1

it would be cool (at least for me) if it was possible make bot alert that someone just created a new clip of my stream, even better if it could also automatically give the link to it.


#2

#3

oops sorry didn’t find it by myself :sweat_smile: btw thank you!


#4

Sure, we can only capture what is in chat though. We need to look more at the Twitch API for clips, but, generally it doesn’t provide every clip for a channel, just the trending and most popular. This would miss any brand new clips unless they get enough views to bubble up over your other popular clips which wouldn’t capture every time someone created a clip.


#5

So, I ran a test against the Twitch Clips API, and yes, it will return, in order of popularity, clips for a channel, and a maximum of 100 clips. Any clips not in the top 100 would never make the list it seems, unless they bubble up over others. So, this would not be able to capture every single new clip that someone makes, unfortunately.


#6

This will be in our next release.


#7

I know this is off topic a bit but i have seen this bit of code about its python but i think it will create a clip from a command maybe it can be converted to be used in phantom

def GetClip(data):
	headers = {
		"Authorization": "Bearer {}".format(ScriptSettings.oAuthToken[6:])
	}
	reply = json.loads(Parent.GetRequest("https://api.twitch.tv/helix/users", headers))
	if reply['status'] == 200:
		jsonToPython = json.loads(reply['response'])
		reply = json.loads(Parent.PostRequest("https://api.twitch.tv/helix/clips?broadcaster_id={0}".format(jsonToPython['data'][0]['id']), headers, {}, True))
		if reply["status"] == 202 :
			resp = json.loads(reply["response"])
			return resp["data"][0]["edit_url"][:-5]
		else:
			return ScriptSettings.ReponseApiError.format(data.User, ScriptSettings.Command)
	else:
		return ScriptSettings.ReponseClientIDError.format(data.User, ScriptSettings.Command)

#8

Helix (which we are not supporting yet) will support clip creation. We will not be looking to support Helix until mid-year. Why? Twitch still doesn’t support a majority of the API endpoints that Kraken does and changes are being made to Helix on an ongoing basis.


#9

Additionally, as of right now, there is not a way to know when any clips are created for a channel. There is a /clip/ endpoint for getting data about a specific clip, but nothing to track clips for a channel. There was supposed to be a WebHook but that was pulled from the Twitch Trello fairly early on – also, WebHooks probably would not work for a number of our users.