Spaces:
Sleeping
Sleeping
print("===更新逐字稿文件===")
Browse files
app.py
CHANGED
@@ -105,8 +105,7 @@ def upload_file_to_gcs_with_json_string(gcs_client, bucket_name, destination_blo
|
|
105 |
bucket = gcs_client.bucket(bucket_name)
|
106 |
blob = bucket.blob(destination_blob_name)
|
107 |
blob.upload_from_string(json_string)
|
108 |
-
print(f"JSON string uploaded to {destination_blob_name} in GCS.")
|
109 |
-
|
110 |
|
111 |
def download_blob_to_string(gcs_client, bucket_name, source_blob_name):
|
112 |
"""从 GCS 下载文件内容到字符串"""
|
@@ -456,6 +455,9 @@ def process_transcript_and_screenshots_on_gcs(video_id):
|
|
456 |
print(f"截图已上传到GCS: {img_file_id}")
|
457 |
|
458 |
# 更新逐字稿文件
|
|
|
|
|
|
|
459 |
updated_transcript_text = json.dumps(transcript, ensure_ascii=False, indent=2)
|
460 |
upload_file_to_gcs_with_json_string(gcs_client, bucket_name, transcript_blob_name, updated_transcript_text)
|
461 |
print("逐字稿已更新,包括截图链接")
|
|
|
105 |
bucket = gcs_client.bucket(bucket_name)
|
106 |
blob = bucket.blob(destination_blob_name)
|
107 |
blob.upload_from_string(json_string)
|
108 |
+
print(f"JSON string uploaded to {destination_blob_name} in GCS.")
|
|
|
109 |
|
110 |
def download_blob_to_string(gcs_client, bucket_name, source_blob_name):
|
111 |
"""从 GCS 下载文件内容到字符串"""
|
|
|
455 |
print(f"截图已上传到GCS: {img_file_id}")
|
456 |
|
457 |
# 更新逐字稿文件
|
458 |
+
print("===更新逐字稿文件===")
|
459 |
+
print(transcript)
|
460 |
+
print("===更新逐字稿文件===")
|
461 |
updated_transcript_text = json.dumps(transcript, ensure_ascii=False, indent=2)
|
462 |
upload_file_to_gcs_with_json_string(gcs_client, bucket_name, transcript_blob_name, updated_transcript_text)
|
463 |
print("逐字稿已更新,包括截图链接")
|