From f8019cdaefd49d0931b4b51e2de74284921f8747 Mon Sep 17 00:00:00 2001 From: Wayback Archiver <66856220+waybackarchiver@users.noreply.github.com> Date: Wed, 26 Jun 2024 04:00:10 +0000 Subject: [PATCH] Allow perform wayback no browser detection --- reduxer/reduxer.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/reduxer/reduxer.go b/reduxer/reduxer.go index d0802308..7e4caefe 100644 --- a/reduxer/reduxer.go +++ b/reduxer/reduxer.go @@ -11,6 +11,7 @@ import ( "io" "net/url" "os" + "os/exec" "path/filepath" "strings" "sync" @@ -148,6 +149,12 @@ func Do(ctx context.Context, opts *config.Options, urls ...*url.URL) (Reduxer, e return bs, errors.New("Specify directory to environment `WAYBACK_STORAGE_DIR` to enable reduxer") } + // No supported browser found, returns empty results to ensure archives are normal. + if _, err := exec.LookPath(helper.FindChromeExecPath()); err != nil { + logger.Debug("No browser detected, no artifacts scraped.") + return bs, nil + } + dir, err := createDir(opts.StorageDir()) if err != nil { return bs, errors.Wrap(err, "create storage directory failed")