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

Code before:

            # prefer format with similar bitrate because there might be
            # multiple video with the same resolution but different bitrate
            format_copy = format_copy[0] or format_copy[1] or {}
            return {
                'format_id': f'https-{tbr}',
                'width': format_copy.get('width'),
                'height': format_copy.get('height'),
                'tbr': format_copy.get('tbr'),
                'vcodec': format_copy.get('vcodec'),
                'acodec': format_copy.get('acodec'),
                'fps': format_copy.get('fps'),
            } if format_copy else {
                'format_id': f'https-{tbr}',
                'width': _QUALITY[tbr][0],
                'height': _QUALITY[tbr][1],
                'tbr': tbr,
                'vcodec': 'avc1',
                'acodec': 'mp4a',
                'fps': 25,
            }

        # Check if MP4 download is available
        try:
            self._request_webpage(
                HEADRequest(_MP4_TMPL % (relinker_url, '*')), video_id=video_id, note='Checking MP4 availability')
        except ExtractorError as e:
            self.to_screen(f'{video_id}: MP4 direct download is not available: {e.cause}')
            return []

        # filter out single-stream formats
        fmts = [f for f in fmts
                if not f.get('vcodec') == 'none' and not f.get('acodec') == 'none']

        mobj = re.search(_MANIFEST_REG, manifest_url)
        if not mobj:
            return []
        available_qualities = mobj.group('quality').split(',') if mobj.group('quality') else ['*']

        formats = []
        for q in filter(None, available_qualities):
            self.write_debug(f'Creating https format for quality {q}')
            formats.append({
                'url': _MP4_TMPL % (relinker_url, q),
                'protocol': 'https',
                'ext': 'mp4',
                **get_format_info(q)
            })
        return formats

    @staticmethod

Review comment (suggestion):
```suggestion
                HEADRequest(_MP4_TMPL % (relinker_url, '*')), video_id, 'Checking MP4 availability')
```

Code after:

            # prefer format with similar bitrate because there might be
            # multiple video with the same resolution but different bitrate
            format_copy = format_copy[0] or format_copy[1] or {}
            return {
                'format_id': f'https-{tbr}',
                'width': format_copy.get('width'),
                'height': format_copy.get('height'),
                'tbr': format_copy.get('tbr'),
                'vcodec': format_copy.get('vcodec'),
                'acodec': format_copy.get('acodec'),
                'fps': format_copy.get('fps'),
            } if format_copy else {
                'format_id': f'https-{tbr}',
                'width': _QUALITY[tbr][0],
                'height': _QUALITY[tbr][1],
                'tbr': tbr,
                'vcodec': 'avc1',
                'acodec': 'mp4a',
                'fps': 25,
            }

        # Check if MP4 download is available
        try:
            self._request_webpage(
                HEADRequest(_MP4_TMPL % (relinker_url, '*')), video_id, 'Checking MP4 availability')
        except ExtractorError as e:
            self.to_screen(f'{video_id}: MP4 direct download is not available: {e.cause}')
            return []

        # filter out single-stream formats
        fmts = [f for f in fmts
                if not f.get('vcodec') == 'none' and not f.get('acodec') == 'none']

        mobj = re.search(_MANIFEST_REG, manifest_url)
        if not mobj:
            return []
        available_qualities = mobj.group('quality').split(',') if mobj.group('quality') else ['*']

        formats = []
        for q in filter(None, available_qualities):
            self.write_debug(f'Creating https format for quality {q}')
            formats.append({
                'url': _MP4_TMPL % (relinker_url, q),
                'protocol': 'https',
                'ext': 'mp4',
                **get_format_info(q)
            })
        return formats

    @staticmethod