]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
Added extractor for AudioBoom.com
authorBenjamin Congdon <bencongdon96@gmail.com>
Thu, 10 Mar 2016 03:16:21 +0000 (21:16 -0600)
committerSergey M․ <dstftw@gmail.com>
Fri, 11 Mar 2016 13:43:01 +0000 (19:43 +0600)
youtube_dl/extractor/__init__.py
youtube_dl/extractor/audioboom.py [new file with mode: 0644]

index 98de5ddff3f6903f8af818d5dacba4edec6b99ac..1a7d689dfa8ee856ae98e83186d2b399a6f27b3e 100644 (file)
@@ -54,6 +54,7 @@ from .arte import (
 from .atresplayer import AtresPlayerIE
 from .atttechchannel import ATTTechChannelIE
 from .audimedia import AudiMediaIE
+from .audioboom import AudioBoomIE
 from .audiomack import AudiomackIE, AudiomackAlbumIE
 from .azubu import AzubuIE, AzubuLiveIE
 from .baidu import BaiduVideoIE
diff --git a/youtube_dl/extractor/audioboom.py b/youtube_dl/extractor/audioboom.py
new file mode 100644 (file)
index 0000000..84d4755
--- /dev/null
@@ -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,
+        }