async def Submit(self):#提交投票
     postdata=selector(self.html,self.voting_token,self.captcha)
     sleepTime=120-(time.time()-self.startTime)#消耗的时间减去90秒
     if(sleepTime>0):#还没到90秒
         print(self.id,self.proxy,'开始等待%d秒'%(sleepTime))
         await asyncio.sleep(sleepTime)#坐等到90秒
     print(self.id,self.proxy,'开始Submit')
     result=await self._post("https://www.internationalsaimoe.com/voting/submit",data=postdata)
     return result
 async def submit(self) -> str:
     needed_sleep_time = int(re.search(waiting_time_pattern, self.html).group(1))
     sleep_time = needed_sleep_time - time.time() + self.start_time
     if sleep_time > 0:
         logging.info(f'{self.proxy} wait for {int(sleep_time)} seconds')
         await asyncio.sleep(sleep_time)
     post_data = selector(self.html, self.voting_token, self.captcha)
     result = await self._post("https://www.internationalsaimoe.com/voting/submit", data=post_data)
     logging.info(f'{self.proxy} {result}')
     return result
 def Submit(self):  #提交投票
     postdata = selector(self.html, self.voting_token, self.captcha)
     sleepTime = 190 - (time.time() - self.startTime)  #消耗的时间减去90秒
     if (sleepTime > 0):  #还没到90秒
         print(self.id, self.proxy, "开始等待%d秒" % (sleepTime))
         gevent.sleep(sleepTime)  #坐等到90秒
     #try:
     result = self._post(
         "https://www.internationalsaimoe.com/voting/submit",
         data=postdata)
     #except Exception:
     #    result=self._localpost("https://www.internationalsaimoe.com/voting/submit",data=postdata)
     return result
Exemple #4
0
 async def Submit(self):#提交投票
     postdata=selector(self.html,self.voting_token,self.captcha)
     sleepTime=90-(time.time()-self.startTime)#消耗的时间减去90秒
     if(sleepTime>0):#还没到90秒
         await asyncio.sleep(sleepTime)#坐等到90秒
     result=await self._post("https://2019.internationalsaimoe.com/voting/submit",data=postdata)