@@ -161,22 +161,6 @@ def index_spoken_words(
161
161
show_progress = True ,
162
162
)
163
163
164
- def index_scenes (
165
- self ,
166
- force : bool = False ,
167
- prompt : str = None ,
168
- callback_url : str = None ,
169
- ) -> None :
170
- self ._connection .post (
171
- path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .index } " ,
172
- data = {
173
- "index_type" : IndexType .scene ,
174
- "force" : force ,
175
- "prompt" : prompt ,
176
- "callback_url" : callback_url ,
177
- },
178
- )
179
-
180
164
def get_scenes (self ) -> Union [list , None ]:
181
165
if self .scenes :
182
166
return self .scenes
@@ -216,7 +200,7 @@ def _format_scene_collection(self, collection_data: dict) -> SceneCollection:
216
200
217
201
return SceneCollection (
218
202
self ._connection ,
219
- collection_data .get ("scenes_collection_id " ),
203
+ collection_data .get ("scene_collection_id " ),
220
204
self .id ,
221
205
collection_data .get ("config" , {}),
222
206
scenes ,
@@ -232,36 +216,36 @@ def extract_scenes(
232
216
scenes_data = self ._connection .post (
233
217
path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .scenes } " ,
234
218
data = {
235
- "index_type" : IndexType .scene ,
236
219
"extraction_type" : extraction_type ,
237
220
"extraction_config" : extraction_config ,
238
221
"force" : force ,
239
222
"callback_url" : callback_url ,
240
223
},
241
224
)
242
- return self ._format_scene_collection (scenes_data .get ("scenes_collection " ))
225
+ return self ._format_scene_collection (scenes_data .get ("scene_collection " ))
243
226
244
227
def get_scene_collection (self , collection_id : str ):
245
228
scenes_data = self ._connection .get (
246
229
path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .scenes } /{ collection_id } "
247
230
)
248
- return self ._format_scene_collection (scenes_data .get ("scenes_collection " ))
231
+ return self ._format_scene_collection (scenes_data .get ("scene_collection " ))
249
232
250
233
def get_scene_collections (self ):
251
234
scene_collections_data = self ._connection .get (
252
235
path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .scenes } "
253
236
)
254
- return scene_collections_data .get ("scenes_collections " , [])
237
+ return scene_collections_data .get ("scene_collections " , [])
255
238
256
239
def delete_scene_collection (self , collection_id : str ) -> None :
257
240
self ._connection .delete (
258
241
path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .scenes } /{ collection_id } "
259
242
)
260
243
261
- def create_scene_index (
244
+ def index_scenes (
262
245
self ,
263
246
extraction_type : SceneExtractionType = SceneExtractionType .scene ,
264
247
extraction_config : dict = {},
248
+ prompt : str = None ,
265
249
scenes : List [Scene ] = [],
266
250
force : bool = False ,
267
251
callback_url : str = None ,
@@ -272,6 +256,7 @@ def create_scene_index(
272
256
"scenes" : [scene .to_json () for scene in scenes ],
273
257
"extraction_type" : extraction_type ,
274
258
"extraction_config" : extraction_config ,
259
+ "prompt" : prompt ,
275
260
"force" : force ,
276
261
"callback_url" : callback_url ,
277
262
},
@@ -291,20 +276,11 @@ def get_scene_index(self, scene_index_id: str) -> Scene:
291
276
)
292
277
return index_data .get ("scene_index_records" , [])
293
278
294
- def delete_index (self , scene_index_id : str ) -> None :
279
+ def delete_scene_index (self , scene_index_id : str ) -> None :
295
280
self ._connection .delete (
296
281
path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .index } /{ ApiPath .scene } /{ scene_index_id } "
297
282
)
298
283
299
- def delete_scene_index (self ) -> None :
300
- self ._connection .post (
301
- path = f"{ ApiPath .video } /{ self .id } /{ ApiPath .index } /{ ApiPath .delete } " ,
302
- data = {
303
- "index_type" : IndexType .scene ,
304
- },
305
- )
306
- self .scenes = None
307
-
308
284
def add_subtitle (self , style : SubtitleStyle = SubtitleStyle ()) -> str :
309
285
if not isinstance (style , SubtitleStyle ):
310
286
raise ValueError ("style must be of type SubtitleStyle" )
0 commit comments