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