From b5420c53ed263a1d77b330983d36e9f4c21e2289 Mon Sep 17 00:00:00 2001 From: renalid Date: Fri, 16 Sep 2016 15:49:37 +0200 Subject: [PATCH 1/2] [France Inter] Bug fix on upload date There is an issue on the upload date. The format is wrong when the month is between January (1) to September (9). The 0 is missing. --- youtube_dl/extractor/franceinter.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/franceinter.py b/youtube_dl/extractor/franceinter.py index 0d58f89c5..95f5f1c7d 100644 --- a/youtube_dl/extractor/franceinter.py +++ b/youtube_dl/extractor/franceinter.py @@ -38,9 +38,10 @@ class FranceInterIE(InfoExtractor): webpage, 'upload date', fatal=False) if upload_date_str: upload_date_list = upload_date_str.split() - upload_date_list.reverse() - upload_date_list[1] = compat_str(month_by_name(upload_date_list[1], lang='fr')) - upload_date = ''.join(upload_date_list) + upload_date = '%s%02d%02d' % ( + upload_date_list[2], + int(compat_str(month_by_name(upload_date_list[1], lang='fr'))), + int(upload_date_list[0])) else: upload_date = None From 8fc4fbe59093d82122867d5b18f90be6577bb393 Mon Sep 17 00:00:00 2001 From: renalid Date: Fri, 16 Sep 2016 18:18:02 +0200 Subject: [PATCH 2/2] Add a test case Add a new test case to test an upload_date with month and day with a 0 --- youtube_dl/extractor/franceinter.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/franceinter.py b/youtube_dl/extractor/franceinter.py index 95f5f1c7d..5e3565583 100644 --- a/youtube_dl/extractor/franceinter.py +++ b/youtube_dl/extractor/franceinter.py @@ -9,7 +9,7 @@ from ..utils import month_by_name class FranceInterIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?franceinter\.fr/emissions/(?P[^?#]+)' - _TEST = { + _TESTS = [{ 'url': 'https://www.franceinter.fr/emissions/la-marche-de-l-histoire/la-marche-de-l-histoire-18-decembre-2013', 'md5': '4764932e466e6f6c79c317d2e74f6884', 'info_dict': { @@ -19,7 +19,17 @@ class FranceInterIE(InfoExtractor): 'description': 'md5:7f2ce449894d1e585932273080fb410d', 'upload_date': '20131218', }, - } + }, { + 'url': 'https://www.franceinter.fr/emissions/affaires-sensibles/affaires-sensibles-07-septembre-2016', + 'md5': '9e54d7bdb6fdc02a841007f8a975c094', + 'info_dict': { + 'id': 'affaires-sensibles/affaires-sensibles-07-septembre-2016', + 'ext': 'mp3', + 'title': 'Affaire Cahuzac : le contentieux du compte en Suisse', + 'description': 'md5:401969c5d318c061f86bda1fa359292b', + 'upload_date': '20160907', + }, + }] def _real_extract(self, url): video_id = self._match_id(url)