From 28bbfc6eabc39dcd7857abd4a4e0e9a8c962c4d1 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 25 Feb 2018 21:22:59 +0100 Subject: [PATCH] dplay: show an error message if its a bad url --- lib/svtplay_dl/service/dplay.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/svtplay_dl/service/dplay.py b/lib/svtplay_dl/service/dplay.py index a0dbd19..53e8c3a 100644 --- a/lib/svtplay_dl/service/dplay.py +++ b/lib/svtplay_dl/service/dplay.py @@ -41,6 +41,9 @@ class Dplay(Service): 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"}) janson = res.json() + if "errors" in janson: + yield ServiceError("Cant find any videos on this url") + return if self.options.output_auto: directory = os.path.dirname(self.options.output)