3 from .common
import InfoExtractor
12 class GiantBombIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:www\.)?giantbomb\.com/(?:videos|shows)/(?P<display_id>[^/]+)/(?P<id>\d+-\d+)'
15 'url': 'http://www.giantbomb.com/videos/quick-look-destiny-the-dark-below/2300-9782/',
16 'md5': '132f5a803e7e0ab0e274d84bda1e77ae',
19 'display_id': 'quick-look-destiny-the-dark-below',
21 'title': 'Quick Look: Destiny: The Dark Below',
22 'description': 'md5:0aa3aaf2772a41b91d44c63f30dfad24',
24 'thumbnail': r
're:^https?://.*\.jpg$',
27 'url': 'https://www.giantbomb.com/shows/ben-stranding/2970-20212',
28 'only_matching': True,
31 def _real_extract(self
, url
):
32 mobj
= self
._match
_valid
_url
(url
)
33 video_id
= mobj
.group('id')
34 display_id
= mobj
.group('display_id')
36 webpage
= self
._download
_webpage
(url
, display_id
)
38 title
= self
._og
_search
_title
(webpage
)
39 description
= self
._og
_search
_description
(webpage
)
40 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
42 video
= json
.loads(unescapeHTML(self
._search
_regex
(
43 r
'data-video="([^"]+)"', webpage
, 'data-video')))
45 duration
= int_or_none(video
.get('lengthSeconds'))
48 'f4m_low', 'progressive_low', 'f4m_high',
49 'progressive_high', 'f4m_hd', 'progressive_hd'])
52 for format_id
, video_url
in video
['videoStreams'].items():
53 if format_id
== 'f4m_stream':
55 ext
= determine_ext(video_url
)
57 f4m_formats
= self
._extract
_f
4m
_formats
(video_url
+ '?hdcore=3.3.1', display_id
)
59 f4m_formats
[0]['quality'] = quality(format_id
)
60 formats
.extend(f4m_formats
)
62 formats
.extend(self
._extract
_m
3u8_formats
(
63 video_url
, display_id
, ext
='mp4', entry_protocol
='m3u8_native',
64 m3u8_id
='hls', fatal
=False))
68 'format_id': format_id
,
69 'quality': quality(format_id
),
73 youtube_id
= video
.get('youtubeID')
75 return self
.url_result(youtube_id
, 'Youtube')
79 'display_id': display_id
,
81 'description': description
,
82 'thumbnail': thumbnail
,