video_bot_999 / app.py

Commit History

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

df_summarise = generate_df_summarise(transcript)
62fea27

youngtsai commited on

html_content
b8bbc38

youngtsai commited on

print(html_content)
51478fd

youngtsai commited on

transcript_html
a41dfa9

youngtsai commited on

def get_screenshot_from_video(video_link, start_time):
a11ae70

youngtsai commited on

line = f"---- 時間: {start_time} ~ {end_time} ----\n{entry['text']}\n\n"
ae369e8

youngtsai commited on

def format_seconds_to_time(seconds):
e950bce

youngtsai commited on

formatted_transcript
938aee2

youngtsai commited on

gr.Markdown("## 這是什麼樣的資料?")
3e13a5c

youngtsai commited on

YouTubeTranscriptApi
b7fa139

youngtsai commited on

def process_youtube_link(link):
52d5702

youngtsai commited on

df_string = df_string.replace("@XX@", "|")
e8ac9fc

youngtsai commited on

"max_tokens": 4000,
bbc9832

youngtsai commited on

df_summarise = gr.Textbox(container=True, show_copy_button=True, label="資料本文", lines=40)
51d81e0

youngtsai commited on

df_string_output = gr.Textbox(container=True, show_copy_button=True, label="資料本文", lines=20)
4d9c54c

youngtsai commited on

user_content = f"請根據 {df_string},大概描述這張表的欄位敘述、資料樣態與資料分析,告訴老師這張表的意義,以及可能的結論與對應方式"
8b6845f

youngtsai commited on

def generate_df_summarise(df_string):
0da86f5

youngtsai commited on

def generate_df_summarise(df_string):
6777045

youngtsai commited on

gr.Markdown("## 常用問題")
61e0e54

youngtsai commited on

questions
9d0ff0e

youngtsai commited on

questions = json_response # 示例问题列表
45b848f

youngtsai commited on