Spaces:
Running
Running
yt-wsp.sh : print help on empty args
Browse files- examples/main/main.cpp +2 -2
- examples/yt-wsp.sh +15 -18
examples/main/main.cpp
CHANGED
|
@@ -91,12 +91,12 @@ void whisper_print_usage(int argc, char ** argv, const whisper_params & params);
|
|
| 91 |
bool whisper_params_parse(int argc, char ** argv, whisper_params & params) {
|
| 92 |
for (int i = 1; i < argc; i++) {
|
| 93 |
std::string arg = argv[i];
|
| 94 |
-
|
| 95 |
if (arg == "-"){
|
| 96 |
params.fname_inp.push_back(arg);
|
| 97 |
continue;
|
| 98 |
}
|
| 99 |
-
|
| 100 |
if (arg[0] != '-') {
|
| 101 |
params.fname_inp.push_back(arg);
|
| 102 |
continue;
|
|
|
|
| 91 |
bool whisper_params_parse(int argc, char ** argv, whisper_params & params) {
|
| 92 |
for (int i = 1; i < argc; i++) {
|
| 93 |
std::string arg = argv[i];
|
| 94 |
+
|
| 95 |
if (arg == "-"){
|
| 96 |
params.fname_inp.push_back(arg);
|
| 97 |
continue;
|
| 98 |
}
|
| 99 |
+
|
| 100 |
if (arg[0] != '-') {
|
| 101 |
params.fname_inp.push_back(arg);
|
| 102 |
continue;
|
examples/yt-wsp.sh
CHANGED
|
@@ -67,23 +67,6 @@ msg() {
|
|
| 67 |
echo >&2 -e "${1-}"
|
| 68 |
}
|
| 69 |
|
| 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 |
-
|
| 87 |
cleanup() {
|
| 88 |
local -r clean_me="${1}";
|
| 89 |
|
|
@@ -145,6 +128,20 @@ fi
|
|
| 145 |
|
| 146 |
check_requirements;
|
| 147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
msg "Downloading VOD...";
|
| 149 |
|
| 150 |
################################################################################
|
|
@@ -199,6 +196,6 @@ ffmpeg -i "${temp_dir}/${title_name}.vod.mp4" \
|
|
| 199 |
-c:s mov_text \
|
| 200 |
-y "${title_name}-res.mp4";
|
| 201 |
|
| 202 |
-
cleanup "${temp_dir}";
|
| 203 |
|
| 204 |
msg "Done! Your finished file is ready: ${title_name}-res.mp4";
|
|
|
|
| 67 |
echo >&2 -e "${1-}"
|
| 68 |
}
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
cleanup() {
|
| 71 |
local -r clean_me="${1}";
|
| 72 |
|
|
|
|
| 128 |
|
| 129 |
check_requirements;
|
| 130 |
|
| 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 |
+
|
| 145 |
msg "Downloading VOD...";
|
| 146 |
|
| 147 |
################################################################################
|
|
|
|
| 196 |
-c:s mov_text \
|
| 197 |
-y "${title_name}-res.mp4";
|
| 198 |
|
| 199 |
+
#cleanup "${temp_dir}";
|
| 200 |
|
| 201 |
msg "Done! Your finished file is ready: ${title_name}-res.mp4";
|