aboutsummaryrefslogtreecommitdiffstats
path: root/pyinst.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2021-10-06 06:34:10 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2021-10-06 06:45:45 +0530
commit49e7e9c3ce9d5294f024757cbbfedd6c9d0623be (patch)
tree5baa6a28ec6b02e35d4012561a82dd3a56968d96 /pyinst.py
parent84726743993295f6105ed9ef5412040b8842e4c6 (diff)
downloadhypervideo-pre-49e7e9c3ce9d5294f024757cbbfedd6c9d0623be.tar.lz
hypervideo-pre-49e7e9c3ce9d5294f024757cbbfedd6c9d0623be.tar.xz
hypervideo-pre-49e7e9c3ce9d5294f024757cbbfedd6c9d0623be.zip
[docs,build] Change all pycryptodome references to pycryptodomex
Diffstat (limited to 'pyinst.py')
-rw-r--r--pyinst.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/pyinst.py b/pyinst.py
index be1e00caa..ed410e0f2 100644
--- a/pyinst.py
+++ b/pyinst.py
@@ -3,7 +3,6 @@
from __future__ import unicode_literals
import sys
-# import os
import platform
from PyInstaller.utils.hooks import collect_submodules
@@ -29,10 +28,6 @@ print(f'Building {arch}bit version with options {opts}')
FILE_DESCRIPTION = 'yt-dlp%s' % (' (32 Bit)' if _x86 else '')
-# root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-# print('Changing working directory to %s' % root_dir)
-# os.chdir(root_dir)
-
exec(compile(open('yt_dlp/version.py').read(), 'yt_dlp/version.py', 'exec'))
VERSION = locals()['__version__']
@@ -76,7 +71,22 @@ VERSION_FILE = VSVersionInfo(
]
)
-dependancies = ['Cryptodome', 'mutagen'] + collect_submodules('websockets')
+
+def pycryptodome_module():
+ try:
+ import Cryptodome # noqa: F401
+ except ImportError:
+ try:
+ import Crypto # noqa: F401
+ print('WARNING: Using Crypto since Cryptodome is not available. '
+ 'Install with: pip install pycryptodomex', file=sys.stderr)
+ return 'Crypto'
+ except ImportError:
+ pass
+ return 'Cryptodome'
+
+
+dependancies = [pycryptodome_module(), 'mutagen'] + collect_submodules('websockets')
excluded_modules = ['test', 'ytdlp_plugins', 'youtube-dl', 'youtube-dlc']
PyInstaller.__main__.run([