1 from .common
import InfoExtractor
9 class SnotrIE(InfoExtractor
):
10 _VALID_URL
= r
'http?://(?:www\.)?snotr\.com/video/(?P<id>\d+)/([\w]+)'
12 'url': 'http://www.snotr.com/video/13708/Drone_flying_through_fireworks',
16 'title': 'Drone flying through fireworks!',
18 'filesize_approx': 40700000,
19 'description': 'A drone flying through Fourth of July Fireworks',
20 'thumbnail': r
're:^https?://.*\.jpg$',
22 'expected_warnings': ['description'],
24 'url': 'http://www.snotr.com/video/530/David_Letteman_-_George_W_Bush_Top_10',
28 'title': 'David Letteman - George W. Bush Top 10',
30 'filesize_approx': 8500000,
31 'description': 'The top 10 George W. Bush moments, brought to you by David Letterman!',
32 'thumbnail': r
're:^https?://.*\.jpg$',
36 def _real_extract(self
, url
):
37 mobj
= self
._match
_valid
_url
(url
)
38 video_id
= mobj
.group('id')
40 webpage
= self
._download
_webpage
(url
, video_id
)
41 title
= self
._og
_search
_title
(webpage
)
43 description
= self
._og
_search
_description
(webpage
)
44 info_dict
= self
._parse
_html
5_media
_entries
(
45 url
, webpage
, video_id
, m3u8_entry_protocol
='m3u8_native')[0]
47 view_count
= str_to_int(self
._html
_search
_regex
(
48 r
'<p[^>]*>\s*<strong[^>]*>Views:</strong>\s*<span[^>]*>([\d,\.]+)',
49 webpage
, 'view count', fatal
=False))
51 duration
= parse_duration(self
._html
_search
_regex
(
52 r
'<p[^>]*>\s*<strong[^>]*>Length:</strong>\s*<span[^>]*>([\d:]+)',
53 webpage
, 'duration', fatal
=False))
55 filesize_approx
= parse_filesize(self
._html
_search
_regex
(
56 r
'<p[^>]*>\s*<strong[^>]*>Filesize:</strong>\s*<span[^>]*>([^<]+)',
57 webpage
, 'filesize', fatal
=False))
61 'description': description
,
63 'view_count': view_count
,
65 'filesize_approx': filesize_approx
,