This bash script downloads the latest Zoom video recording of your meeting and then deletes it from your Zoom account (to free up storage).
As the download link generated by Zoom is too long and nonsensical to be saved, this script extracts the recording start date and time, and first 12 letters of the recording topic as a recording name (and file extension) to be saved from the parent entry of the video(s) JSON file retrieved from the Zoom API.
It also automatically moves it to your folder of choice, with MP4 files moved to the subfolder vid.
- jq. You may install it with
brew install jq - curl. You may install it with
brew install curl - [npm] (https://formulae.brew.sh/formula/node). You may install it with
brew install node - jsonwebtoken
npm install jsonwebtoken - npm express module
npm install express
In order to download files from your (own) Zoom account, you need an authorization token.
To do this, you need to go to Zoom Marketplace, create an account, and create an app. Do not worry, you do not need to become a full app developer now. You merely need to create an app to generate a JWT token. We do this in the next step.
First, you register on Zoom Marketplace, and create an app to get your unique credentials.
Then, you go to Zoom Marketplace > Manage > > App Credentials. For the purpose of this sample app, you only need your credentials and you do not have to fill out any additional information while registering the app.
Follow all the steps explained on the Zoom API JWT.
Some clarification:
- enter all your credentials (API key and API secret) inside the config files
- Open your terminal and go to the project folder
- Type
node index.jsin your terminal - Open a browser and access port 3000 on your local host. Typing
localhost:3000in the search bar will do the trick. - Enter your email and view the API's response. When you run the app, you will see a form that asks for an email address. Provide your Zoom email address and you will see your JWT and other information related to your account.
- To run the script, you must replace the paths to your
curlfunction. For userahoimarieyou would change/path/to/anaconda3/bin/curlto/Users/ahoimarie/anaconda3/bin/curl - In line 4, change directory to the folder of your choice. It is currently set to
~/Downloads/myzoomvideos - In line 10, enter your
meetingID. You find it in your Zoom Admin section underRecording ManagementunderID. - In lines 12, 16, 24 and 34, change the path to your
curlfunction. - In lines 37f, downloaded
mp4files containingSPECIALare moved toSPECIALFOLDER. - In line 39, we move all remaining downloaded files (i.e. those files not ending in
mp4or containing theSPECIALtopic) starting with202*(i.e. for the year 2020) to the subfolderOTHERS
Open Mac's Script Editor and copy this line into it. Save it as your automaticZoomDownload.app. Now you can double-click your shell script, which will download and sort your videos automatically (and delete the downloaded recordings from your Zoom storage).
do shell script "/bin/bash ~/yourprojectfolder/automatic_zoom_download.sh"When you created an app with this one line in the Script Editor, you can further automate your downloads with your calendar as explained here. Now your app will automatically download, sort and delete your Zoom meetings according to your calendar settings!