Geler
Help convert dynamic websites to static ones.
Install
=> dans un venv
pip install geler-CERTIC
=> de manière isolée et indépendante (mais disponible globalement)
pipx install geler-CERTIC
Usage
As a library in your own program:
import geler
freezer = geler.Freezer(
"https://acme.tld/",
"/save/to/path/",
thread_pool_size=10,
http_get_timeout=30,
skip_extensions=[".mp4", ".mp3"],
).freeze()
for err in result.http_errors:
print(f'{err.get("status_code")}: {err.get("url")}')
As a CLI tool:
$> geler --help
usage: geler [-h] [-t THREAD_POOL_SIZE] [--http-get-timeout HTTP_GET_TIMEOUT] [-s SKIP_EXTENSIONS] [-v] start-from-url save-to-path
positional arguments:
start-from-url -
save-to-path -
optional arguments:
-h, --help show this help message and exit
-t THREAD_POOL_SIZE, --thread-pool-size THREAD_POOL_SIZE
1
--http-get-timeout HTTP_GET_TIMEOUT
30
-s SKIP_EXTENSIONS, --skip-extensions SKIP_EXTENSIONS
-
-v, --verbose False
Thread pool size (--thread-pool-size) defaults to 1. Increase the number to have multiple downloads in parallel.
HTTP get timeout (--http-get-timeout) default to 30s. This includes the time needed to download the file. Increase the number to increase the timeout, or set it to 0 for no timeout.
List of skipped (--skip-extensions) is a comma-separated list of extensions that won't be downloaded.
Verbose mode (--verbose) will show downloaded URLs and HTTP errors.
Every non-dry run stores its crawl progress in .geler-state.sqlite3 inside the
destination directory. If a crawl is interrupted, resume it with the same URL,
destination, and skipped extensions:
geler --resume https://acme.tld/ /path/to/local/dir
Resume retries interrupted and failed downloads, skips files that were completed,
and patches links again when the crawl finishes. A run without --resume starts a
new checkpoint. Geler refuses to resume if the root URL or skipped extensions do
not match the checkpoint. Dry runs do not create checkpoints and cannot be resumed.
Complete example:
geler --http-get-timeout 30 --thread-pool-size 10 --skip-extension ".mp4,.zip" https://acme.tld/ /path/to/local/dir
Why ?
For MaX and associated tools, we needed a lightweight, portable, pure Python solution to convert small dynamic websites to static ones.
Alternatives
This tool has a narrow scope, on purpose. Please turn to these solutions if you need more:
Known Limitations
- only works with HTTP GET
- does not submit forms (even with GET method)
- only considers URLs in
src,href, or URL-like JavaScript string literals inonclickattributes - only considers URLs with
httporhttpsschemes - only downloads what is in the same netloc (same domain, same port) as the start URL
- patches URLs in
*.html,*.cssand JavaScript module imports in*.jsfiles, but does not parse arbitrary JS URL construction patterns - does not throttle requests
- does not respect
robots.txtor<meta name="robots" content="noindex">or any other robot directives.
Metadata
Release files for geler-CERTIC 0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| geler_certic-0.5.5.tar.gz | 20.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| geler_certic-0.5.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.7 kB
Release files / geler_certic-0.5.5.tar.gz
| Download URL | geler_certic-0.5.5.tar.gz |
|---|---|
| Size | 20.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db7114d8bf237e30dbf7a9ff85dd4e40f91c6e596a0d3e321ed397b2134e1d3b
|
|
BLAKE2b-256 checksum How to use checksums |
91b95b015346f3f79a80c6261b9be22260a19a0e80f22918aeb91ad8682af34a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.2
|
Release files / geler_certic-0.5.5-py3-none-any.whl
| Download URL | geler_certic-0.5.5-py3-none-any.whl |
|---|---|
| Size | 20.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af25a09676c5045940882db1812765e72e491a22136b0362d01e3072d547c104
|
|
BLAKE2b-256 checksum How to use checksums |
ee7711a4f546157d8968ab21ab65c9d5cc00a1f2482aeceaca30712cfd028381
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.2
|