mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[thisamericanlife] Add a new extractor
This commit is contained in:
		
							
								
								
									
										32
									
								
								youtube_dl/extractor/thisamericanlife.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								youtube_dl/extractor/thisamericanlife.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,32 @@ | ||||
| # coding: utf-8 | ||||
| from __future__ import unicode_literals | ||||
|  | ||||
| from .common import InfoExtractor | ||||
|  | ||||
|  | ||||
| class ThisAmericanLifeIE(InfoExtractor): | ||||
|     _VALID_URL = r'https?://(?:www\.)?thisamericanlife\.org/radio-archives/episode/(?P<id>\d+)' | ||||
|     _TEST = { | ||||
|         'url': 'http://www.thisamericanlife.org/radio-archives/episode/487/harper-high-school-part-one', | ||||
|         'md5': '5cda28076c9f9d1fd0b0f5cff5959948', | ||||
|         'info_dict': { | ||||
|             'id': '487', | ||||
|             'title': '487: Harper High School, Part One', | ||||
|             'url' : 'http://stream.thisamericanlife.org/487/stream/487_64k.m3u8', | ||||
|             'ext': 'aac', | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     def _real_extract(self, url): | ||||
|         video_id = self._match_id(url) | ||||
|         webpage = self._download_webpage(url, video_id) | ||||
|  | ||||
|         title = self._html_search_regex(r'<h1[^>]*>(.*?)</h1>', webpage, 'title') | ||||
|         media_url = 'http://stream.thisamericanlife.org/' + video_id + '/stream/' + video_id + '_64k.m3u8' | ||||
|  | ||||
|         return { | ||||
|             'id': video_id, | ||||
|             'title': title, | ||||
|             'url': media_url, | ||||
|             'ext': 'aac', | ||||
|         } | ||||
		Reference in New Issue
	
	Block a user
	 Eric Wong
					Eric Wong