Add a script that removes audio from a video

This commit is contained in:
2023-03-16 12:59:23 -04:00
parent 08a26b6716
commit 4464e4f681
8 changed files with 77 additions and 32 deletions

44
aliases
View File

@@ -36,11 +36,6 @@ error() {
printf "${BOLD}${RED}$1${NORMAL}\n"
}
abort() {
error "\nAborting..."
exit 1
}
reload() {
test -f ~/.env.loader && . ~/.env.loader
}
@@ -217,7 +212,7 @@ check_signature() {
local sig_file="$4"
if [[ $hashes_file == "" || $pem_file == "" || $sig_file == "" ]]; then
error "Format: $0 <hashes file (e.g. sha512 hashes)> <pem file> <sig file>\n"
error "Usage: $0 <hashes file (e.g. sha512 hashes)> <pem file> <sig file>"
return
fi
@@ -342,7 +337,7 @@ make_vid_dir_and_cd_into() {
error=$?
if [[ ! $error -eq 0 ]]; then
error "Error: failed to create directory. Aborting.\n"
error "Error: failed to create directory. Aborting."
return 1
fi
@@ -359,7 +354,7 @@ download_youtube_vid() {
local opts="$@"
if [[ $url == "" ]]; then
error "Format: $0 <make folder?> <url> <optional args>\n"
error "Usage: $0 <make folder?> <url> <optional args>"
return
fi
@@ -405,7 +400,7 @@ download_youtube_vid_and_hflip() {
local opts="$@"
if [[ $url == "" ]]; then
error "Format: $0 <make folder?> <url> <optional args>\n"
error "Usage: $0 <make folder?> <url> <optional args>"
return
fi
if [[ $format == "" ]]; then
@@ -449,7 +444,7 @@ download_youtube_playlist() {
local opts="$@"
if [[ $url == "" ]]; then
error "Format: $0 <url> <directory name (optional)> <optional args>\n"
error "Usage: $0 <url> <directory name (optional)> <optional args>"
return
fi
if [[ $format == "" ]]; then
@@ -498,7 +493,7 @@ download_twitch_chat() {
local opts="$@"
if [[ $url == "" ]]; then
error "Format: $0 <url>\n"
error "Usage: $0 <url>"
return
fi
@@ -537,7 +532,7 @@ download_twitch_vid() {
local opts="$@"
if [[ $url == "" ]]; then
error "Format: $0 <make folder?> <url> <optional args>\n"
error "Usage: $0 <make folder?> <url> <optional args>"
return
fi
@@ -611,7 +606,7 @@ download_twitch_vid() {
printf "${BOLD}Make sure to delete the original video file${NORMAL}\n"
fi
else
error "Error: Failed to download '$url'\n"
error "Error: Failed to download '$url'"
fi
if [[ $make_folder == "1" ]]; then
@@ -633,7 +628,7 @@ download_vimeo_vid() {
local opts="$@"
if [[ $url == "" ]]; then
error "Format: $0 <make folder?> <url> <optional args>\n"
error "Usage: $0 <make folder?> <url> <optional args>"
return
fi
@@ -674,7 +669,7 @@ download_vimeo_vid() {
printf "${BOLD}Make sure to delete the original video file${NORMAL}\n"
fi
else
error "Error: Failed to download '$url'\n"
error "Error: Failed to download '$url'"
fi
if [[ $make_folder == "1" ]]; then
@@ -690,7 +685,7 @@ download_twitter_vid() {
local vid_name="$4"
if [[ $url == "" ]]; then
error "Format: $0 <make folder?> <url> <optional filename> <optional args>\n"
error "Usage: $0 <make folder?> <url> <optional filename> <optional args>"
return
fi
@@ -725,7 +720,7 @@ download_twitter_vid() {
error=$?
if [[ $error -eq 1 ]]; then
error "Error: Failed to download '$url'\n"
error "Error: Failed to download '$url'"
fi
if [[ $make_folder == "1" ]]; then
@@ -739,7 +734,7 @@ download_mp4() {
local filename="$2"
if [[ $url == "" || $filename == "" ]]; then
error "Format: $0 <url> <filename>\n"
error "Usage: $0 <url> <filename>"
return
fi
@@ -749,7 +744,7 @@ download_mp4() {
curl "$url" -o $temp_name
if [[ $? -ne 0 ]]; then
error "Error: failed to download.\n"
error "Error: failed to download."
return
fi
@@ -762,7 +757,7 @@ download_from_m3u8() {
local filename="$2"
if [[ $m3u8_path == "" || $filename == "" ]]; then
error "Format: $0 <m3u8 path> <filename>\n"
error "Usage: $0 <m3u8 path> <filename>"
return
fi
@@ -770,7 +765,7 @@ download_from_m3u8() {
ffmpeg.exe -protocol_whitelist file,https,crypto,tls,tcp -i $m3u8_path -acodec copy -vcodec copy "${filename}.mp4"
if [[ $? -ne 0 ]]; then
error "Error: failed to download.\n"
error "Error: failed to download."
return
fi
@@ -783,7 +778,7 @@ download_instagram_vid_and_hflip() {
local filename="$2"
if [[ $url == "" || $filename == "" ]]; then
error "Format: $0 <url> <filename>\n"
error "Usage: $0 <url> <filename>"
return
fi
@@ -793,7 +788,7 @@ download_instagram_vid_and_hflip() {
curl "$url" -o $temp_name
if [[ $? -ne 0 ]]; then
error "Error: failed to download.\n"
error "Error: failed to download."
return
fi
@@ -876,7 +871,7 @@ function _compress_video_hard() {
local name="$1"
local out="$2"
if [[ name == "" || out == "" ]]; then
error "Format: cmd <source> <dest>\n"
error "Usage: cmd <source> <dest>"
return
fi
# 0=cpu, 1=gpu
@@ -1003,6 +998,7 @@ alias gmffs='git merge --ff-only --squash'
alias gmtheirs='git merge -Xtheirs'
alias gp='git push'
alias gpa='git push --all && echo "pushing tags..." && git push --tags'
alias gpaf='git push --all -f && echo "pushing tags..." && git push --tags -f'
alias gpf='git push -f'
alias gpff='git pull --ff-only'
alias gplu='git pull --set-upstream origin HEAD'