5 from .common import InfoExtractor
8 class DotsubIE(InfoExtractor):
9 _VALID_URL = r'(?:http://)?(?:www\.)?dotsub\.com/view/([^/]+)'
11 u'url': u'http://dotsub.com/view/aed3b8b2-1889-4df5-ae63-ad85f5572f27',
12 u'file': u'aed3b8b2-1889-4df5-ae63-ad85f5572f27.flv',
13 u'md5': u'0914d4d69605090f623b7ac329fea66e',
15 u"title": u"Pyramids of Waste (2010), AKA The Lightbulb Conspiracy - Planned obsolescence documentary",
16 u"uploader": u"4v4l0n42",
17 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',
18 u'thumbnail': u'http://dotsub.com/media/aed3b8b2-1889-4df5-ae63-ad85f5572f27/p',
19 u'upload_date': u'20101213',
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
25 video_id = mobj.group(1)
26 info_url = "https://dotsub.com/api/media/%s/metadata" %(video_id)
27 webpage = self._download_webpage(info_url, video_id)
28 info = json.loads(webpage)
29 date = time.gmtime(info['dateCreated']/1000) # The timestamp is in miliseconds
33 'url': info['mediaURI'],
35 'title': info['title'],
36 'thumbnail': info['screenshotURI'],
37 'description': info['description'],
38 'uploader': info['user'],
39 'view_count': info['numberOfViews'],
40 'upload_date': u'%04i%02i%02i' % (date.tm_year, date.tm_mon, date.tm_mday),