File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -249,6 +249,30 @@ def get_transcript_text(
249
249
)
250
250
return self .transcript_text
251
251
252
+ def generate_transcript (
253
+ self ,
254
+ force : bool = None ,
255
+ ) -> str :
256
+ """Generate transcript for the video.
257
+
258
+ :param bool force: Force generate new transcript
259
+ :return: Full transcript text as string
260
+ :rtype: str
261
+ """
262
+ transcript_data = self ._connection .post (
263
+ path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .transcription } " ,
264
+ data = {
265
+ "force" : True if force else False ,
266
+ },
267
+ )
268
+ transcript = transcript_data .get ("word_timestamps" , [])
269
+ if transcript :
270
+ return {
271
+ "success" : True ,
272
+ "message" : "Transcript generated successfully" ,
273
+ }
274
+ return transcript_data
275
+
252
276
def translate_transcript (
253
277
self ,
254
278
language : str ,
You can’t perform that action at this time.
0 commit comments