Compare commits
2 Commits
27ce4d3c78
...
7d3c083cea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d3c083cea | ||
|
|
dbfbd6865a |
@@ -24,7 +24,7 @@ func APIClient() (string, error) {
|
|||||||
|
|
||||||
// Формальная попытка притвориться браузером.
|
// Формальная попытка притвориться браузером.
|
||||||
_, _, day := time.Now().Date()
|
_, _, day := time.Now().Date()
|
||||||
userAgent := Config.UserAgents[day]
|
userAgent := Config.UserAgents[day-1]
|
||||||
|
|
||||||
if err := requests.URL(url).UserAgent(userAgent).
|
if err := requests.URL(url).UserAgent(userAgent).
|
||||||
Header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8").
|
Header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8").
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ func CronTask() {
|
|||||||
log.Errorf("Unable to get holidays (try %d/15): %s", errcnt, err)
|
log.Errorf("Unable to get holidays (try %d/15): %s", errcnt, err)
|
||||||
|
|
||||||
switch errcnt {
|
switch errcnt {
|
||||||
case 0, 1, 2:
|
case 1, 2:
|
||||||
timeout = 1 * time.Second
|
timeout = 1 * time.Second
|
||||||
|
|
||||||
case 3, 4, 5:
|
case 3, 4, 5:
|
||||||
|
|||||||
Reference in New Issue
Block a user