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

Code before:
        'params': {'skip_download': 'm3u8'},
    }]

    _CLIENT_DATA = {
        'networkType': 'other',
        'nflClaimGroupsToAdd': [],
        'nflClaimGroupsToRemove': [],
        'clientKey': '4cFUW6DmwJpzT9L7LrG3qRAcABG5s04g',
        'clientSecret': 'CZuvCL49d9OwfGsR',
        'deviceId': str(uuid.uuid4()),
        'deviceInfo': base64.b64encode(json.dumps({
            'model': 'desktop',
            'version': 'Chrome',
            'osName': 'Windows',
            'osVersion': '10.0',
        }, separators=(',', ':')).encode()).decode(),
    }
    _ACCOUNT_INFO = {}
    _API_KEY = None

    _TOKEN = None
    _TOKEN_EXPIRY = 0

    def _get_account_info(self, url, video_id):
        cookies = self._get_cookies('https://www.nfl.com/')
        login_token = try_call(lambda: cookies[f'glt_{self._API_KEY}'].value)
        if not login_token:
            self.raise_login_required()

        account = self._download_json(
            'https://auth-id.nfl.com/accounts.getAccountInfo', video_id,
            note='Downloading account info', data=urlencode_postdata({
                'include': 'profile,data',
                'lang': 'en',
                'APIKey': self._API_KEY,
                'sdk': 'js_latest',
                'login_token': login_token,
                'authMode': 'cookie',
                'pageURL': url,
                'sdkBuild': traverse_obj(cookies, (
                    'gig_canary_ver', {lambda x: x.value.partition('-')[0]}), default='13642'),
                'format': 'json',
            }), headers={'Content-Type': 'application/x-www-form-urlencoded'})

        self._ACCOUNT_INFO = traverse_obj(account, {
            'uid': 'UID',
            'uidSignature': 'UIDSignature',
            'signatureTimestamp': 'signatureTimestamp'
        })

    def _get_auth_token(self, url, video_id):

Review comment (suggestion):
There can be multiple `glt_`... cookies, and they don't always match the API key. In my testing, with each login the `glt` cookies have had identical values, so any `glt` cookie's value will probably work. But I figure if there *is* a `glt_{_API_KEY}` cookie, then that is the cookie most likely to work should the values differ for any reason. That's why I had the for loop

Code after:
        'params': {'skip_download': 'm3u8'},
    }]

    _CLIENT_DATA = {
        'clientKey': '4cFUW6DmwJpzT9L7LrG3qRAcABG5s04g',
        'clientSecret': 'CZuvCL49d9OwfGsR',
        'deviceId': str(uuid.uuid4()),
        'deviceInfo': base64.b64encode(json.dumps({
            'model': 'desktop',
            'version': 'Chrome',
            'osName': 'Windows',
            'osVersion': '10.0',
        }, separators=(',', ':')).encode()).decode(),
        'networkType': 'other',
        'nflClaimGroupsToAdd': [],
        'nflClaimGroupsToRemove': [],
    }
    _ACCOUNT_INFO = {}
    _API_KEY = None

    _TOKEN = None
    _TOKEN_EXPIRY = 0

    def _get_account_info(self, url, video_id):
        cookies = self._get_cookies('https://www.nfl.com/')
        login_token = traverse_obj(cookies, (
            (f'glt_{self._API_KEY}', f'gig_loginToken_{self._API_KEY}',
             lambda k, _: k.startswith('glt_') or k.startswith('gig_loginToken_')),
            {lambda x: x.value}), get_all=False)
        if not login_token:
            self.raise_login_required()

        account = self._download_json(
            'https://auth-id.nfl.com/accounts.getAccountInfo', video_id,
            note='Downloading account info', data=urlencode_postdata({
                'include': 'profile,data',
                'lang': 'en',
                'APIKey': self._API_KEY,
                'sdk': 'js_latest',
                'login_token': login_token,
                'authMode': 'cookie',
                'pageURL': url,
                'sdkBuild': traverse_obj(cookies, (
                    'gig_canary_ver', {lambda x: x.value.partition('-')[0]}), default='13642'),
                'format': 'json',
            }), headers={'Content-Type': 'application/x-www-form-urlencoded'})

        self._ACCOUNT_INFO = traverse_obj(account, {
            'signatureTimestamp': 'signatureTimestamp',
            'uid': 'UID',
            'uidSignature': 'UIDSignature',