[vimeo] add support for Vimeo Pro portfolio protected videos(closes #20070)
authorRemita Amine <remitamine@gmail.com>
Fri, 1 Mar 2019 07:14:34 +0000 (08:14 +0100)
committerRemita Amine <remitamine@gmail.com>
Fri, 1 Mar 2019 07:14:34 +0000 (08:14 +0100)
youtube_dl/extractor/vimeo.py

index 6215b32588cac1b755c63cbb889018f879e6cd27..6f32ea6f1a4fd007313d37485c12e2ea7854b5d6 100644 (file)
@@ -502,7 +502,11 @@ class VimeoIE(VimeoBaseInfoExtractor):
         mobj = re.match(self._VALID_URL, url)
         video_id = mobj.group('id')
         orig_url = url
-        if mobj.group('pro') or mobj.group('player'):
+        if mobj.group('pro'):
+            # some videos require portfolio_id to be present in player url
+            # https://github.com/rg3/youtube-dl/issues/20070
+            url = self._extract_url(url, self._download_webpage(url, video_id))
+        elif mobj.group('player'):
             url = 'https://player.vimeo.com/video/' + video_id
         elif any(p in url for p in ('play_redirect_hls', 'moogaloop.swf')):
             url = 'https://vimeo.com/' + video_id