mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-14 00:47:22 +08:00
Delete source files after merging
This commit is contained in:
parent
378969fdfd
commit
3ab9e4128e
@ -1052,6 +1052,13 @@ class YoutubeDL(object):
|
|||||||
os.remove(encodeFilename(filename))
|
os.remove(encodeFilename(filename))
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
self.report_warning('Unable to remove downloaded video file')
|
self.report_warning('Unable to remove downloaded video file')
|
||||||
|
if '__files_to_merge' in ie_info and not self.params.get('keepvideo', False):
|
||||||
|
for fname in ie_info['__files_to_merge']:
|
||||||
|
try:
|
||||||
|
self.to_screen('Deleting original file %s (pass -k to keep)' % fname)
|
||||||
|
os.remove(encodeFilename(fname))
|
||||||
|
except (IOError, OSError):
|
||||||
|
self.report_warning('Unable to remove downloaded video file')
|
||||||
|
|
||||||
def _make_archive_id(self, info_dict):
|
def _make_archive_id(self, info_dict):
|
||||||
# Future-proof against any change in case
|
# Future-proof against any change in case
|
||||||
|
Loading…
x
Reference in New Issue
Block a user