Skip to content

Commit

Permalink
fix: capture_outlinks option
Browse files Browse the repository at this point in the history
  • Loading branch information
CorentinB committed Nov 18, 2024
1 parent 1471386 commit d8a315d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion options.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type CaptureOptions struct {
// Capture a web page with errors (HTTP status=4xx or 5xx). By default SPN2 captures only status=200 URLs.
CaptureAll bool `spn:"capture_all"`
// Capture web page outlinks automatically. This also applies to PDF, JSON, RSS and MRSS feeds.
CaptureOutlinks bool `spn:"capture_outlinks"`
CaptureOutlinks int `spn:"capture_outlinks"`
// Capture full page screenshot in PNG format. This is also stored in the Wayback Machine as a different capture.
CaptureScreenshot bool `spn:"capture_screenshot"`
// The capture becomes available in the Wayback Machine after ~12 hours instead of immediately. This option helps reduce the load on our systems. All API responses remain exactly the same when using this option.
Expand Down Expand Up @@ -72,6 +72,8 @@ func (opts CaptureOptions) Encode() url.Values {
if value.String() != "" {
urlValues.Add(field.Tag.Get("spn"), value.String())
}
} else if value.Kind() == reflect.Int {
urlValues.Add(field.Tag.Get("spn"), string(value.Int()))
} else {
panic("Unknown field type")
}
Expand Down

0 comments on commit d8a315d

Please sign in to comment.