aboutsummaryrefslogtreecommitdiff
path: root/bash/youtube.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bash/youtube.sh')
-rw-r--r--bash/youtube.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/bash/youtube.sh b/bash/youtube.sh
index 6ffb2da..c40e0a7 100644
--- a/bash/youtube.sh
+++ b/bash/youtube.sh
@@ -14,7 +14,7 @@ download() {
youtube-dl "$1" \
--download-archive ~/Nextcloud/cache/youtube-dl-seen.conf \
--prefer-free-formats \
- --playlist-end $2 \
+ --playlist-end "$2" \
--write-description \
--output "$YT_TEMPLATE"
}
@@ -22,19 +22,19 @@ export -f download
download_user() {
- download "https://www.youtube.com/user/$1" ${2-$DEFAULT_PLAYLIST_END}
+ download "https://www.youtube.com/user/$1" "${2-$DEFAULT_PLAYLIST_END}"
}
export -f download_user
download_channel() {
- download "https://www.youtube.com/channel/$1" ${2-$DEFAULT_PLAYLIST_END}
+ download "https://www.youtube.com/channel/$1" "${2-$DEFAULT_PLAYLIST_END}"
}
export -f download_channel
download_playlist() {
- download "https://www.youtube.com/playlist?list=$1" ${2-$DEFAULT_PLAYLIST_END}
+ download "https://www.youtube.com/playlist?list=$1" "${2-$DEFAULT_PLAYLIST_END}"
}
export -f download_playlist
@@ -46,8 +46,10 @@ inc_download() {
local file="$HOME/.yt-db/$id"
mkdir -p "$HOME/.yt-db"
- local n_count="$(cat $file 2> /dev/null || printf 10)"
- local n_count_new="$(($n_count + $step))"
+ n_count="$(cat "$file" 2> /dev/null || printf 10)"
+ local n_count
+ n_count_new="$((n_count + step))"
+ local n_count_new
echo "$n_count_new" > "$file"