From 3167c44d94f2c8884e1879fe37ee55652d829858 Mon Sep 17 00:00:00 2001 From: mockuser404 <53865090+mockuser404@users.noreply.github.com> Date: Wed, 27 Oct 2021 00:00:19 +0530 Subject: [PATCH] use os.path.join fixes #142 --- zspotify/podcast.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zspotify/podcast.py b/zspotify/podcast.py index eea36c1b..4b0b3b60 100644 --- a/zspotify/podcast.py +++ b/zspotify/podcast.py @@ -50,11 +50,15 @@ def download_episode(episode_id) -> None: episode_id = EpisodeId.from_base62(episode_id) stream = ZSpotify.get_content_stream(episode_id, ZSpotify.DOWNLOAD_QUALITY) - download_directory = os.path.dirname(__file__) + ZSpotify.get_config(ROOT_PODCAST_PATH) + extra_paths + download_directory = os.path.join( + 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(download_directory + filename + MusicFormat.OGG.value, + with open(os.path.join(download_directory, f"{filename}.ogg"), 'wb') as file, tqdm( desc=filename, total=total_size, @@ -67,4 +71,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') \ No newline at end of file + # extra_paths + filename + '.ogg')