xdrop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseXdrop
Xdrop
Use the bundled scripts inside this skill directory.
使用本技能目录中附带的脚本。
Available scripts
可用脚本
- — Upload local files or directories to an Xdrop server and print the share link
scripts/upload.mjs - — Download an Xdrop share link, decrypt it locally, and save the files
scripts/download.mjs
Environment requirements:
- Bun
- Local filesystem access
- Network access to the target Xdrop server
- — 将本地文件或目录上传至Xdrop服务器并打印分享链接
scripts/upload.mjs - — 下载Xdrop分享链接,在本地解密并保存文件
scripts/download.mjs
环境要求:
- Bun环境
- 本地文件系统访问权限
- 可访问目标Xdrop服务器的网络环境
Upload
上传
bash
bun scripts/upload.mjs --server <xdrop-site-url> <file-or-directory> [...]Prefer these flags when relevant:
- : suppress progress output and keep stdout clean
--quiet - : return
--json,transferId, andshareUrlexpiresAt - : choose a supported expiry
--expires-in <seconds> - : override the default
--api-url <url><server>/api/v1 - : set the transfer display name
--name <value> - : limit parallel uploads per file
--concurrency <n>
Useful examples:
bash
bun scripts/upload.mjs --server http://localhost:8080 ./dist/report.pdf
bun scripts/upload.mjs --server http://localhost:8080 --quiet ./archive.zip
bun scripts/upload.mjs --server http://localhost:8080 --expires-in 600 --json ./notes.txtIf the user wants verification, upload a small temporary file and then confirm the public transfer API or browser can open the returned link.
bash
bun scripts/upload.mjs --server <xdrop-site-url> <file-or-directory> [...]相关场景下优先使用以下参数:
- : 抑制进度输出,保持标准输出整洁
--quiet - : 返回
--json、transferId和shareUrlexpiresAt - : 设置支持的过期时间
--expires-in <seconds> - : 覆盖默认的
--api-url <url>地址<server>/api/v1 - : 设置传输任务的显示名称
--name <value> - : 限制每个文件的并行上传数
--concurrency <n>
实用示例:
bash
bun scripts/upload.mjs --server http://localhost:8080 ./dist/report.pdf
bun scripts/upload.mjs --server http://localhost:8080 --quiet ./archive.zip
bun scripts/upload.mjs --server http://localhost:8080 --expires-in 600 --json ./notes.txt如果用户需要验证,可上传一个小型临时文件,随后确认公开传输API或浏览器能否打开返回的链接。
Download
下载
Require the full share link, including . Without the fragment key, the transfer cannot be decrypted.
#k=...bash
bun scripts/download.mjs "<share-url>"Prefer these flags when relevant:
- : choose the destination directory
--output <dir> - : suppress progress output and keep stdout clean
--quiet - : return
--json,transferId, and saved file pathsoutputRoot - : override the default
--api-url <url><share-origin>/api/v1
Useful examples:
bash
bun scripts/download.mjs "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --output ./downloads "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --quiet --json --output ./downloads "http://localhost:8080/t/abc123#k=..."By default the downloader writes to and preserves the manifest's relative paths.
./xdrop-<transferId>需要完整的分享链接,包括部分。缺少该片段密钥则无法解密传输内容。
#k=...bash
bun scripts/download.mjs "<share-url>"相关场景下优先使用以下参数:
- : 指定目标目录
--output <dir> - : 抑制进度输出,保持标准输出整洁
--quiet - : 返回
--json、transferId和已保存文件路径outputRoot - : 覆盖默认的
--api-url <url>地址<share-origin>/api/v1
实用示例:
bash
bun scripts/download.mjs "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --output ./downloads "http://localhost:8080/t/abc123#k=..."
bun scripts/download.mjs --quiet --json --output ./downloads "http://localhost:8080/t/abc123#k=..."默认情况下,下载器会将文件写入目录,并保留清单中的相对路径。
./xdrop-<transferId>Gotchas
注意事项
- A download link without the fragment is not decryptable. Ask for the full original share URL.
#k=... - Use whenever another command or caller needs to capture stdout. Progress logs otherwise go to stderr, but the final result still matters.
--quiet
- 缺少片段的下载链接无法解密,请要求用户提供完整的原始分享URL。
#k=... - 当其他命令或调用者需要捕获标准输出时,请使用参数。否则进度日志会输出到标准错误流,但最终结果仍会保留。
--quiet
Guardrails
约束规则
- Prefer when another command or script needs to capture stdout.
--quiet - Keep the full share link fragment intact for downloads.
- Do not bypass the scripts' built-in path sanitization or transfer cleanup behavior with manual ad hoc commands unless the user explicitly asks.
- 当其他命令或脚本需要捕获标准输出时,优先使用参数。
--quiet - 下载时请完整保留分享链接的片段部分。
- 除非用户明确要求,否则不要使用手动临时命令绕过脚本内置的路径清理或传输清理行为。