Merge pull request #143 from mockuser404/patch-1

use os.path.join
This commit is contained in:
Footsiefat 2021-10-27 07:34:02 +13:00 committed by GitHub
commit 05e2cdda7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -50,11 +50,15 @@ def download_episode(episode_id) -> None:
episode_id = EpisodeId.from_base62(episode_id) episode_id = EpisodeId.from_base62(episode_id)
stream = ZSpotify.get_content_stream(episode_id, ZSpotify.DOWNLOAD_QUALITY) 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) create_download_directory(download_directory)
total_size = stream.input_stream.size 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( 'wb') as file, tqdm(
desc=filename, desc=filename,
total=total_size, total=total_size,
@ -67,4 +71,4 @@ def download_episode(episode_id) -> None:
stream.input_stream.stream().read(ZSpotify.get_config(CHUNK_SIZE)))) stream.input_stream.stream().read(ZSpotify.get_config(CHUNK_SIZE))))
# convert_audio_format(ROOT_PODCAST_PATH + # convert_audio_format(ROOT_PODCAST_PATH +
# extra_paths + filename + '.ogg') # extra_paths + filename + '.ogg')