aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2013-08-26 21:29:44 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2013-08-26 21:29:44 +0200
commitc3b7b29c23668f5e7e496ec50693a2e1620789b1 (patch)
tree7402e90d1191bd3219394846724b0d3be7446e44
parent627a91a9a827b48270d3f5e288404388946f0733 (diff)
parent6dc63025992404ddb4f7e3f9d42957e83621011d (diff)
Merge remote-tracking branch 'origin/master'
-rw-r--r--youtube_dl/extractor/__init__.py1
-rw-r--r--youtube_dl/extractor/hark.py35
2 files changed, 36 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py
index 39c530ba3..f71ae2713 100644
--- a/youtube_dl/extractor/__init__.py
+++ b/youtube_dl/extractor/__init__.py
@@ -29,6 +29,7 @@ from .gametrailers import GametrailersIE
from .generic import GenericIE
from .googleplus import GooglePlusIE
from .googlesearch import GoogleSearchIE
+from .hark import HarkIE
from .hotnewhiphop import HotNewHipHopIE
from .howcast import HowcastIE
from .hypem import HypemIE
diff --git a/youtube_dl/extractor/hark.py b/youtube_dl/extractor/hark.py
new file mode 100644
index 000000000..ab0a69697
--- /dev/null
+++ b/youtube_dl/extractor/hark.py
@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+
+import re
+
+from .common import InfoExtractor
+from ..utils import determine_ext
+
+class HarkIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.hark\.com/clips/(.+?)-.+'
+ _TEST = {
+ u'url': u'http://www.hark.com/clips/mmbzyhkgny-obama-beyond-the-afghan-theater-we-only-target-al-qaeda-on-may-23-2013',
+ u'file': u'mmbzyhkgny.mp3',
+ u'md5': u'6783a58491b47b92c7c1af5a77d4cbee',
+ u'info_dict': {
+ u"title": u"Obama: 'Beyond The Afghan Theater, We Only Target Al Qaeda' On May 23, 2013 ",
+ }
+ }
+
+ def _real_extract(self, url):
+ mobj = re.match(self._VALID_URL, url)
+ video_id = mobj.group(1)
+ embed_url = "http://www.hark.com/clips/%s/homepage_embed" %(video_id)
+ webpage = self._download_webpage(embed_url, video_id)
+
+ final_url = self._search_regex(r'src="(.+?).mp3"',
+ webpage, 'video url')+'.mp3'
+ title = self._html_search_regex(r'<title>(.+?)</title>',
+ webpage, 'video title').replace(' Sound Clip and Quote - Hark','').replace(
+ 'Sound Clip , Quote, MP3, and Ringtone - Hark','')
+
+ return {'id': video_id,
+ 'url' : final_url,
+ 'title': title,
+ 'ext': determine_ext(final_url),
+ }