Skip post-download operations if dl stop event is set

This commit is contained in:
rlaphoenix 2023-02-28 17:59:28 +00:00
parent 383e7d9647
commit b482f86bb3
1 changed files with 9 additions and 0 deletions

View File

@ -753,6 +753,10 @@ class dl:
license_widevine=prepare_drm
)
if self.DL_POOL_STOP.is_set():
# we stopped during the download, let's exit
return
# no else-if as DASH may convert the track to URL descriptor
if track.descriptor == track.Descriptor.URL:
aria2c(
@ -762,6 +766,11 @@ class dl:
proxy=proxy if track.needs_proxy else None,
progress=progress
)
if self.DL_POOL_STOP.is_set():
# we stopped during the download, let's exit
return
track.path = save_path
if not track.drm and isinstance(track, (Video, Audio)):