#!/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='0C&index=22' # 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 0:00:00 -to 0:04:24 -i "${SRC_FILE}" -vn -acodec copy "01. Pegasus Girl.${FILE_EXT}" ffmpeg -ss 0:04:24 -to 0:08:20 -i "${SRC_FILE}" -vn -acodec copy "02. Love is a Boomerang.${FILE_EXT}" ffmpeg -ss 0:08:20 -to 0:13:03 -i "${SRC_FILE}" -vn -acodec copy "03. Firebird.${FILE_EXT}" ffmpeg -ss 0:13:03 -to 0:17:50 -i "${SRC_FILE}" -vn -acodec copy "04. STARSHIP.${FILE_EXT}" ffmpeg -ss 0:17:50 -to 0:22:25 -i "${SRC_FILE}" -vn -acodec copy "05. The Stranger of Time.${FILE_EXT}" ffmpeg -ss 0:22:25 -to 0:26:22 -i "${SRC_FILE}" -vn -acodec copy "06. Flower Color- Shonen Kenya Theme.${FILE_EXT}" ffmpeg -ss 0:26:22 -to 0:30:01 -i "${SRC_FILE}" -vn -acodec copy "07. MANHATTAN JOKE.${FILE_EXT}" ffmpeg -ss 0:30:01 -to 0:34:24 -i "${SRC_FILE}" -vn -acodec copy "08. "Time Stranger" Theme Song.${FILE_EXT}" ffmpeg -ss 0:34:24 -to 0:38:39 -i "${SRC_FILE}" -vn -acodec copy "09. Teko Theme.${FILE_EXT}" ffmpeg -ss 0:38:39 -to 0:42:11 -i "${SRC_FILE}" -vn -acodec copy "10. Kamui no Sword.${FILE_EXT}" ffmpeg -ss 0:42:11 -to 0:48:35 -i "${SRC_FILE}" -vn -acodec copy "11. Do You Remember Love? Long Version.${FILE_EXT}" ffmpeg -ss 0:48:35 -to 0:53:18 -i "${SRC_FILE}" -vn -acodec copy "12. Angel Paint.${FILE_EXT}" ffmpeg -ss 0:53:18 -to 0:57:36 -i "${SRC_FILE}" -vn -acodec copy "13. Faraway in the Eyes.${FILE_EXT}" ffmpeg -ss 0:57:36 -to 1:02:14 -i "${SRC_FILE}" -vn -acodec copy "14. Dream Hunter.${FILE_EXT}" ffmpeg -ss 1:02:14 -to 1:06:06 -i "${SRC_FILE}" -vn -acodec copy "15. Melancholy Trails.${FILE_EXT}" ffmpeg -ss 1:06:06 -to 1:10:21 -i "${SRC_FILE}" -vn -acodec copy "16. Like a Bird.${FILE_EXT}" ffmpeg -ss 1:10:21 -to 1:14:16 -i "${SRC_FILE}" -vn -acodec copy "17. Uncertain I Love You.${FILE_EXT}" ffmpeg -ss 1:14:16 -to 1:18:32 -i "${SRC_FILE}" -vn -acodec copy "18. Embrace That Sky.${FILE_EXT}" ffmpeg -ss 1:18:32 -to 1:22:55 -i "${SRC_FILE}" -vn -acodec copy "19. Kiss of Glass.${FILE_EXT}" ffmpeg -ss 1:22:55 -to 1:27:03 -i "${SRC_FILE}" -vn -acodec copy "20. Follow Wind in the Heart.${FILE_EXT}" ffmpeg -ss 1:27:03 -to 1:30:49 -i "${SRC_FILE}" -vn -acodec copy "21. DOWNTOWN STEP.${FILE_EXT}" ffmpeg -ss 1:30:49 -to 1:34:46 -i "${SRC_FILE}" -vn -acodec copy "22. Lonely≠Story.${FILE_EXT}" ffmpeg -ss 1:34:46 -to 1:39:05 -i "${SRC_FILE}" -vn -acodec copy "23. Safari Eyes.${FILE_EXT}" ffmpeg -ss 1:39:05 -to 1:42:15 -i "${SRC_FILE}" -vn -acodec copy "24. Pas De Deux.${FILE_EXT}" ffmpeg -ss 1:42:15 -to 1:46:50 -i "${SRC_FILE}" -vn -acodec copy "25. Promise.${FILE_EXT}" ffmpeg -ss 1:46:50 -to 1:51:37 -i "${SRC_FILE}" -vn -acodec copy "26. Beautiful Star.${FILE_EXT}" ffmpeg -ss 1:51:37 -to 1:56:05 -i "${SRC_FILE}" -vn -acodec copy "27. Canon of the Sky and the Sea.${FILE_EXT}" ffmpeg -ss 1:56:05 -to 2:01:48 -i "${SRC_FILE}" -vn -acodec copy "28. In the morning of departure.${FILE_EXT}"