]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/quickvid.py
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)$',
27 'skip': 'Not accessible from Travis CI server',
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, video_id
)
34 title
= self
._html
_search
_regex
(r
'<h2>(.*?)</h2>', webpage
, 'title')
35 view_count
= int_or_none(self
._html
_search
_regex
(
36 r
'(?s)<div id="views">(.*?)</div>',
37 webpage
, 'view count', fatal
=False))
38 video_code
= self
._search
_regex
(
39 r
'(?s)<video id="video"[^>]*>(.*?)</video>', webpage
, 'video code')
42 'url': compat_urlparse
.urljoin(url
, src
),
43 'format_id': determine_ext(src
, None),
44 } for src
in re
.findall('<source\s+src="([^"]+)"', video_code
)
46 self
._sort
_formats
(formats
)
52 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
53 'view_count': view_count
,