You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A URL that you can use to edit the clip's title, identify the part of the clip to publish, and publish the clip. `Learn More <https://help.twitch.tv/s/article/how-to-use-clips>`_
177
+
178
+
The URL is valid for up to 24 hours or until the clip is published, whichever comes first.
) ->CreatedClip: # TODO Test this with non broadcaster token
1241
1246
"""|coro|
1242
1247
@@ -1248,7 +1253,7 @@ async def create_clip(
1248
1253
This may occur if you begin capturing the clip near the beginning or end of the stream.
1249
1254
1250
1255
By default, Twitch publishes up to the last 30 seconds of the 90 seconds window and provides a default title for the clip.
1251
-
To specify the title and the portion of the 90 seconds window that's used for the clip, use the URL in the CreatedClip's ``edit_url`` attribute.
1256
+
You can now specify the title and the duration via this method, or specify the title and the portion of the 90 seconds window that's used for the clip by using the URL in the CreatedClip's ``edit_url`` attribute.
1252
1257
You can specify a clip that's from 5 seconds to 60 seconds in length. The URL is valid for up to 24 hours or until the clip is published, whichever comes first.
1253
1258
1254
1259
Creating a clip is an asynchronous process that can take a short amount of time to complete.
@@ -1258,23 +1263,38 @@ async def create_clip(
1258
1263
.. note::
1259
1264
Requires a user access token that includes the ``clips:edit`` scope.
1260
1265
1266
+
1267
+
.. warning::
1268
+
The `has_delay` argument has been removed by Twitch and no longer has any effect.
1269
+
It has been retained to avoid breaking changes for users who still have it set.
1270
+
1261
1271
Parameters
1262
1272
----------
1273
+
title: str | None
1274
+
The title of the clip.
1275
+
duration: float | None
1276
+
The length of the clip in seconds. Possible values range from 5 to 60 inclusively with a precision of 0.1. The default is 30
1263
1277
has_delay: bool
1264
-
A Boolean value that determines whether the API captures the clip at the moment the viewer requests it or after a delay.
1265
-
If False (default), Twitch captures the clip at the moment the viewer requests it (this is the same clip experience as the Twitch UX).
1266
-
If True, Twitch adds a delay before capturing the clip (this basically shifts the capture window to the right slightly).
1278
+
This has been been removed by Twitch and no longer has any effect.
1279
+
It has been retained to avoid breaking changes for users who still have it set.
1267
1280
token_for: str | PartialUser
1268
1281
User access token that includes the ``clips:edit`` scope.
1269
1282
1270
1283
Returns
1271
1284
-------
1272
1285
CreatedClip
1273
1286
The CreatedClip object.
1287
+
Raises
1288
+
------
1289
+
ValueError
1290
+
Clip duration must be between 5 and 60, with precision of 0.1
1274
1291
"""
1292
+
ifdurationisnotNoneandnot (5<=duration<=60):
1293
+
raiseValueError("Clip duration must be between 5 and 60, with precision of 0.1")
0 commit comments