ScriptSmith's picture
Add files using upload-large-folder tool
333630b verified
raw
history blame contribute delete
672 Bytes
#!/usr/bin/env bash
mkdir -p data
file="$1"
start_id="$2"
skip=true
while read -r id; do
# If a start ID is provided, skip until we reach it
if [ -n "$start_id" ] && $skip; then
if [ "$id" = "$start_id" ]; then
skip=false
else
continue
fi
else
skip=false
fi
if [ ! -f "data/${id}.info.json" ]; then
echo "https://www.youtube.com/watch?v=$id"
else
echo "Skipping $id (metadata already downloaded)" >&2
fi
done < "$file" | yt-dlp \
--skip-download \
--write-info-json \
--write-subs \
--write-auto-subs \
--output "data/%(id)s" \
--sleep-interval 5 \
--sleep-requests 3 \
-a - \
2>&1 | tee -a log.txt