(self, *, account: AccountRecord, user_agent: str)
| 176 | tdc_path.write_text(tdc_code, encoding="utf-8") |
| 177 | ft_path.write_text(ft_code, encoding="utf-8") |
| 178 | input_path.write_text( |
| 179 | json.dumps( |
| 180 | { |
| 181 | "tdcCodePath": str(tdc_path), |
| 182 | "ftCodePath": str(ft_path), |
| 183 | "entryUrl": self.settings.tencent_captcha_entry_url, |
| 184 | "userAgent": user_agent, |
| 185 | "cookieHeader": account.cookie_header, |
| 186 | "setData": {"refreshcnt": 0}, |
| 187 | }, |
| 188 | ensure_ascii=False, |
| 189 | ), |
| 190 | encoding="utf-8", |
| 191 | ) |
| 192 | completed = subprocess.run( |
| 193 | [self.settings.tencent_captcha_node, str(self.runner_path), str(input_path)], |
| 194 | capture_output=True, |
| 195 | text=True, |
| 196 | encoding="utf-8", |
| 197 | timeout=max(self.settings.request_timeout_seconds, 5), |
| 198 | check=False, |
| 199 | ) |
| 200 | finally: |
no test coverage detected