From e2f42493ac23e90334d5ce164f3bb2ddf6dfd020 Mon Sep 17 00:00:00 2001 From: bytedream Date: Fri, 15 Apr 2022 22:38:06 +0200 Subject: [PATCH] Fix credential file overwrite with session id --- cmd/crunchyroll-go/cmd/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/crunchyroll-go/cmd/utils.go b/cmd/crunchyroll-go/cmd/utils.go index f7a95ad..4d3faad 100644 --- a/cmd/crunchyroll-go/cmd/utils.go +++ b/cmd/crunchyroll-go/cmd/utils.go @@ -143,7 +143,7 @@ func loadCrunchy() { continue } out.Debug("Logged in with username '%s' and password '%s'. BLANK THIS LINE OUT IF YOU'RE ASKED TO POST THE DEBUG OUTPUT SOMEWHERE", split[0], split[1]) - if runtime.GOOS != "windows" { + if file != filepath.Join(os.TempDir(), ".crunchy") { // the session id is written to a temp file to reduce the amount of re-logging in. // it seems like that crunchyroll has also a little cooldown if a user logs in too often in a short time if err = os.WriteFile(filepath.Join(os.TempDir(), ".crunchy"), []byte(crunchy.SessionID), 0600); err != nil {