]> jfr.im git - yt-dlp.git/commitdiff
Revert commit 8562218
authorpukkandan <redacted>
Wed, 24 Mar 2021 23:01:25 +0000 (04:31 +0530)
committerpukkandan <redacted>
Wed, 24 Mar 2021 23:01:32 +0000 (04:31 +0530)
[ard] improve clip id extraction
https://github.com/ytdl-org/youtube-dl/commit/8562218350a79d4709da8593bb0c538aa0824acf

This was merged incorrectly

yt_dlp/extractor/ard.py

index 3523087970e7e1729a87b9d371c24b7eae85f40e..12a7cfb54a1fc891ce0e2d8565ddca8d511fbb31 100644 (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')),