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

Code before:
        'url': 'https://www.zee5.com/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730?country=IN',
        'only_matching': True
    }, {
        'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730',
        'only_matching': True
    }]
    _DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&device_id={}&platform_name=desktop_web&country=IN&check_parental_control=false'
    _DEVICE_ID = 'iIxsxYf40cqO3koIkwzKHZhnJzHN13zb'
    _USER_TOKEN = None
    _LOGIN_HINT = 'Use "--username <mobile_number>" to login using otp or "--username token" and "--password <user_token>" to login using user token.'
    _NETRC_MACHINE = 'zee5'

    def _login(self):
        username, password = self._get_login_info()
        if username:
            if len(username) == 10 and username.isdigit() and self._USER_TOKEN is None:
                self.report_login()
                otp_request_json = self._download_json('https://b2bapi.zee5.com/device/sendotp_v1.php?phoneno=91{}'.format(username),
                                                       None, note="Sending OTP")
                if otp_request_json['code'] == 0:
                    self.to_screen(otp_request_json['message'])
                else:
                    raise ExtractorError(otp_request_json['message'], expected=True)
                otp_code = self._get_tfa_info('OTP')
                otp_verify_json = self._download_json('https://b2bapi.zee5.com/device/verifyotp_v1.php?phoneno=91{}&otp={}&guest_token={}&platform=web'.format(username, otp_code, self._DEVICE_ID),
                                                      None, note="Verifying OTP", fatal=False)
                if not otp_verify_json:
                    raise ExtractorError('Unable to verify OTP.', expected=True)
                self._USER_TOKEN = otp_verify_json.get('token')
                if not self._USER_TOKEN:
                    raise ExtractorError(otp_request_json['message'], expected=True)
            elif username.lower() == 'token' and len(password) > 1198:
                self._USER_TOKEN = password

    def _real_initialize(self):
        self._login()

    def _real_extract(self, url):
        video_id, display_id = re.match(self._VALID_URL, url).group('id', 'display_id')
        access_token_request = self._download_json(
            'https://useraction.zee5.com/token/platform_tokens.php?platform_name=web_app',
            video_id, note='Downloading access token')
        data = {
            "x-access-token": access_token_request['token']
        }
        if self._USER_TOKEN:
            data['Authorization'] = 'bearer %s' % self._USER_TOKEN
        else:
            data['X-Z5-Guest-Token'] = self._DEVICE_ID

        json_data = self._download_json(

Review comment (suggestion):
```suggestion
                                                      None, note='Verifying OTP', fatal=False)
```

Code after:
        'url': 'https://www.zee5.com/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730?country=IN',
        'only_matching': True
    }, {
        'url': 'https://www.zee5.com/global/hi/tvshows/details/kundali-bhagya/0-6-366/kundali-bhagya-march-08-2021/0-1-manual_7g9jv1os7730',
        'only_matching': True
    }]
    _DETAIL_API_URL = 'https://spapi.zee5.com/singlePlayback/getDetails?content_id={}&device_id={}&platform_name=desktop_web&country=IN&check_parental_control=false'
    _DEVICE_ID = 'iIxsxYf40cqO3koIkwzKHZhnJzHN13zb'
    _USER_TOKEN = None
    _LOGIN_HINT = 'Use "--username <mobile_number>" to login using otp or "--username token" and "--password <user_token>" to login using user token.'
    _NETRC_MACHINE = 'zee5'

    def _login(self):
        username, password = self._get_login_info()
        if username:
            if len(username) == 10 and username.isdigit() and self._USER_TOKEN is None:
                self.report_login()
                otp_request_json = self._download_json('https://b2bapi.zee5.com/device/sendotp_v1.php?phoneno=91{}'.format(username),
                                                       None, note='Sending OTP')
                if otp_request_json['code'] == 0:
                    self.to_screen(otp_request_json['message'])
                else:
                    raise ExtractorError(otp_request_json['message'], expected=True)
                otp_code = self._get_tfa_info('OTP')
                otp_verify_json = self._download_json('https://b2bapi.zee5.com/device/verifyotp_v1.php?phoneno=91{}&otp={}&guest_token={}&platform=web'.format(username, otp_code, self._DEVICE_ID),
                                                      None, note='Verifying OTP', fatal=False)
                if not otp_verify_json:
                    raise ExtractorError('Unable to verify OTP.', expected=True)
                self._USER_TOKEN = otp_verify_json.get('token')
                if not self._USER_TOKEN:
                    raise ExtractorError(otp_request_json['message'], expected=True)
            elif username.lower() == 'token' and len(password) > 1198:
                self._USER_TOKEN = password

    def _real_initialize(self):
        self._login()

    def _real_extract(self, url):
        video_id, display_id = re.match(self._VALID_URL, url).group('id', 'display_id')
        access_token_request = self._download_json(
            'https://useraction.zee5.com/token/platform_tokens.php?platform_name=web_app',
            video_id, note='Downloading access token')
        data = {
            'x-access-token': access_token_request['token']
        }
        if self._USER_TOKEN:
            data['Authorization'] = 'bearer %s' % self._USER_TOKEN
        else:
            data['X-Z5-Guest-Token'] = self._DEVICE_ID

        json_data = self._download_json(