From 7b8875250cc6ae69a9e3bdfbd11247adb9b37019 Mon Sep 17 00:00:00 2001 From: Rafael Moraes <50295204+glomatico@users.noreply.github.com> Date: Sun, 8 Sep 2024 00:08:19 -0300 Subject: [PATCH] refactor `get_playlist_file_path` --- gamdl/downloader.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/gamdl/downloader.py b/gamdl/downloader.py index 47427b1..a527590 100644 --- a/gamdl/downloader.py +++ b/gamdl/downloader.py @@ -266,19 +266,17 @@ class Downloader: self, tags: dict, ): - template_folder = self.template_file_playlist.split("/") template_file = self.template_file_playlist.split("/") - template_final = template_folder + template_file - return self.output_path.joinpath( + return Path( + self.output_path, *[ self.get_sanitized_string(i.format(**tags), True) - for i in template_final[0:-1] - ] - ).joinpath( + for i in template_file[0:-1] + ], *[ - self.get_sanitized_string(template_final[-1].format(**tags), False) + self.get_sanitized_string(template_file[-1].format(**tags), False) + ".m3u8" - ] + ], ) def update_playlist_file(