#!/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='4cEKAYnxbrk' # 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 05:12 -to Lazarus Moment - Grassy Plains -i "${SRC_FILE}" -vn -acodec copy "01. 00:00.${FILE_EXT}" ffmpeg -ss 09:13 -to VonnBoyd - La Luna -i "${SRC_FILE}" -vn -acodec copy "02. 05:12.${FILE_EXT}" ffmpeg -ss 12:32 -to Infinitum - Until Dawn -i "${SRC_FILE}" -vn -acodec copy "03. 09:13.${FILE_EXT}" ffmpeg -ss 15:36 -to Athene - Panalour -i "${SRC_FILE}" -vn -acodec copy "04. 12:32.${FILE_EXT}" ffmpeg -ss 18:31 -to 4lienetic - If Onsrfderdfly -i "${SRC_FILE}" -vn -acodec copy "05. 15:36.${FILE_EXT}" ffmpeg -ss 22:03 -to Blut Own - Atlas -i "${SRC_FILE}" -vn -acodec copy "06. 18:21.${FILE_EXT}" ffmpeg -ss 26:01 -to Lexis - Brot -i "${SRC_FILE}" -vn -acodec copy "07. 22:03.${FILE_EXT}" ffmpeg -ss 29:51 -to Unrevel - Pause -i "${SRC_FILE}" -vn -acodec copy "08. 26:01.${FILE_EXT}" ffmpeg -ss 33:14 -to Ecepta - Flora -i "${SRC_FILE}" -vn -acodec copy "09. 29:51.${FILE_EXT}" ffmpeg -ss 36:22 -to Maltex - Endless -i "${SRC_FILE}" -vn -acodec copy "10. 33:14.${FILE_EXT}" ffmpeg -ss 38:27 -to Aurora Night - In Space -i "${SRC_FILE}" -vn -acodec copy "11. 36:22.${FILE_EXT}" ffmpeg -ss 41:46 -to Nomyn - Reverie -i "${SRC_FILE}" -vn -acodec copy "12. 38:27.${FILE_EXT}" ffmpeg -ss 43:47 -to Quallm - Rain -i "${SRC_FILE}" -vn -acodec copy "13. 41:46.${FILE_EXT}" ffmpeg -ss 46:09 -to GENY.G - Other Side -i "${SRC_FILE}" -vn -acodec copy "14. 43:47.${FILE_EXT}" ffmpeg -ss 49:44 -to B. o. O. m. - Fireflies -i "${SRC_FILE}" -vn -acodec copy "15. 46:09.${FILE_EXT}" ffmpeg -ss 51_26 -to IWSYS - All The Same -i "${SRC_FILE}" -vn -acodec copy "16. 49:44.${FILE_EXT}" ffmpeg -ss 05:12 -to Lazarus Moment - Grassy Plains -i "${SRC_FILE}" -vn -acodec copy "01. 00:00.${FILE_EXT}" ffmpeg -ss 09:13 -to VonnBoyd - La Luna -i "${SRC_FILE}" -vn -acodec copy "02. 05:12.${FILE_EXT}" ffmpeg -ss 12:32 -to Infinitum - Until Dawn -i "${SRC_FILE}" -vn -acodec copy "03. 09:13.${FILE_EXT}" ffmpeg -ss 15:36 -to Athene - Panalour -i "${SRC_FILE}" -vn -acodec copy "04. 12:32.${FILE_EXT}" ffmpeg -ss 18:31 -to 4lienetic - If Onsrfderdfly -i "${SRC_FILE}" -vn -acodec copy "05. 15:36.${FILE_EXT}" ffmpeg -ss 22:03 -to Blut Own - Atlas -i "${SRC_FILE}" -vn -acodec copy "06. 18:21.${FILE_EXT}" ffmpeg -ss 26:01 -to Lexis - Brot -i "${SRC_FILE}" -vn -acodec copy "07. 22:03.${FILE_EXT}" ffmpeg -ss 29:51 -to Unrevel - Pause -i "${SRC_FILE}" -vn -acodec copy "08. 26:01.${FILE_EXT}" ffmpeg -ss 33:14 -to Ecepta - Flora -i "${SRC_FILE}" -vn -acodec copy "09. 29:51.${FILE_EXT}" ffmpeg -ss 36:22 -to Maltex - Endless -i "${SRC_FILE}" -vn -acodec copy "10. 33:14.${FILE_EXT}" ffmpeg -ss 38:27 -to Aurora Night - In Space -i "${SRC_FILE}" -vn -acodec copy "11. 36:22.${FILE_EXT}" ffmpeg -ss 41:46 -to Nomyn - Reverie -i "${SRC_FILE}" -vn -acodec copy "12. 38:27.${FILE_EXT}" ffmpeg -ss 43:47 -to Quallm - Rain -i "${SRC_FILE}" -vn -acodec copy "13. 41:46.${FILE_EXT}" ffmpeg -ss 46:09 -to GENY.G - Other Side -i "${SRC_FILE}" -vn -acodec copy "14. 43:47.${FILE_EXT}" ffmpeg -ss 49:44 -to B. o. O. m. - Fireflies -i "${SRC_FILE}" -vn -acodec copy "15. 46:09.${FILE_EXT}" ffmpeg -ss 51:26 -to IWSYS - All The Same -i "${SRC_FILE}" -vn -acodec copy "16. 49:44.${FILE_EXT}"