1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

dplay: better show a error message instead of crashing

This commit is contained in:
Johan Andersson 2016-02-07 20:43:00 +01:00
parent 8db85270c8
commit 293b6ae7e5

View File

@ -81,6 +81,9 @@ class Dplay(Service):
else:
self.options.cookies = cookie
data = self.http.request("get", "https://secure.%s/secure/api/v2/user/authorization/stream/%s?stream_type=hds" % (domain, vid), cookies=self.options.cookies)
if data.status_code == 403:
yield ServiceError("Geoblocked video")
return
dataj = json.loads(data.text)
if "hds" in dataj:
streams = hdsparse(copy.copy(self.options), self.http.request("get", dataj["hds"], params={"hdcore": "3.8.0"}), dataj["hds"])