Refactoring

This commit is contained in:
Nox Sluijtman 2023-11-07 02:23:24 +01:00
parent f1eb737b06
commit 74f7aa38bc

6
arbit
View file

@ -37,8 +37,8 @@ clipboardQuery(){
} }
downloadCommand(){ downloadCommand(){
#yt-dlp --embed-chapters --embed-metadata --embed-subs -o "${downloadDir}/%(title)s - %(uploader)s.%(ext)s" "$1" yt-dlp --embed-chapters --embed-metadata --embed-subs -o "${downloadDir}/%(title)s - %(uploader)s.%(ext)s" "$1"
yt-dlp -o "${downloadDir}/%(title)s - %(uploader)s.%(ext)s" "$1" #yt-dlp -o "${downloadDir}/%(title)s - %(uploader)s.%(ext)s" "$1"
} }
downloadClipUrl(){ downloadClipUrl(){
@ -68,7 +68,7 @@ viewUrl(){
download(){ download(){
url="$(echo "$*" | sed 's/download //')" url="$(echo "$*" | sed 's/download //')"
notify-send "Arbit" "Downloading video to ${downloadDir}" notify-send "Arbit" "Downloading video to ${downloadDir}"
if yt-dlp -o "${downloadDir}/%(title)s - %(uploader)s.%(ext)s" "${url}" if downloadCommand "${url}"
then notify-send "Arbit" "Finished downloading video." then notify-send "Arbit" "Finished downloading video."
else die "Failed to download file" else die "Failed to download file"
fi fi