chromeauth

package
v0.2.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 34 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCredentialsRejected = errors.New("Chrome OAuth 续签材料失效")

ErrCredentialsRejected 表示上游已拒绝保存的 Chrome 续签材料

View Source
var ErrSignedOut = errors.New("Cookie 未登录 AI Studio 或已失效")

ErrSignedOut 表示 Cookie 打开 AI Studio 时被转到登录页

Functions

func DebugAddresses added in v0.2.14

func DebugAddresses(ctx context.Context) ([]string, error)

DebugAddresses 从本机进程命令行找出开启远程调试端口的 Chromium 浏览器,返回去重排序后的 127.0.0.1:端口

func DebugBrowserName added in v0.2.14

func DebugBrowserName(ctx context.Context, address string) (string, error)

DebugBrowserName 返回远程调试地址对应浏览器的产品名与版本

func DefaultChromeRoot

func DefaultChromeRoot() (string, error)

DefaultChromeRoot 返回稳定版 Chrome User Data 目录

func Refresh

func Refresh(ctx context.Context, material aistudio.ChromeOAuthMaterial, proxy string) ([]aistudio.StateCookie, error)

Refresh 使用保存的 OAuth 续签材料重新签发 Google Cookie

Types

type Account

type Account struct {
	ID          string `json:"id"`
	GaiaID      string `json:"-"`
	Profile     string `json:"profile"`
	DisplayName string `json:"display_name"`
	Email       string `json:"email"`
	Locale      string `json:"locale"`
	Importable  bool   `json:"importable"`
}

Account 描述本机 Chrome 中可发现的 Google 账号

func Discover

func Discover(chromeRoot string) ([]Account, error)

Discover 只读列出本机 Chrome Google 账号

type CDPBrowser added in v0.2.14

type CDPBrowser struct {
	Cookies  string
	Locale   string
	Timezone string
}

CDPBrowser 是经远程调试地址读取的浏览器 Cookie 与页面语言、时区

func ReadCDPBrowser added in v0.2.14

func ReadCDPBrowser(ctx context.Context, address string) (CDPBrowser, error)

ReadCDPBrowser 经 Chromium 远程调试地址读取浏览器全部未分区 Cookie,并在第一个页面中读取 navigator.language 与 Intl 时区,没有页面时语言与时区为空

type ImportOptions

type ImportOptions struct {
	AccountIDs []string
	ChromeRoot string
	Proxy      string
	Profiles   []string
	Emails     []string
}

ImportOptions 保存 Chrome 批量导入参数

type ImportResult

type ImportResult struct {
	Profile     string
	DisplayName string
	Email       string
	Locale      string
	CookieCount int
	State       aistudio.StorageState
}

ImportResult 返回一个已验证前的账号状态

func Import

func Import(ctx context.Context, options ImportOptions) ([]ImportResult, error)

Import 用本机 Chrome 的 OAuth 续签材料生成 Playwright storage state

type Verification

type Verification struct {
	Email      string
	ModelCount int
}

Verification 保存 AI Studio 登录页与模型目录验收结果

func Verify

func Verify(ctx context.Context, state *aistudio.StorageState, proxy string) (Verification, error)

Verify 验证账号可访问 WAA 页面并读取实时模型目录

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL