From de36edbf4cd04967b2b56695b5804ad680d05f51 Mon Sep 17 00:00:00 2001 From: Aarni Koskela Date: Sun, 12 Feb 2017 23:57:42 +0200 Subject: [PATCH] Support Vimeo urls with query strings --- youtube_dl/extractor/vimeo.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 61cc469bf..35c671a1f 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -190,7 +190,7 @@ class VimeoIE(VimeoBaseInfoExtractor): ) \. )? - vimeo(?Ppro)?\.com/ + vimeo\.com/ (?!(?:channels|album)/[^/?#]+/?(?:$|[?#])|[^/]+/review/|ondemand/) (?:.*?/)? (?: @@ -201,7 +201,7 @@ class VimeoIE(VimeoBaseInfoExtractor): (?:videos?/)? (?P[0-9]+) (?:/[\da-f]+)? - /?(?:[?&].*)?(?:[#].*)?$ + /?(?P(?:[?&].*)?(?:[#].*)?)$ ''' IE_NAME = 'vimeo' _TESTS = [ @@ -453,11 +453,15 @@ 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('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 + if mobj.group('qs'): + # Some vimeopro embeds have query strings (`?portfolio_id=NNNNNN`) which are necessary + url += mobj.group('qs') + # Retrieve video webpage to extract further information request = sanitized_Request(url, headers=headers) try: @@ -571,7 +575,7 @@ class VimeoIE(VimeoBaseInfoExtractor): if not video_description: video_description = self._html_search_meta( 'description', webpage, default=None) - if not video_description and mobj.group('pro'): + if not video_description: orig_webpage = self._download_webpage( orig_url, video_id, note='Downloading webpage for description',