]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/kickstarter.py
3 from .common
import InfoExtractor
6 class KickStarterIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://www\.kickstarter\.com/projects/(?P<id>\d*)/.*'
9 u
"url": u
"https://www.kickstarter.com/projects/1404461844/intersection-the-story-of-josh-grant?ref=home_location",
10 u
"file": u
"1404461844.mp4",
11 u
"md5": u
"c81addca81327ffa66c642b5d8b08cab",
13 u
"title": u
"Intersection: The Story of Josh Grant by Kyle Cowling",
17 def _real_extract(self
, url
):
18 m
= re
.match(self
._VALID
_URL
, url
)
19 video_id
= m
.group('id')
20 webpage_src
= self
._download
_webpage
(url
, video_id
)
22 video_url
= self
._search
_regex
(r
'data-video="(.*?)">',
23 webpage_src
, u
'video URL')
24 if 'mp4' in video_url
:
28 video_title
= self
._html
_search
_regex
(r
"<title>(.*?)</title>",
29 webpage_src
, u
'title').rpartition(u
'\u2014 Kickstarter')[0].strip()