2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class AudioBoomIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?audioboom\.com/(?:boos|posts)/(?P<id>[0-9]+)'
14 'url': 'https://audioboom.com/posts/7398103-asim-chaudhry',
15 'md5': '7b00192e593ff227e6a315486979a42d',
19 'title': 'Asim Chaudhry',
20 'description': 'md5:2f3fef17dacc2595b5362e1d7d3602fc',
22 'uploader': 'Sue Perkins: An hour or so with...',
23 'uploader_url': r're:https?://(?:www\.)?audioboom\.com/channel/perkins',
26 'url': 'https://audioboom.com/posts/4279833-3-09-2016-czaban-hour-3?t=0',
27 'only_matching': True,
30 def _real_extract(self, url):
31 video_id = self._match_id(url)
33 webpage = self._download_webpage(url, video_id)
37 clip_store = self._parse_json(
38 self._html_search_regex(
39 r'data-new-clip-store=(["\'])(?P<json>{.+?})\1',
40 webpage, 'clip store', default='{}', group='json'),
41 video_id, fatal=False)
43 clips = clip_store.get('clips')
44 if clips and isinstance(clips, list) and isinstance(clips[0], dict):
49 return clip.get(field)
51 audio_url = from_clip('clipURLPriorToLoading') or self._og_search_property(
52 'audio', webpage, 'audio url')
53 title = from_clip('title') or self._html_search_meta(
54 ['og:title', 'og:audio:title', 'audio_title'], webpage)
55 description = from_clip('description') or clean_html(from_clip('formattedDescription')) or self._og_search_description(webpage)
57 duration = float_or_none(from_clip('duration') or self._html_search_meta(
58 'weibo:audio:duration', webpage))
60 uploader = from_clip('author') or self._html_search_meta(
61 ['og:audio:artist', 'twitter:audio:artist_name', 'audio_artist'], webpage, 'uploader')
62 uploader_url = from_clip('author_url') or self._html_search_meta(
63 'audioboo:channel', webpage, 'uploader url')
69 'description': description,
72 'uploader_url': uploader_url,