mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-08-03 10:50:28 +00:00
#29 New option -P
/--paths
to give different paths for different types of files
Syntax: `-P "type:path" -P "type:path"` Types: home, temp, description, annotation, subtitle, infojson, thumbnail
This commit is contained in:
@@ -5893,3 +5893,15 @@ _HEX_TABLE = '0123456789abcdef'
|
||||
|
||||
def random_uuidv4():
|
||||
return re.sub(r'[xy]', lambda x: _HEX_TABLE[random.randint(0, 15)], 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx')
|
||||
|
||||
|
||||
def make_dir(path, to_screen=None):
|
||||
try:
|
||||
dn = os.path.dirname(path)
|
||||
if dn and not os.path.exists(dn):
|
||||
os.makedirs(dn)
|
||||
return True
|
||||
except (OSError, IOError) as err:
|
||||
if callable(to_screen) is not None:
|
||||
to_screen('unable to create directory ' + error_to_compat_str(err))
|
||||
return False
|
||||
|
Reference in New Issue
Block a user