Actions15
Overview
This node integrates with Baidu Netdisk (Baidu Cloud Storage) API to perform various operations related to user info, file information retrieval, file management, and sharing services. Specifically, for the "获取文件信息" (Get File Information) resource and the "搜索文件" (Search File) operation, it allows users to search files within a specified directory on their Baidu Netdisk account by providing a keyword.
Common scenarios where this node is beneficial include:
- Automating file searches in Baidu Netdisk based on keywords.
- Retrieving lists of files matching certain criteria for further processing or reporting.
- Integrating Baidu Netdisk file search into larger workflows for backup, synchronization, or content management.
Practical example:
- A user wants to find all documents containing the word "report" inside the "/work" directory and process them downstream in n8n.
Properties
Name | Meaning |
---|---|
搜索关键字 (key) | The keyword used to search for files. This is required and filters files by matching this string. |
查询目录 (dir) | The directory path in which to perform the search. Defaults to root "/" if not specified. |
查询数目 (num) | The maximum number of results to return. Can be set from 0 up to 1000. Default is 100. |
是否递归 (recursion) | Boolean flag indicating whether to search recursively through subdirectories. Default is false. |
Output
The output is a JSON array where each item represents a file matching the search criteria. Each file object contains structured metadata about the file such as its name, path, size, and other relevant attributes formatted by the helper function formatFileMessage
.
No binary data output is indicated for this operation.
Dependencies
- Requires an API key credential for Baidu Netdisk API authentication.
- Uses internal Baidu API endpoints for file searching.
- The node depends on several utility functions and modules bundled internally (
baiduApiRequest
,errorCode
,formatFileMessage
). - No additional external services beyond Baidu Netdisk are required.
Troubleshooting
- Empty results: Ensure the search keyword and directory path are correct. If recursion is off, files in subfolders will not be found.
- API errors: The node checks for error codes returned by Baidu API and throws errors accordingly. Common issues may include invalid credentials, quota limits, or network problems.
- Invalid parameters: Make sure required fields like "搜索关键字" are provided; missing required inputs will cause execution errors.
- Rate limiting: Baidu API may limit requests; consider adding delays or handling retries in your workflow.
Links and References
- Baidu Netdisk API Documentation (internal link)
- Baidu Netdisk official site: https://pan.baidu.com/