From 13d78925603df273572cdb4525e406f070163c4c Mon Sep 17 00:00:00 2001 From: Steven Gosseling Date: Tue, 8 Mar 2016 15:56:49 +0100 Subject: [PATCH] Added support for closertotruth interview URL --- youtube_dl/extractor/closertotruth.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/closertotruth.py b/youtube_dl/extractor/closertotruth.py index 66b41a9d3..3b9a02921 100644 --- a/youtube_dl/extractor/closertotruth.py +++ b/youtube_dl/extractor/closertotruth.py @@ -1,13 +1,11 @@ # coding: utf-8 from __future__ import unicode_literals -import re - from .common import InfoExtractor class CloserToTruthIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?closertotruth\.com/series/[^#]+#video-(?P\w+)' + _VALID_URL = r'https?://(?:www\.)?closertotruth\.com/(series|interviews)/(?:[^#]+#video-)?(?P\d+)' _TESTS = [{ 'url': 'http://closertotruth.com/series/solutions-the-mind-body-problem#video-3688', 'md5': '2aa5b8971633d86fe32152827846a5b4', @@ -18,6 +16,16 @@ class CloserToTruthIE(InfoExtractor): 'upload_date': '20140307', 'timestamp': 1394236392, 'uploader_id': 'CTTXML' + }, + 'url': 'http://closertotruth.com/interviews/1725', + 'md5': 'b00598fd6a38372edb976408f72c5792', + 'info_dict': { + 'id': '0_19qv5rn1', + 'ext': 'mov', + 'title': 'AyaFr-002 - Francisco J. Ayala', + 'upload_date': '20140307', + 'timestamp': 1394236431, + 'uploader_id': 'CTTXML' } }] @@ -27,8 +35,9 @@ class CloserToTruthIE(InfoExtractor): video_title = self._search_regex(r'(.+) \|.+', webpage, 'video title') - entry_id = self._search_regex(r']+id="video-%s"[^>]+data-kaltura="([^"]+)' % video_id, webpage, "video entry_id") - interviewee_name = re.sub(r'(<[^>]+>)', '', self._search_regex(r'(.+)', webpage, "video interviewee_name")) + entry_id = self._search_regex(r']+id="(?:video-%s|embed-kaltura)"[^>]+data-kaltura="([^"]+)' % video_id, webpage, "video entry_id") + + interviewee_name = self._search_regex(r'
(.*)<\/h3>', webpage, "video interviewee_name") video_title = video_title + ' - ' + interviewee_name @@ -40,4 +49,4 @@ class CloserToTruthIE(InfoExtractor): 'url': 'kaltura:%s:%s' % (p_id, entry_id), 'ie_key': 'Kaltura', 'title': video_title - } \ No newline at end of file + }