#!/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='5VB1RvyfISM' # 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:05:58 -i "${SRC_FILE}" -vn -acodec copy "01. 1 MOZART - Eine Kleine Nachtmusik, K. 525: I. Allegro.${FILE_EXT}" ffmpeg -ss 00:05:58 -to 00:09:15 -i "${SRC_FILE}" -vn -acodec copy "02. 2 VIVALDI - The Four Seasons, Concerto No. 1 "Spring": I. Allegro.${FILE_EXT}" ffmpeg -ss 00:09:15 -to 00:20:39 -i "${SRC_FILE}" -vn -acodec copy "03. 3 STRAUSS II - An der schönen blauen Donau, Op. 314.${FILE_EXT}" ffmpeg -ss 00:20:39 -to 00:34:48 -i "${SRC_FILE}" -vn -acodec copy "04. 4 RACHMANINOFF - Symphony No. 2, Op. 27: III. Adagio.${FILE_EXT}" ffmpeg -ss 00:34:48 -to 00:37:19 -i "${SRC_FILE}" -vn -acodec copy "05. 5 TCHAIKOVSKY - Swan Lake: Scene by a Lake.${FILE_EXT}" ffmpeg -ss 00:37:19 -to 00:42:11 -i "${SRC_FILE}" -vn -acodec copy "06. 6 BEETHOVEN - Piano Sonata No. 14, "Moonlight Sonata": I. Adagio sostenuto.${FILE_EXT}" ffmpeg -ss 00:42:11 -to 00:46:10 -i "${SRC_FILE}" -vn -acodec copy "07. 7 LISZT - Consolations, S. 172: No. 3, Lento placido.${FILE_EXT}" ffmpeg -ss 00:46:10 -to 00:48:48 -i "${SRC_FILE}" -vn -acodec copy "08. 8 SAINT-SAENS - The Carnival of the Animals: XIII, The Swan.${FILE_EXT}" ffmpeg -ss 00:48:48 -to 00:53:19 -i "${SRC_FILE}" -vn -acodec copy "09. 9 SCHUMANN - 5 Pieces in Folk Style, Op. 102: No. 2, Langsam.${FILE_EXT}" ffmpeg -ss 00:53:19 -to 00:56:15 -i "${SRC_FILE}" -vn -acodec copy "10. 10 RACHMANINOFF - Rhapsody on a Theme by Paganini: Var. XVIII.${FILE_EXT}" ffmpeg -ss 00:56:15 -to 01:00:21 -i "${SRC_FILE}" -vn -acodec copy "11. 11 DEBUSSY - 2 Arabesques: No. 1, Andantino con moto.${FILE_EXT}" ffmpeg -ss 01:00:21 -to 01:04:39 -i "${SRC_FILE}" -vn -acodec copy "12. 12 CHOPIN - Nocturnes, Op. 9: No. 2.${FILE_EXT}" ffmpeg -ss 01:04:39 -to 01:07:56 -i "${SRC_FILE}" -vn -acodec copy "13. 13 BACH - Orchestral Suite No. 3, BWV 1068: II. Air on the G String.${FILE_EXT}" ffmpeg -ss 01:07:56 -to 01:12:23 -i "${SRC_FILE}" -vn -acodec copy "14. 14 HAYDN - Cello Concerto No. 2, Op. 101: II. Adagio.${FILE_EXT}" ffmpeg -ss 01:12:23 -to 01:16:07 -i "${SRC_FILE}" -vn -acodec copy "15. 15 TCHAIKOVSKY - Serenade for Strings, Op. 48: II. Valse.${FILE_EXT}" ffmpeg -ss 01:16:07 -to 01:19:50 -i "${SRC_FILE}" -vn -acodec copy "16. 16 GRIEG - Holberg Suite, Op. 40: II. Sarabande.${FILE_EXT}" ffmpeg -ss 01:19:50 -to 01:23:56 -i "${SRC_FILE}" -vn -acodec copy "17. 17 SIBELIUS - Andante Festivo.${FILE_EXT}" ffmpeg -ss 01:23:56 -to 01:26:34 -i "${SRC_FILE}" -vn -acodec copy "18. 18 TOSCA - Vissi d’arte.${FILE_EXT}" ffmpeg -ss 01:26:34 -to 01:46:31 -i "${SRC_FILE}" -vn -acodec copy "19. 19 TCHAIKOVSKY - Romeo & Juliet: Fantasy Overture.${FILE_EXT}" ffmpeg -ss 01:46:31 -to 01:53:43 -i "${SRC_FILE}" -vn -acodec copy "20. 20 MOZART - Die Zauberflöte, K. 620: Ouverture.${FILE_EXT}" ffmpeg -ss 01:53:43 -to 02:01:16 -i "${SRC_FILE}" -vn -acodec copy "21. 21 STRAUSS II - Frühlingsstimmen, Op. 410.${FILE_EXT}" ffmpeg -ss 02:01:16 -to 02:07:13 -i "${SRC_FILE}" -vn -acodec copy "22. 22 MENDELSSOHN - Symphony No. 4, Op. 90 "Italian": IV. Saltarello. Presto.${FILE_EXT}" ffmpeg -ss 02:07:13 -to 02:09:51 -i "${SRC_FILE}" -vn -acodec copy "23. 23 VIVALDI - The Four Seasons, Concerto No. 2, RV 315 "Summer": III. Presto.${FILE_EXT}" ffmpeg -ss 02:09:51 -to 02:18:01 -i "${SRC_FILE}" -vn -acodec copy "24. 24 MOZART - Symphony No. 40, K. 550: I. Molto allegro.${FILE_EXT}" ffmpeg -ss 02:18:01 -to 02:32:52 -i "${SRC_FILE}" -vn -acodec copy "25. 25 BEETHOVEN - Symphony No. 3, Op. 55 ‘Eroica’: I. Allegro con brio.${FILE_EXT}" ffmpeg -ss 02:32:52 -to 02:39:46 -i "${SRC_FILE}" -vn -acodec copy "26. 26 ROSSINI - The Barber of Seville: Overture.${FILE_EXT}" ffmpeg -ss 02:39:46 -to 02:50:59 -i "${SRC_FILE}" -vn -acodec copy "27. 27 MUSSORGSKY - Night on a Bare Mountain.${FILE_EXT}" ffmpeg -ss 02:50:59 -to 02:59:53 -i "${SRC_FILE}" -vn -acodec copy "28. 28 MOZART - Symphony No., K. 551 "Jupiter": IV. Molto Allegro.${FILE_EXT}" ffmpeg -ss 02:59:53 -to 03:10:44 -i "${SRC_FILE}" -vn -acodec copy "29. 29 BEETHOVEN - Symphony No. 6, Op. 68 "Pastoral": I. Allegro ma non troppo.${FILE_EXT}" ffmpeg -ss 03:10:44 -to 03:30:13 -i "${SRC_FILE}" -vn -acodec copy "30. 30 WAGNER - Siegfried Idyll.${FILE_EXT}" ffmpeg -ss 03:30:13 -to 03:32:26 -i "${SRC_FILE}" -vn -acodec copy "31. 31 MOZART - Le Nozze di Figaro: Voi che sapete.${FILE_EXT}" ffmpeg -ss 03:32:26 -to 03:35:44 -i "${SRC_FILE}" -vn -acodec copy "32. 32 MOZART - Don Giovanni: Non più andrai, farfallone amoroso.${FILE_EXT}" ffmpeg -ss 03:35:44 -to 03:41:34 -i "${SRC_FILE}" -vn -acodec copy "33. 33 BACH - Brandenburg Concerto No. 3, BWV 1048: I. Allegro.${FILE_EXT}" ffmpeg -ss 03:41:34 -to 03:45:07 -i "${SRC_FILE}" -vn -acodec copy "34. 34 TELEMANN - Viola Concerto, TWV 51:G9: I. Largo.${FILE_EXT}" ffmpeg -ss 03:45:07 -to 03:54:07 -i "${SRC_FILE}" -vn -acodec copy "35. 35 BEETHOVEN - Symphony No. 7, Op. 92: II. Allegretto.${FILE_EXT}" ffmpeg -ss 03:54:07 -to 03:56:55 -i "${SRC_FILE}" -vn -acodec copy "36. 36 SATIE - Trois Gymnopedies: No. 1, Lent et doloreux.${FILE_EXT}" ffmpeg -ss 03:56:55 -to 04:01:33 -i "${SRC_FILE}" -vn -acodec copy "37. 37 CHOPIN - Nocturne in C sharp minor, Op. Posth..${FILE_EXT}" ffmpeg -ss 04:01:33 -to 04:07:12 -i "${SRC_FILE}" -vn -acodec copy "38. 38 LISZT - Liebesträume, S. 541: No. 3.${FILE_EXT}" ffmpeg -ss 04:07:12 -to 04:10:26 -i "${SRC_FILE}" -vn -acodec copy "39. 39 SCHUMANN - Kinderszenen, Op. 15: No. 7, Träumerei.${FILE_EXT}" ffmpeg -ss 04:10:26 -to 04:16:57 -i "${SRC_FILE}" -vn -acodec copy "40. 40 CHOPIN - 24 Préludes, Op. 28: No. 15, "Raindrop".${FILE_EXT}" ffmpeg -ss 04:16:57 -to 04:21:43 -i "${SRC_FILE}" -vn -acodec copy "41. 41 DEBUSSY - Suite bergamasque, L. 75: No. 3, Clair de lune.${FILE_EXT}" ffmpeg -ss 04:21:43 -to 04:27:39 -i "${SRC_FILE}" -vn -acodec copy "42. 42 CHOPIN - Nocturnes, Op. 27: No. 2, Lento sostenuto.${FILE_EXT}" ffmpeg -ss 04:27:39 -to 04:30:47 -i "${SRC_FILE}" -vn -acodec copy "43. 43 SATIE - Gnossiennes: No. 1, Lent.${FILE_EXT}" ffmpeg -ss 04:30:47 -to 04:37:25 -i "${SRC_FILE}" -vn -acodec copy "44. 44 MOZART - Fantasia in D minor, K. 397.${FILE_EXT}" ffmpeg -ss 04:37:25 -to 04:41:03 -i "${SRC_FILE}" -vn -acodec copy "45. 45 MOZART - Piano Sonata No. 11, K 331: III. Alla Turca.${FILE_EXT}" ffmpeg -ss 04:41:03 -to 04:46:01 -i "${SRC_FILE}" -vn -acodec copy "46. 46 LISZT - Grandes études de Paganini, S. 141: No. 3, "La campanella".${FILE_EXT}" ffmpeg -ss 04:46:01 -to 04:58:47 -i "${SRC_FILE}" -vn -acodec copy "47. 47 CHOPIN - Ballade No. 4, Op. 52 (live recording).${FILE_EXT}" ffmpeg -ss 04:58:47 -to 05:01:28 -i "${SRC_FILE}" -vn -acodec copy "48. 48 CHOPIN - Études, Op. 10: No. 12, "Revolutionary".${FILE_EXT}" ffmpeg -ss 05:01:28 -to 05:02:49 -i "${SRC_FILE}" -vn -acodec copy "49. 49 RIMSKY-KORSAKOV - The Tale of Tsar Saltan: Flight of the Bumblebee.${FILE_EXT}" ffmpeg -ss 05:02:49 -to 05:09:56 -i "${SRC_FILE}" -vn -acodec copy "50. 50 SAINT-SAENS - Danse Macabre.${FILE_EXT}"