mirror of https://github.com/streamlink/streamlink
plugin.api.http_session: Add schema keyword argument.
This commit is contained in:
parent
f00945496d
commit
7baae19f0b
|
@ -100,6 +100,7 @@ class HTTPSession(Session):
|
|||
headers = kwargs.pop("headers", {})
|
||||
params = kwargs.pop("params", {})
|
||||
proxies = kwargs.pop("proxies", self.proxies)
|
||||
schema = kwargs.pop("schema", None)
|
||||
session = kwargs.pop("session", None)
|
||||
timeout = kwargs.pop("timeout", self.timeout)
|
||||
|
||||
|
@ -121,4 +122,7 @@ class HTTPSession(Session):
|
|||
err.err = rerr
|
||||
raise err
|
||||
|
||||
if schema:
|
||||
res = schema.validate(res.text, name="response text", exception=PluginError)
|
||||
|
||||
return res
|
||||
|
|
Loading…
Reference in New Issue