2 from __future__
import unicode_literals
8 from .common
import InfoExtractor
31 class VimeoBaseInfoExtractor(InfoExtractor
):
32 _NETRC_MACHINE
= 'vimeo'
33 _LOGIN_REQUIRED
= False
34 _LOGIN_URL
= 'https://vimeo.com/log_in'
37 (username
, password
) = self
._get
_login
_info
()
39 if self
._LOGIN
_REQUIRED
:
40 raise ExtractorError('No login info available, needed for using %s.' % self
.IE_NAME
, expected
=True)
43 webpage
= self
._download
_webpage
(self
._LOGIN
_URL
, None, False)
44 token
, vuid
= self
._extract
_xsrft
_and
_vuid
(webpage
)
45 data
= urlencode_postdata(encode_dict({
52 login_request
= sanitized_Request(self
._LOGIN
_URL
, data
)
53 login_request
.add_header('Content-Type', 'application/x-www-form-urlencoded')
54 login_request
.add_header('Referer', self
._LOGIN
_URL
)
55 self
._set
_vimeo
_cookie
('vuid', vuid
)
56 self
._download
_webpage
(login_request
, None, False, 'Wrong login info')
58 def _extract_xsrft_and_vuid(self
, webpage
):
59 xsrft
= self
._search
_regex
(
60 r
'(?:(?P<q1>["\'])xsrft(?P
=q1
)\s
*:|xsrft\s
*[=:])\s
*(?P
<q
>["\'])(?P<xsrft>.+?)(?P=q)',
61 webpage, 'login token', group='xsrft')
62 vuid = self._search_regex(
63 r'["\']vuid
["\']\s*:\s*(["\'])(?P
<vuid
>.+?
)\
1',
64 webpage, 'vuid
', group='vuid
')
67 def _set_vimeo_cookie(self, name, value):
68 self._set_cookie('vimeo
.com
', name, value)
71 class VimeoIE(VimeoBaseInfoExtractor):
72 """Information extractor for vimeo.com."""
74 # _VALID_URL matches Vimeo URLs
77 (?:(?:www|(?P<player>player))\.)?
78 vimeo(?P<pro>pro)?\.com/
79 (?!channels/[^/?#]+/?(?:$|[?#])|album/)
81 (?:(?:play_redirect_hls|moogaloop\.swf)\?clip_id=)?
84 /?(?:[?&].*)?(?:[#].*)?$'''
88 'url
': 'http
://vimeo
.com
/56015672#at=0',
89 'md5': '8879b6cc097e987f02484baf890129e5',
93 'title': "youtube-dl test video - \u2605 \" ' \u5e78 / \\ \u00e4 \u21ad \U0001d550",
94 'description': 'md5:2d3305bad981a06ff79f027f19865021',
95 'upload_date': '20121220',
96 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/user7108434',
97 'uploader_id': 'user7108434',
98 'uploader': 'Filippo Valsorda',
103 'url': 'http://vimeopro.com/openstreetmapus/state-of-the-map-us-2013/video/68093876',
104 'md5': '3b5ca6aa22b60dfeeadf50b72e44ed82',
105 'note': 'Vimeo Pro video (#1197)',
109 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/openstreetmapus',
110 'uploader_id': 'openstreetmapus',
111 'uploader': 'OpenStreetMap US',
112 'title': 'Andy Allan - Putting the Carto into OpenStreetMap Cartography',
113 'description': 'md5:fd69a7b8d8c34a4e1d2ec2e4afd6ec30',
118 'url': 'http://player.vimeo.com/video/54469442',
119 'md5': '619b811a4417aa4abe78dc653becf511',
120 'note': 'Videos that embed the url in the player page',
124 'title': 'Kathy Sierra: Building the minimum Badass User, Business of Software 2012',
125 'uploader': 'The BLN & Business of Software',
126 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/theblnbusinessofsoftware',
127 'uploader_id': 'theblnbusinessofsoftware',
133 'url': 'http://vimeo.com/68375962',
134 'md5': 'aaf896bdb7ddd6476df50007a0ac0ae7',
135 'note': 'Video protected with password',
139 'title': 'youtube-dl password protected test video',
140 'upload_date': '20130614',
141 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/user18948128',
142 'uploader_id': 'user18948128',
143 'uploader': 'Jaime Marquínez Ferrándiz',
145 'description': 'This is "youtube-dl password protected test video" by Jaime Marquínez Ferrándiz on Vimeo, the home for high quality videos and the people\u2026',
148 'videopassword': 'youtube-dl',
152 'url': 'http://vimeo.com/channels/keypeele/75629013',
153 'md5': '2f86a05afe9d7abc0b9126d229bbe15d',
154 'note': 'Video is freely available via original URL '
155 'and protected with password when accessed via http://vimeo.com/75629013',
159 'title': 'Key & Peele: Terrorist Interrogation',
160 'description': 'md5:8678b246399b070816b12313e8b4eb5c',
161 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/atencio',
162 'uploader_id': 'atencio',
163 'uploader': 'Peter Atencio',
164 'upload_date': '20130927',
169 'url': 'http://vimeo.com/76979871',
170 'note': 'Video with subtitles',
174 'title': 'The New Vimeo Player (You Know, For Videos)',
175 'description': 'md5:2ec900bf97c3f389378a96aee11260ea',
176 'upload_date': '20131015',
177 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/staff',
178 'uploader_id': 'staff',
179 'uploader': 'Vimeo Staff',
184 # from https://www.ouya.tv/game/Pier-Solar-and-the-Great-Architects/
185 'url': 'https://player.vimeo.com/video/98044508',
186 'note': 'The js code contains assignments to the same variable as the config',
190 'title': 'Pier Solar OUYA Official Trailer',
191 'uploader': 'Tulio Gonçalves',
192 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/user28849593',
193 'uploader_id': 'user28849593',
197 # contains original format
198 'url': 'https://vimeo.com/33951933',
199 'md5': '53c688fa95a55bf4b7293d37a89c5c53',
203 'title': 'FOX CLASSICS - Forever Classic ID - A Full Minute',
204 'uploader': 'The DMCI',
205 'uploader_url': 're:https?://(?:www\.)?vimeo\.com/dmci',
206 'uploader_id': 'dmci',
207 'upload_date': '20111220',
208 'description': 'md5:ae23671e82d05415868f7ad1aec21147',
212 'url': 'https://vimeo.com/109815029',
213 'note': 'Video not completely processed, "failed" seed status',
214 'only_matching': True,
217 'url': 'https://vimeo.com/groups/travelhd/videos/22439234',
218 'only_matching': True,
221 # source file returns 403: Forbidden
222 'url': 'https://vimeo.com/7809605',
223 'only_matching': True,
228 def _extract_vimeo_url(url
, webpage
):
229 # Look for embedded (iframe) Vimeo player
231 r
'<iframe[^>]+?src=(["\'])(?P
<url
>(?
:https?
:)?
//player\
.vimeo\
.com
/video
/.+?
)\
1', webpage)
233 player_url = unescapeHTML(mobj.group('url
'))
234 surl = smuggle_url(player_url, {'http_headers': {'Referer': url}})
236 # Look for embedded (swf embed) Vimeo player
238 r'<embed
[^
>]+?src
="((?:https?:)?//(?:www\.)?vimeo\.com/moogaloop\.swf.+?)"', webpage)
242 def _verify_video_password(self, url, video_id, webpage):
243 password = self._downloader.params.get('videopassword
')
245 raise ExtractorError('This video
is protected by a password
, use the
--video
-password option
', expected=True)
246 token, vuid = self._extract_xsrft_and_vuid(webpage)
247 data = urlencode_postdata(encode_dict({
248 'password
': password,
251 if url.startswith('http
://'):
252 # vimeo only supports https now, but the user can give an http url
253 url = url.replace('http
://', 'https
://')
254 password_request = sanitized_Request(url + '/password
', data)
255 password_request.add_header('Content
-Type
', 'application
/x
-www
-form
-urlencoded
')
256 password_request.add_header('Referer
', url)
257 self._set_vimeo_cookie('vuid
', vuid)
258 return self._download_webpage(
259 password_request, video_id,
260 'Verifying the password
', 'Wrong password
')
262 def _verify_player_video_password(self, url, video_id):
263 password = self._downloader.params.get('videopassword
')
265 raise ExtractorError('This video
is protected by a password
, use the
--video
-password option
')
266 data = urlencode_postdata(encode_dict({'password': password}))
267 pass_url = url + '/check
-password
'
268 password_request = sanitized_Request(pass_url, data)
269 password_request.add_header('Content
-Type
', 'application
/x
-www
-form
-urlencoded
')
270 return self._download_json(
271 password_request, video_id,
272 'Verifying the password
',
275 def _real_initialize(self):
278 def _real_extract(self, url):
279 url, data = unsmuggle_url(url, {})
280 headers = std_headers
281 if 'http_headers
' in data:
282 headers = headers.copy()
283 headers.update(data['http_headers
'])
284 if 'Referer
' not in headers:
285 headers['Referer
'] = url
287 # Extract ID from URL
288 mobj = re.match(self._VALID_URL, url)
289 video_id = mobj.group('id')
291 if mobj.group('pro
') or mobj.group('player
'):
292 url = 'https
://player
.vimeo
.com
/video
/' + video_id
294 url = 'https
://vimeo
.com
/' + video_id
296 # Retrieve video webpage to extract further information
297 request = sanitized_Request(url, None, headers)
299 webpage = self._download_webpage(request, video_id)
300 except ExtractorError as ee:
301 if isinstance(ee.cause, compat_HTTPError) and ee.cause.code == 403:
302 errmsg = ee.cause.read()
303 if b'Because of its privacy settings
, this video cannot be played here
' in errmsg:
304 raise ExtractorError(
305 'Cannot download embed
-only video without embedding
'
306 'URL
. Please call youtube
-dl
with the URL of the page
'
307 'that embeds this video
.',
311 # Now we begin extracting as much information as we can from what we
312 # retrieved. First we extract the information common to all extractors,
313 # and latter we extract those that are Vimeo specific.
314 self.report_extraction(video_id)
316 vimeo_config = self._search_regex(
317 r'vimeo\
.config\s
*=\s
*(?
:({.+?}
)|_extend\
([^
,]+,\s
+({.+?}
)\
));', webpage,
318 'vimeo config
', default=None)
320 seed_status = self._parse_json(vimeo_config, video_id).get('seed_status
', {})
321 if seed_status.get('state
') == 'failed
':
322 raise ExtractorError(
323 '%s said
: %s' % (self.IE_NAME, seed_status['title
']),
326 # Extract the config JSON
329 config_url = self._html_search_regex(
330 r' data
-config
-url
="(.+?)"', webpage,
331 'config URL
', default=None)
333 # Sometimes new react-based page is served instead of old one that require
334 # different config URL extraction approach (see
335 # https://github.com/rg3/youtube-dl/pull/7209)
336 vimeo_clip_page_config = self._search_regex(
337 r'vimeo\
.clip_page_config\s
*=\s
*({.+?}
);', webpage,
338 'vimeo clip page config
')
339 config_url = self._parse_json(
340 vimeo_clip_page_config, video_id)['player
']['config_url
']
341 config_json = self._download_webpage(config_url, video_id)
342 config = json.loads(config_json)
343 except RegexNotFoundError:
344 # For pro videos or player.vimeo.com urls
345 # We try to find out to which variable is assigned the config dic
346 m_variable_name = re.search('(\w
)\
.video\
.id', webpage)
347 if m_variable_name is not None:
348 config_re = r'%s=({[^}
].+?
});' % re.escape(m_variable_name.group(1))
350 config_re = [r' = {config:({.+?}
),assets
:', r'(?
:[abc
])=({.+?}
);']
351 config = self._search_regex(config_re, webpage, 'info section
',
353 config = json.loads(config)
354 except Exception as e:
355 if re.search('The creator of this video has
not given you permission to embed it on this domain
.', webpage):
356 raise ExtractorError('The author has restricted the access to this video
, try with the
"--referer" option
')
358 if re.search(r'<form
[^
>]+?
id="pw_form"', webpage) is not None:
359 if '_video_password_verified
' in data:
360 raise ExtractorError('video password verification failed
!')
361 self._verify_video_password(url, video_id, webpage)
362 return self._real_extract(
363 smuggle_url(url, {'_video_password_verified': 'verified'}))
365 raise ExtractorError('Unable to extract info section
',
368 if config.get('view
') == 4:
369 config = self._verify_player_video_password(url, video_id)
371 if '>You rented this title
.<' in webpage:
372 feature_id = config.get('video
', {}).get('vod', {}).get('feature_id
')
373 if feature_id and not data.get('force_feature_id
', False):
374 return self.url_result(smuggle_url(
375 'https
://player
.vimeo
.com
/player
/%s' % feature_id,
376 {'force_feature_id': True}), 'Vimeo
')
379 video_title = config['video
']['title
']
381 # Extract uploader, uploader_url and uploader_id
382 video_uploader = config['video
'].get('owner
', {}).get('name
')
383 video_uploader_url = config['video
'].get('owner
', {}).get('url
')
384 video_uploader_id = video_uploader_url.split('/')[-1] if video_uploader_url else None
386 # Extract video thumbnail
387 video_thumbnail = config['video
'].get('thumbnail
')
388 if video_thumbnail is None:
389 video_thumbs = config['video
'].get('thumbs
')
390 if video_thumbs and isinstance(video_thumbs, dict):
391 _, video_thumbnail = sorted((int(width if width.isdigit() else 0), t_url) for (width, t_url) in video_thumbs.items())[-1]
393 # Extract video description
395 video_description = self._html_search_regex(
396 r'(?s
)<div\s
+class="[^"]*description
[^
"]*"[^
>]*>(.*?
)</div
>',
397 webpage, 'description
', default=None)
398 if not video_description:
399 video_description = self._html_search_meta(
400 'description
', webpage, default=None)
401 if not video_description and mobj.group('pro
'):
402 orig_webpage = self._download_webpage(
404 note='Downloading webpage
for description
',
407 video_description = self._html_search_meta(
408 'description
', orig_webpage, default=None)
409 if not video_description and not mobj.group('player
'):
410 self._downloader.report_warning('Cannot find video description
')
412 # Extract video duration
413 video_duration = int_or_none(config['video
'].get('duration
'))
415 # Extract upload date
416 video_upload_date = None
417 mobj = re.search(r'<time
[^
>]+datetime
="([^"]+)"', webpage)
419 video_upload_date = unified_strdate(mobj.group(1))
422 view_count = int(self._search_regex(r'UserPlays:(\d+)', webpage, 'view count'))
423 like_count = int(self._search_regex(r'UserLikes:(\d+)', webpage, 'like count'))
424 comment_count = int(self._search_regex(r'UserComments:(\d+)', webpage, 'comment count'))
425 except RegexNotFoundError:
426 # This info is only available in vimeo.com/{id} urls
432 download_request = sanitized_Request('https://vimeo.com/%s?action=load_download_config' % video_id, headers={
433 'X-Requested-With': 'XMLHttpRequest'})
434 download_data = self._download_json(download_request, video_id, fatal=False)
436 source_file = download_data.get('source_file')
437 if isinstance(source_file, dict):
438 download_url = source_file.get('download_url')
439 if download_url and not source_file.get('is_cold') and not source_file.get('is_defrosting'):
440 source_name = source_file.get('public_name', 'Original')
441 if self._is_valid_url(download_url, video_id, '%s video' % source_name):
442 ext = source_file.get('extension', determine_ext(download_url)).lower()
446 'width': int_or_none(source_file.get('width')),
447 'height': int_or_none(source_file.get('height')),
448 'filesize': parse_filesize(source_file.get('size')),
449 'format_id': source_name,
452 config_files = config['video'].get('files') or config['request'].get('files', {})
453 for f in config_files.get('progressive', []):
454 video_url = f.get('url')
459 'format_id': 'http-%s' % f.get('quality'),
460 'width': int_or_none(f.get('width')),
461 'height': int_or_none(f.get('height')),
462 'fps': int_or_none(f.get('fps')),
463 'tbr': int_or_none(f.get('bitrate')),
465 m3u8_url = config_files.get('hls', {}).get('url')
467 formats.extend(self._extract_m3u8_formats(
468 m3u8_url, video_id, 'mp4', 'm3u8_native', m3u8_id='hls', fatal=False))
469 # Bitrates are completely broken. Single m3u8 may contain entries in kbps and bps
470 # at the same time without actual units specified. This lead to wrong sorting.
471 self._sort_formats(formats, field_preference=('preference', 'height', 'width', 'fps', 'format_id'))
474 text_tracks = config['request'].get('text_tracks')
476 for tt in text_tracks:
477 subtitles[tt['lang']] = [{
479 'url': 'https://vimeo.com' + tt['url'],
484 'uploader': video_uploader,
485 'uploader_url': video_uploader_url,
486 'uploader_id': video_uploader_id,
487 'upload_date': video_upload_date,
488 'title': video_title,
489 'thumbnail': video_thumbnail,
490 'description': video_description,
491 'duration': video_duration,
494 'view_count': view_count,
495 'like_count': like_count,
496 'comment_count': comment_count,
497 'subtitles': subtitles,
501 class VimeoChannelIE(VimeoBaseInfoExtractor):
502 IE_NAME = 'vimeo:channel'
503 _VALID_URL = r'https://vimeo\.com/channels/(?P<id>[^/?#]+)/?(?:$|[?#])'
504 _MORE_PAGES_INDICATOR = r'<a.+?rel="next
"'
506 _TITLE_RE = r'<link rel="alternate
"[^>]+?title="(.*?
)"'
508 'url': 'https://vimeo.com/channels/tributes',
511 'title': 'Vimeo Tributes',
513 'playlist_mincount': 25,
516 def _page_url(self, base_url, pagenum):
517 return '%s/videos/page:%d/' % (base_url, pagenum)
519 def _extract_list_title(self, webpage):
520 return self._TITLE or self._html_search_regex(self._TITLE_RE, webpage, 'list title')
522 def _login_list_password(self, page_url, list_id, webpage):
523 login_form = self._search_regex(
524 r'(?s)<form[^>]+?id="pw_form
"(.*?)</form>',
525 webpage, 'login form', default=None)
529 password = self._downloader.params.get('videopassword')
531 raise ExtractorError('This album is protected by a password, use the --video-password option', expected=True)
532 fields = self._hidden_inputs(login_form)
533 token, vuid = self._extract_xsrft_and_vuid(webpage)
534 fields['token'] = token
535 fields['password'] = password
536 post = urlencode_postdata(encode_dict(fields))
537 password_path = self._search_regex(
538 r'action="([^
"]+)"', login_form, 'password URL
')
539 password_url = compat_urlparse.urljoin(page_url, password_path)
540 password_request = sanitized_Request(password_url, post)
541 password_request.add_header('Content
-type', 'application
/x
-www
-form
-urlencoded
')
542 self._set_vimeo_cookie('vuid
', vuid)
543 self._set_vimeo_cookie('xsrft
', token)
545 return self._download_webpage(
546 password_request, list_id,
547 'Verifying the password
', 'Wrong password
')
549 def _title_and_entries(self, list_id, base_url):
550 for pagenum in itertools.count(1):
551 page_url = self._page_url(base_url, pagenum)
552 webpage = self._download_webpage(
554 'Downloading page
%s' % pagenum)
557 webpage = self._login_list_password(page_url, list_id, webpage)
558 yield self._extract_list_title(webpage)
560 for video_id in re.findall(r'id="clip_(\d+?)"', webpage):
561 yield self.url_result('https
://vimeo
.com
/%s' % video_id, 'Vimeo
')
563 if re.search(self._MORE_PAGES_INDICATOR, webpage, re.DOTALL) is None:
566 def _extract_videos(self, list_id, base_url):
567 title_and_entries = self._title_and_entries(list_id, base_url)
568 list_title = next(title_and_entries)
569 return self.playlist_result(title_and_entries, list_id, list_title)
571 def _real_extract(self, url):
572 mobj = re.match(self._VALID_URL, url)
573 channel_id = mobj.group('id')
574 return self._extract_videos(channel_id, 'https
://vimeo
.com
/channels
/%s' % channel_id)
577 class VimeoUserIE(VimeoChannelIE):
578 IE_NAME = 'vimeo
:user
'
579 _VALID_URL = r'https
://vimeo\
.com
/(?
!(?
:[0-9]+|watchlater
)(?
:$|
[?
#/]))(?P<name>[^/]+)(?:/videos|[#?]|$)'
580 _TITLE_RE
= r
'<a[^>]+?class="user">([^<>]+?)</a>'
582 'url': 'https://vimeo.com/nkistudio/videos',
587 'playlist_mincount': 66,
590 def _real_extract(self
, url
):
591 mobj
= re
.match(self
._VALID
_URL
, url
)
592 name
= mobj
.group('name')
593 return self
._extract
_videos
(name
, 'https://vimeo.com/%s' % name
)
596 class VimeoAlbumIE(VimeoChannelIE
):
597 IE_NAME
= 'vimeo:album'
598 _VALID_URL
= r
'https://vimeo\.com/album/(?P<id>\d+)'
599 _TITLE_RE
= r
'<header id="page_header">\n\s*<h1>(.*?)</h1>'
601 'url': 'https://vimeo.com/album/2632481',
604 'title': 'Staff Favorites: November 2013',
606 'playlist_mincount': 13,
608 'note': 'Password-protected album',
609 'url': 'https://vimeo.com/album/3253534',
616 'videopassword': 'youtube-dl',
620 def _page_url(self
, base_url
, pagenum
):
621 return '%s/page:%d/' % (base_url
, pagenum
)
623 def _real_extract(self
, url
):
624 album_id
= self
._match
_id
(url
)
625 return self
._extract
_videos
(album_id
, 'https://vimeo.com/album/%s' % album_id
)
628 class VimeoGroupsIE(VimeoAlbumIE
):
629 IE_NAME
= 'vimeo:group'
630 _VALID_URL
= r
'https://vimeo\.com/groups/(?P<name>[^/]+)(?:/(?!videos?/\d+)|$)'
632 'url': 'https://vimeo.com/groups/rolexawards',
635 'title': 'Rolex Awards for Enterprise',
637 'playlist_mincount': 73,
640 def _extract_list_title(self
, webpage
):
641 return self
._og
_search
_title
(webpage
)
643 def _real_extract(self
, url
):
644 mobj
= re
.match(self
._VALID
_URL
, url
)
645 name
= mobj
.group('name')
646 return self
._extract
_videos
(name
, 'https://vimeo.com/groups/%s' % name
)
649 class VimeoReviewIE(InfoExtractor
):
650 IE_NAME
= 'vimeo:review'
651 IE_DESC
= 'Review pages on vimeo'
652 _VALID_URL
= r
'https://vimeo\.com/[^/]+/review/(?P<id>[^/]+)'
654 'url': 'https://vimeo.com/user21297594/review/75524534/3c257a1b5d',
655 'md5': 'c507a72f780cacc12b2248bb4006d253',
659 'title': "DICK HARDWICK 'Comedian'",
660 'uploader': 'Richard Hardwick',
663 'note': 'video player needs Referer',
664 'url': 'https://vimeo.com/user22258446/review/91613211/13f927e053',
665 'md5': '6295fdab8f4bf6a002d058b2c6dce276',
669 'title': 're:(?i)^Death by dogma versus assembling agile . Sander Hoogendoorn',
670 'uploader': 'DevWeek Events',
672 'thumbnail': 're:^https?://.*\.jpg$',
676 def _real_extract(self
, url
):
677 mobj
= re
.match(self
._VALID
_URL
, url
)
678 video_id
= mobj
.group('id')
679 player_url
= 'https://player.vimeo.com/player/' + video_id
680 return self
.url_result(player_url
, 'Vimeo', video_id
)
683 class VimeoWatchLaterIE(VimeoChannelIE
):
684 IE_NAME
= 'vimeo:watchlater'
685 IE_DESC
= 'Vimeo watch later list, "vimeowatchlater" keyword (requires authentication)'
686 _VALID_URL
= r
'https://vimeo\.com/(?:home/)?watchlater|:vimeowatchlater'
687 _TITLE
= 'Watch Later'
688 _LOGIN_REQUIRED
= True
690 'url': 'https://vimeo.com/watchlater',
691 'only_matching': True,
694 def _real_initialize(self
):
697 def _page_url(self
, base_url
, pagenum
):
698 url
= '%s/page:%d/' % (base_url
, pagenum
)
699 request
= sanitized_Request(url
)
700 # Set the header to get a partial html page with the ids,
701 # the normal page doesn't contain them.
702 request
.add_header('X-Requested-With', 'XMLHttpRequest')
705 def _real_extract(self
, url
):
706 return self
._extract
_videos
('watchlater', 'https://vimeo.com/watchlater')
709 class VimeoLikesIE(InfoExtractor
):
710 _VALID_URL
= r
'https://(?:www\.)?vimeo\.com/user(?P<id>[0-9]+)/likes/?(?:$|[?#]|sort:)'
711 IE_NAME
= 'vimeo:likes'
712 IE_DESC
= 'Vimeo user likes'
714 'url': 'https://vimeo.com/user755559/likes/',
715 'playlist_mincount': 293,
717 'id': 'user755559_likes',
718 'description': 'See all the videos urza likes',
719 'title': 'Videos urza likes',
723 def _real_extract(self
, url
):
724 user_id
= self
._match
_id
(url
)
725 webpage
= self
._download
_webpage
(url
, user_id
)
726 page_count
= self
._int
(
728 r
'''(?x)<li><a\s+href="[^"]+"\s+data-page="([0-9]+)">
729 .*?</a></li>\s*<li\s+class="pagination_next">
730 ''', webpage
, 'page count'),
731 'page count', fatal
=True)
733 title
= self
._html
_search
_regex
(
734 r
'(?s)<h1>(.+?)</h1>', webpage
, 'title', fatal
=False)
735 description
= self
._html
_search
_meta
('description', webpage
)
738 page_url
= 'https://vimeo.com/user%s/likes/page:%d/sort:date' % (
740 webpage
= self
._download
_webpage
(
742 note
='Downloading page %d/%d' % (idx
+ 1, page_count
))
743 video_list
= self
._search
_regex
(
744 r
'(?s)<ol class="js-browse_list[^"]+"[^>]*>(.*?)</ol>',
745 webpage
, 'video content')
747 r
'<li[^>]*>\s*<a\s+href="([^"]+)"', video_list
)
751 'url': compat_urlparse
.urljoin(page_url
, path
),
754 pl
= InAdvancePagedList(_get_page
, page_count
, PAGE_SIZE
)
758 'id': 'user%s_likes' % user_id
,
760 'description': description
,