Browse Source

[YoutubeDL] Ignore failure to create existing directory (#27811)

Aaron Zeng 4 years ago
parent
commit
8e5477d036
1 changed files with 2 additions and 0 deletions
  1. 2 0
      youtube_dl/YoutubeDL.py

+ 2 - 0
youtube_dl/YoutubeDL.py

@@ -1779,6 +1779,8 @@ class YoutubeDL(object):
                     os.makedirs(dn)
                     os.makedirs(dn)
                 return True
                 return True
             except (OSError, IOError) as err:
             except (OSError, IOError) as err:
+                if isinstance(err, OSError) and err.errno == errno.EEXIST:
+                    return True
                 self.report_error('unable to create directory ' + error_to_compat_str(err))
                 self.report_error('unable to create directory ' + error_to_compat_str(err))
                 return False
                 return False