Compare commits

..

7 Commits

Author SHA1 Message Date
coletdjnz
b16f050552
gah 2023-10-10 20:09:42 +13:00
coletdjnz
22012642f8
Update yt_dlp/YoutubeDL.py 2023-10-10 07:08:13 +00:00
coletdjnz
0fd6dc657f
supress 2023-10-10 20:04:10 +13:00
coletdjnz
36e87f19e0
add docs 2023-10-10 19:58:39 +13:00
coletdjnz
9b3e66e41d
oops, add Cryptodome back 2023-10-10 19:52:38 +13:00
coletdjnz
19de7f5f44
try this 2023-10-10 19:48:26 +13:00
coletdjnz
32bff8234b
exclude requests and urllib3 from py2exe build
to investigate later
2023-10-10 19:30:20 +13:00
4 changed files with 13 additions and 6 deletions

View File

@ -62,7 +62,14 @@ def py2exe_params():
'compressed': 1, 'compressed': 1,
'optimize': 2, 'optimize': 2,
'dist_dir': './dist', 'dist_dir': './dist',
'excludes': ['Crypto', 'Cryptodome'], # py2exe cannot import Crypto 'excludes': [
# py2exe cannot import Crypto
'Crypto',
'Cryptodome',
# py2exe appears to confuse this with our socks library.
# We don't use pysocks and urllib3.contrib.socks would fail to import if tried.
'urllib3.contrib.socks'
],
'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'], 'dll_excludes': ['w9xpopen.exe', 'crypt32.dll'],
# Modules that are only imported dynamically must be added here # Modules that are only imported dynamically must be added here
'includes': ['yt_dlp.compat._legacy', 'yt_dlp.compat._deprecated', 'includes': ['yt_dlp.compat._legacy', 'yt_dlp.compat._deprecated',

View File

@ -4099,7 +4099,8 @@ class YoutubeDL:
'client_certificate_key': 'client_certificate_key', 'client_certificate_key': 'client_certificate_key',
'client_certificate_password': 'client_certificate_password', 'client_certificate_password': 'client_certificate_password',
}, },
}))) }),
))
director.preferences.update(preferences or []) director.preferences.update(preferences or [])
if 'prefer-legacy-http-handler' in self.params['compat_opts']: if 'prefer-legacy-http-handler' in self.params['compat_opts']:
director.preferences.add(lambda rh, _: 500 if rh.RH_KEY == 'Urllib' else 0) director.preferences.add(lambda rh, _: 500 if rh.RH_KEY == 'Urllib' else 0)

View File

@ -23,7 +23,7 @@ def get_hidden_imports():
yield pycryptodome_module() yield pycryptodome_module()
yield from collect_submodules('websockets') yield from collect_submodules('websockets')
# These are auto-detected, but explicitly add them just in case # These are auto-detected, but explicitly add them just in case
yield from ('mutagen', 'brotli', 'certifi') yield from ('mutagen', 'brotli', 'certifi', 'requests', 'urllib3')
hiddenimports = list(get_hidden_imports()) hiddenimports = list(get_hidden_imports())

View File

@ -1,3 +1,4 @@
import contextlib
import functools import functools
import http.client import http.client
import logging import logging
@ -116,10 +117,8 @@ See: https://github.com/urllib3/urllib3/issues/517
""" """
if urllib3_version < (2, 0, 0): if urllib3_version < (2, 0, 0):
try: with contextlib.suppress():
urllib3.util.IS_SECURETRANSPORT = urllib3.util.ssl_.IS_SECURETRANSPORT = True urllib3.util.IS_SECURETRANSPORT = urllib3.util.ssl_.IS_SECURETRANSPORT = True
except AttributeError:
pass
# Requests will not automatically handle no_proxy by default # Requests will not automatically handle no_proxy by default