2 min read
Baidu Netdisk
Access files through Baidu Netdisk OAuth and xpan APIs using your own application credentials and a refresh token.
Adapter type: baidu_netdisk. See Common configuration for mounting instructions.
Setup
- Create and configure an application in the Baidu Netdisk developer platform, enable the required access, and record App Key and Secret Key.
- Follow the platform OAuth flow, configure a callback, request
basic,netdiskaccess for your account, and exchange the authorization code for a refresh token. - App Key maps to
client_id, and Secret Key toclient_secret; the token must belong to the same application. - Use an existing drive path such as
/apps/foxelforrootand confirm your app is authorized to access it.
Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
client_id | string | Yes | — | Baidu application App Key. |
client_secret | password | Yes | — | Matching application Secret Key. |
refresh_token | password | Yes | — | Refresh token issued for this application and account. |
access_token | password | No | — | Optional access token; it does not replace required refresh tokens or application credentials. |
root | string | No | "/" | Directory on the backend, separate from the mount path displayed in Foxel. |
timeout | number | No | 60 | Request or connection timeout in seconds. |
Example
This is a config object. In the admin form, fill the corresponding fields rather than pasting the whole object. Replace credential placeholders with your own values.
json
{
"client_id": "YOUR_APP_KEY",
"client_secret": "YOUR_SECRET_KEY",
"refresh_token": "YOUR_REFRESH_TOKEN",
"root": "/",
"timeout": 60
}
Behavior and limitations
- App credentials and
refresh_tokenremain required even withaccess_token. Refreshed tokens are saved in the adapter configuration. - Supports listings, downloads, directories, deletion, moves, copies, and multipart uploads.
- The implementation uses 4 MiB parts with a maximum of 2048 parts, limiting uploads to 8 GiB per file. Account or app restrictions may be lower.
- This is not a Cookie driver; BDUSS cannot replace the OAuth refresh token.
Troubleshooting
- OAuth refresh failed: check app credentials, token ownership, and consent; reauthorize if needed.
- Authenticated but no file access: check application approval, scopes, and the app’s actual access to
root. - Part limit exceeded: this implementation cannot upload a file larger than 8 GiB; split it or use another storage backend.
References
External documentation provides service and authorization context. Use this page and the current Foxel adapter for configuration fields and limitations.