summaryrefslogtreecommitdiff
path: root/video_download.sh
diff options
context:
space:
mode:
Diffstat (limited to 'video_download.sh')
-rwxr-xr-xvideo_download.sh10
1 files changed, 4 insertions, 6 deletions
diff --git a/video_download.sh b/video_download.sh
index ffbc4f7..acf52c9 100755
--- a/video_download.sh
+++ b/video_download.sh
@@ -3,20 +3,18 @@
VIDE_DIR="/var/tank/videos/Videos/"
PLAY_DIR="/var/tank/videos/Playlists/"
-PLAY_SUBS="$(ls -1 ${PLAY_DIR})"
-
LAST_FILE="${XDG_CACHE_HOME:-$HOME/.cache}/video_download"
get_videos () {
- cd "$VIDE_DIR"
+ cd "$VIDE_DIR" || exit 1
yt-dlp "$(cat url.txt)"
date '+%s' > "${LAST_FILE}.video.txt"
}
get_playlists () {
- cd "$PLAY_DIR"
- ls -1 | while read subdir; do
- cd "$PLAY_DIR/$subdir"
+ cd "$PLAY_DIR" || exit 1
+ find ./* -maxdepth 1 -type d | while read -r subdir; do
+ cd "$PLAY_DIR/$subdir" || exit 1
yt-dlp "$(cat url.txt)"
done
}