diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-09-28 12:14:16 +0200 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-09-28 12:14:16 +0200 |
commit | d6e6a4225650ff220c7fe0687d883552e4b45bde (patch) | |
tree | e5692e65674c2d424f48d1086c6fdab6704d5258 /youtube_dl/extractor/vimeo.py | |
parent | 76e7d1e74b10b99ed9289b0c30c5f4933f9d841e (diff) |
[vimeo:likes] Add new extractor (Fixes #3835)
Diffstat (limited to 'youtube_dl/extractor/vimeo.py')
-rw-r--r-- | youtube_dl/extractor/vimeo.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/youtube_dl/extractor/vimeo.py b/youtube_dl/extractor/vimeo.py index bc01d7fbf..4be1b8785 100644 --- a/youtube_dl/extractor/vimeo.py +++ b/youtube_dl/extractor/vimeo.py @@ -15,6 +15,7 @@ from ..utils import ( get_element_by_attribute, ExtractorError, RegexNotFoundError, + smuggle_url, std_headers, unsmuggle_url, urlencode_postdata, @@ -529,3 +530,35 @@ class VimeoWatchLaterIE(VimeoBaseInfoExtractor, VimeoChannelIE): def _real_extract(self, url): return self._extract_videos('watchlater', 'https://vimeo.com/home/watchlater') + + +class VimeoLikesIE(InfoExtractor): + _VALID_URL = r'https?://(?:www\.)?vimeo\.com/user(?P<id>[0-9]+)/likes(?:$|[?#])' + IE_NAME = 'vimeo:likes' + IE_DESC = 'Vimeo user likes' + _TEST = { + 'url': 'https://vimeo.com/user20132939/likes', + 'playlist_mincount': 4, + 'add_ies': ['Generic'], + "info_dict": { + "description": "Videos Philipp Hagemeister likes on Vimeo.", + "title": "Vimeo / Philipp Hagemeister's likes", + }, + 'params': { + 'extract_flat': False, + }, + } + + def _real_extract(self, url): + user_id = self._match_id(url) + rss_url = '%s//vimeo.com/user%s/likes/rss' % ( + self.http_scheme(), user_id) + surl = smuggle_url(rss_url, { + 'force_videoid': '%s_likes' % user_id, + 'to_generic': True, + }) + + return { + '_type': 'url', + 'url': surl, + } |