]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/aeonco.py
[build] Only archive if `vars.ARCHIVE_REPO` is set
[yt-dlp.git] / yt_dlp / extractor / aeonco.py
CommitLineData
c6989aa3 1from .common import InfoExtractor
2from .vimeo import VimeoIE
3
4
5class AeonCoIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:www\.)?aeon\.co/videos/(?P<id>[^/?]+)'
7 _TESTS = [{
8 'url': 'https://aeon.co/videos/raw-solar-storm-footage-is-the-punk-rock-antidote-to-sleek-james-webb-imagery',
9 'md5': 'e5884d80552c9b6ea8d268a258753362',
10 'info_dict': {
11 'id': '1284717',
12 'ext': 'mp4',
13 'title': 'Brilliant Noise',
14 'thumbnail': 'https://i.vimeocdn.com/video/21006315-1a1e49da8b07fd908384a982b4ba9ff0268c509a474576ebdf7b1392f4acae3b-d_960',
15 'uploader': 'Semiconductor',
16 'uploader_id': 'semiconductor',
17 'uploader_url': 'https://vimeo.com/semiconductor',
18 'duration': 348
19 }
20 }, {
21 'url': 'https://aeon.co/videos/dazzling-timelapse-shows-how-microbes-spoil-our-food-and-sometimes-enrich-it',
22 'md5': '4e5f3dad9dbda0dbfa2da41a851e631e',
23 'info_dict': {
24 'id': '728595228',
25 'ext': 'mp4',
26 'title': 'Wrought',
27 'thumbnail': 'https://i.vimeocdn.com/video/1484618528-c91452611f9a4e4497735a533da60d45b2fe472deb0c880f0afaab0cd2efb22a-d_1280',
28 'uploader': 'Biofilm Productions',
29 'uploader_id': 'user140352216',
30 'uploader_url': 'https://vimeo.com/user140352216',
31 'duration': 1344
32 }
33 }]
34
35 def _real_extract(self, url):
36 video_id = self._match_id(url)
37 webpage = self._download_webpage(url, video_id)
38 vimeo_id = self._search_regex(r'hosterId":\s*"(?P<id>[0-9]+)', webpage, 'vimeo id')
39 vimeo_url = VimeoIE._smuggle_referrer(f'https://player.vimeo.com/video/{vimeo_id}', 'https://aeon.co')
40 return self.url_result(vimeo_url, VimeoIE)