Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ https://mypikpak.com/s/synthetic-demo
Password: demo
```

Share text copied from any PikPak client works in every language it supports, and common synonyms such as `Pass code` or `Access code` are recognized too; see [Copying share text](docs/en/clipboard.md) for the details.
Share text copied from any PikPak client works in every language it supports, and common synonyms such as `Pass code` or `Access code` are recognized too; see [Copying share text](docs/en/clipboard.md) for the details. If the pass code is missing or wrong, the share row shows the reason in red; select the share and press Enter to type the pass code and scan again.

The new task appears right away. It is then scanned, saved, downloaded and verified, and the files end up in a folder named after the share title inside your download folder. You can also press `a` to open the paste box, which shows in real time how many shares and pass codes it found:

Expand All @@ -129,7 +129,7 @@ The icon in front of a name shows where the file is now:

| Key | Action |
| --- | --- |
| `↑` `↓` / `←` `→` / `Enter` | Select; collapse or expand a share; view file details |
| `↑` `↓` / `←` `→` / `Enter` | Select; collapse or expand a share; view file details; type the pass code for a share waiting for one |
| `r` | Retry the selected file or share |
| `c` | Cancel (asks for confirmation). Local files, saved progress and cloud copies are kept; press `r` later to resume |
| `p` / `P` | Pause or resume the selected item; pause all, or start all when something is paused. Paused state survives a restart |
Expand Down
4 changes: 2 additions & 2 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ https://mypikpak.com/s/synthetic-demo
パスワード: demo
```

PikPak の各言語のクライアントでコピーした共有テキストに対応しており、「パスワード」「パスコード」などのよく使われる表記も認識します。PikPak のウェブ版(日本語)でコピーしたテキストは「パスワード:」の後が空になっているため、パスコードを書き足してください。詳しくは[共有テキストのコピー](docs/ja/clipboard.md)を参照してください。
PikPak の各言語のクライアントでコピーした共有テキストに対応しており、「パスワード」「パスコード」などのよく使われる表記も認識します。PikPak のウェブ版(日本語)でコピーしたテキストは「パスワード:」の後が空になっているため、パスコードを書き足してください。パスコードがないか正しくない場合、共有の行に理由が赤字で表示されます。共有を選んで Enter を押すとパスコードを入力して再スキャンできます。詳しくは[共有テキストのコピー](docs/ja/clipboard.md)を参照してください。

画面にはすぐ新しいタスクが表示され、スキャン、保存、ダウンロード、検証を順に進めます。最後に、ダウンロード先の中にある共有タイトル名のフォルダにファイルを置きます。`a` を押して貼り付け欄を開くこともでき、認識した共有の数とパスコードの有無がその場で表示されます。

Expand All @@ -129,7 +129,7 @@ PikPak の各言語のクライアントでコピーした共有テキストに

| キー | 動作 |
| --- | --- |
| `↑` `↓` / `←` `→` / `Enter` | 選択、共有の折りたたみ・展開、ファイルの詳細表示 |
| `↑` `↓` / `←` `→` / `Enter` | 選択、共有の折りたたみ・展開、ファイルの詳細表示、パスコード待ちの共有へのパスコード入力 |
| `r` | 選択したファイルまたは共有を再試行 |
| `c` | 取消(確認あり)。ローカルファイル、進捗、クラウドのコピーはすべて残り、後で `r` で再開できます |
| `p` / `P` | 選択項目を一時停止・再開。すべて一時停止、または一時停止中の項目があればすべて開始。一時停止の状態は再起動後も保たれます |
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ xattr -d com.apple.quarantine ./pikpak-dl-cli-darwin-arm64
提取码:demo
```

提取码缺失或错误时,分享行以红色显示原因,选中该分享按 Enter 输入提取码即可重新扫描,详见[复制分享文本](docs/clipboard.md)。

界面会立即显示新任务,随后依次扫描、转存、下载、校验,最后把文件放进下载目录中以分享标题命名的文件夹里。也可以按 `a` 打开粘贴框,界面会实时提示识别到的分享数和提取码:

<p align="center">
Expand All @@ -127,7 +129,7 @@ xattr -d com.apple.quarantine ./pikpak-dl-cli-darwin-arm64

| 按键 | 作用 |
| --- | --- |
| `↑` `↓` / `←` `→` / `Enter` | 选择;折叠或展开分享;查看文件详情 |
| `↑` `↓` / `←` `→` / `Enter` | 选择;折叠或展开分享;查看文件详情;在等待提取码的分享上输入提取码 |
| `r` | 重试选中的文件或分享 |
| `c` | 取消(需确认);本地文件、断点和云端副本都保留,之后可用 `r` 恢复 |
| `p` / `P` | 暂停或继续选中项;全部暂停,或有暂停时全部开始。暂停状态在重启后保持 |
Expand Down
4 changes: 3 additions & 1 deletion docs/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@

标注后可以跟冒号(含全角)、等号、空格或“是/为”,码也可以放在括号或引号里;冒号在行尾时,码可以单独写在下一行,但这一行须是最后一行或后面空一行(否则可能是模板里的文件名,不会当成提取码)。英文等以空格分词的语言,标注与码之间需要冒号、等号或 `is`。解压密码、账号或登录密码、Vault 加密分享的密钥和 Wi-Fi 密码不会被当成提取码。标注后同一行没有内容时按未提供提取码处理;PikPak 网页版的日文界面复制的文本就是这样(“パスワード:”后面是空的),需要补上提取码后重新复制或粘贴。

也支持链接内明确标记的 `pwd`、`password`、`passcode` 或 `pass_code` 参数;无码分享可以只复制链接。真实缺码、错误码分别已观察到 `PASS_CODE_EMPTY`、`PASS_CODE_ERROR`,应等待新的完整文本,不把它们当成全局账号失效。
没有任何标注时,只有一种写法会被识别:整段文本只有一行链接和一行单独的提取码(中间可以有空行)。其他没有标注的文字一律不当成提取码。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Document the constraints of the unlabeled two-line form: the code must be 4–32 letters/digits and the link line must contain only the link

loneCode (src/intake/parse.ts:81) only pairs the second line when it is 4–32 alphanumeric characters (NFKC-normalized) and the first line matches /^https?:\/\/\S+$/ (URL only). A 1–3 character code, or a link line with extra text, is silently not recognized (tests/share-text.test.ts:62-63) and the share is accepted without a code. This sentence — and its parallels in docs/en/clipboard.md, docs/ja/clipboard.md, and docs/releaseNotes/v0.9.2.md — states no limits, while openspec/specs/clipboard-intake/spec.md explicitly requires “一行仅含 4 到 32 位字母数字的行”. The release notes' nearby “提取码只能是 1 到 32 位” (about the input box) invites readers to assume the same range applies to the copied two-line shape. Mentioning the minimum length would avoid that confusion.


也支持链接内明确标记的 `pwd`、`password`、`passcode` 或 `pass_code` 参数;无码分享可以只复制链接。真实缺码、错误码分别已观察到 `PASS_CODE_EMPTY`、`PASS_CODE_ERROR`,不会被当成全局账号失效。这时分享行会以红色显示“分享需要提取码”或“提取码错误”:选中该分享按 Enter 输入提取码即可重新扫描,也可以重新复制完整文本。之后单独复制的提取码不会自动配对到等待中的分享。

多个分享可以分别占一行或一段,且每个码明确配对。一个码跟在多条无法区分的链接之后时不会猜测;请分别复制。相似域名、其他 PikPak 页面、单独的提取码和普通文本不会创建任务。原始剪贴板不写入日志或数据库。

Expand Down
4 changes: 3 additions & 1 deletion docs/en/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ Password: demo

The pass code can be labelled the way any PikPak client labels it in its own language, or with a common synonym: `Password`, `Pass code`, `Access code`, `提取码`, `密码`, `识别码`, `パスワード`, `パスコード`, `비밀번호`, `Kata sandi`, `Kata laluan`, `Contraseña`, `Senha`, `Пароль`, `كلمة المرور` and more. In English and other languages that separate words with spaces, put a colon, an equals sign or `is` between the label and the code (`Password: demo`, `the password is demo`). The code may be wrapped in brackets or quotes, or sit alone on the next line after a trailing colon, as long as that line is the last one or is followed by a blank line (otherwise it may be a file name from a template and is not taken as the pass code). Archive (unzip) passwords, account or sign-in passwords, Vault share keys and Wi-Fi passwords are never taken as the pass code. A label with nothing after it on the same line counts as no pass code; this is what the PikPak web client produces in Japanese (`パスワード:` is left empty), so add the code and copy or paste the text again.

Explicitly labelled `pwd`, `password`, `passcode` or `pass_code` parameters in the link are also supported, and for a share without a pass code you can copy just the link. A missing pass code and a wrong pass code have been observed as `PASS_CODE_EMPTY` and `PASS_CODE_ERROR`. In those cases the program waits for a new complete text and does not treat them as the whole account failing.
Without any label, only one shape is recognized: the whole text is one line with the link and one line with the pass code alone (blank lines in between are fine). Any other unlabelled text is never taken as the pass code.

Explicitly labelled `pwd`, `password`, `passcode` or `pass_code` parameters in the link are also supported, and for a share without a pass code you can copy just the link. A missing pass code and a wrong pass code have been observed as `PASS_CODE_EMPTY` and `PASS_CODE_ERROR`. Neither is treated as the whole account failing. The share row turns red and reads “The share needs a pass code” or “Wrong pass code”: select the share and press Enter to type the pass code and scan again, or copy the complete text again. A pass code copied on its own later is never paired with a waiting share automatically.

Several shares can each take their own line or paragraph, as long as each pass code is clearly paired. A pass code after several links that cannot be told apart is never guessed; copy them separately. Look-alike domains, other PikPak pages, a pass code on its own and ordinary text do not create tasks. The raw clipboard is never written to logs or the database.

Expand Down
4 changes: 3 additions & 1 deletion docs/ja/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

PikPak のウェブ版を日本語で使っている場合、コピーされるテキストは「パスワード:」の後が空になっています(ウェブ版の日本語テンプレートの不具合です)。この場合はパスコードなしの共有として受け付け、「パスコードが必要」と表示されるので、パスコードを書き足してからもう一度コピーするか貼り付けてください。

リンク内で明示された `pwd`、`password`、`passcode`、`pass_code` パラメーターにも対応しています。パスコードのない共有はリンクだけをコピーすれば十分です。実際にパスコードがない場合と誤っている場合には、それぞれ `PASS_CODE_EMPTY`、`PASS_CODE_ERROR` が返ることを確認しています。これらは新しいテキスト全体を待つべき状態であり、アカウント全体の失効とは見なしません。
ラベルがない場合に認識するのは、テキスト全体がリンクの行とパスコードだけの行の 2 行からなる形だけです(間に空行があってもかまいません)。それ以外のラベルのない文字はパスコードとして扱いません。

リンク内で明示された `pwd`、`password`、`passcode`、`pass_code` パラメーターにも対応しています。パスコードのない共有はリンクだけをコピーすれば十分です。実際にパスコードがない場合と誤っている場合には、それぞれ `PASS_CODE_EMPTY`、`PASS_CODE_ERROR` が返ることを確認しています。どちらもアカウント全体の失効とは見なしません。共有の行は赤字で「共有にパスコードが必要です」または「パスコードが正しくありません」と表示されます。共有を選んで Enter を押すとパスコードを入力して再スキャンできます。テキスト全体をもう一度コピーしてもかまいません。後から単独でコピーしたパスコードが、待機中の共有に自動で対応付けられることはありません。

複数の共有は、それぞれ別の行や段落に分けてかまいません。ただし、各パスコードがどのリンクのものかを明確に対応付けられる必要があります。区別できない複数のリンクの後にパスコードが一つだけある場合は推測しないので、一つずつコピーしてください。類似したドメイン、PikPak のほかのページ、パスコード単独、普通のテキストではタスクを作成しません。クリップボードの元の内容はログにもデータベースにも書き込みません。

Expand Down
39 changes: 39 additions & 0 deletions docs/releaseNotes/v0.9.2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# PikPak DL CLI v0.9.2

发布日期:2026-10-25

提取码缺失或错误时,分享不再一直显示“扫描中”,可以在界面里直接补填提取码;也能识别只有链接和一行提取码的分享文本。

## 改进

- **在界面中补填提取码**:分享因提取码缺失或错误而停下时,选中该分享按 Enter 打开提取码输入框,提交后立即重新扫描。按键提示中的 Enter 会相应显示为“提取码”。提取码只能是 1 到 32 位字母或数字,格式不对时在输入框内说明。
- **识别单独一行的提取码**:整段文本只有一行链接和一行提取码(中间可以有空行)时,即使没有“提取码:”之类的标注,也能识别。其他没有标注的文字仍不当成提取码。

## 修复

- **扫描失败不再显示为“扫描中”**:提取码被拒绝、分享已失效或扫描多次失败时,分享行以红色显示原因,不再显示“扫描中”和动态图标。提取码问题分为“分享需要提取码”和“提取码错误”两种,分别显示。

## 下载

| 平台 | 文件 |
| --- | --- |
| macOS Apple 芯片 | `pikpak-dl-cli-darwin-arm64` |
| macOS Intel | `pikpak-dl-cli-darwin-x64` |
| Windows x64 | `pikpak-dl-cli-windows-x64.exe` |
| Windows arm64 | `pikpak-dl-cli-windows-arm64.exe` |
| Linux x64(glibc) | `pikpak-dl-cli-linux-x64` |
| Linux arm64(glibc) | `pikpak-dl-cli-linux-arm64` |

`SHA256SUMS.txt` 列出各文件的校验和。

## 升级说明

直接替换可执行文件即可。任务库结构不变,不需要迁移或重新登录。

升级前已经因提取码停下的分享仍显示“分享需要提取码,或提取码不正确”,同样可以按 Enter 补填提取码。

## 已知问题与待验收

- 提取码输入框尚未在真实终端中手动演练,目前只经过自动化界面测试。
- 之后单独复制的提取码仍不会自动配对到等待中的分享,需要按 Enter 输入,或重新复制包含链接和提取码的完整文本。
- v0.9.1 与 v0.8.1 列出的待验收项仍然有效。
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Context

分享扫描在 `scanShare` 中调用 `/drive/v1/share`;服务端返回 `PASS_CODE_EMPTY` 或 `PASS_CODE_ERROR` 时抛出 `ShareScanError("access_required")`,`finishScan` 把分享的 `scan_status` 记为 `failed`、`last_error` 记为 `access_required`。界面的分享行只区分“已完成扫描”与“其他”,`failed` 也被当成扫描中。

## Goals / Non-Goals

**Goals:** 等待提取码的分享一眼可见,并能在界面中就地补填;识别“链接 + 单独一行提取码”的简单写法。

**Non-Goals:** 不放宽多分享或带说明文字时的配对规则;不把之后单独复制的提取码自动关联到任务(`clipboard-intake` 原有要求保持不变)。

## Decisions

1. **单独一行的提取码只在最简单的形状下识别。** 整段文本去掉空白行后恰好两行:一行只有一个受支持的分享链接,另一行只有 4–32 位字母数字。其他形状(有说明文字、多个链接、带文件名的模板)仍按原规则处理,避免把文件名当成提取码。即使误判,服务端会拒绝,分享进入“提取码错误”,用户可以按 Enter 改正。
2. **缺码与错码分开记录。** `ShareScanError` 保留 `access_required` 作为类别(文件转存路径仍按它判断),另带 `reason`:`pass_code_missing` 或 `pass_code_wrong`。`finishScan` 与 `scan_waiting` 事件使用 `reason`;访问资料不可读时仍为 `access_required`。
3. **扫描失败的分享显示错误状态。** `scan_status` 为 `pending` 或 `active` 才算扫描中;`failed` 时用错误色显示原因,没有文件时替代“扫描中”,有文件时附在计数后。
4. **补填提取码是显式指定目标的输入。** 选中原因为 `pass_code_missing`、`pass_code_wrong` 或 `access_required` 的分享按 Enter 时打开输入框(其他分享仍是展开/折叠)。提交时由 `RuntimeSession` 的新命令 `setPassCode` 交给 `IntakeReceiver.receivePassCode`,复用 `acceptShare`:写入新的访问资料、重置因提取码失败的文件并请求重新扫描。这是用户对选中分享的明确操作,不违反“不自动关联单独复制的提取码”。提取码不写入事件、日志或快照。
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Why

复制 `链接 + 空行 + 单独一行的提取码`(不带“密码:”之类的标注)时,解析器认不出提取码,分享按无码接收。服务端返回需要提取码后,分享的扫描记为失败,界面却仍显示“扫描中…”,只有事件区写着“扫描等待:分享需要提取码,或提取码不正确”。用户看不出任务已经停下,只能重新复制完整文本,没有就地补填提取码的办法。

## What Changes

- 解析:整段文本只有一个分享链接(独占一行)和一行单独的提取码时,把这一行识别为该链接的提取码。
- 扫描结果区分“缺少提取码”(服务端 `PASS_CODE_EMPTY`)与“提取码错误”(`PASS_CODE_ERROR`),分别记录原因。
- 主面板:扫描失败的分享不再显示“扫描中”,改用错误色显示失败原因;等待提取码的分享显示“按 Enter 输入提取码”。
- 选中等待提取码的分享按 Enter,打开提取码输入框;提交后更新该分享的访问资料并重新扫描。

## Capabilities

### New Capabilities

(无)

### Modified Capabilities

- `clipboard-intake`:完整分享文本解析支持“单独一行的提取码”;缺失或错误提取码可以在界面中为指定分享补填。
- `terminal-ui`:扫描失败的分享显示错误状态;新增提取码输入框。

## Impact

- `src/intake/parse.ts`、`src/intake/receiver.ts`
- `src/pikpak/shares.ts`(区分缺码与错码)、`src/runtime/engine.ts`、`src/runtime/session.ts`(新命令 `setPassCode`)
- `src/tui/app.tsx`、`main-panel.tsx`、`pages.tsx`、`view-model.ts` 与三种语言的界面文字
- 测试:`tests/share-text.test.ts`、`tests/shares.test.ts`、界面与会话测试
Loading
Loading