XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/gpt4free

fix: update reCAPTCHA tokens in LMArena class and change debug mode to dev in CLI

fdf5e584
hlohaus <983577+hlohaus@users.noreply.github.com>
提交于

代码差异

2 个文件 +4 -4
Modified g4f/Provider/needs_auth/LMArena.py +2 -2
@@ -246,7 +246,7 @@ class LMArena(AsyncGeneratorProvider, ProviderModelMixin, AuthFileMixin):
246 246 while not await page.evaluate('window.grecaptcha && window.grecaptcha.enterprise'):
247 247 await asyncio.sleep(1)
248 248 captcha = await page.evaluate(
249 """window.grecaptcha.enterprise.execute('6Led_uYrAAAAAKjxDIF58fgFtX3t8loNAK85bW9I', { action: 'chat_submit' } );""",
249 """window.grecaptcha.enterprise.execute('6LeTGMcsAAAAALuIlkVwIxaAuZA8VledA6d3Nnb0', { action: 'chat_submit' } );""",
250 250 await_promise=True)
251 251 grecaptcha.append(captcha)
252 252 debug.log("Obtained grecaptcha token.")
@@ -274,7 +274,7 @@ class LMArena(AsyncGeneratorProvider, ProviderModelMixin, AuthFileMixin):
274 274 window.grecaptcha.enterprise.ready(async () => {
275 275 try {
276 276 const token = await window.grecaptcha.enterprise.execute(
277 '6Led_uYrAAAAAKjxDIF58fgFtX3t8loNAK85bW9I',
277 '6LeTGMcsAAAAALuIlkVwIxaAuZA8VledA6d3Nnb0',
278 278 { action: 'chat_submit' }
279 279 );
280 280 resolve(token);
Modified g4f/cli/__init__.py +2 -2
@@ -300,7 +300,7 @@ def main():
300 300
301 301
302 302 mode_parser = ArgumentParser(description="Select mode to run g4f in.", exit_on_error=False)
303 mode_parser.add_argument("mode", nargs="?", choices=["api", "gui", "client", "mcp", "auth", "debug"], default="api", help="Mode to run g4f in (default: api).")
303 mode_parser.add_argument("mode", nargs="?", choices=["api", "gui", "client", "mcp", "auth", "dev"], default="api", help="Mode to run g4f in (default: api).")
304 304
305 305 # Preserve original remaining so the API parser gets all args if mode
306 306 # detection fails (e.g. `python -m g4f --port 8080` without a mode prefix).
@@ -319,7 +319,7 @@ def main():
319 319 print(f"Handling auth for provider: {args.provider}, action: {args.action}")
320 320 handle_auth(args.provider, args.action, remaining)
321 321 return
322 elif args.mode == "debug":
322 elif args.mode == "dev":
323 323 parser = get_api_parser()
324 324 args = parser.parse_args(remaining)
325 325 args.debug = True