def login(username: str, password: str) -> req_Session: headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" } login_url = "https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1" login_data = { "fastloginfield": "username", "username": username, "password": password, } s = req_Session() s.post(url=login_url, data=login_data, headers=headers) return s
def login(username, password): headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36" } login_url = "https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1" login_data = { "fastloginfield": "username", "username": username, "password": password, "quickforward": "yes", "handlekey": "ls" } s = req_Session() s.cookies.set("L7DFW", hashlib.md5((username+str(time.time())).encode(encoding='UTF-8')).hexdigest()) s.post(url=login_url, data=login_data, headers=headers) return s
def login(username, password): headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36", "origin": "https://www.hostloc.com", "referer": "https://www.hostloc.com/home.php?mod=space&do=notice&view=mypost", "content-type": "application/x-www-form-urlencoded" } login_url = "https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1" login_data = { "fastloginfield": "username", "username": username, "password": password, "quickforward": "yes", "handlekey": "ls" } s = req_Session() s.post(url=login_url, data=login_data, headers=headers) return s
def login(username: str, password: str) -> req_Session: headers = { "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36", "origin": "https://www.hostloc.com", "referer": "https://www.hostloc.com/forum.php", } login_url = "https://www.hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1" login_data = { "fastloginfield": "username", "username": username, "password": password, "quickforward": "yes", "handlekey": "ls", } s = req_Session() res = s.post(url=login_url, data=login_data, headers=headers) res.raise_for_status() return s
def login(self, username: str, password: str) -> req_Session: headers = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36', 'origin': 'https://hostloc.com', 'referer': 'https://hostloc.com/forum.php', } login_url = 'https://hostloc.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1' login_data = { 'fastloginfield': 'username', 'username': username, 'password': password, 'quickforward': 'yes', 'handlekey': 'ls', } s = req_Session() s.headers.update(headers) s.cookies.update(self.gen_anti_cc_cookies()) res = s.post(url=login_url, data=login_data) res.raise_for_status() return s
def login(username: str, password: str) -> req_Session: headers = { # "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", "user-agent": "Mozilla/5.0 (Linux; Android 9; MI 9 SE Build/PKQ1.181121.001; wv) AppleWebKit/537.36 " "(KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.126 MQQBrowser/6.2 TBS/045111 Mobile Safari/537.36 " "MMWEBID/1500 MicroMessenger/7.0.11.1600(0x27000B33) Process/tools NetType/WIFI Language/zh_CN ABI/arm64", "origin": "https://www.91wii.com/", "referer": "https://www.91wii.com/forum.php", } # login_url = "https://www.91wii.com/forum.php/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&lssubmit=yes&inajax=1&mobile=2" login_url = "https://www.91wii.com/member.php?mod=logging&action=login&loginsubmit=yes&infloat=yes&" \ "lssubmit=yes&fastloginfield=username&username={}&password={}&quickforward=yes&handlekey=ls&mobile=2".format(username,password) # login_data = { # "fastloginfield": "username", # "username": username, # "password": password, # "quickforward": "yes", # "handlekey": "ls", # } s = req_Session() s.headers.update(headers) s.cookies.update(gen_anti_cc_cookies()) # res = s.post(url=login_url, data=login_data)\ res = s.post(url=login_url) res.raise_for_status() print(s.headers) headers1 = { 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36' } s.headers.update(headers1) print(s.headers) return s