aboutsummaryrefslogtreecommitdiffstats
path: root/devscripts
diff options
context:
space:
mode:
authorjosanabr <john.sanabria@correounivalle.edu.co>2022-09-18 09:32:28 -0500
committerGitHub <noreply@github.com>2022-09-18 20:02:28 +0530
commit46d72cd2c7fced093189babb484d53766f52ef57 (patch)
tree331b094bd768dc0e3acd257448c2a16a3c32b0d8 /devscripts
parent19b4e59a1e1bf368078f90e7f735fa4576f97b64 (diff)
downloadhypervideo-pre-46d72cd2c7fced093189babb484d53766f52ef57.tar.lz
hypervideo-pre-46d72cd2c7fced093189babb484d53766f52ef57.tar.xz
hypervideo-pre-46d72cd2c7fced093189babb484d53766f52ef57.zip
[devscripts] make_lazy_extractors: Fix for Docker (#4958)
Authored by: josanabr
Diffstat (limited to 'devscripts')
-rw-r--r--devscripts/make_lazy_extractors.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/devscripts/make_lazy_extractors.py b/devscripts/make_lazy_extractors.py
index 43885331f..383c7e057 100644
--- a/devscripts/make_lazy_extractors.py
+++ b/devscripts/make_lazy_extractors.py
@@ -3,6 +3,7 @@
# Allow direct execution
import os
import sys
+import shutil
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
@@ -50,12 +51,13 @@ def get_all_ies():
PLUGINS_DIRNAME = 'ytdlp_plugins'
BLOCKED_DIRNAME = f'{PLUGINS_DIRNAME}_blocked'
if os.path.exists(PLUGINS_DIRNAME):
- os.rename(PLUGINS_DIRNAME, BLOCKED_DIRNAME)
+ # os.rename cannot be used, e.g. in Docker. See https://github.com/yt-dlp/yt-dlp/pull/4958
+ shutil.move(PLUGINS_DIRNAME, BLOCKED_DIRNAME)
try:
from yt_dlp.extractor.extractors import _ALL_CLASSES
finally:
if os.path.exists(BLOCKED_DIRNAME):
- os.rename(BLOCKED_DIRNAME, PLUGINS_DIRNAME)
+ shutil.move(BLOCKED_DIRNAME, PLUGINS_DIRNAME)
return _ALL_CLASSES