1 from .common
import InfoExtractor
2 from .vimeo
import VimeoIE
3 from ..utils
import ExtractorError
, traverse_obj
, url_or_none
6 class AeonCoIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?:www\.)?aeon\.co/videos/(?P<id>[^/?]+)'
9 'url': 'https://aeon.co/videos/raw-solar-storm-footage-is-the-punk-rock-antidote-to-sleek-james-webb-imagery',
10 'md5': 'e5884d80552c9b6ea8d268a258753362',
14 'title': 'Brilliant Noise',
15 'thumbnail': 'https://i.vimeocdn.com/video/21006315-1a1e49da8b07fd908384a982b4ba9ff0268c509a474576ebdf7b1392f4acae3b-d_960',
16 'uploader': 'Semiconductor',
17 'uploader_id': 'semiconductor',
18 'uploader_url': 'https://vimeo.com/semiconductor',
22 'url': 'https://aeon.co/videos/dazzling-timelapse-shows-how-microbes-spoil-our-food-and-sometimes-enrich-it',
23 'md5': '03582d795382e49f2fd0b427b55de409',
28 'thumbnail': 'https://i.vimeocdn.com/video/1525599692-84614af88e446612f49ca966cf8f80eab2c73376bedd80555741c521c26f9a3e-d_1280',
29 'uploader': 'Aeon Video',
30 'uploader_id': 'aeonvideo',
31 'uploader_url': 'https://vimeo.com/aeonvideo',
35 'url': 'https://aeon.co/videos/chew-over-the-prisoners-dilemma-and-see-if-you-can-find-the-rational-path-out',
36 'md5': '1cfda0bf3ae24df17d00f2c0cb6cc21b',
40 'title': 'How to outsmart the Prisoner’s Dilemma - Lucas Husted',
41 'thumbnail': 'https://i.ytimg.com/vi_webp/emyi4z-O0ls/maxresdefault.webp',
43 'uploader_id': '@TEDEd',
44 'uploader_url': 'https://www.youtube.com/@TEDEd',
46 'upload_date': '20200827',
47 'channel_id': 'UCsooa4yRKGN_zEE8iknghZA',
48 'playable_in_embed': True,
49 'description': 'md5:c0959524f08cb60f96fd010f3dfb17f3',
50 'categories': ['Education'],
53 'chapters': 'count:7',
54 'channel_url': 'https://www.youtube.com/channel/UCsooa4yRKGN_zEE8iknghZA',
56 'availability': 'public',
57 'channel_follower_count': int,
60 'live_status': 'not_live',
65 def _real_extract(self
, url
):
66 video_id
= self
._match
_id
(url
)
67 webpage
= self
._download
_webpage
(url
, video_id
)
68 embed_url
= traverse_obj(self
._yield
_json
_ld
(webpage
, video_id
), (
69 lambda _
, v
: v
['@type'] == 'VideoObject', 'embedUrl', {url_or_none}
), get_all
=False)
71 raise ExtractorError('No embed URL found in webpage')
72 if 'player.vimeo.com' in embed_url
:
73 embed_url
= VimeoIE
._smuggle
_referrer
(embed_url
, 'https://aeon.co/')
74 return self
.url_result(embed_url
)