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

Code before:
            'tags': 'count:15',
            'timestamp': 1758213949,
            'upload_date': '20250918',
        },
    }, {
        'url': 'https://media.netapp.com/video-detail/45593e5d-cf1c-5996-978c-c9081906e69f/unleash-ai-innovation-with-your-data-with-the-netapp-platform',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_uuid = self._match_id(url)
        metadata = self._download_json(self._VIDEO_METADATA_URL % video_uuid, video_uuid)

        video_id = None
        title = None
        for section in metadata.get('sections', {}):
            if section.get('type') == 'Player':
                video_id = section.get('video')
            if section.get('type') == 'VideoDetail':
                title = section.get('name')
                description = section.get('description')

        if not video_id:
            raise ExtractorError('Video ID not found in metadata')
        if not title:
            raise ExtractorError('Title not found in metadata')

        return {
            '_type': 'url_transparent',
            'url': self._BC_URL % video_id,
            'ie_key': 'BrightcoveNew',
            'title': title,
            'description': description,
        }


class NetAppCollectionIE(NetAppBaseIE):
    _VALID_URL = r'https?://media\.netapp\.com/collection/(?P<id>[0-9a-f-]+)'
    _TESTS = [{
        'url': 'https://media.netapp.com/collection/9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        'info_dict': {
            'title': 'Featured sessions',
            'id': '9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        },
        'playlist_count': 4,
    }]

    def _entries(self, metadata):
        for item in metadata.get('items', {}):
            video_id = item.get('brightcoveVideoId')
            yield {

Review comment (suggestion):
Let's use traverse_obj for this. Title is also not a mandatory field
```suggestion
        brightcove_video_id = traverse_obj(metadata, (
            'sections', lambda _, v: v['type'] == 'Player', 'video',  {str}, any, {require('brightcove video id')}))
```

Code after:
            'id': '1843620950167202073',
            'ext': 'mp4',
            'title': 'Seamless storage for modern Kubernetes deployments',
            'description': 'md5:1ee39e315243fe71fb90af2796037248',
            'uploader_id': '6255154784001',
            'duration': 2159.41,
            'thumbnail': r're:https://house-fastly-signed-us-east-1-prod\.brightcovecdn\.com/image/.*\.jpg',
            'tags': 'count:15',
            'timestamp': 1758213949,
            'upload_date': '20250918',
        },
    }, {
        'url': 'https://media.netapp.com/video-detail/45593e5d-cf1c-5996-978c-c9081906e69f/unleash-ai-innovation-with-your-data-with-the-netapp-platform',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_uuid = self._match_id(url)
        metadata = self._download_json(
            f'https://api.media.netapp.com/client/detail/{video_uuid}', video_uuid)

        brightcove_video_id = traverse_obj(metadata, (
            'sections', lambda _, v: v['type'] == 'Player', 'video', {str}, any, {require('brightcove video id')}))

        video_item = traverse_obj(metadata, ('sections', lambda _, v: v['type'] == 'VideoDetail', any))

        return self.url_result(
            self._BC_URL.format(brightcove_video_id), BrightcoveNewIE, brightcove_video_id,
            url_transparent=True, **self._parse_metadata(video_item))


class NetAppCollectionIE(NetAppBaseIE):
    _VALID_URL = r'https?://media\.netapp\.com/collection/(?P<id>[0-9a-f-]+)'
    _TESTS = [{
        'url': 'https://media.netapp.com/collection/9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        'info_dict': {
            'title': 'Featured sessions',
            'id': '9820e190-f2a6-47ac-9c0a-98e5e64234a4',
        },
        'playlist_count': 4,
    }]

    def _entries(self, metadata):
        for item in traverse_obj(metadata, ('items', lambda _, v: v['brightcoveVideoId'])):
            brightcove_video_id = item['brightcoveVideoId']
            yield self.url_result(
                self._BC_URL.format(brightcove_video_id), BrightcoveNewIE, brightcove_video_id,
                url_transparent=True, **self._parse_metadata(item))

    def _real_extract(self, url):
        collection_uuid = self._match_id(url)