mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-30 22:25:19 +00:00 
			
		
		
		
	[devscripts] make_lazy_extractors: Fix for Docker (#4958)
Authored by: josanabr
This commit is contained in:
		| @@ -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 | ||||
| 
 | ||||
| 
 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 josanabr
					josanabr