BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Wangpan) API to perform various file and user management operations. Specifically, for the "管理文件" (Manage Files) resource and the "文件重命名" (Rename File) operation, it allows users to rename files or batches of files on their Baidu Netdisk storage.

Typical use cases include:

  • Renaming a single file or multiple files in bulk by providing a collection of file paths and their new names.
  • Automating file organization workflows where files need to be renamed based on certain criteria or external data.
  • Integrating Baidu Netdisk file renaming into larger automation pipelines within n8n.

Example: A user can input a list of files with their current paths and desired new names, and the node will send requests to Baidu Netdisk to rename each file accordingly.

Properties

Name Meaning
操作合集 A collection of files to rename. It supports two ways to specify files:
- JSON 合集: A JSON array representing the list of files and their new names.
- 文件合集: A fixed collection allowing multiple entries, each with:
- 文件路径 (path): The current path of the file to rename.
- 重命名 (newname): The new name to assign to the file.

The property is required and must contain at least one file entry to process.

Output

The output is a JSON array where each item corresponds to the result of the rename operation for each input item. The structure typically includes:

  • path: The file path after renaming.
  • fs_id: The unique file system identifier assigned by Baidu Netdisk.
  • category: Usually indicates the type, e.g., "文件夹" (folder) if applicable.

If the operation involves batch renaming, the output contains an array of such objects reflecting the status of each renamed file.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for Baidu Netdisk API access.
  • The node uses internal helper functions to serialize parameters and handle HTTP requests to Baidu's REST API endpoints.
  • Network connectivity to Baidu Netdisk services is necessary.
  • Proper configuration of the Baidu Netdisk API credentials in n8n is mandatory.

Troubleshooting

  • Invalid or missing file list: If the "操作合集" property is empty or not properly formatted, the node throws an error prompting to select a valid operation collection.
  • Invalid JSON format: When using the JSON collection option, invalid JSON strings cause errors. Ensure the JSON is well-formed.
  • API errors: The node checks for error codes returned by Baidu API and surfaces them as node execution errors. Common issues include authentication failures, permission denied, or file not found.
  • Encoding issues: File paths and names are URL-encoded before sending to the API. Incorrect encoding might cause rename failures.
  • Duplicate file names: The API parameter ondup is set to "fail", so attempts to rename to an existing filename will fail. Users should ensure new names do not conflict with existing files.

Links and References

Discussion