mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-12-06 06:45:00 +01:00
[rh:requests] Work around partial read dropping data (#13599)
Authored by: Grub4K
This commit is contained in:
parent
ca5cce5b07
commit
c2ff2dbaec
2 changed files with 16 additions and 5 deletions
|
|
@ -140,6 +140,10 @@ class RequestsResponseAdapter(Response):
|
|||
|
||||
def read(self, amt: int | None = None):
|
||||
try:
|
||||
# Work around issue with `.read(amt)` then `.read()`
|
||||
# See: https://github.com/urllib3/urllib3/issues/3636
|
||||
if amt is None:
|
||||
amt = (1 << 31) - 1
|
||||
# Interact with urllib3 response directly.
|
||||
return self.fp.read(amt, decode_content=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue