Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/kompas.py (Python)

Code before:
                fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
                formats.extend(fmt)
                self._merge_subtitles(sub, target=subtitles)
            else:
                formats.append({
                    'url': stream.get('url'),
                    'width': stream.get('width'),
                    'height': stream.get('height'),
                    'ext': 'mp4',
                })

        self._sort_formats(formats)
        return {
            'id': video_id,
            'display_id': display_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': json_data.get('title') or self._html_search_meta(['og:title', 'twitter:title'], webpage),
            'description': (clean_html(traverse_obj(json_data, ('metadata', 'description')))
                            or self._html_search_meta(['description', 'og:description', 'twitter:description'], webpage)),
            'thumbnails': traverse_obj(json_data, ('metadata', 'thumbnails')),
            'thumbnail': traverse_obj(json_data, ('metadata', 'thumbnail')),
            'duration': float_or_none(traverse_obj(json_data, ('metadata', 'duration'))),
            'has_drm': json_data.get('drm'),
            'tags': str_or_none(traverse_obj(json_data, ('metadata', 'keywords')), '').split(',') or None,
            'categories': str_or_none(traverse_obj(json_data, ('metadata', 'categories')), '').split(',') or None,
            'uploader_id': json_data.get('owner_id'),
        }


Review comment (suggestion):
`''.split(',') or None` doesn't work like you think. It makes sense to use `try_call` here instead
```suggestion
            'tags': try_call(lambda: json_data['metadata']['keywords'].split(',')),
            'categories': try_call(lambda: json_data['metadata']['categories'].split(',')),
```

Code after:
                fmt, sub = self._extract_m3u8_formats_and_subtitles(stream.get('url'), display_id, ext='mp4')
                formats.extend(fmt)
                self._merge_subtitles(sub, target=subtitles)
            else:
                formats.append({
                    'url': stream.get('url'),
                    'width': stream.get('width'),
                    'height': stream.get('height'),
                    'ext': 'mp4',
                })

        self._sort_formats(formats)
        return {
            'id': video_id,
            'display_id': display_id,
            'formats': formats,
            'subtitles': subtitles,
            'title': json_data.get('title') or self._html_search_meta(['og:title', 'twitter:title'], webpage),
            'description': (clean_html(traverse_obj(json_data, ('metadata', 'description')))
                            or self._html_search_meta(['description', 'og:description', 'twitter:description'], webpage)),
            'thumbnails': traverse_obj(json_data, ('metadata', 'thumbnails')),
            'duration': float_or_none(traverse_obj(json_data, ('metadata', 'duration'))),
            'tags': try_call(lambda: json_data['metadata']['keywords'].split(',')),
            'categories': try_call(lambda: json_data['metadata']['categories'].split(',')),
            'uploader_id': json_data.get('owner_id'),
        }