1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

picsearch: better error messages

This commit is contained in:
Johan Andersson 2014-03-31 19:15:40 +02:00
parent 0046d05987
commit 05972c7b43

View File

@ -18,11 +18,11 @@ class Picsearch(Service, OpenGraphThumbMixin):
data = self.get_urldata() data = self.get_urldata()
ajax_auth = re.search(r"picsearch_ajax_auth = '(\w+)'", data) ajax_auth = re.search(r"picsearch_ajax_auth = '(\w+)'", data)
if not ajax_auth: if not ajax_auth:
print "hej" log.error("Cant find token for video")
sys.exit(2) sys.exit(2)
mediaid = re.search(r"mediaId = '(\w+)';", data) mediaid = re.search(r"mediaId = '(\w+)';", data)
if not mediaid: if not mediaid:
print "didi" log.error("Cant find media id")
sys.exit(2) sys.exit(2)
jsondata = get_http_data("http://csp.picsearch.com/rest?jsonp=&eventParam=1&auth=%s&method=embed&mediaid=%s" % (ajax_auth.group(1), mediaid.group(1))) jsondata = get_http_data("http://csp.picsearch.com/rest?jsonp=&eventParam=1&auth=%s&method=embed&mediaid=%s" % (ajax_auth.group(1), mediaid.group(1)))
jsondata = json.loads(jsondata) jsondata = json.loads(jsondata)