diff --git a/scripts/lib/constants.py b/scripts/lib/constants.py index b9cffd6..6156acc 100644 --- a/scripts/lib/constants.py +++ b/scripts/lib/constants.py @@ -4,6 +4,12 @@ 'corp': 3, } +ZOOM_ROLES = { + 'owner': 0, + 'admin': 1, + 'member': 2, +} + VIDEO_CATEGORY_IDS = { 'Film & Animation': 1, 'Autos & Vehicles': 2, @@ -36,4 +42,4 @@ 'Shorts': 42, 'Shows': 43, 'Trailers': 44, -} \ No newline at end of file +} diff --git a/scripts/upload_zoom_recordings.py b/scripts/upload_zoom_recordings.py index dce6261..fc440f4 100644 --- a/scripts/upload_zoom_recordings.py +++ b/scripts/upload_zoom_recordings.py @@ -35,7 +35,7 @@ from typing import Dict from urllib.parse import urlparse from zoomus import ZoomClient -from lib.constants import USER_TYPES, VIDEO_CATEGORY_IDS +from lib.constants import VIDEO_CATEGORY_IDS, ZOOM_ROLES from lib.youtube import get_youtube_client, upload_video, add_video_to_playlist, validate_youtube_credentials YOUTUBE_CREDENTIALS_PATH = '.youtube-upload-credentials.json' @@ -175,9 +175,8 @@ def main(): zoom = ZoomClient(ZOOM_CLIENT_ID, ZOOM_CLIENT_SECRET, ZOOM_ACCOUNT_ID) - # Get main account, which should be 'pro' - zoom_user_id = next(user['id'] for user in zoom.user.list().json()['users'] - if user['type'] >= USER_TYPES['pro']) + # Official meeting recordings we will upload belong to the account owner. + zoom_user_id = zoom.user.list(role_id=ZOOM_ROLES['owner']).json()['users'][0]['id'] with tempfile.TemporaryDirectory() as tmpdirname: print(f'Creating tmp dir: {tmpdirname}\n')