projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
75ef77c
)
[prosiebensat1] improve geo restriction handling(closes #23571)
author
Remita Amine
<remitamine@gmail.com>
Mon, 30 Dec 2019 21:31:11 +0000
(22:31 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Mon, 30 Dec 2019 21:31:11 +0000
(22:31 +0100)
youtube_dl/extractor/prosiebensat1.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/prosiebensat1.py
b/youtube_dl/extractor/prosiebensat1.py
index e19a470a5eee5efda48fe88a694c7e3a62010963..1bc4f9b6b3a455e027f1e676f24c4f352888a0c4 100644
(file)
--- a/
youtube_dl/extractor/prosiebensat1.py
+++ b/
youtube_dl/extractor/prosiebensat1.py
@@
-16,7
+16,7
@@
from ..utils import (
class ProSiebenSat1BaseIE(InfoExtractor):
class ProSiebenSat1BaseIE(InfoExtractor):
- _GEO_
COUNTRIES = ['DE']
+ _GEO_
BYPASS = False
_ACCESS_ID = None
_SUPPORTED_PROTOCOLS = 'dash:clear,hls:clear,progressive:clear'
_V4_BASE_URL = 'https://vas-v4.p7s1video.net/4.0/get'
_ACCESS_ID = None
_SUPPORTED_PROTOCOLS = 'dash:clear,hls:clear,progressive:clear'
_V4_BASE_URL = 'https://vas-v4.p7s1video.net/4.0/get'
@@
-39,14
+39,18
@@
class ProSiebenSat1BaseIE(InfoExtractor):
formats = []
if self._ACCESS_ID:
raw_ct = self._ENCRYPTION_KEY + clip_id + self._IV + self._ACCESS_ID
formats = []
if self._ACCESS_ID:
raw_ct = self._ENCRYPTION_KEY + clip_id + self._IV + self._ACCESS_ID
-
server_token = (
self._download_json(
+
protocols =
self._download_json(
self._V4_BASE_URL + 'protocols', clip_id,
'Downloading protocols JSON',
headers=self.geo_verification_headers(), query={
'access_id': self._ACCESS_ID,
'client_token': sha1((raw_ct).encode()).hexdigest(),
'video_id': clip_id,
self._V4_BASE_URL + 'protocols', clip_id,
'Downloading protocols JSON',
headers=self.geo_verification_headers(), query={
'access_id': self._ACCESS_ID,
'client_token': sha1((raw_ct).encode()).hexdigest(),
'video_id': clip_id,
- }, fatal=False) or {}).get('server_token')
+ }, fatal=False, expected_status=(403,)) or {}
+ error = protocols.get('error') or {}
+ if error.get('title') == 'Geo check failed':
+ self.raise_geo_restricted(countries=['AT', 'CH', 'DE'])
+ server_token = protocols.get('server_token')
if server_token:
urls = (self._download_json(
self._V4_BASE_URL + 'urls', clip_id, 'Downloading urls JSON', query={
if server_token:
urls = (self._download_json(
self._V4_BASE_URL + 'urls', clip_id, 'Downloading urls JSON', query={