mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-05 15:01:24 +01:00
Compare commits
3 Commits
5f58b86d12
...
aae42c5f24
Author | SHA1 | Date | |
---|---|---|---|
|
aae42c5f24 | ||
|
503e7c41e9 | ||
|
7389843b59 |
|
@ -361,11 +361,7 @@ class ARDBetaMediathekIE(InfoExtractor):
|
||||||
|
|
||||||
def _real_extract(self, url):
|
def _real_extract(self, url):
|
||||||
display_id = self._match_id(url)
|
display_id = self._match_id(url)
|
||||||
|
query = {'embedded': 'false', 'mcV6': 'true'}
|
||||||
query = {
|
|
||||||
'embedded': 'false',
|
|
||||||
'mcV6': 'true'
|
|
||||||
}
|
|
||||||
headers = {}
|
headers = {}
|
||||||
|
|
||||||
if self._get_cookies(self._TOKEN_URL).get('ams'):
|
if self._get_cookies(self._TOKEN_URL).get('ams'):
|
||||||
|
@ -373,17 +369,15 @@ class ARDBetaMediathekIE(InfoExtractor):
|
||||||
self._TOKEN_URL, display_id, 'Fetching token for age verification',
|
self._TOKEN_URL, display_id, 'Fetching token for age verification',
|
||||||
'Unable to fetch age verification token', fatal=False)
|
'Unable to fetch age verification token', fatal=False)
|
||||||
id_token = traverse_obj(token, ('idToken', {str}))
|
id_token = traverse_obj(token, ('idToken', {str}))
|
||||||
user_id = traverse_obj(id_token, ({jwt_decode_hs256}, ('user_id', 'sub'), {str}), get_all=False)
|
decoded_token = traverse_obj(id_token, ({jwt_decode_hs256}, {dict}))
|
||||||
if not id_token or not user_id:
|
user_id = traverse_obj(decoded_token, (('user_id', 'sub'), {str}), get_all=False)
|
||||||
|
if not user_id:
|
||||||
self.report_warning('Unable to extract token, continuing without authentication')
|
self.report_warning('Unable to extract token, continuing without authentication')
|
||||||
else:
|
else:
|
||||||
headers['x-authorization'] = f'Bearer {id_token}'
|
headers['x-authorization'] = f'Bearer {id_token}'
|
||||||
query['userId'] = user_id
|
query['userId'] = user_id
|
||||||
|
if decoded_token.get('age_rating') != 18:
|
||||||
age_rating = traverse_obj(id_token, ({jwt_decode_hs256}, 'age_rating'), get_all=False)
|
self.report_warning('Account is not verified as 18+; video may be unavailable')
|
||||||
if age_rating != 18:
|
|
||||||
self.report_warning(f'Authenticated age_rating is not 18, but "{age_rating}", '
|
|
||||||
'video might still be blocked')
|
|
||||||
|
|
||||||
page_data = self._download_json(
|
page_data = self._download_json(
|
||||||
f'https://api.ardmediathek.de/page-gateway/pages/ard/item/{display_id}',
|
f'https://api.ardmediathek.de/page-gateway/pages/ard/item/{display_id}',
|
||||||
|
@ -406,9 +400,7 @@ class ARDBetaMediathekIE(InfoExtractor):
|
||||||
media_data = traverse_obj(player_data, ('mediaCollection', 'embedded', {dict}))
|
media_data = traverse_obj(player_data, ('mediaCollection', 'embedded', {dict}))
|
||||||
|
|
||||||
if player_data.get('blockedByFsk'):
|
if player_data.get('blockedByFsk'):
|
||||||
self.raise_login_required(
|
self.raise_login_required('This video is only available for age verified users or after 22:00')
|
||||||
'This video is only available after 22:00, '
|
|
||||||
'try passing cookies a verified account session to enable age verification ')
|
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user