Foxel
Menu
On this page

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

  1. Create and configure an application in the Baidu Netdisk developer platform, enable the required access, and record App Key and Secret Key.
  2. Follow the platform OAuth flow, configure a callback, request basic,netdisk access for your account, and exchange the authorization code for a refresh token.
  3. App Key maps to client_id, and Secret Key to client_secret; the token must belong to the same application.
  4. Use an existing drive path such as /apps/foxel for root and confirm your app is authorized to access it.

Configuration

FieldTypeRequiredDefaultDescription
client_idstringYes—Baidu application App Key.
client_secretpasswordYes—Matching application Secret Key.
refresh_tokenpasswordYes—Refresh token issued for this application and account.
access_tokenpasswordNo—Optional access token; it does not replace required refresh tokens or application credentials.
rootstringNo"/"Directory on the backend, separate from the mount path displayed in Foxel.
timeoutnumberNo60Request 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_token remain required even with access_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.