BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Wangpan) API to retrieve various types of file information and manage files stored in a Baidu cloud drive. Specifically, the "获取图片列表" (Get Image List) operation under the "获取文件信息" (Get File Information) resource fetches a list of images from a specified directory in the user's Baidu Netdisk storage.

Common scenarios for this node include:

  • Automating retrieval of image files from a specific folder in Baidu Netdisk for further processing or backup.
  • Integrating Baidu Netdisk image data into workflows that require image metadata or lists.
  • Filtering and sorting images based on user-defined criteria such as recursion into subfolders or sorting order.

Practical example:

  • A user wants to periodically fetch the latest 100 images from their "/Photos" directory in Baidu Netdisk, including all subdirectories, sorted by date descending, to sync with another service or generate reports.

Properties

Name Meaning
目录名称 (parent_path) The directory path in Baidu Netdisk from which to retrieve the image list. Default is root "/" directory.
查询数目 (num) The maximum number of image items to query. Range: 0 to 1000. Default is 100.
是否递归 (recursion) Whether to recursively search through subdirectories within the specified directory. Boolean value. Default is false.
文件排序 (desc) Whether to sort the results in descending order. Boolean value. Default is false (ascending order).

Output

The output is a JSON array where each item represents an image file retrieved from the specified directory. Each item contains metadata about the image such as its name, path, size, modification time, and other relevant file attributes formatted by the helper function formatFileMessage.

No binary data output is indicated for this operation; the node returns structured JSON metadata only.

Dependencies

  • Requires an API key credential for Baidu Netdisk API authentication.
  • Uses internal Baidu API endpoints to perform GET requests for file listing.
  • The node depends on n8n's HTTP request capabilities and helper methods for constructing execution metadata.
  • No additional external services beyond Baidu Netdisk are required.

Troubleshooting

  • Common issues:

    • Invalid or expired API credentials will cause authentication failures.
    • Specifying a non-existent directory path may return empty results or errors.
    • Requesting more than 1000 items will be rejected due to API limits.
    • Recursive queries on very large directories may lead to timeouts or performance issues.
  • Error messages:

    • Errors returned from Baidu API calls are checked and thrown via errorCode helper. Typical errors include permission denied, invalid parameters, or quota exceeded.
    • If the node throws an error related to JSON parsing or unexpected response structure, verify the API response and ensure network connectivity.
  • Resolutions:

    • Ensure valid and active API credentials are configured.
    • Double-check directory paths and parameter values.
    • Limit the number of queried items and avoid deep recursion if performance issues occur.

Links and References

Discussion