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

Code before:
            fmt.update({
                'ext': 'mp4',
                'protocol': 'https',
                'vcodec': 'h264',
                'acodec': 'aac',
                'http_headers': {'Referer': url},
            })

        return {
            'id': video_id,
            'title': uploader or video_id,
            'formats': formats,
            'uploader': uploader,
            'uploader_id': uploader_id,
            'like_count': view_data.get('likeCount'),
            'view_count': view_data.get('viewCount'),
            'thumbnail': view_data.get('imageURL'),
            'duration': view_data.get('duration'),
            'description': view_data.get('caption'),
            'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))),
        }


class IchinanaLiveVODIE(InfoExtractor):
    IE_NAME = '17live:vod'
    _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/]+/(?P<video_id>[^/]+)'
    _TESTS = [{
        'url': 'https://17.live/ja/vod/27323042/2cf84520-e65e-4b22-891e-1d3a00b0f068',
        'md5': '3299b930d7457b069639486998a89580',
        'info_dict': {
            'id': '2cf84520-e65e-4b22-891e-1d3a00b0f068',
            'ext': 'mp4',
            'title': 'md5:b5f8cbf497d54cc6a60eb3b480182f01',
            'uploader': 'md5:29fb12122ab94b5a8495586e7c3085a5',
            'uploader_id': '2b4f85f1-d61e-429d-a901-68d32bdd8645',
            'like_count': int,
            'view_count': int,
            'thumbnail': r're:^https?://.*\.(?:jpe?g|png)$',
            'duration': 549,
            'description': 'md5:116f326579700f00eaaf5581aae1192e',
            'upload_date': '20250304',
        },
    }, {
        'url': 'https://17.live/ja/vod/27323042/0de11bac-9bea-40b8-9eab-0239a7d88079',
        'only_matching': True,
    }]

    def _real_extract(self, url):
        video_id = self._match_valid_url(url).group('video_id')
        json_data = self._download_json(f'https://wap-api.17app.co/api/v1/vods/{video_id}', video_id)
        return traverse_obj(json_data, {

Review comment (suggestion):
- Need to use `[^/?#]` instead of `[^/]` or else we'll match the URL query/fragment in the ID
- Whenever possible use `id` as the name of the capture group; then the preliminary check done for `--download-archive` is effective
```suggestion
    _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/?#]+/(?P<id>[^/?#]+)'
```

Code after:
                'ext': 'mp4',
                'protocol': 'https',
                'vcodec': 'h264',
                'acodec': 'aac',
                'http_headers': {'Referer': url},
            })

        return {
            'id': video_id,
            'title': uploader or video_id,
            'formats': formats,
            'uploader': uploader,
            'uploader_id': uploader_id,
            'like_count': view_data.get('likeCount'),
            'view_count': view_data.get('viewCount'),
            'thumbnail': view_data.get('imageURL'),
            'duration': view_data.get('duration'),
            'description': view_data.get('caption'),
            'upload_date': unified_strdate(str_or_none(view_data.get('createdAt'))),
        }


class IchinanaLiveVODIE(InfoExtractor):
    IE_NAME = '17live:vod'
    _VALID_URL = r'https?://(?:www\.)?17\.live/ja/vod/[^/?#]+/(?P<id>[^/?#]+)'
    _TESTS = [{
        'url': 'https://17.live/ja/vod/27323042/2cf84520-e65e-4b22-891e-1d3a00b0f068',
        'md5': '3299b930d7457b069639486998a89580',
        'info_dict': {
            'id': '2cf84520-e65e-4b22-891e-1d3a00b0f068',
            'ext': 'mp4',
            'title': 'md5:b5f8cbf497d54cc6a60eb3b480182f01',
            'uploader': 'md5:29fb12122ab94b5a8495586e7c3085a5',
            'uploader_id': '27323042',
            'channel': '🌟オールナイトニッポン アーカイブ🌟',
            'channel_id': '2b4f85f1-d61e-429d-a901-68d32bdd8645',
            'like_count': int,
            'view_count': int,
            'thumbnail': r're:https?://.+/.+\.(?:jpe?g|png)',
            'duration': 549,
            'description': 'md5:116f326579700f00eaaf5581aae1192e',
            'timestamp': 1741058645,
            'upload_date': '20250304',
        },
    }, {
        'url': 'https://17.live/ja/vod/27323042/0de11bac-9bea-40b8-9eab-0239a7d88079',
        'only_matching': True,
    }]

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