Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rickystar04 committed Oct 25, 2023
1 parent 079fbaa commit 564f5e2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 23 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ SPDownloader is a Python-based tool that allows you to download all the tracks f
## Setup

1. Clone this repository to your local machine.
2. Navigate to the `modules` folder and open the `cred.py` file.
3. Paste your Client Id and Client Secret in the appropriate fields in `cred.py`.
4. Run `setup.py` to install the necessary dependencies.
2. Run `setup.py` to install the necessary dependencies.
3. Run the "spdownloader.py" file once to create the .env file, then edit it by entering the client_id and client_secret you copied previously
4. Paste the Client Id and Client Secret into the appropriate fields in the newly created `.env` file

## Usage

1. Open Spotify and navigate to the playlist or album you want to download.
2. Click the 3 dots and select share > copy link to playlist.
3. Run `python3 spdownloader.py` in your terminal.
4. Paste the link to the playlist or album

## Contributing

Expand Down
12 changes: 0 additions & 12 deletions modules/download_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@ def download_songs(record, filelocation, i, playlist, progress_callback):
error_code = ydl.download(url)
print(error_code)

"""
os.rename(
os.path.join("music", playlist, original),
os.path.join("music", playlist, record["titolo"]),
)
extract_audio(
os.path.join("music", playlist, record["titolo"]),
playlist,
record["titolo"] + ".mp3",
)
"""
tqdm.write(
color.GREEN + record["titolo"] + " downloaded successfully!" + color.END
)
Expand Down
1 change: 0 additions & 1 deletion modules/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ def image(playlist_name, type):

with open("images/"+ title + " cover.png", "rb") as cover:
audio.tag.images.set(3, cover.read(), "image/jpeg")
print("Fatto")

tag = audio.tag

Expand Down
8 changes: 1 addition & 7 deletions spdownloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ def start_download(playlist_name, type):
print(color.BOLD + color.RED + "\nFinished!" + color.END)
#

# TODO
# da rimettere:

dir = "images/"
for f in os.listdir(dir):
os.remove(os.path.join(dir, f))
Expand All @@ -67,9 +66,6 @@ def main():
cmd = f'cp "{src}" "{dst}"'
os.system(cmd)

# Copy File


cycle = True
while cycle:

Expand All @@ -85,8 +81,6 @@ def main():
if auth:
link = input("Paste playlist link: ")

# playlist_id = "https://open.spotify.com/playlist/2CLuiyi6uFuRGOV2ys3IZo"

name, type = song_download(link)
if type == "playlist":
print("PLAYLIST: " + name)
Expand Down

0 comments on commit 564f5e2

Please sign in to comment.