]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/audioboom.py
393f381c6129f41688e2e163b6135a5254eaf3ea
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..utils
import float_or_none
8 class AudioBoomIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://(?:www\.)?audioboom\.com/(?:boos|posts)/(?P<id>[0-9]+)'
11 'url': 'https://audioboom.com/boos/4279833-3-09-2016-czaban-hour-3?t=0',
12 'md5': '63a8d73a055c6ed0f1e51921a10a5a76',
16 'title': '3/09/2016 Czaban Hour 3',
17 'description': 'Guest: Nate Davis - NFL free agency, Guest: Stan Gans',
19 'uploader': 'SB Nation A.M.',
20 'uploader_url': r
're:https?://(?:www\.)?audioboom\.com/channel/steveczabanyahoosportsradio',
23 'url': 'https://audioboom.com/posts/4279833-3-09-2016-czaban-hour-3?t=0',
24 'only_matching': True,
27 def _real_extract(self
, url
):
28 video_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(url
, video_id
)
34 clip_store
= self
._parse
_json
(
36 r
'data-new-clip-store=(["\'])(?P
<json
>{.*?
"clipId"\s
*:\s
*%s.*?
})\
1' % video_id,
37 webpage, 'clip store
', default='{}', group='json
'),
38 video_id, fatal=False)
40 clips = clip_store.get('clips
')
41 if clips and isinstance(clips, list) and isinstance(clips[0], dict):
46 return clip.get(field)
48 audio_url = from_clip('clipURLPriorToLoading
') or self._og_search_property(
49 'audio
', webpage, 'audio url
')
50 title = from_clip('title
') or self._og_search_title(webpage)
51 description = from_clip('description
') or self._og_search_description(webpage)
53 duration = float_or_none(from_clip('duration
') or self._html_search_meta(
54 'weibo
:audio
:duration
', webpage))
56 uploader = from_clip('author
') or self._og_search_property(
57 'audio
:artist
', webpage, 'uploader
', fatal=False)
58 uploader_url = from_clip('author_url
') or self._html_search_meta(
59 'audioboo
:channel
', webpage, 'uploader url
')
65 'description
': description,
68 'uploader_url
': uploader_url,