推荐学习书目
› Python Cookbook如果在使用 Antigravity 时点击 "Sign in with Google" 没有反应或无法跳转,请按照以下步骤手动完成授权。
<username> 替换为您的实际 Windows 用户名):cd "C:\Users\<username>\AppData\Local\Programs\Antigravity"
.\Antigravity.exe --inspect=9229
11819):
[Auth] Localhost server listening on port 11819
# 1. 输入端口号
$port = Read-Host "Enter the port from the log"
# 2. 设置回调地址
$redirect = [uri]::EscapeDataString("http://localhost:$port/oauth-callback")
# 3. 设置 Scope
$scope = [uri]::EscapeDataString(
"https://www.googleapis.com/auth/cloud-platform " +
"https://www.googleapis.com/auth/userinfo.email " +
"https://www.googleapis.com/auth/userinfo.profile " +
"https://www.googleapis.com/auth/cclog " +
"https://www.googleapis.com/auth/experimentsandconfigs"
)
# 4. 设置 Client ID
$clientId = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com"
# 5. 生成随机 State
$state = [uri]::EscapeDataString([guid]::NewGuid().ToString())
# 6. 拼接最终 URL
$url = "https://accounts.google.com/o/oauth2/v2/auth" +
"?client_id=$clientId" +
"&redirect_uri=$redirect" +
"&response_type=code" +
"&scope=$scope" +
"&access_type=offline" +
"&prompt=consent" +
"&state=$state"
# 7. 尝试打开浏览器
Write-Host "Opening browser..." -ForegroundColor Green
Start-Process $url
Enter the port from the log:。11819)并回车。如果运行脚本后没有自动弹出浏览器,请在第二个 PowerShell 窗口中继续输入以下命令:
Write-Host $url
PowerShell 会打印出完整的长链接。请复制该链接手动粘贴到浏览器地址栏访问即可。
提示:此方法因使用系统默认浏览器进行验证,经测试在部分网络受限环境(如大陆白名单模式)下也能顺利通过,无需额外配置代理。
1
111111111111 3 小时 7 分钟前
起始就只要做两件事:
1. 一个可以访问 google 的浏览器(通过插件实现浏览器全局代理) 2. 点击 Sign in with Google 之前 [断网] ,得到 URL 后然后用第一步的浏览器访问 |
2
blufaux 3 小时 5 分钟前
楼上的有点 6
|