Batch downloader for Gemini protocol
Find a file
2024-06-24 22:38:30 +03:00
.gitignore init composer project 2024-06-24 22:19:30 +03:00
composer.json init composer project 2024-06-24 22:19:30 +03:00
help.gmi update help 2024-06-24 22:30:59 +03:00
LICENSE Initial commit 2024-06-24 22:11:37 +03:00
README.md update readme 2024-06-24 22:38:30 +03:00

gemini-dl

CLI downloader for Gemini protocol, inspired by wget and yt-dlp tools

At this moment, project under development, some features already implemented and testing (feedback | PR)

Interface

Components

Features

  • Grab single location or entire capsule for mirroring or offline reading
  • Multiple MIME types download support (e.g. inline images and other media)
  • Detailed crawler log for every request
  • Flexible options
    • Custom delay between requests
    • Custom index filename for directories
    • Custom storage location
      • Filesystem
      • FTP
    • Optional URL replacement to relative URI
    • Recursive crawler
    • Regex URL rules
    • Unique snap version or sync local copy (by default)
    • Configurable redirect levels to follow
    • Crawl depth levels limit
    • Document size limit to download
    • Follow external links on crawl

Environment

apt install git composer php-fpm php-mbstring

Install

  • git clone
  • cd gemini-dl
  • composer update
  • chmod +x src/gemini-dl.php (for direct execution only)

Usage

src/gemini-dl.php --source gemini://.. --target /path/to/download
  • alternatively, launch with specified php version /path/to/php src/gemini-dl.php

Options

## Required

    -s, --source     - string, gemini protocol address
    -t, --target     - string, absolute path to destination folder

## Optional

    -c, --crawl      - no value, crawl document links (entire capsule download), disabled by default
    -d, --delay      - integer, pause between requests (seconds), 1 by default
    -i, --index      - string, index filename of directory listing, index.gmi by default
    -h, --help       - no value, show available commands
    -k, --keep       - no value, keep original links (--crawl mode only), disabled by default
    -m, --match      - string, collect links match regex rule, /.*/ by default
    -r, --raw        - no value, include meta headers (--keep option ignored), disabled by default
    -u, --unique     - no value, append snap version as folder timestamp, disabled by default

## Experimental (in development)

    -e, --external   - no value, follow external hosts, disabled by default
    -f, --follow     - integer, follow redirects on --crawl, 0 by default
    -l, --level      - integer, depth to --crawl, 0 by default
  • show in CLI: gemini-dl.php --help