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

Code before:
            'Could not find the playlist URL. This event may not be accessible',
            'No video formats found!',
            'Requested format is not available',
            'This video is DRM protected',
        ],
    }, {
        'url': 'https://live.eplus.jp/2053935',
        'info_dict': {
            'id': '331320-0001-001',
            'title': '丘みどり2020配信LIVE Vol.2 ～秋麗～ 【Streaming+(配信チケット)】',
            'live_status': 'was_live',
            'release_date': '20200920',
            'release_timestamp': 1600596000,
        },
        'params': {
            'skip_download': True,
            'ignore_no_formats_error': True,
        },
        'expected_warnings': [
            'Could not find the playlist URL. This event may not be accessible',
            'No video formats found!',
            'Requested format is not available',
        ],
    }]

    _USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0'
    _TEST_EVENT_URL = 'https://live.eplus.jp/2053935'

    def _perform_login(self, id, password):
        urlh = self._request_webpage(
            self._TEST_EVENT_URL, None, note='Getting auth status', errnote='Unable to get auth status')
        if urlh.url.startswith(self._TEST_EVENT_URL):
            # already logged in
            return

        cltft_token = urlh.headers.get('X-CLTFT-Token')
        if not cltft_token:
            raise ExtractorError('Unable to get X-CLTFT-Token', expected=False)
        self._set_cookie('live.eplus.jp', 'X-CLTFT-Token', cltft_token)

        login_json = self._download_json(
            'https://live.eplus.jp/member/api/v1/FTAuth/idpw', None,
            note='Sending pre-login info', errnote='Unable to send pre-login info', headers={
                'Content-Type': 'application/json; charset=UTF-8',
                'Referer': urlh.url,
                'X-Cltft-Token': cltft_token,
                'Accept': '*/*',
            }, data=json.dumps({
                'loginId': id,
                'loginPassword': password,
            }).encode())

Review comment (suggestion):
Are you sure the Edge UA is needed to check `drm_mode`? When I request the sample event's webpage with a default Chrome UA, the `drm_mode` field is still present in the JSON object

Code after:
            'Could not find the playlist URL. This event may not be accessible',
            'No video formats found!',
            'Requested format is not available',
            'This video is DRM protected',
        ],
    }, {
        'url': 'https://live.eplus.jp/2053935',
        'info_dict': {
            'id': '331320-0001-001',
            'title': '丘みどり2020配信LIVE Vol.2 ～秋麗～ 【Streaming+(配信チケット)】',
            'live_status': 'was_live',
            'release_date': '20200920',
            'release_timestamp': 1600596000,
        },
        'params': {
            'skip_download': True,
            'ignore_no_formats_error': True,
        },
        'expected_warnings': [
            'Could not find the playlist URL. This event may not be accessible',
            'No video formats found!',
            'Requested format is not available',
        ],
    }]

    _USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0'

    def _login(self, username, password, urlh):
        if not self._get_cookies('https://live.eplus.jp/').get('ci_session'):
            raise ExtractorError('Unable to get ci_session cookie')

        cltft_token = urlh.headers.get('X-CLTFT-Token')
        if not cltft_token:
            raise ExtractorError('Unable to get X-CLTFT-Token')
        self._set_cookie('live.eplus.jp', 'X-CLTFT-Token', cltft_token)

        login_json = self._download_json(
            'https://live.eplus.jp/member/api/v1/FTAuth/idpw', None,
            note='Sending pre-login info', errnote='Unable to send pre-login info', headers={
                'Content-Type': 'application/json; charset=UTF-8',
                'Referer': urlh.url,
                'X-Cltft-Token': cltft_token,
                'Accept': '*/*',
            }, data=json.dumps({
                'loginId': username,
                'loginPassword': password,
            }).encode())
        if not login_json.get('isSuccess'):
            raise ExtractorError('Login failed: Invalid id or password', expected=True)

        self._request_webpage(