[YoutubeDL] Ignore failure to create existing directory (#27811)
authorAaron Zeng <zeng.aaron.l@gmail.com>
Thu, 14 Jan 2021 04:46:07 +0000 (23:46 -0500)
committerGitHub <noreply@github.com>
Thu, 14 Jan 2021 04:46:07 +0000 (11:46 +0700)
youtube_dl/YoutubeDL.py

index 3f1f03379d3eb5a5deee61a4ed10fdccaabc97db..0ed4bc6ba470b6a5cac69607bb1c7d07db0eb49d 100755 (executable)
@@ -1779,6 +1779,8 @@ class YoutubeDL(object):
                     os.makedirs(dn)
                 return True
             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))
                 return False