1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-09-03 00:25:08 +00:00

[utils] HTTPHeaderDict: Handle byte values

This commit is contained in:
pukkandan
2023-07-30 03:18:10 +05:30
parent de20687ee6
commit 3f7965105d
2 changed files with 4 additions and 0 deletions

View File

@ -65,6 +65,8 @@ class HTTPHeaderDict(collections.UserDict, dict):
self.update(kwargs)
def __setitem__(self, key, value):
if isinstance(value, bytes):
value = value.decode('latin-1')
super().__setitem__(key.title(), str(value))
def __getitem__(self, key):