From 9fd87c0d22d87f8cfb3e9d7e191fc9a5ca0057e1 Mon Sep 17 00:00:00 2001 From: Andreas Schulte Date: Fri, 27 Oct 2023 16:05:27 +0200 Subject: [PATCH] make use of git.0x0001f346.de/andreas/useragents --- imdb-scraper.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imdb-scraper.go b/imdb-scraper.go index edb71b1..59542a5 100644 --- a/imdb-scraper.go +++ b/imdb-scraper.go @@ -8,6 +8,7 @@ import ( "strings" "unicode" + "git.0x0001f346.de/andreas/useragents" "git.0x0001f346.de/andreas/utils" "github.com/gocolly/colly" ) @@ -68,7 +69,7 @@ func Scrap(id string) (IMDbEntry, error) { c := colly.NewCollector( colly.MaxDepth(1), colly.AllowedDomains("www.imdb.com"), - colly.UserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"), + colly.UserAgent(useragents.GetRandomUserAgent()), ) c.OnRequest(func(r *colly.Request) {