mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-16 05:13:21 +00:00
Fix directory creation not working with absolute paths
This commit is contained in:
parent
acd3d84298
commit
3af1e17284
|
@ -94,6 +94,7 @@ class FileDownloader(object):
|
||||||
"""Create directory components in filename. Similar to Unix "mkdir -p"."""
|
"""Create directory components in filename. Similar to Unix "mkdir -p"."""
|
||||||
components = filename.split(os.sep)
|
components = filename.split(os.sep)
|
||||||
aggregate = [os.sep.join(components[0:x]) for x in xrange(1, len(components))]
|
aggregate = [os.sep.join(components[0:x]) for x in xrange(1, len(components))]
|
||||||
|
aggregate = ['%s%s' % (x, os.sep) for x in aggregate] # Finish names with separator
|
||||||
for dir in aggregate:
|
for dir in aggregate:
|
||||||
if not os.path.exists(dir):
|
if not os.path.exists(dir):
|
||||||
os.mkdir(dir)
|
os.mkdir(dir)
|
||||||
|
|
Loading…
Reference in a new issue