mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
[postprocessor/atomicparsley] Don't try to remove the temporary and original files if the format is unsupported (fixes #5419)
This commit is contained in:
parent
8f02ad4f12
commit
37b44fe7c1
@ -50,8 +50,13 @@ class AtomicParsleyPP(PostProcessor):
|
||||
msg = stderr.decode('utf-8', 'replace').strip()
|
||||
raise AtomicParsleyPPError(msg)
|
||||
|
||||
os.remove(encodeFilename(filename))
|
||||
os.remove(encodeFilename(temp_thumbnail))
|
||||
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
|
||||
# for formats that don't support thumbnails (like 3gp) AtomicParsley
|
||||
# won't create to the temporary file
|
||||
if b'No changes' in stdout:
|
||||
self._downloader.report_warning('The file format doesn\'t support embedding a thumbnail')
|
||||
else:
|
||||
os.remove(encodeFilename(filename))
|
||||
os.rename(encodeFilename(temp_filename), encodeFilename(filename))
|
||||
|
||||
return True, info
|
||||
|
Loading…
Reference in New Issue
Block a user