使用 Dropbox API v2 和 Python,如何获取公共共享文件夹中的文件和文件夹列表?

Using Dropbox API v2 and Python, how to get a list of files and folders present in a publicly shared folder?

我是 Dropbox API 的新手,正在为公开共享的 link 创建一个 Python 应用程序。我想获取上述公开共享 link 中的文件和文件夹列表及其修改日期。我正在寻找在功能方面类似于 "files_list_folder" 的东西。谢谢

[交叉link供参考:https://www.dropboxforum.com/t5/API-support/How-to-get-a-list-of-files-and-folders-present-in-a-publicly/m-p/257852#M14954]

您实际上可以使用 files_list_folder 本身列出文件夹共享 link 的内容。为此,您应该使用 shared_link 参数。看起来像这样:

import dropbox

dbx = dropbox.Dropbox("<ACCESS_TOKEN>")

url = "https://www.dropbox.com/sh/..."
shared_link = dropbox.files.SharedLink(url=url)

print(dbx.files_list_folder(path="", shared_link=shared_link))