Skip to content

Instantly share code, notes, and snippets.

@Thoroslives
Thoroslives / remove_orphaned_assets.py
Last active April 24, 2024 13:07 — forked from T-One/gist:c857005e58286149914ad38f24a891e1
I made some changes to the original script as people were having issues removing assets from users other than admin. this now asks for admin api for scanning and the owners api of the assets to remove which is used in the DELETE command
#!/usr/bin/env python3
# Note: you might need to run "pip install requests halo tabulate tqdm" if these dependencies are missing on your machine
import argparse
import json
import requests
from urllib.parse import urlparse
from halo import Halo
from tabulate import tabulate