diff --git a/README.md b/README.md index 3f7062b..7b8f1b0 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Requirements: Binaries -- Python 3.8 or greater +- Python 3.9 or greater - ffmpeg* - Git** diff --git a/src/album.py b/src/album.py index d797d02..12f86eb 100644 --- a/src/album.py +++ b/src/album.py @@ -28,7 +28,7 @@ def get_album_tracks(album_id): def get_album_name(album_id): """ Returns album name """ resp = ZSpotify.invoke_url(f'{ALBUM_URL}/{album_id}') - return sanitize_data(resp[ARTISTS][0][NAME]), sanitize_data(resp[NAME]) + return resp[ARTISTS][0][NAME], sanitize_data(resp[NAME]) def get_artist_albums(artist_id): diff --git a/src/podcast.py b/src/podcast.py index 1ff2910..0d6c13c 100644 --- a/src/podcast.py +++ b/src/podcast.py @@ -1,3 +1,4 @@ +import os from typing import Optional from librespot.metadata import EpisodeId @@ -47,10 +48,11 @@ def download_episode(episode_id) -> None: episode_id = EpisodeId.from_base62(episode_id) stream = ZSpotify.get_content_stream(episode_id, ZSpotify.DOWNLOAD_QUALITY) - create_download_directory(ZSpotify.get_config(ROOT_PODCAST_PATH) + extra_paths) + download_directory = os.path.dirname(__file__) + ZSpotify.get_config(ROOT_PODCAST_PATH) + extra_paths + create_download_directory(download_directory) total_size = stream.input_stream.size - with open(ZSpotify.get_config(ROOT_PODCAST_PATH) + extra_paths + filename + MusicFormat.OGG.value, + with open(download_directory + filename + MusicFormat.OGG.value, 'wb') as file, tqdm( desc=filename, total=total_size, @@ -63,6 +65,4 @@ def download_episode(episode_id) -> None: stream.input_stream.stream().read(ZSpotify.get_config(CHUNK_SIZE)))) # convert_audio_format(ROOT_PODCAST_PATH + - # extra_paths + filename + '.ogg') - - # related functions that do stuff with the spotify API + # extra_paths + filename + '.ogg') \ No newline at end of file