From fcd47d2db3f871c7b7d638773c36cc503119742d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Mon, 29 Dec 2025 03:50:03 +0100 Subject: [PATCH] [ie/picarto] Fix extraction when stream has no title (#15407) Closes #14540 Authored by: mikf --- yt_dlp/extractor/picarto.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yt_dlp/extractor/picarto.py b/yt_dlp/extractor/picarto.py index 92431fa241..4db8425241 100644 --- a/yt_dlp/extractor/picarto.py +++ b/yt_dlp/extractor/picarto.py @@ -4,6 +4,7 @@ from .common import InfoExtractor from ..utils import ( ExtractorError, str_or_none, + strip_or_none, traverse_obj, update_url, ) @@ -50,7 +51,6 @@ class PicartoIE(InfoExtractor): if metadata.get('online') == 0: raise ExtractorError('Stream is offline', expected=True) - title = metadata['title'] cdn_data = self._download_json(''.join(( update_url(data['getLoadBalancerUrl']['url'], scheme='https'), @@ -79,7 +79,7 @@ class PicartoIE(InfoExtractor): return { 'id': channel_id, - 'title': title.strip(), + 'title': strip_or_none(metadata.get('title')), 'is_live': True, 'channel': channel_id, 'channel_id': metadata.get('id'), @@ -159,7 +159,7 @@ class PicartoVodIE(InfoExtractor): 'id': video_id, **traverse_obj(data, { 'id': ('id', {str_or_none}), - 'title': ('title', {str}), + 'title': ('title', {str.strip}), 'thumbnail': 'video_recording_image_url', 'channel': ('channel', 'name', {str}), 'age_limit': ('adult', {lambda x: 18 if x else 0}),