]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/willow.py
1 from ..utils
import ExtractorError
2 from .common
import InfoExtractor
5 class WillowIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(www\.)?willow\.tv/videos/(?P<id>[0-9a-z-_]+)'
7 _GEO_COUNTRIES
= ['US']
10 'url': 'http://willow.tv/videos/d5winning-moment-eng-vs-ind-streaming-online-4th-test-india-tour-of-england-2021',
13 'display_id': 'd5winning-moment-eng-vs-ind-streaming-online-4th-test-india-tour-of-england-2021',
15 'title': 'Winning Moment: 4th Test, England vs India',
16 'thumbnail': 'https://aimages.willow.tv/ytThumbnails/6748_D5winning_moment.jpg',
18 'timestamp': 1630947954,
19 'upload_date': '20210906',
20 'location': 'Kennington Oval, London',
21 'series': 'India tour of England 2021',
24 'skip_download': True, # AES-encrypted m3u8
27 'url': 'http://willow.tv/videos/highlights-short-ind-vs-nz-streaming-online-2nd-t20i-new-zealand-tour-of-india-2021',
28 'only_matching': True,
31 def _real_extract(self
, url
):
32 video_id
= self
._match
_id
(url
)
33 webpage
= self
._download
_webpage
(url
, video_id
)
34 video_data
= self
._parse
_json
(self
._html
_search
_regex
(
35 r
'var\s+data_js\s*=\s*JSON\.parse\(\'(.+)\'\
)', webpage,
38 video = next((v for v in video_data.get('trending_videos
') or []
39 if v.get('secureurl
')), None)
41 raise ExtractorError('No videos found
')
43 formats = self._extract_m3u8_formats(video['secureurl
'], video_id, 'mp4
')
44 self._sort_formats(formats)
47 'id': str(video.get('content_id
')),
48 'display_id
': video.get('video_slug
'),
49 'title
': video.get('video_name
') or self._html_search_meta('twitter
:title
', webpage),
51 'thumbnail
': video.get('yt_thumb_url
') or self._html_search_meta(
52 'twitter
:image
', webpage, default=None),
53 'duration
': video.get('duration_seconds
'),
54 'timestamp
': video.get('created_date
'),
55 'location
': video.get('venue
'),
56 'series
': video.get('series_name
'),