Revert commit 8562218

[ard] improve clip id extraction
8562218350

This was merged incorrectly
This commit is contained in:
pukkandan 2021-03-25 04:31:25 +05:30
parent a3affbe6a0
commit b704fc1a68
No known key found for this signature in database
GPG key ID: 0F00D95A001F4698

View file

@ -413,12 +413,6 @@ class ARDBetaMediathekIE(ARDMediathekBaseIE):
# playlist of type 'sammlung'
'url': 'https://www.ardmediathek.de/ard/sammlung/team-muenster/5JpTzLSbWUAK8184IOvEir/',
'only_matching': True,
}, {
'url': 'https://www.ardmediathek.de/video/coronavirus-update-ndr-info/astrazeneca-kurz-lockdown-und-pims-syndrom-81/ndr/Y3JpZDovL25kci5kZS84NzE0M2FjNi0wMWEwLTQ5ODEtOTE5NS1mOGZhNzdhOTFmOTI/',
'only_matching': True,
}, {
'url': 'https://www.ardmediathek.de/ard/player/Y3JpZDovL3dkci5kZS9CZWl0cmFnLWQ2NDJjYWEzLTMwZWYtNGI4NS1iMTI2LTU1N2UxYTcxOGIzOQ/tatort-duo-koeln-leipzig-ihr-kinderlein-kommet',
'only_matching': True,
}]
def _ARD_load_playlist_snipped(self, playlist_id, display_id, client, mode, pageNumber):
@ -518,7 +512,13 @@ def _ARD_extract_playlist(self, url, playlist_id, display_id, client, mode):
return self.playlist_result(entries, playlist_title=display_id)
def _real_extract(self, url):
video_id = self._match_id(url)
mobj = re.match(self._VALID_URL, url)
video_id = mobj.group('video_id')
display_id = mobj.group('display_id')
if display_id:
display_id = display_id.rstrip('/')
if not display_id:
display_id = video_id
if mobj.group('mode') in ('sendung', 'sammlung'):
# this is a playlist-URL
@ -529,9 +529,9 @@ def _real_extract(self, url):
player_page = self._download_json(
'https://api.ardmediathek.de/public-gateway',
video_id, data=json.dumps({
display_id, data=json.dumps({
'query': '''{
playerPage(client: "ard", clipId: "%s") {
playerPage(client:"%s", clipId: "%s") {
blockedByFsk
broadcastedOn
maturityContentRating
@ -561,7 +561,7 @@ def _real_extract(self, url):
}
}
}
}''' % video_id,
}''' % (mobj.group('client'), video_id),
}).encode(), headers={
'Content-Type': 'application/json'
})['data']['playerPage']
@ -586,6 +586,7 @@ def _real_extract(self, url):
r'\(FSK\s*(\d+)\)\s*$', description, 'age limit', default=None))
info.update({
'age_limit': age_limit,
'display_id': display_id,
'title': title,
'description': description,
'timestamp': unified_timestamp(player_page.get('broadcastedOn')),