Skip to content

Commit d03cd76

Browse files
committed
fix downloading of multiple formats, define yt-dlp cache dir
1 parent e699137 commit d03cd76

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

Version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.3.1
1+
v0.3.2

docker-compose-dev.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: "3.8"
2-
31
services:
42

53
downloader:

files/downloader.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ E%(episode_number,playlist_index|XX)02d%(title& {}|)s (%(release_date>%Y,upload_
8686
while true; do
8787
EXIT_CODE=0
8888
yt-dlp "${YT_DLP_ARGUMENTS[@]}" --abort-on-error --abort-on-unavailable-fragments \
89-
--audio-multistream --concurrent-fragments 8 --convert-thumb jpg \
90-
--download-archive "${CONFIG_DIR}/${TYPE}/downloaded.txt" \
89+
--audio-multistream --cache-dir /tmp/yt-dlp/cache --concurrent-fragments 8 \
90+
--convert-thumb jpg --download-archive "${CONFIG_DIR}/${TYPE}/downloaded.txt" \
9191
--embed-chapters --embed-metadata --embed-subs --embed-thumbnail \
92-
--fragment-retries 1000 --max-downloads 1 --retries 100 --retry-sleep 10 \
92+
--fragment-retries 1000 --retries 100 --retry-sleep 10 \
9393
--sub-langs all,-live_chat --trim-filenames "124" --quiet "$URL" \
9494
|| EXIT_CODE=$?
9595
if [[ "$EXIT_CODE" != @(101|0) ]]; then
@@ -101,7 +101,7 @@ E%(episode_number,playlist_index|XX)02d%(title& {}|)s (%(release_date>%Y,upload_
101101
break
102102
fi
103103

104-
echo "Downloaded new file \"$(ls -A "$WORKDIR")\""
104+
echo "Downloaded new files $(ls --almost-all --quote-name --width 0 "$WORKDIR")"
105105
NEW_DOWNLOAD=true
106106
touch --no-create "$WORKDIR"/*
107107

@@ -125,10 +125,10 @@ tok.*)\)//gi" \
125125
rename --filename "s/^/${NOTE} - /" "$WORKDIR"/*
126126
fi
127127

128-
echo "Move file \"$(ls -A "$WORKDIR")\""
128+
echo "Move files"
129129
mv --no-clobber "$WORKDIR"/* "${OUTPUT_DIR}/${TYPE}"
130-
if [[ "$(ls -A "$WORKDIR")" ]]; then
131-
echo "Failed to move file"
130+
if [[ -n "$(ls --almost-all "$WORKDIR")" ]]; then
131+
echo "Failed to move files $(ls --almost-all --quote-name --width 0 "$WORKDIR")"
132132
mv "$WORKDIR"/* "$FAIL_DIR"
133133
fi
134134
done

0 commit comments

Comments
 (0)