xdrop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Xdrop

Xdrop

Use the bundled scripts inside this skill directory.
使用本技能目录中附带的脚本。

Available scripts

可用脚本

  • scripts/upload.mjs
    — Upload local files or directories to an Xdrop server and print the share link
  • scripts/download.mjs
    — Download an Xdrop share link, decrypt it locally, and save the files
Environment requirements:
  • Bun
  • Local filesystem access
  • Network access to the target Xdrop server
  • scripts/upload.mjs
    — 将本地文件或目录上传至Xdrop服务器并打印分享链接
  • scripts/download.mjs
    — 下载Xdrop分享链接,在本地解密并保存文件
环境要求:
  • Bun环境
  • 本地文件系统访问权限
  • 可访问目标Xdrop服务器的网络环境

Upload

上传

bash
bun scripts/upload.mjs --server <xdrop-site-url> <file-or-directory> [...]
Prefer these flags when relevant:
  • --quiet
    : suppress progress output and keep stdout clean
  • --json
    : return
    transferId
    ,
    shareUrl
    , and
    expiresAt
  • --expires-in <seconds>
    : choose a supported expiry
  • --api-url <url>
    : override the default
    <server>/api/v1
  • --name <value>
    : set the transfer display name
  • --concurrency <n>
    : limit parallel uploads per file
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.txt
If 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
    shareUrl
    expiresAt
  • --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
#k=...
. Without the fragment key, the transfer cannot be decrypted.
bash
bun scripts/download.mjs "<share-url>"
Prefer these flags when relevant:
  • --output <dir>
    : choose the destination directory
  • --quiet
    : suppress progress output and keep stdout clean
  • --json
    : return
    transferId
    ,
    outputRoot
    , and saved file paths
  • --api-url <url>
    : override the default
    <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
./xdrop-<transferId>
and preserves the manifest's relative paths.
需要完整的分享链接,包括
#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
    #k=...
    fragment is not decryptable. Ask for the full original share URL.
  • Use
    --quiet
    whenever another command or caller needs to capture stdout. Progress logs otherwise go to stderr, but the final result still matters.
  • 缺少
    #k=...
    片段的下载链接无法解密,请要求用户提供完整的原始分享URL。
  • 当其他命令或调用者需要捕获标准输出时,请使用
    --quiet
    参数。否则进度日志会输出到标准错误流,但最终结果仍会保留。

Guardrails

约束规则

  • Prefer
    --quiet
    when another command or script needs to capture stdout.
  • 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
    参数。
  • 下载时请完整保留分享链接的片段部分。
  • 除非用户明确要求,否则不要使用手动临时命令绕过脚本内置的路径清理或传输清理行为。