]> jfr.im git - yt-dlp.git/blobdiff - setup.py
[outtmpl] Fix replacement for `playlist_index`
[yt-dlp.git] / setup.py
index 88716152a4805a59f839718a6053cc57e4e4f45a..a2f9f55c365cf4821bc0ff17bf7669f4a41fc753 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,8 +1,12 @@
 #!/usr/bin/env python3
 
-import os.path
-import subprocess
+# Allow execution from anywhere
+import os
 import sys
+
+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
+
+import subprocess
 import warnings
 
 try:
@@ -61,7 +65,8 @@ def py2exe_params():
             'excludes': ['Crypto', 'Cryptodome'],  # py2exe cannot import Crypto
             'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
             # Modules that are only imported dynamically must be added here
-            'includes': ['yt_dlp.compat._legacy'],
+            'includes': ['yt_dlp.compat._legacy', 'yt_dlp.compat._deprecated',
+                         'yt_dlp.utils._legacy', 'yt_dlp.utils._deprecated'],
         },
         'zipfile': None,
     }
@@ -88,7 +93,10 @@ def build_params():
     params = {'data_files': data_files}
 
     if setuptools_available:
-        params['entry_points'] = {'console_scripts': ['yt-dlp = yt_dlp:main']}
+        params['entry_points'] = {
+            'console_scripts': ['yt-dlp = yt_dlp:main'],
+            'pyinstaller40': ['hook-dirs = yt_dlp.__pyinstaller:get_hook_dirs'],
+        }
     else:
         params['scripts'] = ['yt-dlp']
     return params