BaiduWp icon

BaiduWp

调用百度网盘接口

Overview

This node integrates with Baidu Netdisk (Baidu Cloud Storage) to perform various operations related to user info, file information, file management, and sharing services. Specifically, for the 分享服务 (Sharing Service) resource and the 百度文件分享 (Baidu File Share) operation, it enables users to create shareable links for files stored on Baidu Netdisk, optionally protected by a password and with configurable expiration periods.

Common scenarios where this node is beneficial include:

  • Automating the generation of shareable download links for files stored in Baidu Netdisk.
  • Setting password protection on shared files to restrict access.
  • Defining how long a shared link remains valid (e.g., 1 day, 7 days, 30 days, or permanent).
  • Integrating Baidu file sharing into workflows that require distributing files securely and efficiently.

Practical example:

  • A marketing team automatically shares finalized campaign assets via Baidu Netdisk links with passwords and expiry dates, ensuring secure and time-limited access for external partners.

Properties

Name Meaning
文件ID (shareId) The unique identifier of the file to be shared on Baidu Netdisk.
分享密码 (pwd) Optional password to protect the shared file link, requiring recipients to enter it.
有效期 (period) The validity period of the share link. Options: 1天 (1 day), 7天 (7 days), 30天 (30 days), 永久有效 (Permanent).

Output

The node outputs JSON data containing details about the created share link:

  • shorturl: The shortened URL for accessing the shared file.
  • pwd: The password set for the share link (if any).
  • expiredType: Describes the expiration type of the share link, either "永久有效" (permanent) or a number indicating the number of days before expiration.

This output allows downstream nodes or users to retrieve and distribute the share link along with its access credentials and expiration information.

Dependencies

  • Requires an API key credential for Baidu Netdisk API access.
  • Uses Baidu's official APIs for user info, file management, and sharing.
  • Needs proper configuration of the Baidu API authentication token within n8n credentials.
  • Relies on network connectivity to Baidu's cloud services.

Troubleshooting

  • Invalid File ID: If the provided file ID does not exist or is incorrect, the API will return an error. Verify the file ID before running the node.
  • Incorrect Password: When setting a password, ensure it matches the expected format; otherwise, the share link creation may fail.
  • Expired Token or Authentication Failure: If the API token is invalid or expired, requests will fail. Refresh or reconfigure the API credentials.
  • API Rate Limits: Excessive requests might trigger rate limiting from Baidu. Implement retries or backoff strategies if needed.
  • Error Messages: The node throws errors when API responses indicate failure, including detailed messages from Baidu's API. Check these messages to identify issues such as permission problems or invalid parameters.

Links and References

Discussion