diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index 8cb9da6..a725bd5 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -73,6 +73,9 @@ class Tv4play(Service, OpenGraphThumbMixin): url = "https://playback-api.b17g.net/media/{}?service=tv4&device=browser&protocol=hls%2Cdash&drm=widevine".format(vid) res = self.http.request("get", url, cookies=self.cookies) + if res.status_code > 200: + yield ServiceError("Can't play this because the video is geoblocked.") + return if res.json()["playbackItem"]["type"] == "hls": streams = hlsparse(self.config, self.http.request("get", res.json()["playbackItem"]["manifestUrl"]), res.json()["playbackItem"]["manifestUrl"], output=self.output, httpobject=self.http) @@ -136,6 +139,9 @@ class Tv4(Service, OpenGraphThumbMixin): url = "https://playback-api.b17g.net/media/{}?service=tv4&device=browser&protocol=hls%2Cdash&drm=widevine".format(self.output["id"]) res = self.http.request("get", url, cookies=self.cookies) + if res.status_code > 200: + yield ServiceError("Can't play this because the video is geoblocked.") + return if res.json()["playbackItem"]["type"] == "hls": streams = hlsparse(self.config, self.http.request("get", res.json()["playbackItem"]["manifestUrl"]), res.json()["playbackItem"]["manifestUrl"], output=self.output)