Last active
August 4, 2023 12:44
-
-
Save RageCage64/9f029d2d793b96c34e099702c1994a39 to your computer and use it in GitHub Desktop.
Downloading a list of youtube links as audio with yt-dlp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
set -u | |
set -o pipefail | |
set -x | |
LINK_FILE=$1 | |
LINKS=$(cat $LINK_FILE | tr '\n' ' ') | |
CURR_DATE=$(date +"%Y%m%d") | |
CURR_TIME=$(date +"%T" | tr -d ':') | |
DOWNLOAD_DIR="audiodownload_$CURR_DATE$CURR_TIME" | |
for link in $LINKS; do | |
yt-dlp -f 'ba' -x --audio-format mp3 $link -o "$DOWNLOAD_DIR/%(title)s.%(ext)s" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment