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

Code before:
            resp = self._request_webpage(
                HEADRequest(url), None, expected_status=(200, 404),
                fatal=False, errnote=False, note=False,
                headers={'User-Agent': 'raiweb'})

            if resp is False:
                return False

            if resp.code == 200:
                return True if resp.url == url else resp.url
            elif resp.code == 404:
                return None
            return None

        def get_format_info(tbr):
            import math
            br = int_or_none(tbr)
            if len(fmts) == 1 and not br:
                br = fmts[0].get('tbr')
            if br > 300:
                tbr = compat_str(math.floor(br / 100) * 100)
            else:
                tbr = '250'

            # try extracting info from available m3u8 formats
            c = None
            for f in fmts:
                if f.get('tbr'):
                    if math.floor(f['tbr'] / 100) == math.floor(br / 100):
                        c = f.copy()
            return [
                c.get('width'),
                c.get('height'),
                c.get('tbr'),
                c.get('vcodec'),
                c.get('acodec'),
                tbr,
            ] if c else [None, None, None, None, None, tbr]

        loc = test_url(relinker_url)
        if not isinstance(loc, compat_str):
            return []

        base_url, vid, quality = None, None, None
        mobj = re.match(_MP4_REG, loc or '')
        if mobj:
            base_url, vid, quality = mobj.groups()
        else:
            return []

        available_qualities = []

Review comment (suggestion):
Dont use `c`? Make the variable name more readable

Code after:
            resp = self._request_webpage(
                HEADRequest(url), None, headers={'User-Agent': 'Rai'},
                fatal=False, errnote=False, note=False)

            if resp is False:
                return False

            if resp.code == 200:
                return False if resp.url == url else resp.url
            return None

        def get_format_info(tbr):
            import math
            br = int_or_none(tbr)
            if len(fmts) == 1 and not br:
                br = fmts[0].get('tbr')
            if br > 300:
                tbr = compat_str(math.floor(br / 100) * 100)
            else:
                tbr = '250'

            # try extracting info from available m3u8 formats
            format_copy = None
            for f in fmts:
                if f.get('tbr'):
                    br_limit = math.floor(br / 100)
                    if br_limit - 1 <= math.floor(f['tbr'] / 100) <= br_limit + 1:
                        format_copy = f.copy()
            return {
                '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'),
                'format_id': 'https-%s' % tbr,
            } if format_copy else {
                'width': _QUALITY[tbr][0],
                'height': _QUALITY[tbr][1],
                'format_id': 'https-%s' % tbr,
                'tbr': int(tbr),
            }

        loc = test_url(_MP4_TMPL % (relinker_url, '*'))
        if not isinstance(loc, compat_str):
            return []

        mobj = re.match(
            _RELINKER_REG,
            test_url(relinker_url) or '')
        if not mobj: