-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess
More file actions
executable file
·66 lines (53 loc) · 1.67 KB
/
process
File metadata and controls
executable file
·66 lines (53 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
# Function to display the help text
function display_help {
echo "Usage: $0 [options] youtube_url"
echo
echo "This script downloads a YouTube video, converts it to audio, transcribes it, chunks the transcription, and generates a summary."
echo
echo "Options:"
echo "--help Display this help text."
echo "--stop-download Stop after downloading the video."
echo "--stop-conversion Stop after converting the video to audio."
echo "--stop-transcribe Stop after transcribing the audio."
echo "--stop-chunk Stop after chunking the transcription."
}
# Check if no arguments or the --help option was provided
if [ $# -eq 0 ] || [ $1 = "--help" ]; then
display_help
exit 0
fi
# Define the YouTube URL
url=$1
# Run the download script
python3 ytget.py "$url"
# Check if the download was successful
if [ $? -ne 0 ] || [ "$2" = "--stop-download" ]; then
exit $?
fi
# Run the conversion script
bash v2a.sh
# Check if the conversion was successful
if [ $? -ne 0 ] || [ "$2" = "--stop-conversion" ]; then
exit $?
fi
# Run the transcription script and redirect the output to a file
python3 transcribe.py > transcription.txt
rm output.mp3
# Check if the transcription was successful
if [ $? -ne 0 ] || [ "$2" = "--stop-transcribe" ]; then
exit $?
fi
# Run the chunking script with the transcription as input
python3 chnk.py transcription.txt
# Check if the chunking was successful
if [ $? -ne 0 ] || [ "$2" = "--stop-chunk" ]; then
exit $?
fi
# Run the summarization script
python3 summarize.py
# Check if the summarization was successful
if [ $? -ne 0 ]; then
echo "Error during summarization. Exiting."
exit 1
fi