]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
yt-wsp.sh : print help on empty args
authorGeorgi Gerganov <redacted>
Sat, 18 Feb 2023 07:42:31 +0000 (09:42 +0200)
committerGeorgi Gerganov <redacted>
Sat, 18 Feb 2023 07:42:31 +0000 (09:42 +0200)
examples/main/main.cpp
examples/yt-wsp.sh

index 5bd7e424c61c85e4514c475b895d7c18b8f5b3b5..b8366b79f4581cc474930a99080d562f4374eb75 100644 (file)
@@ -91,12 +91,12 @@ void whisper_print_usage(int argc, char ** argv, const whisper_params & params);
 bool whisper_params_parse(int argc, char ** argv, whisper_params & params) {
     for (int i = 1; i < argc; i++) {
         std::string arg = argv[i];
-           
+
         if (arg == "-"){
             params.fname_inp.push_back(arg);
             continue;
         }
-       
+
         if (arg[0] != '-') {
             params.fname_inp.push_back(arg);
             continue;
index 8b230833f200e1e940ee54061c7ecb55b6db6ca7..8e5bbcf5a00bef31d455084ab0908bec2dfcc3a6 100755 (executable)
@@ -67,23 +67,6 @@ msg() {
     echo >&2 -e "${1-}"
 }
 
-################################################################################
-# create a temporary directory to work in
-# set the temp_dir and temp_filename variables
-################################################################################
-temp_dir="$(mktemp -d ${SCRIPT_DIR}/tmp.XXXXXX)";
-temp_filename="${temp_dir}/yt-dlp-filename";
-
-################################################################################
-# for now we only take one argument
-# TODO: a for loop
-################################################################################
-source_url="${1}"
-
-
-title_name="";
-
-
 cleanup() {
     local -r clean_me="${1}";
 
@@ -145,6 +128,20 @@ fi
 
 check_requirements;
 
+################################################################################
+# create a temporary directory to work in
+# set the temp_dir and temp_filename variables
+################################################################################
+temp_dir="$(mktemp -d ${SCRIPT_DIR}/tmp.XXXXXX)";
+temp_filename="${temp_dir}/yt-dlp-filename";
+
+################################################################################
+# for now we only take one argument
+# TODO: a for loop
+################################################################################
+source_url="${1}"
+title_name="";
+
 msg "Downloading VOD...";
 
 ################################################################################
@@ -199,6 +196,6 @@ ffmpeg -i "${temp_dir}/${title_name}.vod.mp4" \
     -c:s mov_text \
     -y "${title_name}-res.mp4";
 
-cleanup "${temp_dir}";
+#cleanup "${temp_dir}";
 
 msg "Done! Your finished file is ready: ${title_name}-res.mp4";