-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.py
24 lines (20 loc) · 832 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
from transcribe import get_transcript, get_video_id
from summarize import summarize_transcript
from pine import generate_pine_script
def process_video_to_pine_script(youtube_url):
video_id = get_video_id(youtube_url)
transcript_file = get_transcript(video_id)
transcript = ''.join([entry['text'] + "\n" for entry in transcript_file])
print(transcript)
summary_file = summarize_transcript(transcript)
print(summary_file)
pine_script_file = generate_pine_script(summary_file)
return pine_script_file
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python3 main.py <youtube_video_url>")
sys.exit(1)
youtube_url = sys.argv[1]
pine_script_file = process_video_to_pine_script(youtube_url)
print(f"Pine script generated: {pine_script_file}")