#!/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='duY6SzYHsa0' # 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:48 -i "${SRC_FILE}" -vn -acodec copy "01. I Got Love.${FILE_EXT}" ffmpeg -ss 00:03:48 -to 00:07:06 -i "${SRC_FILE}" -vn -acodec copy "02. Don't Even Know.${FILE_EXT}" ffmpeg -ss 00:07:06 -to 00:10:48 -i "${SRC_FILE}" -vn -acodec copy "03. Lost My Mind.${FILE_EXT}" ffmpeg -ss 00:10:48 -to 00:16:08 -i "${SRC_FILE}" -vn -acodec copy "04. Esperanza.${FILE_EXT}" ffmpeg -ss 00:16:08 -to 00:20:23 -i "${SRC_FILE}" -vn -acodec copy "05. The Melting Of The Sun.${FILE_EXT}" ffmpeg -ss 00:20:23 -to 00:23:32 -i "${SRC_FILE}" -vn -acodec copy "06. Trophy.${FILE_EXT}" ffmpeg -ss 00:23:32 -to 00:27:45 -i "${SRC_FILE}" -vn -acodec copy "07. magic wand.${FILE_EXT}" ffmpeg -ss 00:27:45 -to 00:31:05 -i "${SRC_FILE}" -vn -acodec copy "08. Burner of Ships.${FILE_EXT}" ffmpeg -ss 00:31:05 -to 00:34:46 -i "${SRC_FILE}" -vn -acodec copy "09. Don't Call My Name.${FILE_EXT}" ffmpeg -ss 00:34:46 -to 00:38:52 -i "${SRC_FILE}" -vn -acodec copy "10. everything's worth it.${FILE_EXT}" ffmpeg -ss 00:38:52 -to 00:42:22 -i "${SRC_FILE}" -vn -acodec copy "11. Right Down the Line.${FILE_EXT}" ffmpeg -ss 00:42:22 -to 00:47:40 -i "${SRC_FILE}" -vn -acodec copy "12. Naima's Dream.${FILE_EXT}" ffmpeg -ss 00:47:40 -to 00:50:56 -i "${SRC_FILE}" -vn -acodec copy "13. Now She's Gone.${FILE_EXT}" ffmpeg -ss 00:50:56 -to 00:56:24 -i "${SRC_FILE}" -vn -acodec copy "14. Juju Dancer.${FILE_EXT}" ffmpeg -ss 00:56:24 -to 00:59:46 -i "${SRC_FILE}" -vn -acodec copy "15. The Starchaser.${FILE_EXT}" ffmpeg -ss 00:59:46 -to 01:02:27 -i "${SRC_FILE}" -vn -acodec copy "16. All Good News Is Good News.${FILE_EXT}" ffmpeg -ss 00:00:00 -to 00:03:48 -i "${SRC_FILE}" -vn -acodec copy "01. I Got Love.${FILE_EXT}" ffmpeg -ss 00:03:48 -to 00:07:06 -i "${SRC_FILE}" -vn -acodec copy "02. Don't Even Know.${FILE_EXT}" ffmpeg -ss 00:07:06 -to 00:10:48 -i "${SRC_FILE}" -vn -acodec copy "03. Lost My Mind.${FILE_EXT}" ffmpeg -ss 00:10:48 -to 00:16:08 -i "${SRC_FILE}" -vn -acodec copy "04. Esperanza.${FILE_EXT}" ffmpeg -ss 00:16:08 -to 00:20:23 -i "${SRC_FILE}" -vn -acodec copy "05. The Melting Of The Sun.${FILE_EXT}" ffmpeg -ss 00:20:23 -to 00:23:32 -i "${SRC_FILE}" -vn -acodec copy "06. Trophy.${FILE_EXT}" ffmpeg -ss 00:23:32 -to 00:27:45 -i "${SRC_FILE}" -vn -acodec copy "07. magic wand.${FILE_EXT}" ffmpeg -ss 00:27:45 -to 00:31:05 -i "${SRC_FILE}" -vn -acodec copy "08. Burner of Ships.${FILE_EXT}" ffmpeg -ss 00:31:05 -to 00:34:46 -i "${SRC_FILE}" -vn -acodec copy "09. Don't Call My Name.${FILE_EXT}" ffmpeg -ss 00:34:46 -to 00:38:52 -i "${SRC_FILE}" -vn -acodec copy "10. everything's worth it.${FILE_EXT}" ffmpeg -ss 00:38:52 -to 00:42:22 -i "${SRC_FILE}" -vn -acodec copy "11. Right Down the Line.${FILE_EXT}" ffmpeg -ss 00:42:22 -to 00:47:40 -i "${SRC_FILE}" -vn -acodec copy "12. Naima's Dream.${FILE_EXT}" ffmpeg -ss 00:47:40 -to 00:50:56 -i "${SRC_FILE}" -vn -acodec copy "13. Now She's Gone.${FILE_EXT}" ffmpeg -ss 00:50:56 -to 00:56:24 -i "${SRC_FILE}" -vn -acodec copy "14. Juju Dancer.${FILE_EXT}" ffmpeg -ss 00:56:24 -to 00:59:46 -i "${SRC_FILE}" -vn -acodec copy "15. The Starchaser.${FILE_EXT}" ffmpeg -ss 00:59:46 -to 01:02:27 -i "${SRC_FILE}" -vn -acodec copy "16. All Good News Is Good News.${FILE_EXT}"