]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/hark.py
[extractors] Remove superfluous whitespace
[yt-dlp.git] / youtube_dl / extractor / hark.py
CommitLineData
dcdb292f 1# coding: utf-8
cdc5cb7c 2from __future__ import unicode_literals
e3a88568
Y
3
4from .common import InfoExtractor
cdc5cb7c 5
e3a88568
Y
6
7class HarkIE(InfoExtractor):
92519402 8 _VALID_URL = r'https?://(?:www\.)?hark\.com/clips/(?P<id>.+?)-.+'
e3a88568 9 _TEST = {
cdc5cb7c
PH
10 'url': 'http://www.hark.com/clips/mmbzyhkgny-obama-beyond-the-afghan-theater-we-only-target-al-qaeda-on-may-23-2013',
11 'md5': '6783a58491b47b92c7c1af5a77d4cbee',
12 'info_dict': {
13 'id': 'mmbzyhkgny',
14 'ext': 'mp3',
15 'title': 'Obama: \'Beyond The Afghan Theater, We Only Target Al Qaeda\' on May 23, 2013',
16 'description': '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.',
17 'duration': 11,
e3a88568
Y
18 }
19 }
20
21 def _real_extract(self, url):
cdc5cb7c
PH
22 video_id = self._match_id(url)
23 data = self._download_json(
24 'http://www.hark.com/clips/%s.json' % video_id, video_id)
e3a88568 25
cdc5cb7c
PH
26 return {
27 'id': video_id,
28 'url': data['url'],
29 'title': data['name'],
30 'description': data.get('description'),
31 'thumbnail': data.get('image_original'),
32 'duration': data.get('duration'),
33 }