From 95670350cbf80fb0d34cbc47ff138e1a0ce9e5d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Wed, 18 Aug 2021 14:42:47 +0200 Subject: [PATCH 1/2] [extractor/rtve.es:live] Fix title and video id discovering --- youtube_dl/extractor/rtve.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/youtube_dl/extractor/rtve.py b/youtube_dl/extractor/rtve.py index d2fb754cf..a79a65392 100644 --- a/youtube_dl/extractor/rtve.py +++ b/youtube_dl/extractor/rtve.py @@ -17,7 +17,6 @@ from ..utils import ( float_or_none, qualities, remove_end, - remove_start, std_headers, ) @@ -208,7 +207,7 @@ class RTVELiveIE(RTVEALaCartaIE): 'info_dict': { 'id': 'la-1', 'ext': 'mp4', - 'title': 're:^La 1 [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$', + 'title': r're:^[^\s].+[^\s]$', }, 'params': { 'skip_download': 'live stream', @@ -220,14 +219,12 @@ class RTVELiveIE(RTVEALaCartaIE): video_id = mobj.group('id') webpage = self._download_webpage(url, video_id) - title = remove_end(self._og_search_title(webpage), ' en directo en RTVE.es') - title = remove_start(title, 'Estoy viendo ') + title = remove_end( + self._html_search_regex(r']*>(.*?)', webpage, 'title'), + ' en directo, en RTVE Play') vidplayer_id = self._search_regex( - (r'playerId=player([0-9]+)', - r'class=["\'].*?\blive_mod\b.*?["\'][^>]+data-assetid=["\'](\d+)', - r'data-id=["\'](\d+)'), - webpage, 'internal video ID') + r'"idAsset":\s*"([0-9]+)"', webpage, 'internal video ID') return { 'id': video_id, From 1b2b4a6e91193aec26fd87d51b51bcc6cb25ad27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Wed, 18 Aug 2021 14:51:43 +0200 Subject: [PATCH 2/2] Add test for La 2 live stream --- youtube_dl/extractor/rtve.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/youtube_dl/extractor/rtve.py b/youtube_dl/extractor/rtve.py index a79a65392..6a1d10da0 100644 --- a/youtube_dl/extractor/rtve.py +++ b/youtube_dl/extractor/rtve.py @@ -212,6 +212,16 @@ class RTVELiveIE(RTVEALaCartaIE): 'params': { 'skip_download': 'live stream', } + }, { + 'url': 'http://www.rtve.es/directo/la-2/', + 'info_dict': { + 'id': 'la-2', + 'ext': 'mp4', + 'title': r're:^[^\s].+[^\s]$', + }, + 'params': { + 'skip_download': 'live stream', + } }] def _real_extract(self, url):