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

Code before:
            'channel_id': '93ca5866-2551-49fc-8424-6db35af58920',
            'display_id': '95c80c52-6b9a-4ae9-9197-984145adfced',
            'duration': 41097,
            'upload_date': '20220309',
            'timestamp': 1646860727.0,
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        meta = self._download_json(
            'https://api.sportdeutschland.tv/api/stateless/frontend/assets/' + display_id,
            display_id, query={'access_token': 'true'})

        asset_id = meta.get('id') or meta.get('uuid')
        profile = meta.get('profile')

        info = {
            'id': asset_id,
            'title': (meta.get('title') or meta.get('name')).strip(),
            'description': meta.get('description'),
            'channel': profile.get('name'),
            'channel_id': profile.get('id'),
            'channel_url': 'https://sportdeutschland.tv/' + profile.get('slug'),
            'is_live': meta.get('currently_live'),
            'was_live': meta.get('was_live')
        }

        videos = meta.get('videos') or []

        if len(videos) > 1:
            info.update({
                '_type': 'multi_video',
                'entries': self.processVideoOrStream(asset_id, video)
            } for video in enumerate(videos) if video.get('formats'))

        elif len(videos) == 1:
            info.update(
                self.processVideoOrStream(asset_id, videos[0])
            )

        livestream = meta.get('livestream')

        if livestream is not None:
            info.update(
                self.processVideoOrStream(asset_id, livestream)
            )

        return info

    def processVideoOrStream(self, asset_id, video):

Review comment (suggestion):
```suggestion
        asset_id = traverse_obj(meta, 'id', 'uuid')
        info = {
            'id': asset_id,
            'channel_url': format_field(meta, ('profile', 'name'), 'https://sportdeutschland.tv/%s'),
            **traverse_obj(meta, {
                'title': (('title', 'name'), {strip_or_none}),
                'description': 'description',
                'channel': ('profile', 'name'),
                'channel_id': ('profile', 'id'),
                'is_live': 'currently_live',
                'was_live': 'was_live'
            }, get_all=False),
```

Code after:
            'description': 'md5:2afb5996ceb9ac0b2ac81f563d3a883e',
            'live_status': 'was_live',
            'channel': 'Deutscher Badminton Verband',
            'channel_url': 'https://sportdeutschland.tv/deutscherbadmintonverband',
            'channel_id': '93ca5866-2551-49fc-8424-6db35af58920',
            'display_id': '95c80c52-6b9a-4ae9-9197-984145adfced',
            'duration': 41097,
            'upload_date': '20220309',
            'timestamp': 1646860727.0,
        }
    }]

    def _real_extract(self, url):
        display_id = self._match_id(url)
        meta = self._download_json(
            'https://api.sportdeutschland.tv/api/stateless/frontend/assets/' + display_id,
            display_id, query={'access_token': 'true'})

        asset_id = traverse_obj(meta, 'id', 'uuid')

        info = {
            'id': asset_id,
            'channel_url': format_field(meta, ('profile', 'slug'), 'https://sportdeutschland.tv/%s'),
            **traverse_obj(meta, {
                'title': (('title', 'name'), {strip_or_none}),
                'description': 'description',
                'channel': ('profile', 'name'),
                'channel_id': ('profile', 'id'),
                'is_live': 'currently_live',
                'was_live': 'was_live'
            }, get_all=False)
        }

        videos = meta.get('videos') or []

        if len(videos) > 1:
            info.update({
                '_type': 'multi_video',
                'entries': self.processVideoOrStream(asset_id, video)
            } for video in enumerate(videos) if video.get('formats'))

        elif len(videos) == 1:
            info.update(
                self.processVideoOrStream(asset_id, videos[0])
            )

        livestream = meta.get('livestream')

        if livestream is not None:
            info.update(
                self.processVideoOrStream(asset_id, livestream)