-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfast_start.sh
More file actions
88 lines (78 loc) · 2.28 KB
/
fast_start.sh
File metadata and controls
88 lines (78 loc) · 2.28 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
# fast_start.sh - A more efficient way to use the YouTube QA Bot
# Display help message
show_help() {
echo "YouTube QA Bot - Fast Start Helper"
echo ""
echo "Usage:"
echo " ./fast_start.sh [command] [arguments]"
echo ""
echo "Commands:"
echo " download URL [--tags tag1,tag2] Download a video for later processing"
echo " batch FILE [--tags tag1,tag2] Download videos from a file containing URLs"
echo " process [--all | --video-id ID] Process downloaded videos"
echo " list List videos in the database"
echo " delete VIDEO_ID Delete a video from the database"
echo " query \"Your question\" Ask a question about your videos"
echo " help Show this help message"
echo ""
echo "Examples:"
echo " ./fast_start.sh download https://www.youtube.com/watch?v=VIDEO_ID --tags ml,tutorial"
echo " ./fast_start.sh batch videos.txt"
echo " ./fast_start.sh process --all"
echo " ./fast_start.sh query \"What is explained in these videos?\""
}
# Check if at least one argument was provided
if [ $# -lt 1 ]; then
show_help
exit 1
fi
# Process command
COMMAND=$1
shift
case $COMMAND in
download)
if [ $# -lt 1 ]; then
echo "Error: URL required"
exit 1
fi
URL=$1
shift
python fast_download.py "$URL" $@
;;
batch)
if [ $# -lt 1 ]; then
echo "Error: File required"
exit 1
fi
FILE=$1
shift
python fast_download.py "$FILE" --batch $@
;;
process)
python process_later.py $@
;;
list)
python youtube_qa_app.py list --fast
;;
delete)
if [ $# -lt 1 ]; then
echo "Error: VIDEO_ID required"
exit 1
fi
VIDEO_ID=$1
python youtube_qa_app.py delete --video-id "$VIDEO_ID" --fast
;;
query)
if [ $# -lt 1 ]; then
echo "Error: Query string required"
exit 1
fi
QUERY=$1
shift
python youtube_qa_app.py query "$QUERY" $@
;;
help|*)
show_help
;;
esac