update cleanup_temp_path

This commit is contained in:
Rafael Moraes
2024-09-24 21:26:47 -03:00
parent fec4f223c9
commit 268c982a6a
5 changed files with 6 additions and 9 deletions
+2 -5
View File
@@ -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)
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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,