]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/crooksandliars.py
1 from .common
import InfoExtractor
8 class CrooksAndLiarsIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://embed\.crooksandliars\.com/(?:embed|v)/(?P<id>[A-Za-z0-9]+)'
11 'url': 'https://embed.crooksandliars.com/embed/8RUoRhRi',
15 'title': 'Fox & Friends Says Protecting Atheists From Discrimination Is Anti-Christian!',
16 'description': 'md5:e1a46ad1650e3a5ec7196d432799127f',
17 'thumbnail': r
're:^https?://.*\.jpg',
18 'timestamp': 1428207000,
19 'upload_date': '20150405',
20 'uploader': 'Heather',
24 'url': 'http://embed.crooksandliars.com/v/MTE3MjUtMzQ2MzA',
25 'only_matching': True,
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(
32 'http://embed.crooksandliars.com/embed/%s' % video_id
, video_id
)
34 manifest
= self
._parse
_json
(
36 r
'var\s+manifest\s*=\s*({.+?})\n', webpage
, 'manifest JSON'),
39 quality
= qualities(('webm_low', 'mp4_low', 'webm_high', 'mp4_high'))
43 'format_id': item
['type'],
44 'quality': quality(item
['type']),
45 } for item
in manifest
['flavors'] if item
['mime'].startswith('video/')]
46 self
._sort
_formats
(formats
)
51 'title': manifest
['title'],
52 'description': manifest
.get('description'),
53 'thumbnail': self
._proto
_relative
_url
(manifest
.get('poster')),
54 'timestamp': int_or_none(manifest
.get('created')),
55 'uploader': manifest
.get('author'),
56 'duration': int_or_none(manifest
.get('duration')),