From f0afdbf6ac470454588db9ddfcc21b257a60bd1a Mon Sep 17 00:00:00 2001 From: josemgarciar <114011530+josemgarciar@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:52:58 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Co-authored-by:=20Juli=C3=A1n=20Romero=20Pa?= =?UTF-8?q?rejo=20=20Co-authored-by:=20FernandoTC18?= =?UTF-8?q?=20=20Changes=20for=20ma?= =?UTF-8?q?intenance=20and=20protocols=20security=20problems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- devscripts/buildserver.py | 8 ++++---- youtube_dl/extractor/minoto.py | 2 +- youtube_dl/utils.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/devscripts/buildserver.py b/devscripts/buildserver.py index 4a4295ba9..f051670b1 100644 --- a/devscripts/buildserver.py +++ b/devscripts/buildserver.py @@ -54,7 +54,7 @@ LPTSTR = ctypes.c_wchar_p START_CALLBACK = ctypes.WINFUNCTYPE(None, ctypes.c_int, ctypes.POINTER(LPTSTR)) -class SERVICE_TABLE_ENTRY(ctypes.Structure): +class ServiceTableEntry(ctypes.Structure): _fields_ = [ ('lpServiceName', LPTSTR), ('lpServiceProc', START_CALLBACK) @@ -183,12 +183,12 @@ def win_service_start(service_name, real_main): try: cb = START_CALLBACK( functools.partial(win_service_main, service_name, real_main)) - dispatch_table = _ctypes_array(SERVICE_TABLE_ENTRY, [ - SERVICE_TABLE_ENTRY( + dispatch_table = _ctypes_array(ServiceTableEntry, [ + ServiceTableEntry( service_name, cb ), - SERVICE_TABLE_ENTRY(None, ctypes.cast(None, START_CALLBACK)) + ServiceTableEntry(None, ctypes.cast(None, START_CALLBACK)) ]) if not advapi32.StartServiceCtrlDispatcherW(dispatch_table): diff --git a/youtube_dl/extractor/minoto.py b/youtube_dl/extractor/minoto.py index 636731195..80d6c1367 100644 --- a/youtube_dl/extractor/minoto.py +++ b/youtube_dl/extractor/minoto.py @@ -26,7 +26,7 @@ class MinotoIE(InfoExtractor): continue container = fmt.get('container') if container == 'hls': - formats.extend(fmt_url, video_id, 'mp4', m3u8_id='hls', fatal=False) + formats.extend([fmt_url, video_id, 'mp4'], m3u8_id='hls', fatal=False) else: fmt_profile = fmt.get('profile') or {} formats.append({ diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index c249e7168..ab8bf24b8 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2372,7 +2372,7 @@ def make_HTTPS_handler(params, **kwargs): if sys.version_info < (3, 2): return YoutubeDLHTTPSHandler(params, **kwargs) else: # Python3 < 3.4 - context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) + context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) context.verify_mode = (ssl.CERT_NONE if opts_no_check_certificate else ssl.CERT_REQUIRED) @@ -2593,7 +2593,7 @@ def _create_http_connection(ydl_handler, http_class, is_https, *args, **kwargs): if is_https: self.sock = ssl.wrap_socket( sock, self.key_file, self.cert_file, - ssl_version=ssl.PROTOCOL_TLSv1) + ssl_version=ssl.PROTOCOL_TLSv1_2) else: self.sock = sock hc.connect = functools.partial(_hc_connect, hc) From 481ac5e12ca82b27b48500626718ef8a8b1457b8 Mon Sep 17 00:00:00 2001 From: josemgarciar <114011530+josemgarciar@users.noreply.github.com> Date: Fri, 8 Mar 2024 11:06:35 +0100 Subject: [PATCH 2/2] =?UTF-8?q?Co-authored-by:=20Juli=C3=A1n=20Romero=20Pa?= =?UTF-8?q?rejo=20=20Co-authored-by:=20FernandoTC18?= =?UTF-8?q?=20=20Maintenance=20and?= =?UTF-8?q?=20security=20problems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- youtube_dl/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index ab8bf24b8..7d37626cd 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -2360,7 +2360,7 @@ def make_HTTPS_handler(params, **kwargs): set_alpn_protocols(context) if opts_no_check_certificate: context.check_hostname = False - context.verify_mode = ssl.CERT_NONE + context.verify_mode = ssl.CERT_REQUIRED try: return YoutubeDLHTTPSHandler(params, context=context, **kwargs) @@ -2373,7 +2373,7 @@ def make_HTTPS_handler(params, **kwargs): return YoutubeDLHTTPSHandler(params, **kwargs) else: # Python3 < 3.4 context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2) - context.verify_mode = (ssl.CERT_NONE + context.verify_mode = (ssl.CERT_REQUIRED if opts_no_check_certificate else ssl.CERT_REQUIRED) context.set_default_verify_paths()