✨ Scraper custom user agent
This commit is contained in:
parent
8bea691f2e
commit
93171bf48c
@ -8,6 +8,7 @@ import (
|
|||||||
"github.com/gocolly/colly"
|
"github.com/gocolly/colly"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/samber/lo"
|
"github.com/samber/lo"
|
||||||
|
"github.com/spf13/viper"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@ -37,7 +38,7 @@ func LinkExpand(target string) (*models.LinkMeta, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
c := colly.NewCollector(
|
c := colly.NewCollector(
|
||||||
colly.UserAgent("SolarBot/1.0"),
|
colly.UserAgent(viper.GetString("scraper.user-agent")),
|
||||||
colly.MaxDepth(3),
|
colly.MaxDepth(3),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -44,4 +44,4 @@ prefix = "dealer_"
|
|||||||
aliases = { id = "auth", uc = "files", co = "interactive", im = "messaging" }
|
aliases = { id = "auth", uc = "files", co = "interactive", im = "messaging" }
|
||||||
|
|
||||||
[scraper]
|
[scraper]
|
||||||
cache = "uploads/cache.db"
|
user-agent = "SolarBot/1.0"
|
Loading…
Reference in New Issue
Block a user