]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/quickvid.py
af7d76cf47e575277de3ffe480fdb8e1eb48b43c
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
15 class QuickVidIE(InfoExtractor
):
16 _VALID_URL
= r
'https?://(www\.)?quickvid\.org/watch\.php\?v=(?P<id>[a-zA-Z_0-9-]+)'
18 'url': 'http://quickvid.org/watch.php?v=sUQT3RCG8dx',
19 'md5': 'c0c72dd473f260c06c808a05d19acdc5',
23 'title': 'Nick Offerman\'s Summer Reading Recap',
24 'thumbnail': 're:^https?://.*\.(?:png|jpg|gif)$',
29 def _real_extract(self
, url
):
30 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(url
, video_id
)
33 title
= self
._html
_search
_regex
(r
'<h2>(.*?)</h2>', webpage
, 'title')
34 view_count
= int_or_none(self
._html
_search
_regex
(
35 r
'(?s)<div id="views">(.*?)</div>',
36 webpage
, 'view count', fatal
=False))
37 video_code
= self
._search
_regex
(
38 r
'(?s)<video id="video"[^>]*>(.*?)</video>', webpage
, 'video code')
41 'url': compat_urlparse
.urljoin(url
, src
),
42 'format_id': determine_ext(src
, None),
43 } for src
in re
.findall('<source\s+src="([^"]+)"', video_code
)
45 self
._sort
_formats
(formats
)
51 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
52 'view_count': view_count
,