Resume partial downloads unless the .clean file is found

This commit is contained in:
tcely 2025-03-24 12:54:42 -04:00 committed by GitHub
parent e01301e1ce
commit f9eb571dd8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,7 +296,10 @@ def download_media(
temp_dir_parent = ytopts['paths']['temp'] temp_dir_parent = ytopts['paths']['temp']
temp_dir_prefix = f'{temp_dir_prefix}{v_key}-' temp_dir_prefix = f'{temp_dir_prefix}{v_key}-'
temp_dir_obj = TemporaryDirectory(prefix=temp_dir_prefix,dir=temp_dir_parent) temp_dir_obj = TemporaryDirectory(prefix=temp_dir_prefix,dir=temp_dir_parent)
if temp_dir_obj and (Path(temp_dir_parent) / '.clean').exists():
temp_dir_path = Path(temp_dir_obj.name) temp_dir_path = Path(temp_dir_obj.name)
else:
temp_dir_path = Path(temp_dir_parent)
(temp_dir_path / '.ignore').touch(exist_ok=True) (temp_dir_path / '.ignore').touch(exist_ok=True)
ytopts['paths'].update({ ytopts['paths'].update({
'home': str(output_dir), 'home': str(output_dir),