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

Code before:
        playlist_id, playlist_type = self._match_valid_url(url).group('id', 'type')

        endpoints = {
            'albums': ['albums'],
            'collections': ['collections'],
            'embed': ['collections', 'albums'],
        }.get(playlist_type)
        for endpoint in endpoints:
            playlist_data = self._call_api(
                endpoint, playlist_id, note=f'Downloading {endpoint[:-1]} data',
                fatal=False, expected_status=404)
            if not playlist_data.get('errorCode'):
                playlist_type = endpoint
                break
        if playlist_data.get('errorCode'):
            raise ExtractorError('Could not find playlist data')

        return self.playlist_result(
            self._entries(playlist_data), playlist_id,
            **traverse_obj(playlist_data, {
                'title': ('name', {str}),
                'description': ('description', {str}),
                'uploader': ('creator', 'name', {str}),
                'uploader_id': ('creator', 'username', {str}),
                'timestamp': ('createdOn', {parse_iso8601}),
                'release_date': ('releaseDate', {lambda x: x and x.replace('-', '')}),
                'thumbnail': ('picture', ('original', 'url'), {url_or_none}, any),
                'like_count': ('counters', 'likes', {int_or_none}),
                'comment_count': ('counters', 'comments', {int_or_none}),
                'view_count': ('counters', 'plays', {int_or_none}),
            }),
            **(traverse_obj(playlist_data, {
                'album': ('name', {str}),
                'album_type': ('type', {str}),
            }) if playlist_type == 'albums' else {}))


Review comment (suggestion):
this doesn't guard against empty strings, would return `'release_date': ''`

```suggestion
                'release_date': ('releaseDate', {lambda x: x.replace('-', '')}, filter),
```

Code after:
        playlist_id, playlist_type = self._match_valid_url(url).group('id', 'type')

        endpoints = {
            'albums': ['albums'],
            'collections': ['collections'],
            'embed': ['collections', 'albums'],
        }.get(playlist_type)
        for endpoint in endpoints:
            playlist_data = self._call_api(
                endpoint, playlist_id, note=f'Downloading {endpoint[:-1]} data',
                fatal=False, expected_status=404)
            if not playlist_data.get('errorCode'):
                playlist_type = endpoint
                break
        if error_code := playlist_data.get('errorCode'):
            raise ExtractorError(f'Could not find playlist data. Error code: "{error_code}"')

        return self.playlist_result(
            self._entries(playlist_data), playlist_id,
            **traverse_obj(playlist_data, {
                'title': ('name', {str}),
                'description': ('description', {str}),
                'uploader': ('creator', 'name', {str}),
                'uploader_id': ('creator', 'username', {str}),
                'timestamp': ('createdOn', {parse_iso8601}),
                'release_date': ('releaseDate', {lambda x: x.replace('-', '')}, filter),
                'thumbnail': ('picture', ('original', 'url'), {url_or_none}, any),
                'like_count': ('counters', 'likes', {int_or_none}),
                'comment_count': ('counters', 'comments', {int_or_none}),
                'view_count': ('counters', 'plays', {int_or_none}),
            }),
            **(traverse_obj(playlist_data, {
                'album': ('name', {str}),
                'album_type': ('type', {str}),
            }) if playlist_type == 'albums' else {}))