2015-06-15 08:07:48 +00:00
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
|
|
|
class ThisAmericanLifeIE(InfoExtractor):
|
2015-07-03 23:42:53 +00:00
|
|
|
_VALID_URL = r'https?://(?:www\.)?thisamericanlife\.org/(?:radio-archives/episode/|play_full\.php\?play=)(?P<id>\d+)'
|
|
|
|
_TESTS = [{
|
2015-06-15 08:07:48 +00:00
|
|
|
'url': 'http://www.thisamericanlife.org/radio-archives/episode/487/harper-high-school-part-one',
|
2015-07-03 23:42:53 +00:00
|
|
|
'md5': '8f7d2da8926298fdfca2ee37764c11ce',
|
2015-06-15 08:07:48 +00:00
|
|
|
'info_dict': {
|
|
|
|
'id': '487',
|
2015-07-03 23:42:53 +00:00
|
|
|
'ext': 'm4a',
|
2015-06-15 08:07:48 +00:00
|
|
|
'title': '487: Harper High School, Part One',
|
2015-07-03 23:42:53 +00:00
|
|
|
'description': 'md5:ee40bdf3fb96174a9027f76dbecea655',
|
2017-01-02 12:08:07 +00:00
|
|
|
'thumbnail': r're:^https?://.*\.jpg$',
|
2015-06-15 16:35:48 +00:00
|
|
|
},
|
2015-07-03 23:42:53 +00:00
|
|
|
}, {
|
|
|
|
'url': 'http://www.thisamericanlife.org/play_full.php?play=487',
|
|
|
|
'only_matching': True,
|
|
|
|
}]
|
2015-06-15 08:07:48 +00:00
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
video_id = self._match_id(url)
|
2015-07-03 23:42:53 +00:00
|
|
|
|
|
|
|
webpage = self._download_webpage(
|
2024-06-11 23:09:58 +00:00
|
|
|
f'http://www.thisamericanlife.org/radio-archives/episode/{video_id}', video_id)
|
2015-06-15 08:07:48 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
2024-06-11 23:09:58 +00:00
|
|
|
'url': f'http://stream.thisamericanlife.org/{video_id}/stream/{video_id}_64k.m3u8',
|
2015-07-03 23:42:53 +00:00
|
|
|
'protocol': 'm3u8_native',
|
|
|
|
'ext': 'm4a',
|
|
|
|
'acodec': 'aac',
|
|
|
|
'vcodec': 'none',
|
|
|
|
'abr': 64,
|
|
|
|
'title': self._html_search_meta(r'twitter:title', webpage, 'title', fatal=True),
|
|
|
|
'description': self._html_search_meta(r'description', webpage, 'description'),
|
|
|
|
'thumbnail': self._og_search_thumbnail(webpage),
|
2015-06-15 08:07:48 +00:00
|
|
|
}
|