[ie/dropout] Fix extraction (#12102)
[yt-dlp.git] / yt_dlp / extractor / screenrec.py
blob64f8d2494a6502a5ebc05f3887440282e1ccb55d
1 from .common import InfoExtractor
4 class ScreenRecIE(InfoExtractor):
5 _VALID_URL = r'https?://(?:www\.)?screenrec\.com/share/(?P<id>\w{10})'
6 _TESTS = [{
7 'url': 'https://screenrec.com/share/DasLtbknYo',
8 'info_dict': {
9 'id': 'DasLtbknYo',
10 'ext': 'mp4',
11 'title': '02.05.2024_03.01.25_REC',
12 'description': 'Recorded with ScreenRec',
13 'thumbnail': r're:^https?://.*\.gif$',
15 'params': {
16 'skip_download': True,
20 def _real_extract(self, url):
21 video_id = self._match_id(url)
22 webpage = self._download_webpage(url, video_id)
24 m3u8_url = self._search_regex(
25 r'customUrl\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage, 'm3u8 URL', group='url')
27 return {
28 'id': video_id,
29 'title': self._og_search_title(webpage, default=None) or self._html_extract_title(webpage),
30 'description': self._og_search_description(webpage),
31 'thumbnail': self._og_search_thumbnail(webpage),
32 'formats': self._extract_m3u8_formats(m3u8_url, video_id, ext='mp4'),