make screenshot update cookies

This commit is contained in:
Steve Dudenhoeffer 2024-12-14 00:50:25 -05:00
parent a51f8200ea
commit 23334991b1
2 changed files with 9 additions and 2 deletions

6
go.mod
View File

@ -2,7 +2,10 @@ module gitea.stevedudenhoeffer.com/steve/go-extractor
go 1.23.2
require github.com/playwright-community/playwright-go v0.4802.0
require (
github.com/go-shiori/go-readability v0.0.0-20241012063810-92284fa8a71f
github.com/playwright-community/playwright-go v0.4802.0
)
require (
github.com/andybalholm/cascadia v1.3.2 // indirect
@ -10,7 +13,6 @@ require (
github.com/deckarep/golang-set/v2 v2.6.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
github.com/go-shiori/dom v0.0.0-20230515143342-73569d674e1c // indirect
github.com/go-shiori/go-readability v0.0.0-20241012063810-92284fa8a71f // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f // indirect
golang.org/x/net v0.32.0 // indirect

View File

@ -256,6 +256,11 @@ func (b playWrightBrowser) Screenshot(ctx context.Context, url string, opts Scre
}
defer page.Close()
err = b.updateCookies(ctx, page)
if err != nil {
return nil, err
}
return b.getScreenshot(ctx, page, opts)
}