]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/normalboots.py
[ie/box] Fix formats extraction (#8649)
[yt-dlp.git] / yt_dlp / extractor / normalboots.py
CommitLineData
c81a855b 1from .common import InfoExtractor
89533199 2from .jwplatform import JWPlatformIE
c81a855b
OP
3
4from ..utils import (
c81a855b
OP
5 unified_strdate,
6)
7
92661c99 8
c81a855b 9class NormalbootsIE(InfoExtractor):
5886b38d 10 _VALID_URL = r'https?://(?:www\.)?normalboots\.com/video/(?P<id>[0-9a-z-]*)/?$'
3bf8bc7f 11 _TEST = {
92661c99 12 'url': 'http://normalboots.com/video/home-alone-games-jontron/',
92661c99
JMF
13 'info_dict': {
14 'id': 'home-alone-games-jontron',
15 'ext': 'mp4',
16 'title': 'Home Alone Games - JonTron - NormalBoots',
17 'description': 'Jon is late for Christmas. Typical. Thanks to: Paul Ritchey for Co-Writing/Filming: http://www.youtube.com/user/ContinueShow Michael Azzi for Christmas Intro Animation: http://michafrar.tumblr.com/ Jerrod Waters for Christmas Intro Music: http://www.youtube.com/user/xXJerryTerryXx Casey Ormond for ‘Tense Battle Theme’:\xa0http://www.youtube.com/Kiamet/',
18 'uploader': 'JonTron',
19 'upload_date': '20140125',
a285b637
JMF
20 },
21 'params': {
e3de3d6f 22 # m3u8 download
a285b637
JMF
23 'skip_download': True,
24 },
89533199 25 'add_ie': ['JWPlatform'],
3bf8bc7f 26 }
92661c99 27
c81a855b 28 def _real_extract(self, url):
53157257 29 video_id = self._match_id(url)
c81a855b 30 webpage = self._download_webpage(url, video_id)
92661c99 31
53157257
PH
32 video_uploader = self._html_search_regex(
33 r'Posted\sby\s<a\shref="[A-Za-z0-9/]*">(?P<uploader>[A-Za-z]*)\s</a>',
34 webpage, 'uploader', fatal=False)
35 video_upload_date = unified_strdate(self._html_search_regex(
36 r'<span style="text-transform:uppercase; font-size:inherit;">[A-Za-z]+, (?P<date>.*)</span>',
37 webpage, 'date', fatal=False))
38
89533199 39 jwplatform_url = JWPlatformIE._extract_url(webpage)
92661c99
JMF
40
41 return {
e3de3d6f 42 '_type': 'url_transparent',
92661c99 43 'id': video_id,
89533199 44 'url': jwplatform_url,
45 'ie_key': JWPlatformIE.ie_key(),
92661c99
JMF
46 'title': self._og_search_title(webpage),
47 'description': self._og_search_description(webpage),
48 'thumbnail': self._og_search_thumbnail(webpage),
49 'uploader': video_uploader,
50 'upload_date': video_upload_date,
51 }