Skip to content

Commit f254e78

Browse files
committed
yt-wsp.sh : print help on empty args
1 parent a94897b commit f254e78

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

examples/main/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ void whisper_print_usage(int argc, char ** argv, const whisper_params & params);
9191
bool whisper_params_parse(int argc, char ** argv, whisper_params & params) {
9292
for (int i = 1; i < argc; i++) {
9393
std::string arg = argv[i];
94-
94+
9595
if (arg == "-"){
9696
params.fname_inp.push_back(arg);
9797
continue;
9898
}
99-
99+
100100
if (arg[0] != '-') {
101101
params.fname_inp.push_back(arg);
102102
continue;

examples/yt-wsp.sh

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,6 @@ msg() {
6767
echo >&2 -e "${1-}"
6868
}
6969

70-
################################################################################
71-
# create a temporary directory to work in
72-
# set the temp_dir and temp_filename variables
73-
################################################################################
74-
temp_dir="$(mktemp -d ${SCRIPT_DIR}/tmp.XXXXXX)";
75-
temp_filename="${temp_dir}/yt-dlp-filename";
76-
77-
################################################################################
78-
# for now we only take one argument
79-
# TODO: a for loop
80-
################################################################################
81-
source_url="${1}"
82-
83-
84-
title_name="";
85-
86-
8770
cleanup() {
8871
local -r clean_me="${1}";
8972

@@ -145,6 +128,20 @@ fi
145128

146129
check_requirements;
147130

131+
################################################################################
132+
# create a temporary directory to work in
133+
# set the temp_dir and temp_filename variables
134+
################################################################################
135+
temp_dir="$(mktemp -d ${SCRIPT_DIR}/tmp.XXXXXX)";
136+
temp_filename="${temp_dir}/yt-dlp-filename";
137+
138+
################################################################################
139+
# for now we only take one argument
140+
# TODO: a for loop
141+
################################################################################
142+
source_url="${1}"
143+
title_name="";
144+
148145
msg "Downloading VOD...";
149146

150147
################################################################################
@@ -199,6 +196,6 @@ ffmpeg -i "${temp_dir}/${title_name}.vod.mp4" \
199196
-c:s mov_text \
200197
-y "${title_name}-res.mp4";
201198

202-
cleanup "${temp_dir}";
199+
#cleanup "${temp_dir}";
203200

204201
msg "Done! Your finished file is ready: ${title_name}-res.mp4";

0 commit comments

Comments
 (0)