[ie/twitter:spaces] Support video spaces (#10789)
[yt-dlp3.git] / yt_dlp / extractor / lenta.py
blob105ec371e0c092f7a823a8d73161c63c82ddfccc
1 from .common import InfoExtractor
4 class LentaIE(InfoExtractor):
5 _WORKING = False
6 _VALID_URL = r'https?://(?:www\.)?lenta\.ru/[^/]+/\d+/\d+/\d+/(?P<id>[^/?#&]+)'
7 _TESTS = [{
8 'url': 'https://lenta.ru/news/2018/03/22/savshenko_go/',
9 'info_dict': {
10 'id': '964400',
11 'ext': 'mp4',
12 'title': 'Надежду Савченко задержали',
13 'thumbnail': r're:^https?://.*\.jpg$',
14 'duration': 61,
15 'view_count': int,
17 'params': {
18 'skip_download': True,
20 }, {
21 # EaglePlatform iframe embed
22 'url': 'http://lenta.ru/news/2015/03/06/navalny/',
23 'info_dict': {
24 'id': '227304',
25 'ext': 'mp4',
26 'title': 'Навальный вышел на свободу',
27 'description': 'md5:d97861ac9ae77377f3f20eaf9d04b4f5',
28 'thumbnail': r're:^https?://.*\.jpg$',
29 'duration': 87,
30 'view_count': int,
31 'age_limit': 0,
33 'params': {
34 'skip_download': True,
38 def _real_extract(self, url):
39 display_id = self._match_id(url)
41 webpage = self._download_webpage(url, display_id)
43 video_id = self._search_regex(
44 r'vid\s*:\s*["\']?(\d+)', webpage, 'eagleplatform id',
45 default=None)
46 if video_id:
47 return self.url_result(
48 f'eagleplatform:lentaru.media.eagleplatform.com:{video_id}',
49 ie='EaglePlatform', video_id=video_id)
51 return self.url_result(url, ie='Generic')