Skip to content

Commit

Permalink
[vimeo] cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
soimort committed Aug 19, 2024
1 parent 26db833 commit 2c8a0cb
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/you_get/extractors/vimeo.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,34 +132,6 @@ def extract(self, **kwargs):


def vimeo_download_by_id(id, title=None, output_dir='.', merge=True, info_only=False, **kwargs):
'''
try:
# normal Vimeo video
html = get_content('https://vimeo.com/' + id)
cfg_patt = r'clip_page_config\s*=\s*(\{.+?\});'
cfg = json.loads(match1(html, cfg_patt))
video_page = get_content(cfg['player']['config_url'], headers=fake_headers)
title = cfg['clip']['title']
info = loads(video_page)
except:
# embedded player - referer may be required
if 'referer' in kwargs:
fake_headers['Referer'] = kwargs['referer']
video_page = get_content('http://player.vimeo.com/video/%s' % id, headers=fake_headers)
title = r1(r'<title>([^<]+)</title>', video_page)
info = loads(match1(video_page, r'var t=(\{.+?\});'))
streams = info['request']['files']['progressive']
streams = sorted(streams, key=lambda i: i['height'])
url = streams[-1]['url']
type, ext, size = url_info(url, faker=True)
print_info(site_info, title, type, size)
if not info_only:
download_urls([url], title, ext, size, output_dir, merge=merge, faker=True)
'''
site = VimeoExtractor()
site.download_by_vid(id, info_only=info_only, output_dir=output_dir, merge=merge, **kwargs)

Expand Down

0 comments on commit 2c8a0cb

Please sign in to comment.