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

Code before:
        webpage = self._download_webpage(url, video_id)
        config = self._search_json(
            r'window\.__NUXT__\.config\s*=', webpage, 'config', video_id, transform_source=js_to_json)
        api_key = traverse_obj(config, ('public', 'streaksVodPlaybackApiKey', {str}, {require('api key')}))

        return {
            **self._extract_from_streaks_api('locipo-prod', media_id, headers={
                'Origin': 'https://locipo.jp', 'X-Streaks-Api-Key': api_key}),
            **traverse_obj(creatives, {
                'title': ('name', {clean_html}),
                'description': ('description', {clean_html}, filter),
                'release_timestamp': ('publication_started_at', {parse_iso8601}),
                'tags': ('keyword', {clean_html}, {lambda x: x.split(',')}, ..., {str.strip}, filter),
                'uploader': ('company', 'name', {clean_html}, filter),
            }),
            **traverse_obj(creatives, ('series', {
                'series': ('name', {clean_html}, filter),
                'series_id': ('id', {str_or_none}),
            })),
            'id': video_id,
        }


class LocipoPlaylistIE(LocipoBaseIE):
    _PAGE_SIZE = 100
    _VALID_URL = fr'https?://locipo\.jp/(?P<type>playlist|series)/(?P<id>{LocipoBaseIE._UUID_RE}|\d+)'
    _TESTS = [{
        'url': 'https://locipo.jp/playlist/35d3dd2b-531d-4824-8575-b1c527d29538',
        'info_dict': {
            'id': '35d3dd2b-531d-4824-8575-b1c527d29538',
            'title': 'レシピ集',
        },
        'playlist_mincount': 135,
    }, {
        # Redirects to https://locipo.jp/series/1363
        'url': 'https://locipo.jp/playlist/fef7c4fb-741f-4d6a-a3a6-754f354302a2',
        'info_dict': {
            'id': '1363',
            'title': 'CBCアナウンサー公式【みてちょてれび】',
            'description': 'md5:50a1b23e63112d5c06c882835c8c1fb1',
        },
        'playlist_mincount': 38,
    }, {
        'url': 'https://locipo.jp/series/503',
        'info_dict': {
            'id': '503',
            'title': 'FishingLover東海',
            'description': '東海地区の釣り場でフィッシングの魅力を余すところなくご紹介！！',
        },
        'playlist_mincount': 223,
    }]

Review comment (suggestion):
```suggestion
    _VALID_URL = [
        fr'https?://locipo\.jp/(?P<type>playlist)/(?P<id>{LocipoBaseIE._UUID_RE})',
        fr'https?://locipo\.jp/(?P<type>series)/(?P<id>\d+)',
    ]
```

Code after:
        api_key = traverse_obj(config, ('public', 'streaksVodPlaybackApiKey', {str}, {require('api key')}))

        return {
            **self._extract_from_streaks_api('locipo-prod', media_id, headers={
                'Origin': 'https://locipo.jp',
                'X-Streaks-Api-Key': api_key,
            }),
            **traverse_obj(creatives, {
                'title': ('name', {clean_html}),
                'description': ('description', {clean_html}, filter),
                'release_timestamp': ('publication_started_at', {parse_iso8601}),
                'tags': ('keyword', {clean_html}, {lambda x: x.split(',')}, ..., {str.strip}, filter),
                'uploader': ('company', 'name', {clean_html}, filter),
            }),
            **traverse_obj(creatives, ('series', {
                'series': ('name', {clean_html}, filter),
                'series_id': ('id', {str_or_none}),
            })),
            'id': video_id,
        }


class LocipoPlaylistIE(LocipoBaseIE):
    _VALID_URL = [
        fr'https?://locipo\.jp/(?P<type>playlist)/(?P<id>{LocipoBaseIE._UUID_RE})',
        r'https?://locipo\.jp/(?P<type>series)/(?P<id>\d+)',
    ]
    _TESTS = [{
        'url': 'https://locipo.jp/playlist/35d3dd2b-531d-4824-8575-b1c527d29538',
        'info_dict': {
            'id': '35d3dd2b-531d-4824-8575-b1c527d29538',
            'title': 'レシピ集',
        },
        'playlist_mincount': 135,
    }, {
        # Redirects to https://locipo.jp/series/1363
        'url': 'https://locipo.jp/playlist/fef7c4fb-741f-4d6a-a3a6-754f354302a2',
        'info_dict': {
            'id': '1363',
            'title': 'CBCアナウンサー公式【みてちょてれび】',
            'description': 'md5:50a1b23e63112d5c06c882835c8c1fb1',
        },
        'playlist_mincount': 38,
    }, {
        'url': 'https://locipo.jp/series/503',
        'info_dict': {
            'id': '503',
            'title': 'FishingLover東海',
            'description': '東海地区の釣り場でフィッシングの魅力を余すところなくご紹介！！',
        },
        'playlist_mincount': 223,