From 9fea67be31e959ba44b2f536b4e6989cd8c9246f Mon Sep 17 00:00:00 2001 From: Michael Tilbury Date: Sun, 21 Apr 2019 17:15:16 -0400 Subject: [PATCH 1/2] [FranceTVInfo] Fix video id regex extraction --- youtube_dl/extractor/francetv.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py index 20f449c5c..5e19793d6 100644 --- a/youtube_dl/extractor/francetv.py +++ b/youtube_dl/extractor/francetv.py @@ -371,12 +371,13 @@ class FranceTVInfoIE(FranceTVBaseInfoExtractor): self.url_result(dailymotion_url, DailymotionIE.ie_key()) for dailymotion_url in dailymotion_urls]) - video_id, catalogue = self._search_regex( - (r'id-video=([^@]+@[^"]+)', + video_id = self._search_regex( + (r'player\.load[^;]+src:[^"\']*["\']([^"\']+)', + r'id-video=([^@]+@[^"]+)', r']+href="(?:https?:)?//videos\.francetv\.fr/video/([^@]+@[^"]+)"'), - webpage, 'video id').split('@') + webpage, 'video id') - return self._make_url_result(video_id, catalogue) + return self._make_url_result(video_id) class FranceTVInfoSportIE(FranceTVBaseInfoExtractor): From eaf1ef17ddb78c2a8c3b21234373adcd94346d3f Mon Sep 17 00:00:00 2001 From: Michael Tilbury Date: Thu, 2 May 2019 13:43:15 -0700 Subject: [PATCH 2/2] Make regex search more strict by only matching whitespace. --- youtube_dl/extractor/francetv.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/extractor/francetv.py b/youtube_dl/extractor/francetv.py index 5e19793d6..81b468c7d 100644 --- a/youtube_dl/extractor/francetv.py +++ b/youtube_dl/extractor/francetv.py @@ -372,7 +372,7 @@ class FranceTVInfoIE(FranceTVBaseInfoExtractor): for dailymotion_url in dailymotion_urls]) video_id = self._search_regex( - (r'player\.load[^;]+src:[^"\']*["\']([^"\']+)', + (r'player\.load[^;]+src:\s*["\']([^"\']+)', r'id-video=([^@]+@[^"]+)', r']+href="(?:https?:)?//videos\.francetv\.fr/video/([^@]+@[^"]+)"'), webpage, 'video id')