diff --git a/youtube_dl/extractor/rtp.py b/youtube_dl/extractor/rtp.py index 2f9360e12..da30a7789 100644 --- a/youtube_dl/extractor/rtp.py +++ b/youtube_dl/extractor/rtp.py @@ -40,6 +40,14 @@ class RTPIE(InfoExtractor): title = self._html_search_regex(r'(.+?)', webpage, 'title') + # Replace irrelevant text in title + title = title.replace(' - RTP Play - RTP', '') + + # Check if it's a video split in parts, if so add part number to title + part = self._html_search_regex(r'section\-parts.*(.+?).*', webpage, 'part', default=None) + if part: + title = f'{title} {part}' + # Get JS object js_object = self._search_regex(r'(?s)RTPPlayer *\( *({.+?}) *\);', webpage, 'player config')