Spaces:
Sleeping
Sleeping
is_transcript_exists
Browse files
app.py
CHANGED
@@ -434,8 +434,8 @@ def process_transcript_and_screenshots_on_gcs(video_id):
|
|
434 |
transcript_file_name = f'{video_id}_transcript.json'
|
435 |
transcript_blob_name = f"{video_id}/{transcript_file_name}"
|
436 |
# 检查逐字稿是否存在
|
437 |
-
|
438 |
-
if not
|
439 |
# 从YouTube获取逐字稿并上传
|
440 |
transcript = get_transcript(video_id)
|
441 |
transcript_text = json.dumps(transcript, ensure_ascii=False, indent=2)
|
|
|
434 |
transcript_file_name = f'{video_id}_transcript.json'
|
435 |
transcript_blob_name = f"{video_id}/{transcript_file_name}"
|
436 |
# 检查逐字稿是否存在
|
437 |
+
is_transcript_exists = gcs_check_file_exists(gcs_client, bucket_name, transcript_blob_name)
|
438 |
+
if not is_transcript_exists:
|
439 |
# 从YouTube获取逐字稿并上传
|
440 |
transcript = get_transcript(video_id)
|
441 |
transcript_text = json.dumps(transcript, ensure_ascii=False, indent=2)
|