BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Cloud Storage) API to manage files and user information. Specifically, the "管理文件" (Manage Files) resource with the "移动文件" (Move File) operation allows users to move one or multiple files from their current locations to new directories within their Baidu Netdisk storage.

Common scenarios include:

  • Organizing files by moving them into categorized folders.
  • Renaming files while moving them to a different directory.
  • Batch processing multiple files in one operation for efficient file management.

For example, a user can provide a collection of files with their current paths, target destination directories, and optionally new names, and the node will execute the move operations accordingly.

Properties

Name Meaning
操作合集 A collection of files to operate on. It supports two input modes:
- JSON 合集: A JSON array describing files with properties like path, destination, name.
- 文件合集: A fixed collection where each entry includes:
- 文件路径 (path): The current file path to move.
- 移动目录 (dest): The target directory to move the file into.
- 重命名 (newname): Optional new name for the file after moving.

Output

The output is an array of JSON objects representing the result of the move operations. Each object contains details about the moved files, such as:

  • path: The new path of the file after moving.
  • fs_id: The unique file system identifier assigned by Baidu Netdisk.
  • category: The type/category of the item, e.g., "文件夹" (folder).

If multiple files are moved, the output will be a list of these objects corresponding to each file processed.

Dependencies

  • Requires an API key credential for Baidu Netdisk API access.
  • Uses Baidu's REST API endpoints for file management.
  • The node depends on internal helper functions for making authenticated requests and handling responses.
  • No additional external services beyond Baidu Netdisk API are required.

Troubleshooting

  • Invalid JSON Collection: If the JSON input for the file collection 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 provided in the collection, 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 errors. Common issues might include authentication failures, invalid paths, or permission errors.
  • Rate Limiting: The node batches file operations in chunks of 4 and waits briefly between batches to avoid hitting API rate limits.
  • Missing Required Fields: Each file entry must have at least a source path and destination directory; missing these will cause errors.

Links and References

Discussion