Skip to content

Commit

Permalink
Changed download to accept correct dict.
Browse files Browse the repository at this point in the history
  • Loading branch information
remi1111 committed Mar 30, 2024
1 parent 3cfef32 commit 635217e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/download.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
""" Downloading of songs through yt-dlp """
import subprocess

def download_ids(id_dict):
def download_ids(id_dict, verbose=False):
""" Download all songs from a dictionary. """
for song in id_dict:
title = "~/audio/" + id_dict[song][2] + " - " + id_dict[song][3] + ".%(ext)s"
page = "https://www.youtube.com/watch?v=" + id_dict[song][1]
print(id_dict[song][3] + "\t id: " + id_dict[song][1])
title = "~/audio/" + song['song artist'] + " - " + song['song name'] + ".%(ext)s"
page = "https://www.youtube.com/watch?v=" + song['video id']
if verbose:
print(song['song name'] + "\t id: " + song['video id'])
subprocess.run(["yt-dlp",
'-x',
'-f',
Expand Down

0 comments on commit 635217e

Please sign in to comment.