我正在尝试查找shared_link
权限为False
的文件。
file1 = user_client.file(file_id).get()
shared_link =file1.shared_link
permissions = shared_link.permissions
if permissions == False:
print(f'File "{file1.name}" is not downloadable')
else:
pass
我希望“此文件不可下载”,但得到了这个:
Exception has occurred: AttributeError
'dict' object has no attribute 'permissions'
File "/Users/ianhorn/Documents/Box-Reports/can_download.py", line 38, in \<module\>
permissions = shared_link.permissions
AttributeError: 'dict' object has no attribute 'permissions'
1条答案
按热度按时间ws51t4hk1#
您可以通过调试脚本来获取此变量。在变量中,您将切换打开shared_link变量,然后打开函数变量。
答案是
data.shared_link['permissions']['can_download']
。