BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Cloud Storage) API to retrieve file information, manage files, share files, and get user info. Specifically, the "获取文件信息" (Get File Information) resource with the "获取文件列表" (Get File List) operation allows users to query a directory on their Baidu Netdisk and retrieve a list of files or folders within it.

Common scenarios where this node is beneficial include:

  • Automating file management workflows by listing files in specific directories.
  • Integrating Baidu Netdisk file data into other systems or processes.
  • Filtering files or folders based on criteria such as folder-only results or sorting order.

Practical example:

  • A user wants to list all files in the root directory / but only wants to see folders, sorted ascendingly, limiting the result to 50 entries. This node can perform that query and output the structured list for further processing.

Properties

Name Meaning
查询目录 (dir) The directory path to query. Example: / for root directory.
查询数目 (limit) Maximum number of results to return. Must be at least 1. Default is 50.
文件排序 (desc) Boolean flag indicating whether to sort results in descending order (true) or ascending (false). Default is false.
是否只返回文件夹 (folder) Boolean flag to specify if only folders should be returned (true) or both files and folders (false). Default is false.

Output

The node outputs an array of JSON objects representing files and/or folders retrieved from the specified directory. Each item in the output array corresponds to a file or folder with properties formatted by the helper function (0,t.formatFileMessage) which typically includes metadata such as:

  • File/folder name
  • Path
  • Size
  • Modification date
  • File type/category
  • Unique identifiers (e.g., fs_id)

If the "是否只返回文件夹" property is set to true, the output will contain only folder entries.

No binary data output is indicated for this operation.

Dependencies

  • Requires an API key credential for Baidu Netdisk API authentication.
  • Uses internal helper functions and API request wrappers to communicate with Baidu's endpoints.
  • No additional external services beyond Baidu Netdisk API are required.
  • Node configuration must include valid Baidu Netdisk API credentials.

Troubleshooting

  • Empty or no results: Ensure the 查询目录 (dir) path exists and is accessible in the user's Baidu Netdisk account.
  • Invalid parameter errors: Check that 查询数目 (limit) is a positive integer and other parameters are correctly set.
  • API errors: The node calls t.errorCode.call(this,a,e) after each API request to handle errors. Common issues may include expired or invalid API tokens, network connectivity problems, or rate limits imposed by Baidu.
  • Permission denied: Make sure the API credentials have sufficient permissions to access the requested directory.
  • Unexpected output format: The node formats the response using a helper; if the API changes, output structure might differ.

Links and References

Discussion