Install and use qjfoidnh/BaiduPCS-Go on Ubuntu to upload files or whole directories to Baidu Netdisk, especially when bypy fails on large files, slice uploads, or app-root path semantics. Use when Codex needs a reproducible CLI workflow for Baidu Netdisk login via browser cookies, tmux-safe long-running uploads, remote directory creation, or verification of uploaded artifacts.
Use this skill for Ubuntu-based Baidu Netdisk uploads or downloads when reliability matters more than speed, but expose parallelism when the user wants higher throughput.
Prefer this over bypy when:
bypy hits Slice MD5 mismatch, 31064 file is not authorized, or other large-file upload failurestmuxBaiduPCS-Go sees the Baidu Netdisk root /, not bypy's /apps/bypy sandbox.bypy may still need to be created again under the real root for BaiduPCS-Go.--norapid -p 1 -l 1 --retry 8--norapid is the safest default, but BaiduPCS-Go notes that disabling rapid upload effectively limits single-file threading to one thread.tmux so transfers survive shell disconnects and can be reattached safely.Use the bundled installer script:
bash scripts/install_baidupcsgo.sh
The script prints the absolute binary path on success.
Default install directory: ./baidupcsgo
Default release: v4.0.1
Prefer cookie login over username/password.
pan.baidu.com browser session.baidu_net_cookie.txt.COOKIE=$(tr -d '\n' < baidu_net_cookie.txt)
/absolute/path/to/BaiduPCS-Go login --cookies="$COOKIE"
/absolute/path/to/BaiduPCS-Go quota
/absolute/path/to/BaiduPCS-Go pwd
/absolute/path/to/BaiduPCS-Go ls /
Successful login should show the real Netdisk root and the account quota.
Before uploading, explicitly create the remote path if it may not exist:
/absolute/path/to/BaiduPCS-Go mkdir /output
/absolute/path/to/BaiduPCS-Go mkdir /output/stage1_2b
/absolute/path/to/BaiduPCS-Go mkdir /output/stage1_2b/my-run
Ignore 31061 文件已存在.
Use the bundled uploader script when the goal is “local directory -> same-named remote directory”.
Example:
bash scripts/upload_dir.sh \
/abs/local/output/stage1_2b/coco_bbox_max60-coco80-desc_first-1024-lvis_proxy-merged \
/output/stage1_2b/coco_bbox_max60-coco80-desc_first-1024-lvis_proxy-merged \
/abs/path/to/BaiduPCS-Go
The script:
dirname(REMOTE_DIR) so the original folder name is preserved--norapid -p 1 -l 1 --retry 8Example with parallel uploads across files while keeping --norapid:
BAIDUPCS_UPLOAD_PARALLEL_FILES=4 \
BAIDUPCS_UPLOAD_FILE_THREADS=1 \
bash scripts/upload_dir.sh /abs/local/dir /output/stage1_2b/my-run /abs/path/to/BaiduPCS-Go
Example with more aggressive per-file parallelism:
BAIDUPCS_UPLOAD_NO_RAPID=0 \
BAIDUPCS_UPLOAD_FILE_THREADS=4 \
BAIDUPCS_UPLOAD_PARALLEL_FILES=2 \
bash scripts/upload_dir.sh /abs/local/dir /output/stage1_2b/my-run /abs/path/to/BaiduPCS-Go
Use the aggressive mode only when higher throughput matters more than the safer --norapid path.
Use the bundled downloader script when the goal is “remote directory -> local parent directory while preserving the remote folder name”.
Example:
bash scripts/download_dir.sh \
/output/stage1_2b/coco_bbox_max60-coco80-desc_first-1024-lvis_proxy-merged \
/abs/local/output_cache \
/abs/path/to/BaiduPCS-Go
The script:
BaiduPCS-Go's save directory to the provided local parent directory--fullpath so the remote folder structure is preserved--mode locate -p 4 -l 2 --retry 8 --ow --mtime1592545883_Pien1722/output/... under the chosen local parent before the final files are merged into the repo treeThis account prefix is a BaiduPCS-Go download behavior, not a transfer failure. Treat it as the staging area for the current login session.
Example with higher download parallelism:
BAIDUPCS_DOWNLOAD_THREADS=8 \
BAIDUPCS_DOWNLOAD_PARALLEL_FILES=4 \
bash scripts/download_dir.sh /output/stage1_2b/my-run /abs/local/output_cache /abs/path/to/BaiduPCS-Go
For multi-GB uploads, prefer:
tmux new -s baidupcs_upload
bash scripts/upload_dir.sh /abs/local/dir /remote/dir /abs/path/to/BaiduPCS-Go
For downloads, the same pattern applies:
tmux new -s baidupcs_download
bash scripts/download_dir.sh /remote/dir /abs/local/parent /abs/path/to/BaiduPCS-Go
Treat tmux as the default launch mode for any long-running transfer. If a command may take more than a few seconds or involve a multi-file sync, start it in a dedicated session rather than the foreground.
Detach with Ctrl-b d.
Reattach with:
tmux attach -t baidupcs_upload
Check the target directory:
/absolute/path/to/BaiduPCS-Go ls /output/stage1_2b/my-run
For a large upload, validate the highest-risk artifacts first:
model-00001-of-00002.safetensorsmodel.safetensors.index.jsonFor a large download, validate:
ls output from the remote sideoutput/If login succeeds but uploads fail:
--norapid-p 1 -l 1 before trying higher concurrencyBAIDUPCS_UPLOAD_PARALLEL_FILES before BAIDUPCS_UPLOAD_FILE_THREADS/apps/bypyquotaIf downloads fail:
BAIDUPCS_DOWNLOAD_MODE=pcs when locate hits authorization issuesBAIDUPCS_DOWNLOAD_THREADS and BAIDUPCS_DOWNLOAD_PARALLEL_FILES if the transfer becomes unstable--mtime enabled unless you specifically want fresh local timestampsIf bypy already uploaded files somewhere else:
BaiduPCS-Go will not show files stored only under bypy's app rootscripts/install_baidupcsgo.sh: download and unpack the tested Linux amd64 releasescripts/upload_dir.sh: create the remote directory chain and upload a local directory with stable defaults plus env-based parallel tuningscripts/download_dir.sh: download a remote file or directory into a chosen local parent directory with env-based parallel tuning