diff --git a/internal/provider/gemini-web/client.go b/internal/provider/gemini-web/client.go index 68a0d102..8dd28e3e 100644 --- a/internal/provider/gemini-web/client.go +++ b/internal/provider/gemini-web/client.go @@ -9,8 +9,6 @@ import ( "net/http" "net/http/cookiejar" "net/url" - "os" - "path/filepath" "regexp" "strings" "time" @@ -126,19 +124,6 @@ func getAccessToken(baseCookies map[string]string, proxy string, verbose bool, i } } - cacheDir := "temp" - _ = os.MkdirAll(cacheDir, 0o755) - if v1, ok1 := baseCookies["__Secure-1PSID"]; ok1 { - cacheFile := filepath.Join(cacheDir, ".cached_1psidts_"+v1+".txt") - if b, err := os.ReadFile(cacheFile); err == nil { - cv := strings.TrimSpace(string(b)) - if cv != "" { - merged := map[string]string{"__Secure-1PSID": v1, "__Secure-1PSIDTS": cv} - trySets = append(trySets, merged) - } - } - } - if len(extraCookies) > 0 { trySets = append(trySets, extraCookies) } diff --git a/internal/provider/gemini-web/state.go b/internal/provider/gemini-web/state.go index bb7cc58a..37828dcb 100644 --- a/internal/provider/gemini-web/state.go +++ b/internal/provider/gemini-web/state.go @@ -98,16 +98,16 @@ func (s *GeminiWebState) Label() string { } func (s *GeminiWebState) loadConversationCaches() { - if path := s.convPath(); path != "" { - if store, err := LoadConvStore(path); err == nil { - s.convStore = store - } + path := s.convPath() + if path == "" { + return } - if path := s.convPath(); path != "" { - if items, index, err := LoadConvData(path); err == nil { - s.convData = items - s.convIndex = index - } + if store, err := LoadConvStore(path); err == nil { + s.convStore = store + } + if items, index, err := LoadConvData(path); err == nil { + s.convData = items + s.convIndex = index } }