os-scrapy-ipfilter-resolver
This project provide a DNS Resolver for ip blacklist/whitelist and config DNS expire time.
Install
pip install os-scrapy-ipfilter-resolver
You can run example spider directly in the project root path.
scrapy crawl example
Usage
Settings
-
enable DNS Resolver, in the project settings.py file:
DNS_RESOLVER = "os_scrapy_ipfilter_resolver.Resolver" -
config IP blacklist, it will raise
IPFilteredExceptionwhen the request ip in the blacklistIP_DISALLOWED = ["192.168.0.0/16", "10.143.0.1"] -
config IP whitelist, priority greater than blacklist
IP_ALLOWED = ["192.168.0.1"] -
config DNS cache size and expire time(seconds)
DNSCACHE_ENABLED = True DNSCACHE_SIZE = 10000 DNSCACHE_EXPIRE = 24 * 60 * 60 -
config DNS lookup timeout(seconds)
DNS_TIMEOUT = 60
Unit Tests
tox
License
MIT licensed.
Metadata
Release files for os-scrapy-ipfilter-resolver 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| os_scrapy_ipfilter_resolver-0.0.4.tar.gz | 6.9 kB | Without provenance | Details |
Release files / os_scrapy_ipfilter_resolver-0.0.4.tar.gz
| Download URL | os_scrapy_ipfilter_resolver-0.0.4.tar.gz |
|---|---|
| Size | 6.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12aee9487d6548087557752499c8bf571953f5b67674e203a5c101295645dc67
|
|
BLAKE2b-256 checksum How to use checksums |
aa6875e555b7aa3926ee0ec8d9f42dbbac89362e5e511c4d472c09637dc10673
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.7
|
Security for os-scrapy-ipfilter-resolver 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.