Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security problems and maintenance #32739

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions devscripts/buildserver.py
Expand Up @@ -54,7 +54,7 @@ class BuildHTTPServer(compat_socketserver.ThreadingMixIn, compat_http_server.HTT
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)
Expand Down Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion youtube_dl/extractor/minoto.py
Expand Up @@ -26,7 +26,7 @@ def _real_extract(self, url):
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an actual bug; thanks for the hint:

Suggested change
formats.extend([fmt_url, video_id, 'mp4'], m3u8_id='hls', fatal=False)
formats.extend(self._extract_m3u8_formats(fmt_url, video_id, 'mp4', m3u8_id='hls', fatal=False))

else:
fmt_profile = fmt.get('profile') or {}
formats.append({
Expand Down
8 changes: 4 additions & 4 deletions youtube_dl/utils.py
Expand Up @@ -2360,7 +2360,7 @@ def set_alpn_protocols(ctx):
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)
Expand All @@ -2372,8 +2372,8 @@ def set_alpn_protocols(ctx):
if sys.version_info < (3, 2):
return YoutubeDLHTTPSHandler(params, **kwargs)
else: # Python3 < 3.4
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
context.verify_mode = (ssl.CERT_NONE
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.verify_mode = (ssl.CERT_REQUIRED
if opts_no_check_certificate
else ssl.CERT_REQUIRED)
context.set_default_verify_paths()
Expand Down Expand Up @@ -2593,7 +2593,7 @@ def _hc_connect(self, *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)
Expand Down