Update v8go
parent
e852c2ed83
commit
7cb34b7a45
2
go.mod
2
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 (
|
||||
|
|
2
go.sum
2
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=
|
||||
|
|
10
mangasee.go
10
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{}
|
||||
|
|
Loading…
Reference in New Issue