video_bot_999 / app.py

Commit History

screenshot_path = f"https://lh3.googleusercontent.com/d/{img_file_id}=s4000"
d52b5e8

youngtsai commited on

screenshot_path
1fe1616

youngtsai commited on

print("=== 更新投影片 ===")
5d4794c

youngtsai commited on

with gr.Tab("截圖與逐字稿"):
697d377

youngtsai commited on

CURRENT_INDEX
e1d77be

youngtsai commited on

prev_button.click(fn=prev_slide, inputs=[], outputs=[image, text])
6afedbf

youngtsai commited on

current_index = 0
2efd672

youngtsai commited on

TRASCRIPTS = []
b5201dc

youngtsai commited on

html_content_container
123a4b1

youngtsai commited on

def format_transcript_to_html(formatted_transcript):
d230f8b

youngtsai commited on

from youtube_transcript_api._errors import NoTranscriptFound
d363c44

youngtsai commited on

你是一個擅長資料分析跟影片教學的老師
c7454f7

youngtsai commited on

df_string_output = json.dumps(transcript, ensure_ascii=False, indent=2)
a9eaf66

youngtsai commited on

screenshot_path = f"https://drive.google.com/thumbnail?id={img_file_id}&sz=s4000"
ae88c8d

youngtsai commited on

img_src = f"https://drive.google.com/thumbnail?id={img_file_id}&sz=s4000"
5408edf

youngtsai commited on

screenshot_path = screenshot_youtube_video(video_id, entry['start'])
d346e8c

youngtsai commited on

print("====process_transcript_and_screenshots====")
6d95426

youngtsai commited on

set_public_permission
9abfccc

youngtsai commited on

def process_transcript_and_screenshots(video_id):
d22eec5

youngtsai commited on

transcript = process_transcript_and_screenshots(video_id)
f99c291

youngtsai commited on

def screenshot_youtube_video(youtube_id, snapshot_sec):
c05c5f9

youngtsai commited on

upload_img_directly(service, file_name, folder_id, screenshot_path)
a028c47

youngtsai commited on

from googleapiclient.http import MediaIoBaseDownload
a69bace

youngtsai commited on

print("逐字稿已存在于Google Drive中")
a48473e

youngtsai commited on

transcript_text = json.dumps(transcript, ensure_ascii=False, indent=2)
474b2c8

youngtsai commited on

upload_content_directly
1ae05ec

youngtsai commited on

def upload_to_drive(service, file_name, folder_id, content):
02dd3ba

youngtsai commited on

def upload_to_drive(service, file_name, folder_id, content):
2fd09c9

youngtsai commited on

检查是否存在特定名称的文件夹,如果不存在则创建
66d6a91

youngtsai commited on

folder_id = create_folder_if_not_exists(service, video_id, parent_folder_id)
7ed5900

youngtsai commited on

check_file_exists
a931b41

youngtsai commited on

extract_youtube_id
cf25313

youngtsai commited on

from_service_account_info
fda35a7

youngtsai commited on

print("=====Google Drive 上的前10個文件=====")
e9909ed

youngtsai commited on

demo.launch(allowed_paths=["videos"])
4610447

youngtsai commited on

demo.launch(allowed_paths=["../videos"])
c275e05

youngtsai commited on

screenshot_paths
b6d28cd

youngtsai commited on

screenshot_path = f'{OUTPUT_PATH}/{youtube_id}_{snapshot_sec}.jpg'
db681b1

youngtsai commited on

html_content += f"<img src='{entry['screenshot_path']}' width='500px' />"
6a6dfe0

youngtsai commited on

html_content += f"<p>{entry['time_sec']} </p> <br><br>"
3c4e755

youngtsai commited on

html_content = format_transcript_to_html(formatted_transcript)
a6ad75a

youngtsai commited on