Show HN: Rapel – 在不稳定网络环境下实现分块断点续传
Show HN: Rapel – chunked resumable downloads in unstable networks

原始链接: https://github.com/redraw/rapel

**Rapel** 是一款现代化的跨平台 HTTP 下载工具,旨在提供可靠且高效的下载体验。它擅长处理大文件传输,通过将下载任务分割成多个并发、可恢复的数据块来提升效率。 **主要特性包括:** * **高性能:** 支持多线程下载,并允许配置数据块大小。 * **可断点续传:** 使用 JSON 状态文件跟踪进度,确保用户可以在中断后(即使是正常关机后)无缝恢复下载。 * **多功能性:** 支持代理设置、实时进度跟踪,以及通过自定义命令钩子进行灵活的后处理(例如:下载完成后立即将数据块上传至云存储)。 * **智能合并:** 自动检测输出文件名,并在合并数据块文件后支持自动清理。 * **广泛兼容:** 提供适用于 Linux(含树莓派)、macOS、Windows 和 FreeBSD 的原生二进制文件。 **快速上手:** 通过 `go install github.com/redraw/rapel@latest` 安装。 * **标准下载:** `rapel download [URL]` * **进阶下载:** `rapel download [URL] -c 50M --jobs 4 --merge` * **代理下载:** `rapel download [URL] -x socks5h://127.0.0.1:9050` 无论您是在管理大型数据集还是身处不稳定的网络环境下,Rapel 都能为您提供一套稳健且可脚本化的文件获取解决方案。

Hacker News | 最新 | 往期 | 评论 | 提问 | 展示 | 招聘 | 提交 | 登录 Show HN: Rapel – 在不稳定网络中进行分块断点续传 (github.com/redraw) 4 点,由 autorun 发布于 2 小时前 | 隐藏 | 往期 | 收藏 | 1 条评论 binyang_qiu 35 分钟前 [–] 很酷。读了你的 README 之后,“post-part” 钩子是我最感兴趣的部分。分块级别的钩子让它更容易接入 rclone 或其他工作流。 正如你提到的,单个 .rapel-state.json 文件跟踪了所有分块的元数据。在恢复下载时,该状态文件是否也会锁定原始文件的标识,以便检测远程文件在两次会话之间是否发生了更改? 回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:
相关文章

原文

Chunked HTTP downloader with resume support.

A modern, cross-platform implementation with improved state management and progress tracking.

Or install directly:

go install github.com/redraw/rapel@latest

Download a file with default settings (100MB chunks, 1 concurrent job):

rapel download https://example.com/file.bin

Download with custom chunk size and multiple concurrent downloads:

rapel download https://example.com/file.bin -c 50M --jobs 4

Download through a proxy:

rapel download https://example.com/file.bin -x socks5h://127.0.0.1:9050

Download and auto-merge:

rapel download https://example.com/file.bin --merge

Run command after each chunk completes:

rapel download https://example.com/file.bin --post-part 'rclone move {part} remote:bucket/'

Merge chunk files manually:

rapel merge                                    # Auto-detects output name
rapel merge --pattern 'file.*.part'           # Auto-detects as "file"
rapel merge -o output.bin --delete            # Explicit name, delete after merge
  • JSON state management: Single .rapel-state.json file tracks all chunk metadata
  • Graceful shutdown: Ctrl+C saves progress and allows resume
  • Better progress display: Real-time speed, completion status with ANSI formatting
  • Cross-platform: Works on Linux (amd64, arm64, arm v6/v7), macOS (Intel/Apple Silicon), Windows, and FreeBSD
  • Raspberry Pi support: Native ARM v7 and v6 binaries for all Raspberry Pi models
  • Resume support: Automatically resumes interrupted downloads
  • Concurrent downloads: Download multiple chunks simultaneously
  • Post-part hooks: Run custom commands after each chunk completes (e.g., upload to cloud)
  • Smart merging: Auto-detects output filename and handles multiple download sessions

Download command:

-c SIZE          Chunk size (K, M, G suffix). Default: 100M
-x URL           Proxy URL (e.g., socks5h://127.0.0.1:9050)
-r N             Retries per request. Default: 10
--no-head        Skip HEAD request (requires --size)
--size BYTES     Total size in bytes (required if --no-head)
--jobs N         Concurrent chunks. Default: 1
--force          Force re-download even if state exists
--merge          Merge chunks after download (auto-detects output name)
--post-part CMD  Command to run after each part completes
                 Placeholders: {part} {idx} {base}

Merge command:

-o FILE        Output filename (auto-detected if not provided)
--pattern GLOB Pattern for chunk files. Default: *.part
--delete       Delete chunk files after merging
联系我们 contact @ memedata.com