[vimeo:album] fix extraction(closes #27079)
authorRemita Amine <remitamine@gmail.com>
Thu, 19 Nov 2020 12:12:58 +0000 (13:12 +0100)
committerRemita Amine <remitamine@gmail.com>
Thu, 19 Nov 2020 12:13:33 +0000 (13:13 +0100)
youtube_dl/extractor/vimeo.py

index 421795b94d9f6cf10fe3d5725503baa86383062c..cfd04d50cc2f3b3787fdb40b74653102911bbbbd 100644 (file)
@@ -946,10 +946,13 @@ class VimeoAlbumIE(VimeoBaseInfoExtractor):
 
     def _real_extract(self, url):
         album_id = self._match_id(url)
-        webpage = self._download_webpage(url, album_id)
-        viewer = self._parse_json(self._search_regex(
-            r'bootstrap_data\s*=\s*({.+?})</script>',
-            webpage, 'bootstrap data'), album_id)['viewer']
+        viewer = self._download_json(
+            'https://vimeo.com/_rv/viewer', album_id, fatal=False)
+        if not viewer:
+            webpage = self._download_webpage(url, album_id)
+            viewer = self._parse_json(self._search_regex(
+                r'bootstrap_data\s*=\s*({.+?})</script>',
+                webpage, 'bootstrap data'), album_id)['viewer']
         jwt = viewer['jwt']
         album = self._download_json(
             'https://api.vimeo.com/albums/' + album_id,