diff options
author | Evgeny Kuznetsov <evgeny@kuznetsov.md> | 2022-03-21 18:51:12 +0300 |
---|---|---|
committer | Evgeny Kuznetsov <evgeny@kuznetsov.md> | 2022-03-21 18:51:12 +0300 |
commit | 400094b2d321e22a261e64246ec1134f961cc0e8 (patch) | |
tree | 115e8a92c11a2896ec50df3acf08cfa8e3dfda46 | |
parent | 51cf63a33f23ab9e4507ed440c57c44f9714ede3 (diff) | |
download | radiorus-rss-400094b2d321e22a261e64246ec1134f961cc0e8.tar.gz radiorus-rss-400094b2d321e22a261e64246ec1134f961cc0e8.zip |
spoof user-agent
-rw-r--r-- | main.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -287,7 +287,10 @@ func addText(arr []string, str string) []string { } func getPage(pageUrl string) []byte { - res, err := http.Get(pageUrl) + client := &http.Client{} + req, err := http.NewRequest("GET", pageUrl, nil) + req.Header.Add("User-Agent", `Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.27 Safari/537.36`) + res, err := client.Do(req) if err != nil { log.Fatal(err) } |