]>
Commit | Line | Data |
---|---|---|
81388c09 H |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class OnePlacePodcastIE(InfoExtractor): | |
5 | _VALID_URL = r'https?://www\.oneplace\.com/[\w]+/[^/]+/listen/[\w-]+-(?P<id>\d+)' | |
6 | _TESTS = [{ | |
7 | 'url': 'https://www.oneplace.com/ministries/a-daily-walk/listen/living-in-the-last-days-part-2-958461.html', | |
8 | 'info_dict': { | |
9 | 'id': '958461', | |
10 | 'ext': 'mp3', | |
11 | 'title': 'Living in the Last Days Part 2 | A Daily Walk with John Randall', | |
12 | 'description': 'md5:fbb8f1cf21447ac54ecaa2887fc20c6e', | |
13 | } | |
14 | }, { | |
15 | 'url': 'https://www.oneplace.com/ministries/ankerberg-show/listen/ep-3-relying-on-the-constant-companionship-of-the-holy-spirit-part-2-922513.html', | |
16 | 'info_dict': { | |
17 | 'id': '922513', | |
18 | 'ext': 'mp3', | |
19 | 'description': 'md5:8b810b4349aa40a5d033b4536fe428e1', | |
20 | 'title': 'md5:ce10f7d8d5ddcf485ed8905ef109659d', | |
21 | } | |
22 | }] | |
23 | ||
24 | def _real_extract(self, url): | |
25 | video_id = self._match_id(url) | |
26 | webpage = self._download_webpage(url, video_id) | |
27 | ||
28 | return { | |
29 | 'id': video_id, | |
30 | 'url': self._search_regex(( | |
31 | r'mp3-url\s*=\s*"([^"]+)', | |
32 | r'<div[^>]+id\s*=\s*"player"[^>]+data-media-url\s*=\s*"(?P<media_url>[^"]+)', | |
33 | ), webpage, 'media url'), | |
34 | 'ext': 'mp3', | |
35 | 'vcodec': 'none', | |
36 | 'title': self._html_search_regex(( | |
37 | r'<div[^>]class\s*=\s*"details"[^>]+>[^<]<h2[^>]+>(?P<content>[^>]+)>', | |
38 | self._meta_regex('og:title'), self._meta_regex('title'), | |
39 | ), webpage, 'title', group='content', default=None), | |
40 | 'description': self._html_search_regex( | |
41 | r'<div[^>]+class="[^"]+epDesc"[^>]*>\s*(?P<desc>.+?)\s*</div>', | |
42 | webpage, 'description', default=None), | |
43 | } |