Actions15
Overview
This node integrates with Baidu Netdisk (Baidu Cloud Storage) API to perform various file and user-related operations. Specifically, for the resource 获取文件信息 ("Get File Information") and operation 递归获取文件列表 ("Recursively Get File List"), it retrieves a list of files from a specified directory path on Baidu Netdisk, optionally traversing subdirectories recursively.
This functionality is useful when you want to automate the retrieval of file metadata or build workflows that process or analyze files stored in Baidu Netdisk. For example, you could use this node to:
- Generate an inventory of all files under a folder including nested folders.
- Monitor changes or new files added to a directory structure.
- Feed file lists into downstream processing nodes for backup, analysis, or reporting.
Properties
Name | Meaning |
---|---|
目录 (path) | The directory path on Baidu Netdisk from which to start listing files. Default is root / . |
是否递归 (recursion) | Boolean flag indicating whether to recursively list files in all subdirectories (true ) or only the specified directory (false ). |
查询数目 (limit) | Maximum number of file results to return. Must be at least 1. |
文件排序 (desc) | Boolean flag to specify sorting order of files. true means descending order, false ascending. |
Note: Some properties are shown conditionally depending on the selected resource and operation.
Output
The node outputs an array of JSON objects representing files retrieved from Baidu Netdisk. Each object contains metadata about a file or folder, such as name, path, size, modification date, and other relevant attributes formatted by the helper function formatFileMessage
.
The output is structured as:
[
{
"name": "example.txt",
"path": "/folder/example.txt",
"size": 12345,
"isdir": 0,
"server_mtime": 1680000000,
...
},
...
]
If recursion is enabled, the list includes files from all nested directories under the specified path.
The node does not output binary data; it only returns file metadata.
Dependencies
- Requires an API key credential for Baidu Netdisk API authentication.
- Uses internal helper functions to make HTTP requests to Baidu's API endpoints.
- Relies on n8n's standard node helpers for constructing execution metadata and error handling.
No additional external services beyond Baidu Netdisk API are required.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Specifying a non-existent directory path may result in empty results or errors.
- Exceeding API rate limits or query limits can cause request failures.
- Improper JSON formatting in input parameters (for other operations) can throw errors.
Error messages:
- Errors returned from Baidu API are caught and surfaced by the node. They typically include error codes and messages from Baidu.
- If the node throws an error about invalid JSON or missing parameters, verify the input property values carefully.
- Network or timeout errors may occur if Baidu API is unreachable.
To resolve errors:
- Ensure valid API credentials are configured.
- Double-check directory paths and parameter values.
- Respect API usage limits.
- Review error details provided by the node for specific Baidu API error codes.
Links and References
- Baidu Netdisk API Documentation (in Chinese)
- Baidu Netdisk official site: https://pan.baidu.com/
This summary focuses on the "获取文件信息" resource and "递归获取文件列表" operation as requested.