MCPcopy Create free account
hub / github.com/VitoHowe/glm-coding / _fetch_ft_script

Method _fetch_ft_script

app/services/tdc_service.py:178–197  ·  view source on GitHub ↗
(self, *, account: AccountRecord, user_agent: str)

Source from the content-addressed store, hash-verified

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:

Callers 1

collect_for_challengeMethod · 0.95

Calls 2

_cache_pathMethod · 0.95
request_textMethod · 0.80

Tested by

no test coverage detected