updated formatting

This commit is contained in:
2026-11-05 15:25:29 +00:00
parent 6be8655393
commit bc0e894bfa
2 changed files with 470 additions and 9 deletions
+391
View File
@@ -0,0 +1,391 @@
[
{
"artist": "Meat Loaf",
"album": "Bat Out Of Hell",
"year": "1977",
"cover_img_url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e026f8ff647f7bf9b70f961ca91",
"tracks": [
{ "track": 1,
"title": "Bat Out of Hell",
"url": "https://www.youtube.com/watch?v=x7ES7ueI7p0" },
{ "track": 2,
"title": "You Took the Words Right Out of My Mouth (Hot Summer Night)",
"url": "https://www.youtube.com/watch?v=HRZTRTPiIT4" },
{ "track": 3,
"title": "Heaven Can Wait",
"url": "https://www.youtube.com/watch?v=VJKm0KxQ2L4" },
{ "track": 4,
"title": "All Revved Up with No Place to Go",
"url": "https://www.youtube.com/watch?v=eWVmRvq50kQ" },
{ "track": 5,
"title": "Two Out of Three Ain't Bad",
"url": "https://www.youtube.com/watch?v=HVvXWUAKtus" },
{ "track": 6,
"title": "Paradise by the Dashboard Light",
"url": "https://www.youtube.com/watch?v=a136H5K3OKw" },
{ "track": 7,
"title": "For Crying Out Loud",
"url": "https://www.youtube.com/watch?v=8KyHDNQkBSA" }
]
},
{
"artist": "Meat Loaf",
"album": "Bat Out Of Hell II: Back Into Hell",
"year": "1993",
"cover_img_url": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e02760b07851c769338b26b76d6",
"tracks": [
{ "track": 1,
"title": "I'd Do Anything for Love (But I Won't Do That)",
"url": "https://www.youtube.com/watch?v=9X_ViIPA-Gc" },
{ "track": 2,
"title": "Life Is a Lemon and I Want My Money Back",
"url": "https://www.youtube.com/watch?v=sqThzmd_jsc" },
{ "track": 3,
"title": "Rock and Roll Dreams Come Through",
"url": "https://www.youtube.com/watch?v=T3Iay1J87x4" },
{ "track": 4,
"title": "It Just Won't Quit",
"url": "https://www.youtube.com/watch?v=kb_rGS6ZDSI" },
{ "track": 5,
"title": "Out of the Frying Pan (And Into the Fire)",
"url": "https://www.youtube.com/watch?v=Mh-UBzxGh9g" },
{ "track": 6,
"title": "Objects in the Rear View Mirror May Appear Closer Than They Are",
"url": "https://www.youtube.com/watch?v=3jPMv9zJ1LE" },
{ "track": 7,
"title": "Wasted Youth",
"url": "https://www.youtube.com/watch?v=5BMgAzwN3JY" },
{ "track": 8,
"title": "Everything Louder Than Everything Else",
"url": "https://www.youtube.com/watch?v=gNmLVWh_GeM" },
{ "track": 9,
"title": "Good Girls Go to Heaven (Bad Girls Go Everywhere)",
"url": "https://www.youtube.com/watch?v=GNtvhjbFKMQ" },
{ "track": 10,
"title": "Back into Hell",
"url": "https://www.youtube.com/watch?v=OYKMuQHCbfY" },
{ "track": 11,
"title": "Lost Boys and Golden Girls",
"url": "https://www.youtube.com/watch?v=ENt-n8q602E" }
]
},
{
"artist": "Meat Loaf",
"album": "Bat Out Of Hell III: The Monster Is Loose",
"year": "2006",
"cover_img_url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e02b98e6978adead80be24bc9dd",
"tracks": [
{ "track": 1,
"title": "The Monster Is Loose",
"url": "https://www.youtube.com/watch?v=ProXVwwrBoA" },
{ "track": 2,
"title": "Blind As a Bat",
"url": "https://www.youtube.com/watch?v=aejZhKnNgmM" },
{ "track": 3,
"title": "It's All Coming Back to Me Now",
"url": "https://www.youtube.com/watch?v=dGOKN9viK_o" },
{ "track": 4,
"title": "Bad for Good",
"url": "https://www.youtube.com/watch?v=gmLhB5PHvQ0" },
{ "track": 5,
"title": "Cry Over Me",
"url": "https://www.youtube.com/watch?v=3uOeoy98wdo" },
{ "track": 6,
"title": "In the Land of the Pig, the Butcher Is King",
"url": "https://www.youtube.com/watch?v=Iz7JNNNSIqQ" },
{ "track": 7,
"title": "Monstro",
"url": "https://www.youtube.com/watch?v=FWZKDmxNVBM" },
{ "track": 8,
"title": "Alive",
"url": "https://www.youtube.com/watch?v=8QplehqHrgA" },
{ "track": 9,
"title": "If God Could Talk",
"url": "https://www.youtube.com/watch?v=c4EQjx6lu7Y" },
{ "track": 10,
"title": "If It Ain't Broke Break It",
"url": "https://www.youtube.com/watch?v=U-EAtfDXyUc" },
{ "track": 11,
"title": "What About Love",
"url": "https://www.youtube.com/watch?v=EmjxJwwAcdE" },
{ "track": 12,
"title": "Seize the Night",
"url": "https://www.youtube.com/watch?v=R3p5RSHzAxU" },
{ "track": 13,
"title": "The Future Ain't What It Used to Be",
"url": "https://www.youtube.com/watch?v=6UR4_-vcKXY" },
{ "track": 14,
"title": "Cry to Heaven",
"url": "https://www.youtube.com/watch?v=n82G7Yg_-rY" }
]
},
{
"artist": "Queen",
"album": "Greatest Hits",
"year": "1981",
"cover_img_url": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e02b8809efd73259c1bc1914995",
"tracks": [
{ "track": 1,
"title": "Bohemian Rhapsody",
"url": "https://www.youtube.com/watch?v=fJ9rUzIMcZQ" },
{ "track": 2,
"title": "Another One Bites the Dust",
"url": "https://www.youtube.com/watch?v=rY0WxgSXdEE" },
{ "track": 3,
"title": "Killer Queen",
"url": "" },
{ "track": 4,
"title": "Fat Bottomed Girls",
"url": "https://www.youtube.com/watch?v=VMnjF1O4eH0" },
{ "track": 5,
"title": "Bicycle Race",
"url": "https://www.youtube.com/watch?v=GugsCdLHm-Q" },
{ "track": 6,
"title": "You're My Best Friend",
"url": "" },
{ "track": 7,
"title": "Don't Stop Me Now",
"url": "https://www.youtube.com/watch?v=HgzGwKwLmgM" },
{ "track": 8,
"title": "Save Me",
"url": "" },
{ "track": 9,
"title": "Crazy Little Thing Called Love",
"url": "" },
{ "track": 10,
"title": "Somebody to Love",
"url": "https://www.youtube.com/watch?v=kijpcUv-b8M" },
{ "track": 11,
"title": "Now I'm Here",
"url": "" },
{ "track": 12,
"title": "Good Old-Fashioned Lover Boy",
"url": "https://www.youtube.com/watch?v=PI3LAgGBxqU" },
{ "track": 13,
"title": "Play the Game",
"url": "" },
{ "track": 14,
"title": "Flash",
"url": "" },
{ "track": 15,
"title": "Seven Seas of Rhye",
"url": "" },
{ "track": 16,
"title": "We Will Rock You",
"url": "https://www.youtube.com/watch?v=-tJYN-eG1zk" },
{ "track": 17,
"title": "We Are the Champions",
"url": "https://www.youtube.com/watch?v=04854XqcfCY" }
]
},
{
"artist": "Queen",
"album": "Greatest Hits II",
"year": "1991",
"cover_img_url": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e02787cd0b344ed20b338498f2a",
"tracks": [
{ "track": 1,
"title": "A Kind of Magic",
"url": "" },
{ "track": 2,
"title": "Under Pressure",
"url": "https://www.youtube.com/watch?v=a01QQZyl-_I" },
{ "track": 3,
"title": "Radio Ga Ga",
"url": "" },
{ "track": 4,
"title": "I Want It All",
"url": "https://www.youtube.com/watch?v=hFDcoX7s6rE" },
{ "track": 5,
"title": "I Want to Break Free",
"url": "" },
{ "track": 6,
"title": "Innuendo",
"url": "" },
{ "track": 7,
"title": "It's a Hard Life",
"url": "https://www.youtube.com/watch?v=uHP-qgzUVLM" },
{ "track": 8,
"title": "Breakthru",
"url": "" },
{ "track": 9,
"title": "Who Wants to Live Forever",
"url": "" },
{ "track": 10,
"title": "Headlong",
"url": "" },
{ "track": 11,
"title": "The Miracle",
"url": "https://www.youtube.com/watch?v=2DaY8-Mui0I" },
{ "track": 12,
"title": "I'm Going Slightly Mad",
"url": "https://www.youtube.com/watch?v=Od6hY_50Dh0" },
{ "track": 13,
"title": "The Invisible Man",
"url": "" },
{ "track": 14,
"title": "Hammer to Fall",
"url": "https://www.youtube.com/watch?v=JU5LMG3WFBw" },
{ "track": 15,
"title": "Friends Will Be Friends",
"url": "" },
{ "track": 16,
"title": "The Show Must Go On",
"url": "https://www.youtube.com/watch?v=t99KH0TR-J4" },
{ "track": 17,
"title": "One Vision",
"url": "" }
]
},
{
"artist": "Queen",
"album": "Greatest Hits III",
"year": "1999",
"cover_img_url": "https://image-cdn-ak.spotifycdn.com/image/ab67616d00001e024f27ae739d2040962d8b4c4f",
"tracks": [
{ "track": 1,
"title": "The Show Must Go On (Live featuring Elton John)",
"url": "" },
{ "track": 2,
"title": "Under Pressure (Rah Mix with David Bowie)",
"url": "" },
{ "track": 3,
"title": "Barcelona (Freddie Mercury & Montserrat Caballé)",
"url": "https://www.youtube.com/watch?v=Y1fiOJDXA-E" },
{ "track": 4,
"title": "Too Much Love Will Kill You",
"url": "" },
{ "track": 5,
"title": "Somebody to Love (Live featuring George Michael)",
"url": "" },
{ "track": 6,
"title": "You Don't Fool Me",
"url": "" },
{ "track": 7,
"title": "Heaven for Everyone",
"url": "" },
{ "track": 8,
"title": "Las Palabras de Amor (The Words of Love)",
"url": "" },
{ "track": 9,
"title": "Driven by You (Brian May)",
"url": "" },
{ "track": 10,
"title": "Living on My Own (Freddie Mercury)",
"url": "" },
{ "track": 11,
"title": "Let Me Live",
"url": "" },
{ "track": 12,
"title": "The Great Pretender (Freddie Mercury)",
"url": "" },
{ "track": 13,
"title": "Princes of the Universe",
"url": "" },
{ "track": 14,
"title": "Another One Bites the Dust (featuring Wyclef Jean)",
"url": "" },
{ "track": 15,
"title": "No-One but You (Only the Good Die Young)",
"url": "" },
{ "track": 16,
"title": "These Are the Days of Our Lives",
"url": "" },
{ "track": 17,
"title": "Thank God It's Christmas",
"url": "" }
]
},
{
"artist": "Bad Omans",
"album": "THE DEATH OF PEACE OF MIND",
"year": "2022",
"cover_img_url": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e02bafcef0262b82dec233717e2",
"tracks": [
{ "track": 1,
"title": "CONCRETE JUNGLE",
"url": "https://www.youtube.com/watch?v=o3xHEJZs7as" },
{ "track": 2,
"title": "Nowhere To Go",
"url": "https://www.youtube.com/watch?v=4a8CogWA3-Y" },
{ "track": 3,
"title": "Take Me First",
"url": "https://www.youtube.com/watch?v=G6h5tgfmV3g" },
{ "track": 4,
"title": "THE DEATH OF PEACE OF MIND",
"url": "https://www.youtube.com/watch?v=ouW_RCAI0sg" },
{ "track": 5,
"title": "What It Cost",
"url": "https://www.youtube.com/watch?v=KDiA9dy2fUU" },
{ "track": 6,
"title": "Like A Villain",
"url": "https://www.youtube.com/watch?v=Aibxit_PpAg" },
{ "track": 7,
"title": "bad decisions",
"url": "https://www.youtube.com/watch?v=QmPFChGiTzM" },
{ "track": 8,
"title": "Just Pretend",
"url": "https://www.youtube.com/watch?v=GLRFl26Q92s" },
{ "track": 9,
"title": "The Grey",
"url": "https://www.youtube.com/watch?v=eK7GDLbclsg" },
{ "track": 10,
"title": "Who are you?",
"url": "https://www.youtube.com/watch?v=K9jp5VeAj1U" },
{ "track": 11,
"title": "Somebody else",
"url": "https://www.youtube.com/watch?v=BGaNejrxLx0" },
{ "track": 12,
"title": "IDWT$",
"url": "https://www.youtube.com/watch?v=67R9MAzLo2M" },
{ "track": 13,
"title": "What do you want from me?",
"url": "https://www.youtube.com/watch?v=9YU62awGc9U" },
{ "track": 14,
"title": "ARTIFICIAL SUICIDE",
"url": "https://www.youtube.com/watch?v=IBcUkTXAwbw" },
{ "track": 15,
"title": "Miracle",
"url": "https://www.youtube.com/watch?v=gINLfkTAjls" }
]
},
{
"artist": "Sleep Token",
"album": "Even In Arcadia",
"year": "2025",
"cover_img_url": "https://image-cdn-fa.spotifycdn.com/image/ab67616d00001e02882265cd9bdded9ea9a153b9",
"tracks": [
{ "track": 1,
"title": "Look To Windward",
"url": "https://www.youtube.com/watch?v=Qw0bebAzsYc" },
{ "track": 2,
"title": "Emergence",
"url": "https://www.youtube.com/watch?v=JJpFTUP6fIo" },
{ "track": 3,
"title": "Past Self",
"url": "https://www.youtube.com/watch?v=GSkY_xmkoYg" },
{ "track": 4,
"title": "Dangerous",
"url": "https://www.youtube.com/watch?v=pM1ap2eOHsk" },
{ "track": 5,
"title": "Caramel",
"url": "https://www.youtube.com/watch?v=4iSvoQNfrrk" },
{ "track": 6,
"title": "Even In Arcadia",
"url": "https://www.youtube.com/watch?v=qRL24yVx6Vw" },
{ "track": 7,
"title": "Provider",
"url": "https://www.youtube.com/watch?v=Sh2vn13Wakg" },
{ "track": 8,
"title": "Damocles",
"url": "https://www.youtube.com/watch?v=0NDqYZVbpho" },
{ "track": 9,
"title": "Gethsemane",
"url": "https://www.youtube.com/watch?v=EuwLeCs9z2o" },
{ "track": 10,
"title": "Infinite Baths",
"url": "https://www.youtube.com/watch?v=noWUQci7BsU" }
]
}
]
+78 -8
View File
@@ -39,14 +39,76 @@ def download_playlist_for_cd(playlist_url: str, output_folder: str = "cd_audio")
def download_single_video(url, song_num, artist, title):
output_folder = "cd_audio"
if not os.path.exists(output_folder):
os.makedirs(output_folder)
ytdl_opts = {
"format": "bestaudio/best",
"noplaylist": True,
"outtmpl": os.path.join(output_folder, f"{song_num} - {artist} - {title}.%(ext)s"),
"postprocessors": [
{
"key": "FFmpegExtractAudio",
"preferredcodec": "wav",
}
],
"postprocessor_args": [
"-ar", "44100", # Set sample rate to 44.1 kHz (CD Standard)
"-ac", "2", # Force 2 channels (Stereo)
"-metadata", f"artist={artist}",
"-metadata", f"title={title}",
],
"ignoreerrors": True,
}
with yt_dlp.YoutubeDL(ytdl_opts) as ytdl:
ytdl.download([url])
def parse_file(filename):
class Track:
def __init__(self, track: int, title: str, url: str):
self.track = track
self.title = title
self.url = url
class Album:
def __init__(self, artist: str, album: str):
self.artist = artist
self.album = album
self.tracks = []
def add_track(self, track: Track):
self.tracks.append(track)
with open(filename, "r") as file:
data = json.load(file)
links = data.get("yt-links", {})
return links
albums = []
for album in data:
try:
new_album = Album(
album["artist"],
album["album"])
for video in album["tracks"]:
new_album.add_track(Track(
video["track"],
video["title"],
video["url"]
))
except KeyError as e:
print(e)
continue
albums.append(new_album)
return albums
@@ -60,9 +122,17 @@ if __name__ == "__main__":
else:
data = parse_file(" ".join(sys.argv[1:]))
for album, link in data.items():
if link:
print(f"Album: {album}")
print(f"Link: {link}\n")
else:
print(f"Album: {album}\n")
for album in data:
print(f"Band: {album.artist}")
print(f"Album: {album.album}")
for video in album.tracks:
print(f"\tTrack {video.track}: {video.title}")
if album.album == "Even In Arcadia":
download_single_video(
video.url,
video.track,
album.artist,
album.album
)