about summary refs log tree commit diff
path: root/youtube_dl/extractor/audioboom.py
diff options
context:
space:
mode:
authorBenjamin Congdon <bencongdon96@gmail.com>2016-03-09 21:16:21 -0600
committerSergey M․ <dstftw@gmail.com>2016-03-11 19:43:01 +0600
commit61f317c24c040d051ec6652cb0d4c650c1fc0361 (patch)
tree3884f2e34345c2ed8ad8f2a16116f9a1756ffd45 /youtube_dl/extractor/audioboom.py
parent64f08d4ff2392135be07774f2d5371f111f21592 (diff)
downloadyoutube-dl-61f317c24c040d051ec6652cb0d4c650c1fc0361.tar.gz
youtube-dl-61f317c24c040d051ec6652cb0d4c650c1fc0361.tar.xz
youtube-dl-61f317c24c040d051ec6652cb0d4c650c1fc0361.zip
Added extractor for AudioBoom.com
Diffstat (limited to 'youtube_dl/extractor/audioboom.py')
-rw-r--r--youtube_dl/extractor/audioboom.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/youtube_dl/extractor/audioboom.py b/youtube_dl/extractor/audioboom.py
new file mode 100644
index 000000000..84d4755f5
--- /dev/null
+++ b/youtube_dl/extractor/audioboom.py
@@ -0,0 +1,39 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import float_or_none
+
+
+class AudioBoomIE(InfoExtractor):
+    _VALID_URL = r'https?://(?:www\.)?audioboom\.com/boos/(?P<id>[0-9]+)'
+    _TEST = {
+        'url': 'https://audioboom.com/boos/4279833-3-09-2016-czaban-hour-3?t=0',
+        'md5': '63a8d73a055c6ed0f1e51921a10a5a76',
+        'info_dict': {
+            'id': '4279833',
+            'ext': 'mp3',
+            'title': '3/09/2016 Czaban Hour 3',
+            'description': 'Guest:   Nate Davis - NFL free agency,   Guest:   Stan Gans',
+            'duration': 2245.72
+        }
+    }
+
+    def _real_extract(self, url):
+        video_id = self._match_id(url)
+        webpage = self._download_webpage(url, video_id)
+
+        title = self._og_search_title(webpage)
+
+        download_url = self._og_search_property('audio', webpage, 'url')
+
+        duration = float_or_none(self._html_search_meta(
+            'weibo:audio:duration', webpage, fatal=False))
+
+        return {
+            'id': video_id,
+            'title': title,
+            'url': download_url,
+            'description': self._og_search_description(webpage),
+            'duration': duration,
+        }