Add ability to batch process Frame.io comments to Final Cut Pro clips
latenitefilms opened this issue · 2 comments
latenitefilms commented
Ideally you could put in the URL for a Frame.io project or folder, Marker Toolbox would download ALL the comments for all the clips in that project or folder, then if you drag a library or event to Marker Toolbox, it'll use filenames to match everything up.
latenitefilms commented
latenitefilms commented
Here's a simple Python script to get a list of all the root_asset_id
's:
import requests
# Frame.io API base URL
BASE_URL = "https://api.frame.io/v2"
# Put your Frame.io API token here
TOKEN = "XXX"
# The header for the requests
headers = {
"Authorization": f"Bearer {TOKEN}",
}
def get_resource(resource_url):
"""Send GET request to the provided resource URL and return the JSON response."""
response = requests.get(resource_url, headers=headers)
response.raise_for_status() # Will raise an HTTPError if the response was unsuccessful
return response.json()
def fetch_root_asset_ids():
"""Fetch the root_asset_id for each project in each team in each account."""
# Get the user's accounts
accounts = get_resource(f"{BASE_URL}/accounts")
for account in accounts:
# Get the teams within the current account
teams = get_resource(f"{BASE_URL}/accounts/{account['id']}/teams")
for team in teams:
# Get the projects within the current team
projects = get_resource(f"{BASE_URL}/teams/{team['id']}/projects")
for project in projects:
# Use the .get() method, which returns None if the key is not present in the dictionary
project_name = project.get('name', 'Unnamed Project')
team_name = team.get('name', 'Unnamed Team')
account_name = account.get('name', 'Unnamed Account')
root_asset_id = project.get('root_asset_id', 'No Root Asset ID')
print(f"Project '{project_name}' in team '{team_name}' of account '{account_name}' has root_asset_id '{root_asset_id}'.")
if __name__ == "__main__":
fetch_root_asset_ids()
You can then use that root_asset_id
in this website to get a CSV: