#!/bin/bash # __ __ # ____ ___ ______ / /___ ____ _____/ /__ _____ # / __ `/ / / / __ \/ / __ \/ __ `/ __ / _ \/ ___/ # / /_/ / /_/ / / / / / /_/ / /_/ / /_/ / __/ / # \__, /\__,_/_/ /_/_/\____/\__,_/\__,_/\___/_/ # /____/ # --------------------------------------------------- # Author :: Miris /// GitHub :: MirisWisdom/Albumin # --------------------------------------------------- # This simple Bash script lets you download the video # using yt-dlp, and then takes care of extracting its # audio into a file for each song w/ ffmpeg! # It does not re-encode or tag any of the audio files # due to raw preservation being its purpose. # You should run it line by line rather than blindly! # Feel free to tweak & suggest improvements! # --------------------------------------------------- # We'll be using the ID for both file and directory. VIDEO_ID='Z5zKmbUxr7Q' # Create and enter the new directory. mkdir -p "${VIDEO_ID}" && cd "${VIDEO_ID}" # Download the audio file using yt-dlp. yt-dlp -x -f bestaudio "${VIDEO_ID}" -o "${VIDEO_ID}.%%(ext)s" # Figure out the downloaded file name and extension. SRC_FILE=$(ls "${VIDEO_ID}".*) # ls command should only output the downloaded file name! FILE_EXT=${SRC_FILE:12} # file id + dot = 12 characters; extension length varies! ffmpeg -ss 00:00:00 -to 00:03:46 -i "${SRC_FILE}" -vn -acodec copy "1. Die For You (guitar by paul iballa).${FILE_EXT}" ffmpeg -ss 00:03:46 -to 00:07:01 -i "${SRC_FILE}" -vn -acodec copy "2. Is There Someone Else? (by KissXO).${FILE_EXT}" ffmpeg -ss 00:07:01 -to 00:10:01 -i "${SRC_FILE}" -vn -acodec copy "3. I Was Never There (by menon).${FILE_EXT}" ffmpeg -ss 00:10:01 -to 00:11:49 -i "${SRC_FILE}" -vn -acodec copy "4. Wicked Games (by menon).${FILE_EXT}" ffmpeg -ss 00:11:49 -to 00:16:00 -i "${SRC_FILE}" -vn -acodec copy "5. Call Out My Name (by menon).${FILE_EXT}" ffmpeg -ss 00:16:00 -to 00:19:06 -i "${SRC_FILE}" -vn -acodec copy "6. The Morning (by me).${FILE_EXT}" ffmpeg -ss 00:19:06 -to 00:21:32 -i "${SRC_FILE}" -vn -acodec copy "7. Save Your Tears (by Girg and menon).${FILE_EXT}" ffmpeg -ss 00:21:32 -to 00:25:26 -i "${SRC_FILE}" -vn -acodec copy "8. Less Than Zero (by me and Girg).${FILE_EXT}" ffmpeg -ss 00:25:26 -to 00:28:39 -i "${SRC_FILE}" -vn -acodec copy "9. Blinding Lights (by menon).${FILE_EXT}"