mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-30 03:21:31 +00:00
[WIP] got refactor of file mover basically working
This commit is contained in:
@@ -2099,7 +2099,9 @@ def prepend_extension(filename, ext, expected_real_ext=None):
|
||||
|
||||
def replace_extension(filename, ext, expected_real_ext=None):
|
||||
name, real_ext = os.path.splitext(filename)
|
||||
return '{}.{}'.format(
|
||||
ext = ext if ext.startswith('.') else '.' + ext
|
||||
|
||||
return '{}{}'.format(
|
||||
name if not expected_real_ext or real_ext[1:] == expected_real_ext else filename,
|
||||
ext)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user