1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-04 10:05:16 +08:00

Added support for episodes page

This commit is contained in:
Steven Gosseling 2016-03-18 16:42:28 +01:00
parent 13d7892560
commit 7aabc672ca

View File

@ -5,29 +5,45 @@ from .common import InfoExtractor
class CloserToTruthIE(InfoExtractor): class CloserToTruthIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?closertotruth\.com/(series|interviews)/(?:[^#]+#video-)?(?P<id>\d+)' _VALID_URL = r'https?://(?:www\.)?closertotruth\.com/(episodes/|(series|interviews)/(?:[^#]+#video-)?(?P<id>\d+))'
_TESTS = [{ _TESTS = [
'url': 'http://closertotruth.com/series/solutions-the-mind-body-problem#video-3688', {
'md5': '2aa5b8971633d86fe32152827846a5b4', 'url': 'http://closertotruth.com/series/solutions-the-mind-body-problem#video-3688',
'info_dict': { 'md5': '5c548bde260a9247ddfdc07c7458ed29',
'id': '0_zh2b6eqr', 'info_dict': {
'ext': 'mov', 'id': '0_zof1ktre',
'title': 'ZimDe-010-S', 'ext': 'mov',
'upload_date': '20140307', 'title': 'Solutions to the Mind-Body Problem?',
'timestamp': 1394236392, 'upload_date': '20140221',
'uploader_id': 'CTTXML' 'timestamp': 1392956007,
'uploader_id': 'CTTXML'
}
}, },
'url': 'http://closertotruth.com/interviews/1725', {
'md5': 'b00598fd6a38372edb976408f72c5792', 'url': 'http://closertotruth.com/interviews/1725',
'info_dict': { 'md5': 'b00598fd6a38372edb976408f72c5792',
'id': '0_19qv5rn1', 'info_dict': {
'ext': 'mov', 'id': '0_19qv5rn1',
'title': 'AyaFr-002 - Francisco J. Ayala', 'ext': 'mov',
'upload_date': '20140307', 'title': 'AyaFr-002 - Francisco J. Ayala',
'timestamp': 1394236431, 'upload_date': '20140307',
'uploader_id': 'CTTXML' 'timestamp': 1394236431,
} 'uploader_id': 'CTTXML'
}] }
},
{
'url': 'http://closertotruth.com/episodes/how-do-brains-work',
'md5': '4dd96aa0a5c296afa5c0bd24895c2f16',
'info_dict': {
'id': '0_iuxai6g6',
'ext': 'mov',
'title': 'How do Brains Work?',
'upload_date': '20140221',
'timestamp': 1392956024,
'uploader_id': 'CTTXML'
}
},
]
def _real_extract(self, url): def _real_extract(self, url):
video_id = self._match_id(url) video_id = self._match_id(url)
@ -37,9 +53,10 @@ class CloserToTruthIE(InfoExtractor):
entry_id = self._search_regex(r'<a[^>]+id="(?:video-%s|embed-kaltura)"[^>]+data-kaltura="([^"]+)' % video_id, webpage, "video entry_id") entry_id = self._search_regex(r'<a[^>]+id="(?:video-%s|embed-kaltura)"[^>]+data-kaltura="([^"]+)' % video_id, webpage, "video entry_id")
interviewee_name = self._search_regex(r'<div id="(?:node_interview_full_group_white_wrapper|node_interview_series_full_group_ajax_content)"(?:.|\n)*<h3>(.*)<\/h3>', webpage, "video interviewee_name") interviewee_name = self._search_regex(r'<div id="(?:node_interview_full_group_white_wrapper|node_interview_series_full_group_ajax_content)"(?:.|\n)*<h3>(.*)</h3>.+', webpage, "video interviewee_name", False)
video_title = video_title + ' - ' + interviewee_name if interviewee_name:
video_title = video_title + ' - ' + interviewee_name
p_id = self._search_regex(r'<script[^>]+src=["\'].+?partner_id/(\d+)', webpage, "kaltura partner_id") p_id = self._search_regex(r'<script[^>]+src=["\'].+?partner_id/(\d+)', webpage, "kaltura partner_id")