mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 21:54:17 +01:00
dplay: show an error message if its a bad url
This commit is contained in:
parent
f8877bb970
commit
28bbfc6eab
@ -41,6 +41,9 @@ class Dplay(Service):
|
|||||||
url = "https://disco-api.{}/content{}".format(self.domain, parse.path)
|
url = "https://disco-api.{}/content{}".format(self.domain, parse.path)
|
||||||
res = self.http.get(url, headers={"x-disco-client": "WEB:UNKNOWN:dplay-client:0.0.1"})
|
res = self.http.get(url, headers={"x-disco-client": "WEB:UNKNOWN:dplay-client:0.0.1"})
|
||||||
janson = res.json()
|
janson = res.json()
|
||||||
|
if "errors" in janson:
|
||||||
|
yield ServiceError("Cant find any videos on this url")
|
||||||
|
return
|
||||||
|
|
||||||
if self.options.output_auto:
|
if self.options.output_auto:
|
||||||
directory = os.path.dirname(self.options.output)
|
directory = os.path.dirname(self.options.output)
|
||||||
|
Loading…
Reference in New Issue
Block a user