Spaces:
Sleeping
Sleeping
def screenshot_youtube_video(youtube_id, snapshot_sec):
Browse files
app.py
CHANGED
|
@@ -216,6 +216,7 @@ def process_youtube_link(link):
|
|
| 216 |
|
| 217 |
formatted_transcript = []
|
| 218 |
screenshot_paths = []
|
|
|
|
| 219 |
for entry in transcript:
|
| 220 |
start_time = format_seconds_to_time(entry['start'])
|
| 221 |
end_time = format_seconds_to_time(entry['start'] + entry['duration'])
|
|
@@ -273,9 +274,7 @@ def download_youtube_video(youtube_id, output_path=OUTPUT_PATH):
|
|
| 273 |
print(f"Video downloaded successfully: {output_path}/{youtube_id}.mp4")
|
| 274 |
|
| 275 |
|
| 276 |
-
def screenshot_youtube_video(youtube_id, snapshot_sec):
|
| 277 |
-
# 先下載 video
|
| 278 |
-
download_youtube_video(youtube_id, output_path=OUTPUT_PATH)
|
| 279 |
# 这里假设视频已经在适当的位置
|
| 280 |
video_path = f'{OUTPUT_PATH}/{youtube_id}.mp4'
|
| 281 |
|
|
|
|
| 216 |
|
| 217 |
formatted_transcript = []
|
| 218 |
screenshot_paths = []
|
| 219 |
+
download_youtube_video(video_id, output_path=OUTPUT_PATH)
|
| 220 |
for entry in transcript:
|
| 221 |
start_time = format_seconds_to_time(entry['start'])
|
| 222 |
end_time = format_seconds_to_time(entry['start'] + entry['duration'])
|
|
|
|
| 274 |
print(f"Video downloaded successfully: {output_path}/{youtube_id}.mp4")
|
| 275 |
|
| 276 |
|
| 277 |
+
def screenshot_youtube_video(youtube_id, snapshot_sec):
|
|
|
|
|
|
|
| 278 |
# 这里假设视频已经在适当的位置
|
| 279 |
video_path = f'{OUTPUT_PATH}/{youtube_id}.mp4'
|
| 280 |
|