Skip to content

Commit

Permalink
don't check for chrome binary binary when impersonate is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyberes committed Jul 29, 2024
1 parent bffd709 commit 3f27cef
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ func SetConfig(configFile string) (*Config, error) {
return nil, proxyPoolThirdpartyErr
}

if _, err := os.Stat(config.ProxyCheckImpersonateChromeBinary); os.IsNotExist(err) {
return nil, errors.New(fmt.Sprintf(`curl-impersonate-chrome binary does not exist: "%s"`, config.ProxyCheckImpersonateChromeBinary))
}
cmd := exec.Command(config.ProxyCheckImpersonateChromeBinary, "--help")
err = cmd.Run()
if err != nil {
return nil, errors.New(fmt.Sprintf(`curl-impersonate-chrome binary failed to run: %s`, err))
if config.ProxyCheckImpersonateChrome {
if _, err := os.Stat(config.ProxyCheckImpersonateChromeBinary); os.IsNotExist(err) {
return nil, errors.New(fmt.Sprintf(`curl-impersonate-chrome binary does not exist: "%s"`, config.ProxyCheckImpersonateChromeBinary))
}
cmd := exec.Command(config.ProxyCheckImpersonateChromeBinary, "--help")
err = cmd.Run()
if err != nil {
return nil, errors.New(fmt.Sprintf(`curl-impersonate-chrome binary failed to run: %s`, err))
}
}

cfg = config
Expand Down

0 comments on commit 3f27cef

Please sign in to comment.