src/streamlink/plugins/abweb.py
def _login(self, username, password):
        '''login and update cached cookies'''
        self.logger.debug('login ...')

        res = self.session.http.get(self.login_url)
        input_list = self._input_re.findall(res.text)
        if not input_list:
            raise PluginError('Missing input data on login website.')

        data = {}
        for _input_data in input_list:
            try:
                _input_name = self._name_re.search(_input_data).group(1)
            except AttributeError:
                continue

            try:
                _input_value = self._value_re.search(_input_data).group(1)
            except AttributeError:
                _input_value = ''

            data[_input_name] = _input_value

        login_data = {
            'ctl00$Login1$UserName': username,
            'ctl00$Login1$Password': password,
            'ctl00$Login1$LoginButton.x': '0',
            'ctl00$Login1$LoginButton.y': '0'
        }
        data.update(login_data)

        res = self.session.http.post(self.login_url, data=data)

        for cookie in self.session.http.cookies:
            self._session_attributes.set(cookie.name, cookie.value, expires=3600 * 24)

        if self._session_attributes.get('ASP.NET_SessionId') and self._session_attributes.get('.abportail1'):
            self.logger.debug('New session data')
            self.set_expires_time_cache()
            return True
        else:
            self.logger.error('Failed to login, check your username/password')
            return False
def _login(self, username, password):
        '''login and update cached cookies'''
        self.logger.debug('login ...')

        res = self.session.http.get(self.login_url)
        input_list = self._input_re.findall(res.text)
        if not input_list:
            raise PluginError('Missing input data on login website.')

        data = {}
        for _input_data in input_list:
            try:
                _input_name = self._name_re.search(_input_data).group(1)
            except AttributeError:
                continue

            try:
                _input_value = self._value_re.search(_input_data).group(1)
            except AttributeError:
                _input_value = ''

            data[_input_name] = _input_value

        login_data = {
            'ctl00$Login1$UserName': username,
            'ctl00$Login1$Password': password,
            'ctl00$Login1$LoginButton.x': '0',
            'ctl00$Login1$LoginButton.y': '0'
        }
        data.update(login_data)

        res = self.session.http.post(self.login_url, data=data)

        for cookie in self.session.http.cookies:
            self._session_attributes.set(cookie.name, cookie.value, expires=3600 * 24)

        if self._session_attributes.get('ASP.NET_SessionId') and self._session_attributes.get('.abportail1'):
            self.logger.debug('New session data')
            self.set_expires_time_cache()
            return True
        else:
            self.logger.error('Failed to login, check your username/password')
            return False
def _login ( self , username , password ) : self . logger . debug ( 'login ...' ) res = self . session . http . get ( self . login_url ) input_list = self . _input_re . findall ( res . text ) if not input_list : raise PluginError ( 'Missing input data on login website.' ) data = { } for _input_data in input_list : try : _input_name = self . _name_re . search ( _input_data ) . group ( 1 ) except AttributeError : continue try : _input_value = self . _value_re . search ( _input_data ) . group ( 1 ) except AttributeError : _input_value = '' data [ _input_name ] = _input_value login_data = { 'ctl00$Login1$UserName' : username , 'ctl00$Login1$Password' : password , 'ctl00$Login1$LoginButton.x' : '0' , 'ctl00$Login1$LoginButton.y' : '0' } data . update ( login_data ) res = self . session . http . post ( self . login_url , data = data ) for cookie in self . session . http . cookies : self . _session_attributes . set ( cookie . name , cookie . value , expires = 3600 * 24 ) if self . _session_attributes . get ( 'ASP.NET_SessionId' ) and self . _session_attributes . get ( '.abportail1' ) : self . logger . debug ( 'New session data' ) self . set_expires_time_cache ( ) return True else : self . logger . error ( 'Failed to login, check your username/password' ) return False
login and update cached cookies
login and update cached cookies