From 5928df5f3c6709d81568a58d277cacbf08fca6a3 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 15 Nov 2015 12:23:35 +0400 Subject: [PATCH] picsearch: better error message when the video is not available --- lib/svtplay_dl/service/picsearch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/svtplay_dl/service/picsearch.py b/lib/svtplay_dl/service/picsearch.py index 97d536f..99cb71a 100644 --- a/lib/svtplay_dl/service/picsearch.py +++ b/lib/svtplay_dl/service/picsearch.py @@ -37,6 +37,9 @@ class Picsearch(Service, OpenGraphThumbMixin): return jsondata = self.http.request("get", "http://csp.picsearch.com/rest?jsonp=&eventParam=1&auth=%s&method=embed&mediaid=%s" % (ajax_auth.group(1), mediaid.group(1))).text jsondata = json.loads(jsondata) + if "playerconfig" not in jsondata["media"]: + yield ServiceError(jsondata["error"]) + return playlist = jsondata["media"]["playerconfig"]["playlist"][1] if "bitrates" in playlist: files = playlist["bitrates"]