3 from .common import InfoExtractor
6 class DotsubIE(InfoExtractor):
7 _VALID_URL = r'(?:http://)?(?:www\.)?dotsub\.com/view/([^/]+)'
9 u'url': u'http://dotsub.com/view/aed3b8b2-1889-4df5-ae63-ad85f5572f27',
10 u'file': u'aed3b8b2-1889-4df5-ae63-ad85f5572f27.flv',
11 u'md5': u'0914d4d69605090f623b7ac329fea66e',
13 u"title": u"Pyramids of Waste (2010), AKA The Lightbulb Conspiracy - Planned obsolescence documentary",
14 u"uploader": u"4v4l0n42",
15 u'description': u'Pyramids of Waste (2010) also known as "The lightbulb conspiracy" is a documentary about how our economic system based on consumerism and planned obsolescence is breaking our planet down.\r\n\r\nSolutions to this can be found at:\r\nhttp://robotswillstealyourjob.com\r\nhttp://www.federicopistono.org\r\n\r\nhttp://opensourceecology.org\r\nhttp://thezeitgeistmovement.com',
16 u'thumbnail': u'http://dotsub.com/media/aed3b8b2-1889-4df5-ae63-ad85f5572f27/p'
20 def _real_extract(self, url):
21 mobj = re.match(self._VALID_URL, url)
22 video_id = mobj.group(1)
23 info_url = "https://dotsub.com/api/media/%s/metadata" %(video_id)
24 webpage = self._download_webpage(info_url, video_id)
25 info = json.loads(webpage)
26 video_url = info['mediaURI']
27 uploader = info['user']
28 description = info['description']
29 view_count = info['numberOfViews']
31 thumbnail_url = info['screenshotURI']
38 'thumbnail': thumbnail_url,
39 'description': description,
41 'view_count': view_count,