1.0.3 • Published 2 months ago

spn2 v1.0.3

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 months ago

Save Page Now 2 for Wayback Machine

The SPN2 JS Library provides an easy-to-use interface to interact with the Save Page Now 2 (SPN2) API, which is part of the Internet Archive's Wayback Machine service.

API Docs Source: Google Docs

Installation

npm install -g spn2

OR

pnpm install -g spn2

OR

yarn global add spn2

Usage

See test.ts for usage examples.

Error Codes

status_extDescription
error:bad-gatewayBad Gateway for URL (HTTP status=502).
error:bad-requestThe server could not understand the request due to invalid syntax. (HTTP status=401)
error:bandwidth-limit-exceededThe target server has exceeded the bandwidth specified by the server administrator. (HTTP status=509).
error:blockedThe target site is blocking us (HTTP status=999).
error:blocked-client-ipAnonymous clients which are listed in https://www.spamhaus.org/xbl/ or https://www.spamhaus.org/sbl/ lists (spams & exploits) are blocked. Tor exit nodes are excluded from this filter.
error:blocked-urlWe use a URL block list based on Mozilla web tracker lists to avoid unwanted captures.
error:browsing-timeoutSPN2 back-end headless browser timeout.
error:capture-location-errorSPN2 back-end cannot find the created capture location. (system error).
error:cannot-fetchCannot fetch the target URL due to system overload.
error:celeryCannot start capture task.
error:filesize-limitCannot capture web resources over 2GB.
error:ftp-access-deniedTried to capture an FTP resource but access was denied.
error:gateway-timeoutThe target server didn't respond in time. (HTTP status=504).
error:http-version-not-supportedThe target server does not support the HTTP protocol version used in the request for URL (HTTP status=505).
error:internal-server-errorSPN internal server error.
error:invalid-url-syntaxTarget URL syntax is not valid.
error:invalid-server-responseThe target server response was invalid. (e.g. invalid headers, invalid content encoding, etc).
error:invalid-host-resolutionCouldn’t resolve the target host.
error:job-failedCapture failed due to system error.
error:method-not-allowedThe request method is known by the server but has been disabled and cannot be used (HTTP status=405).
error:not-implementedThe request method is not supported by the server and cannot be handled (HTTP status=501).
error:no-browsers-availableSPN2 back-end headless browser cannot run.
error:network-authentication-requiredThe client needs to authenticate to gain network access to the URL (HTTP status=511).
error:no-accessTarget URL could not be accessed (status=403).
error:not-foundTarget URL not found (status=404).
error:not-implementedThe request method is not supported by the server and cannot be handled for URL (HTTP status=501).
error:proxy-errorSPN2 back-end proxy error.
error:protocol-errorHTTP connection broken. (A possible cause of this error is “IncompleteRead”).
error:read-timeoutHTTP connection read timeout.
error:soft-time-limit-exceededCapture duration exceeded 45s time limit and was terminated.
error:service-unavailableService unavailable for URL (HTTP status=503).
error:too-many-daily-capturesThis URL has been captured 10 times today. We cannot make any more captures.
error:too-many-redirectsToo many redirects. SPN2 tries to follow 3 redirects automatically.
error:too-many-requestsThe target host has received too many requests from SPN and it is blocking it. (HTTP status=429). Note that captures to the same host will be delayed for 10-20s after receiving this response to remedy the situation.
error:user-session-limitUser has reached the limit of concurrent active capture sessions.
error:unauthorizedThe server requires authentication (HTTP status=401).

License

GPL-3.0

Author: Ramazan Sancar