BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Wangpan) API to manage files and user information on Baidu's cloud storage platform. Specifically, the "删除文件" (Delete File) operation under the "管理文件" (Manageable) resource allows users to delete one or multiple files from their Baidu Netdisk account.

Common scenarios for this node include:

  • Automating cleanup of files in Baidu Netdisk by deleting outdated or unnecessary files.
  • Batch deletion of files based on dynamically generated file lists.
  • Integrating Baidu Netdisk file management into larger workflows that require file removal as a step.

For example, a user can provide a collection of file paths to be deleted in one execution, enabling efficient batch file removal without manual intervention.

Properties

Name Meaning
操作合集 A collection of files to operate on. It supports two input modes:
- JSON 合集: A JSON array representing multiple files with their metadata.
- 文件合集: A fixed collection where each entry contains metadata including the file path.

The property "操作合集" is required and must contain either a valid JSON array or a list of file metadata objects specifying the paths of files to delete.

Output

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

  • path: The path of the file that was deleted.
  • fs_id: The unique file system ID assigned by Baidu Netdisk.
  • category: The type/category of the item, e.g., "文件夹" (folder).

If no files are provided, the output will be an empty object.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for Baidu Netdisk API authentication.
  • Uses Baidu Netdisk REST API endpoints for file management.
  • The node depends on internal helper functions for making HTTP requests, error handling, and JSON validation.
  • No additional external services beyond Baidu Netdisk are required.

Troubleshooting

  • Invalid or missing file list: If the "操作合集" property is empty or not properly formatted as JSON or collection, the node throws an error prompting to select a valid operation collection.
  • Invalid JSON format: If the JSON input is malformed, an error indicating invalid JSON will be thrown.
  • API errors: The node checks for error codes returned by Baidu API and surfaces them. Common issues include authentication failures, permission errors, or attempting to delete non-existent files.
  • Rate limiting: The node batches file deletions in chunks of 4 with a delay between requests to avoid hitting API rate limits.
  • Encoding issues: File paths are URL-encoded before sending to the API; incorrect encoding may cause failures.

To resolve these issues:

  • Ensure the "操作合集" input is correctly formatted and contains valid file paths.
  • Verify that the API credentials are correct and have sufficient permissions.
  • Check network connectivity and Baidu API service status.
  • Review error messages for specific API error codes and adjust inputs accordingly.

Links and References

Discussion