1 # -*- coding: utf-8 -*-
6 from .common import InfoExtractor
7 from ..utils import determine_ext
9 class HarkIE(InfoExtractor):
10 _VALID_URL = r'https?://www\.hark\.com/clips/(.+?)-.+'
12 u'url': u'http://www.hark.com/clips/mmbzyhkgny-obama-beyond-the-afghan-theater-we-only-target-al-qaeda-on-may-23-2013',
13 u'file': u'mmbzyhkgny.mp3',
14 u'md5': u'6783a58491b47b92c7c1af5a77d4cbee',
16 u'title': u"Obama: 'Beyond The Afghan Theater, We Only Target Al Qaeda' on May 23, 2013",
17 u'description': u'President Barack Obama addressed the nation live on May 23, 2013 in a speech aimed at addressing counter-terrorism policies including the use of drone strikes, detainees at Guantanamo Bay prison facility, and American citizens who are terrorists.',
22 def _real_extract(self, url):
23 mobj = re.match(self._VALID_URL, url)
24 video_id = mobj.group(1)
25 json_url = "http://www.hark.com/clips/%s.json" %(video_id)
26 info_json = self._download_webpage(json_url, video_id)
27 info = json.loads(info_json)
28 final_url = info['url']
30 return {'id': video_id,
32 'title': info['name'],
33 'ext': determine_ext(final_url),
34 'description': info['description'],
35 'thumbnail': info['image_original'],
36 'duration': info['duration'],