refactor: use flare client for sources with cloudflareClient in Kotlin
- Batch 5: mangawork, mangotheme, mccms, multichan → flare (Kotlin uses cloudflareClient) - Batch 6: natsuid → flare (Kotlin uses cloudflareClient) - Batch 7: gravureblogger → flare (Kotlin uses cloudflareClient) All verified against Kotlin multisrc reference.
This commit is contained in:
@@ -13,7 +13,7 @@ import (
|
|||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
|
|
||||||
"goyomi/internal/httpclient"
|
"goyomi/internal/httpclient/flare"
|
||||||
"goyomi/internal/source"
|
"goyomi/internal/source"
|
||||||
"goyomi/sources/base/util"
|
"goyomi/sources/base/util"
|
||||||
)
|
)
|
||||||
@@ -28,12 +28,12 @@ type Config struct {
|
|||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
cfg Config
|
cfg Config
|
||||||
client *httpclient.Client
|
client *flare.Client
|
||||||
id int64
|
id int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(cfg Config) *Source {
|
func New(cfg Config) *Source {
|
||||||
c := httpclient.NewClient(httpclient.WithRateLimit(1, 2))
|
c := flare.NewClient(flare.WithRateLimit(1, 2))
|
||||||
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
|
|
||||||
"goyomi/internal/httpclient"
|
"goyomi/internal/httpclient/flare"
|
||||||
"goyomi/internal/source"
|
"goyomi/internal/source"
|
||||||
"goyomi/sources/base/util"
|
"goyomi/sources/base/util"
|
||||||
)
|
)
|
||||||
@@ -35,7 +35,7 @@ type Config struct {
|
|||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
cfg Config
|
cfg Config
|
||||||
client *httpclient.Client
|
client *flare.Client
|
||||||
id int64
|
id int64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ func New(cfg Config) *Source {
|
|||||||
if cfg.LatestOrder == "" {
|
if cfg.LatestOrder == "" {
|
||||||
cfg.LatestOrder = "update"
|
cfg.LatestOrder = "update"
|
||||||
}
|
}
|
||||||
c := httpclient.NewClient(httpclient.WithRateLimit(2, 3))
|
c := flare.NewClient(flare.WithRateLimit(2, 3))
|
||||||
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"goyomi/internal/httpclient"
|
"goyomi/internal/httpclient/flare"
|
||||||
"goyomi/internal/source"
|
"goyomi/internal/source"
|
||||||
"goyomi/sources/base/util"
|
"goyomi/sources/base/util"
|
||||||
)
|
)
|
||||||
@@ -30,7 +30,7 @@ type Config struct {
|
|||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
cfg Config
|
cfg Config
|
||||||
client *httpclient.Client
|
client *flare.Client
|
||||||
id int64
|
id int64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ func New(cfg Config) *Source {
|
|||||||
if cfg.APIPath == "" {
|
if cfg.APIPath == "" {
|
||||||
cfg.APIPath = "/api"
|
cfg.APIPath = "/api"
|
||||||
}
|
}
|
||||||
c := httpclient.NewClient(httpclient.WithRateLimit(2, 1))
|
c := flare.NewClient(flare.WithRateLimit(2, 1))
|
||||||
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
|
|
||||||
"goyomi/internal/httpclient"
|
"goyomi/internal/httpclient/flare"
|
||||||
"goyomi/internal/source"
|
"goyomi/internal/source"
|
||||||
"goyomi/sources/base/util"
|
"goyomi/sources/base/util"
|
||||||
)
|
)
|
||||||
@@ -25,7 +25,7 @@ type Config struct {
|
|||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
cfg Config
|
cfg Config
|
||||||
client *httpclient.Client
|
client *flare.Client
|
||||||
id int64
|
id int64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ func New(cfg Config) *Source {
|
|||||||
if cfg.LazyLoadAttr == "" {
|
if cfg.LazyLoadAttr == "" {
|
||||||
cfg.LazyLoadAttr = "data-original"
|
cfg.LazyLoadAttr = "data-original"
|
||||||
}
|
}
|
||||||
c := httpclient.NewClient(httpclient.WithRateLimit(2, 3))
|
c := flare.NewClient(flare.WithRateLimit(2, 3))
|
||||||
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import (
|
|||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
|
|
||||||
"goyomi/internal/httpclient"
|
"goyomi/internal/httpclient/flare"
|
||||||
"goyomi/internal/source"
|
"goyomi/internal/source"
|
||||||
"goyomi/sources/base/util"
|
"goyomi/sources/base/util"
|
||||||
)
|
)
|
||||||
@@ -25,12 +25,12 @@ type Config struct {
|
|||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
cfg Config
|
cfg Config
|
||||||
client *httpclient.Client
|
client *flare.Client
|
||||||
id int64
|
id int64
|
||||||
}
|
}
|
||||||
|
|
||||||
func New(cfg Config) *Source {
|
func New(cfg Config) *Source {
|
||||||
c := httpclient.NewClient(httpclient.WithRateLimit(2, 3))
|
c := flare.NewClient(flare.WithRateLimit(2, 3))
|
||||||
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import (
|
|||||||
|
|
||||||
"github.com/PuerkitoBio/goquery"
|
"github.com/PuerkitoBio/goquery"
|
||||||
|
|
||||||
"goyomi/internal/httpclient"
|
"goyomi/internal/httpclient/flare"
|
||||||
"goyomi/internal/source"
|
"goyomi/internal/source"
|
||||||
"goyomi/sources/base/util"
|
"goyomi/sources/base/util"
|
||||||
)
|
)
|
||||||
@@ -29,7 +29,7 @@ type Config struct {
|
|||||||
|
|
||||||
type Source struct {
|
type Source struct {
|
||||||
cfg Config
|
cfg Config
|
||||||
client *httpclient.Client
|
client *flare.Client
|
||||||
id int64
|
id int64
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ func New(cfg Config) *Source {
|
|||||||
if cfg.PostType == "" {
|
if cfg.PostType == "" {
|
||||||
cfg.PostType = "manga"
|
cfg.PostType = "manga"
|
||||||
}
|
}
|
||||||
c := httpclient.NewClient(httpclient.WithRateLimit(1, 2))
|
c := flare.NewClient(flare.WithRateLimit(1, 2))
|
||||||
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
return &Source{cfg: cfg, client: c, id: source.GenerateSourceID(cfg.Name, cfg.Lang)}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user