youtube add cookies and yt2mp3 scrript
This commit is contained in:
1 parent
5e3a289f4e
commit
61c3d2f6c2
2 files changed
+42
-2
No files matched your search
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
# Usage:
|
||||
# ./download_mp3s.sh links.txt [output_dir]
|
||||
#
|
||||
# links.txt: text file containing one URL per line
|
||||
# output_dir: optional destination directory (default: ./downloads)
|
||||
|
||||
LINKS_FILE="${1:-links.txt}"
|
||||
OUTDIR="${2:-downloads}"
|
||||
|
||||
if ! command -v yt-dlp >/dev/null 2>&1; then
|
||||
echo "Error: yt-dlp not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v ffmpeg >/dev/null 2>&1; then
|
||||
echo "Error: ffmpeg not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$OUTDIR"
|
||||
|
||||
yt-dlp \
|
||||
--newline \
|
||||
--ignore-errors \
|
||||
--extract-audio \
|
||||
--audio-format mp3 \
|
||||
--audio-quality 0 \
|
||||
--embed-metadata \
|
||||
--embed-thumbnail \
|
||||
--add-metadata \
|
||||
--parse-metadata "%(artist|)s:%(meta_artist)s" \
|
||||
--convert-thumbnails jpg \
|
||||
--output "$OUTDIR/%(uploader)s - %(title)s.%(ext)s" \
|
||||
-a "$LINKS_FILE"
|
||||
|
||||
echo "Done."
|
||||
|
||||
Reference in new issue
Block a user