Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Dropbox you are killing me... you give me notifications that we have hundreds of links shared, but no bulk way to remove them. What's worse? While I can delete the thousands that I made over the la...
og19
9 months agoNew member | Level 1
Someone just needs to wrap this into a tool for me:
pip install dropbox
Then:
import dropbox
# Replace with your Dropbox access token
ACCESS_TOKEN = "your_access_token_here"
def revoke_shared_links():
"""Fetches all shared links and revokes them."""
dbx = dropbox.Dropbox(ACCESS_TOKEN)
try:
# Get all shared links
response = dbx.sharing_list_shared_links()
if not response.links:
print("No shared links found.")
return
# Iterate and revoke each shared link
for link in response.links:
try:
print(f"Revoking link: {link.url}")
dbx.sharing_revoke_shared_link(link.url)
print("Revoked successfully.")
except Exception as e:
print(f"Failed to revoke {link.url}: {e}")
except Exception as e:
print(f"Error retrieving shared links: {e}")
if __name__ == "__main__":
revoke_shared_links()
Related Content
- 2 years ago
- 2 years ago
- 2 years ago
- 3 years ago