From 6cf55c85dd1ffe25486a25820b5cc8178bf494bc Mon Sep 17 00:00:00 2001 From: Kay B <> Date: Tue, 1 May 2018 00:10:59 +0200 Subject: [PATCH] [vimeo] clean url when neccessary (PR #15855), add tests --- youtube_dl/extractor/vimeo.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index 509c5c9b5..b498cd2d5 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -837,6 +837,20 @@ class VimeoAlbumIE(VimeoChannelIE): 'title': 'Staff Favorites: November 2013', }, 'playlist_mincount': 13, + }, { + 'url': 'https://vimeo.com/album/2632481/sort:plays/format:thumbnail', + 'info_dict': { + 'id': '2632481', + 'title': 'Staff Favorites: November 2013', + }, + 'playlist_mincount': 13, + }, { + 'url': 'https://vimeo.com/album/2632481/page:2/sort:plays/format:thumbnail', + 'info_dict': { + 'id': '2632481', + 'title': 'Staff Favorites: November 2013', + }, + 'playlist_mincount': 13, }, { 'url': 'https://vimeo.com/album/4786409', 'info_dict': { @@ -869,7 +883,12 @@ class VimeoAlbumIE(VimeoChannelIE): def _real_extract(self, url): album_id = self._match_id(url) - rss_url = url + '/rss' + + # we only want the base url with the id, excluding possibly appended + # options like e.g 'sort:plays'. + re_clean_url = re.compile(r'https://vimeo\.com/album/\d+') + clean_url = re_clean_url.findall(url)[0] + rss_url = clean_url + '/rss' doc = self._download_xml(rss_url, album_id, fatal=False)