Actions15
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 based on metadata or JSON input.
- Automating file organization workflows by programmatically updating file names.
- Integrating Baidu Netdisk file renaming into larger automation pipelines within n8n.
For example, a user can provide a collection of file paths and new names, and the node will process these rename requests sequentially, handling errors and batching requests efficiently.
Properties
Name | Meaning |
---|---|
操作合集 | A collection of files to rename. It supports two input modes: |
- JSON 合集: A JSON array describing files and their new names. | |
- 文件合集: A fixed collection where each entry includes: | |
- 文件路径 (path): The current path of the file to rename. | |
- 重命名 (newname): The new name to assign to the file. |
The property is required and expects either a valid JSON array or a collection of metadata entries specifying the files to rename.
Output
The node outputs an array of JSON objects representing the result of the rename operations. Each object corresponds to a batch of rename requests processed by the Baidu Netdisk API.
- The output JSON typically contains information about the success or failure of each rename operation.
- If no files are provided, the output will be an empty object.
- The node does not output binary data.
Dependencies
- Requires an API key credential for Baidu Netdisk API access.
- The node uses Baidu's REST API endpoints for file management.
- Network connectivity to Baidu Netdisk services is necessary.
- No additional environment variables are explicitly required beyond the API credential.
Troubleshooting
- Invalid JSON Input: If the JSON collection provided is not valid JSON, the node throws an error indicating the JSON is invalid. Ensure the JSON syntax is correct.
- Empty File List: If no files are specified in either JSON or metadata collections, the node returns an empty result without performing any operations.
- API Errors: The node checks for error codes returned by Baidu API and surfaces them as node errors. Common issues might include authentication failures, permission errors, or rate limiting.
- Batch Size Limits: The node processes rename requests in chunks of 4 files per API call to avoid overloading the API. Large inputs may take longer due to this throttling.
- Encoding Issues: File paths and new names are URL-encoded before sending to the API. Ensure that special characters are handled correctly.
Links and References
- Baidu Netdisk API Documentation (in Chinese)
- Baidu Netdisk official site: https://pan.baidu.com/
This summary is based solely on static analysis of the provided source code and property definitions.