diff --git a/votify/downloader.py b/votify/downloader.py index 557f3ec..c616365 100644 --- a/votify/downloader.py +++ b/votify/downloader.py @@ -572,10 +572,10 @@ class Downloader: playlist_track, ) - def _cleanup_temp_path(self): + def cleanup_temp_path(self): if self.temp_path.exists() and not self.skip_cleanup: logger.debug(f'Cleaning up "{self.temp_path}"') - self.cleanup_temp_path() + shutil.rmtree(self.temp_path) @staticmethod @functools.lru_cache() @@ -593,6 +593,3 @@ class Downloader: if cover_url is not None: cover_path.parent.mkdir(parents=True, exist_ok=True) cover_path.write_bytes(self.get_response_bytes(cover_url)) - - def cleanup_temp_path(self): - shutil.rmtree(self.temp_path) diff --git a/votify/downloader_episode.py b/votify/downloader_episode.py index 1ffe9e8..deb2969 100644 --- a/votify/downloader_episode.py +++ b/votify/downloader_episode.py @@ -59,7 +59,7 @@ class DownloaderEpisode(DownloaderAudio): try: self._download(*args, **kwargs) finally: - self.downloader._cleanup_temp_path() + self.downloader.cleanup_temp_path() def _download( self, diff --git a/votify/downloader_episode_video.py b/votify/downloader_episode_video.py index 9e4298d..005f307 100644 --- a/votify/downloader_episode_video.py +++ b/votify/downloader_episode_video.py @@ -30,7 +30,7 @@ class DownloaderEpisodeVideo(DownloaderVideo): try: self._download(*args, **kwargs) finally: - self.downloader._cleanup_temp_path() + self.downloader.cleanup_temp_path() def _download( self, diff --git a/votify/downloader_music_video.py b/votify/downloader_music_video.py index 1ea85fa..3af94ab 100644 --- a/votify/downloader_music_video.py +++ b/votify/downloader_music_video.py @@ -94,7 +94,7 @@ class DownloaderMusicVideo(DownloaderVideo): finally: if self.downloader.temp_path.exists(): logger.debug(f'Cleaning up "{self.downloader.temp_path}"') - self.downloader.cleanup_temp_path() + self.downloader.cleanup_temp_path_ab() def _download( self, diff --git a/votify/downloader_song.py b/votify/downloader_song.py index 132b198..ecb578b 100644 --- a/votify/downloader_song.py +++ b/votify/downloader_song.py @@ -136,7 +136,7 @@ class DownloaderSong(DownloaderAudio): try: self._download(*args, **kwargs) finally: - self.downloader._cleanup_temp_path() + self.downloader.cleanup_temp_path() def _download( self,