Skip to main content

Scrapy Wayback Middleware

Build status

Middleware for submitting all scraped response URLs to the Internet Archive Wayback Machine for archival.

Installation

pip install scrapy-wayback-middleware

Setup

Add scrapy_wayback_middleware.WaybackMiddleware to your project's SPIDER_MIDDLEWARES settings. By default, the middleware will make GET requests to web.archive.org/save/{URL}, but if the WAYBACK_MIDDLEWARE_POST setting is True then it will make POST requests to pragma.archivelab.org instead.

Configuration

To configure custom behavior for certain methods, subclass WaybackMiddleware and override the get_item_urls method to pull additional links to archive from individual items or handle_wayback to change how responses from the Wayback Machine are handled. The WAYBACK_MIDDLEWARE_POST can be set to True to adjust request behavior.

Duplicate Filtering

In order to avoid sending duplicate requests with WAYBACK_MIDDLEWARE_POST set to False, you'll need to either include web.archive.org in your spider's allowed_domains property (if specified) or disable scrapy.spidermiddlewares.offsite.OffsiteMiddleware in your settings.

Rate Limits

While neither endpoint returns headers indicating specific rate limits, the GET endpoint at web.archive.org/save has a rate limit of 25 requests/minute, resetting each minute. The middleware is configured to wait for 60 seconds whenever it sees a 429 error code to handle this.

Metadata

Release files for scrapy-wayback-middleware 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapy-wayback-middleware 0.3.3
File Size Uploaded
scrapy-wayback-middleware-0.3.3.tar.gz 4.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scrapy-wayback-middleware 0.3.3
File Interpreter ABI Platform
scrapy_wayback_middleware-0.3.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.9 kB

Release files / scrapy-wayback-middleware-0.3.3.tar.gz

Download URL scrapy-wayback-middleware-0.3.3.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fd2b8500d64b909289e3541c201b4d672c0e7b458fc20e77bb37f0d71d93a75a
BLAKE2b-256 checksum
How to use checksums
dcef271a189bb78e7a7bddb406ae2ca394fc280992b7987cd6cbd4c0653ae60a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.9 Linux/5.11.0-1025-azure

Release files / scrapy_wayback_middleware-0.3.3-py3-none-any.whl

Download URL scrapy_wayback_middleware-0.3.3-py3-none-any.whl
Size 4.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d48079310958cc9583f2e2ffcdbfd583ee2ec2226c5c3ff9a7a72b0bf3d95784
BLAKE2b-256 checksum
How to use checksums
f89e5e5ffcd6d3b79d809df2d8ebae803c06febb5d44e3b1489f4d13b70f3d91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.9.9 Linux/5.11.0-1025-azure

Release history Release notifications | RSS feed

This release

0.3.3 This release

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page