From 7cb34b7a45a7a576d95334ec250425cdd49da3e0 Mon Sep 17 00:00:00 2001 From: Stein Ivar Berghei Date: Thu, 9 May 2024 00:19:15 +0200 Subject: [PATCH] Update v8go --- go.mod | 2 +- go.sum | 2 ++ mangasee.go | 10 ++-------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index dead4a5..f50ae61 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/PuerkitoBio/goquery v1.6.1 github.com/headzoo/surf v1.0.0 github.com/mmcdole/gofeed v1.1.0 - rogchap.com/v8go v0.5.1 + rogchap.com/v8go v0.9.0 ) require ( diff --git a/go.sum b/go.sum index 10470f2..c604163 100644 --- a/go.sum +++ b/go.sum @@ -45,3 +45,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= rogchap.com/v8go v0.5.1 h1:yx7uQC2ezAHthCHLHl4NuH3eprVLBtNl6Utm/ELjZ+w= rogchap.com/v8go v0.5.1/go.mod h1:IitZnaOtWSJadY/7qinKHIEHpxsilMWyLQ+Efdo4n4I= +rogchap.com/v8go v0.9.0 h1:wYbUCO4h6fjTamziHrzyrPnpFNuzPpjZY+nfmZjNaew= +rogchap.com/v8go v0.9.0/go.mod h1:MxgP3pL2MW4dpme/72QRs8sgNMmM0pRc8DPhcuLWPAs= diff --git a/mangasee.go b/mangasee.go index ce807ed..b5995a2 100644 --- a/mangasee.go +++ b/mangasee.go @@ -61,10 +61,7 @@ func (app *App) GetFeed(uri string) (feed *rss.Feed, err error) { } func (app *App) GetChapterImages(uri string) (pages []string, err error) { - vm, err := v8go.NewContext(app.vm) - if err != nil { - return - } + vm := v8go.NewContext(app.vm) defer vm.Close() err = app.browser.Open(uri) @@ -140,10 +137,7 @@ func New() (app *App, err error) { app.js = append(app.js, fq) app.http = &http.Client{} - app.vm, err = v8go.NewIsolate() - if err != nil { - panic(err) - } + app.vm = v8go.NewIsolate() app.browser = surf.NewBrowser() app.fp = rss.Parser{}