Skip to content

Commit cf2dbec

Browse files
committed
[vimeo] add support for unlisted video source format extraction
1 parent b92bb0e commit cf2dbec

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

youtube_dl/extractor/vimeo.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,12 @@ def _parse_config(self, config, video_id):
226226
'is_live': is_live,
227227
}
228228

229-
def _extract_original_format(self, url, video_id):
229+
def _extract_original_format(self, url, video_id, unlisted_hash=None):
230+
query = {'action': 'load_download_config'}
231+
if unlisted_hash:
232+
query['unlisted_hash'] = unlisted_hash
230233
download_data = self._download_json(
231-
url, video_id, fatal=False,
232-
query={'action': 'load_download_config'},
234+
url, video_id, fatal=False, query=query,
233235
headers={'X-Requested-With': 'XMLHttpRequest'})
234236
if download_data:
235237
source_file = download_data.get('source_file')
@@ -509,6 +511,11 @@ class VimeoIE(VimeoBaseInfoExtractor):
509511
{
510512
'url': 'https://vimeo.com/160743502/abd0e13fb4',
511513
'only_matching': True,
514+
},
515+
{
516+
# requires passing unlisted_hash(a52724358e) to load_download_config request
517+
'url': 'https://vimeo.com/392479337/a52724358e',
518+
'only_matching': True,
512519
}
513520
# https://gettingthingsdone.com/workflowmap/
514521
# vimeo embed with check-password page protected by Referer header
@@ -673,7 +680,8 @@ def _real_extract(self, url):
673680
if config.get('view') == 4:
674681
config = self._verify_player_video_password(redirect_url, video_id, headers)
675682

676-
vod = config.get('video', {}).get('vod', {})
683+
video = config.get('video') or {}
684+
vod = video.get('vod') or {}
677685

678686
def is_rented():
679687
if '>You rented this title.<' in webpage:
@@ -733,7 +741,7 @@ def is_rented():
733741
formats = []
734742

735743
source_format = self._extract_original_format(
736-
'https://vimeo.com/' + video_id, video_id)
744+
'https://vimeo.com/' + video_id, video_id, video.get('unlisted_hash'))
737745
if source_format:
738746
formats.append(source_format)
739747

0 commit comments

Comments
 (0)