From f861761a9010a265826b1ac84bec0e283d69a7af Mon Sep 17 00:00:00 2001 From: Kaspar Vollenweider Date: Sat, 17 Jul 2021 17:45:17 +0200 Subject: [PATCH] =?UTF-8?q?feat(arte=5Fextractor):=20add=20alt=5Ftitle=20f?= =?UTF-8?q?or=20regular=20shows=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=E2=9D=AF=E2=9D=AF?= =?UTF-8?q?=E2=9D=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most repeating Arte.tv shows have an essential subtitle (not to confuse with the one already in the extractor!). Without that title those shows get the same title for all potentially hundreds of shows. Here is an example of the German version of the ARTE Reportage show: https://www.arte.tv/de/videos/030273-820-A/arte-reportage/ Now: title is `ARTE Reportage` and no alt_title is available With this: title is `ARTE Reportage` and alt_title is `Sudan: Die Tigray fliehen aus Äthiopien` --- youtube_dl/extractor/arte.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/arte.py b/youtube_dl/extractor/arte.py index 03abdbfaf..2fb7e86dd 100644 --- a/youtube_dl/extractor/arte.py +++ b/youtube_dl/extractor/arte.py @@ -33,6 +33,16 @@ class ArteTVIE(ArteTVBaseIE): /(?P\d{6}-\d{3}-[AF]) ''' % {'langs': ArteTVBaseIE._ARTE_LANGUAGES} _TESTS = [{ + 'url': 'https://www.arte.tv/de/videos/092724-001-A/lasst-mich-schlafen/', + 'info_dict': { + 'id': '092724-001-A', + 'ext': 'mp4', + 'title': 'Lasst mich schlafen!', + 'alt_title': 'Wie schlafen wir?', + 'description': 'Gegen Abend signalisiert die biologische Uhr dem Körper durch das Ausschütten von Melatonin, dass es Zeit ist, herunterzufahren. Doch was geschieht dabei im Gehirn? Der Schlafforscher Raphael Heinzer vom Schlafforschungszentrum Lausanne will dies herausfinden und beobachtet die Hirnströme in den verschiedenen Schlafphasen.', + 'upload_date': '20200224' + }, + }, { 'url': 'https://www.arte.tv/en/videos/088501-000-A/mexico-stealing-petrol-to-survive/', 'info_dict': { 'id': '088501-000-A', @@ -170,7 +180,7 @@ class ArteTVIE(ArteTVBaseIE): self._sort_formats(formats) - return { + extracted_metadata = { 'id': player_info.get('VID') or video_id, 'title': title, 'description': player_info.get('VDE'), @@ -178,6 +188,9 @@ class ArteTVIE(ArteTVBaseIE): 'thumbnail': player_info.get('programImage') or player_info.get('VTU', {}).get('IUR'), 'formats': formats, } + if player_info.get('subtitle', '').strip(): + extracted_metadata['alt_title'] = player_info.get('subtitle', '').strip() + return extracted_metadata class ArteTVEmbedIE(InfoExtractor):