]>
Commit | Line | Data |
---|---|---|
79bfd010 JMF |
1 | # encoding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
f1d20fa3 JMS |
4 | import re |
5 | ||
6 | from .common import InfoExtractor | |
7 | ||
8 | ||
9 | class KickStarterIE(InfoExtractor): | |
79bfd010 | 10 | _VALID_URL = r'https?://www\.kickstarter\.com/projects/(?P<id>[^/]*)/.*' |
f1d20fa3 | 11 | _TEST = { |
79bfd010 JMF |
12 | 'url': 'https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-grant?ref=home_location', |
13 | 'md5': 'c81addca81327ffa66c642b5d8b08cab', | |
14 | 'info_dict': { | |
15 | 'id': '1404461844', | |
16 | 'ext': 'mp4', | |
17 | 'title': 'Intersection: The Story of Josh Grant by Kyle Cowling', | |
18 | 'description': 'A unique motocross documentary that examines the ' | |
19 | 'life and mind of one of sports most elite athletes: Josh Grant.', | |
94518f20 | 20 | }, |
f1d20fa3 JMS |
21 | } |
22 | ||
f1d20fa3 JMS |
23 | def _real_extract(self, url): |
24 | m = re.match(self._VALID_URL, url) | |
25 | video_id = m.group('id') | |
79bfd010 | 26 | webpage = self._download_webpage(url, video_id) |
f1d20fa3 | 27 | |
79bfd010 JMF |
28 | video_url = self._search_regex(r'data-video-url="(.*?)"', |
29 | webpage, 'video URL') | |
30 | video_title = self._html_search_regex(r'<title>(.*?)</title>', | |
31 | webpage, 'title').rpartition('— Kickstarter')[0].strip() | |
f1d20fa3 | 32 | |
79bfd010 JMF |
33 | return { |
34 | 'id': video_id, | |
35 | 'url': video_url, | |
36 | 'title': video_title, | |
37 | 'description': self._og_search_description(webpage), | |
38 | 'thumbnail': self._og_search_thumbnail(webpage), | |
39 | } |