1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-08-13 16:08:29 +00:00

Fix Content-Length calculation in mhtml generation

This commit is contained in:
Masterjun 2025-08-11 23:52:51 +02:00 committed by GitHub
parent b7de89c910
commit ad355fdc65
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -133,7 +133,7 @@ def real_download(self, filename, info_dict):
'\r\n'
f'--{frag_boundary}\r\n'
'Content-Type: text/html; charset=utf-8\r\n'
f'Content-Length: {len(stub)}\r\n'
f'Content-Length: {len(stub.encode())}\r\n'
'\r\n'
f'{stub}\r\n').encode())
extra_state['header_written'] = True