def login(self):
email = self.get_option("<STR_LIT:email>")<EOL>password = self.get_option("<STR_LIT:password>")<EOL>if email and password:<EOL><INDENT>res = self.session.http.get(self.login_url)<EOL>csrf_match = self.csrf_re.search(res.text)<EOL>token = csrf_match and csrf_match.group(<NUM_LIT:1>)<EOL>self.logger.debug("<STR_LIT>", email, token)<EOL>res = self.session.http.post(self.login_url,<EOL>data=dict(login=email, password=password, csrfmiddlewaretoken=token),<EOL>allow_redirects=False,<EOL>raise_for_status=False,<EOL>headers={"<STR_LIT>": self.login_url})<EOL>if res.status_code != <NUM_LIT>:<EOL><INDENT>self.logger.error("<STR_LIT>", email)<EOL><DEDENT><DEDENT>
Attempt a login to LiveEdu.tv