mirror of https://github.com/yt-dlp/yt-dlp.git
Expose `extensions` as param to `Response`, document
Authored by: bashonly
This commit is contained in:
parent
6c7bfb5c7c
commit
0b95a4f83f
|
@ -497,6 +497,7 @@ class Response(io.IOBase):
|
|||
@param headers: response headers.
|
||||
@param status: Response HTTP status code. Default is 200 OK.
|
||||
@param reason: HTTP status reason. Will use built-in reasons based on status code if not provided.
|
||||
@param extensions: Dictionary of handler-specific response extensions
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
|
@ -505,7 +506,9 @@ class Response(io.IOBase):
|
|||
url: str,
|
||||
headers: Mapping[str, str],
|
||||
status: int = 200,
|
||||
reason: str = None):
|
||||
reason: str = None,
|
||||
extensions: dict = None
|
||||
):
|
||||
|
||||
self.fp = fp
|
||||
self.headers = Message()
|
||||
|
@ -517,7 +520,7 @@ class Response(io.IOBase):
|
|||
self.reason = reason or HTTPStatus(status).phrase
|
||||
except ValueError:
|
||||
self.reason = None
|
||||
self.extensions = {}
|
||||
self.extensions = extensions or {}
|
||||
|
||||
def readable(self):
|
||||
return self.fp.readable()
|
||||
|
|
Loading…
Reference in New Issue