- Notifications
You must be signed in to change notification settings - Fork11
graphaelli/zat
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Copies Zoom recordings to Google Drive.
- Improve discoverability of Zoom recordings
- Preserve recordings when Zoom user leaves the org
- Reduce cost of long term retention (maybe)
zat
requiresgo
to build - 1.13+ is recommended, for proper error formatting, but will work with older versions.
$ go build .$ ./zat
zat
should start without any configuration but isn't very useful without credentials - see below for setup.
zat
will persist tokens to disk atgoogle.creds.json
andzat.creds.json
- be sure to guard those files carefully as permissions are necessarily wide.
Once tokens have been obtained,zat -no-server
will perform only archival duties and then exit.
zat
always attempts to archive, to only start the web server use:-since 0s
.
Obtain Google credentials
- Create an Oauth Client ID credential
- You may need to create a project, or use a dev project you have access to. If the project doesn't have OAuth consent screen info, you'll need to add that as well.
- Choose "internal" user type, give it a name similar to the project name, and add your contact email
- Choose "Web application" as the client ID type
- Set Authorized redirect URIs to
http://localhost:8080/oauth/google
- You may need to create a project, or use a dev project you have access to. If the project doesn't have OAuth consent screen info, you'll need to add that as well.
- Save credentials to
google.config.json
(GCP Console > API & Services > Credentials > Download JSON)
- Create an Oauth Client ID credential
Obtain Zoom credentials
- Create an Oauth Application
- User-managed
- No need to publish
- Set name, descriptions, and contact information
- Add the
recording:read
scope - Set redirect URI to
http://127.0.0.1.ip.es.io:8080/oauth/zoom
and also add it to Whitelisted URLs
- Save credentials to
zoom.config.json
with content:{"id":"your-id","secret":"your-secret","oauth_redirect":"http://127.0.0.1.ip.es.io:8080/oauth/zoom"}
- Create an Oauth Application
[Optional] Obtain Slack credentials
- Create an App
- Add Permissions > Scopes > Bot Token Scopes > Add An Oauth Scope granting:
channels:read
,chat:write
,chat:write.public
- Add Permissions > Scopes > Bot Token Scopes > Add An Oauth Scope granting:
- Save the Bot User OAuth Access Token (under OAuth & Permissions) to
slack.config.json
with content:{"token":"your-token"}
- Create an App
Once the credentials are in place, re-runzat
and use the web server athttp://localhost:8080/ to login to both Google and Zoom to create the*.creds.json
files zat will use for the next run.
- Configure zat
Create zat.yml like:
-name:UI Weeklygoogle:DpB3XhhzV87LfEeLrM-nCopTtHDWxqVGHzoom:023-456-789-name:Team Weeklygoogle:DpB3XhhzV87LfEeLrM-nCopTtHDWxqVGHzoom:123-456-789
Wheregoogle
is the folder ID to store recordings into, andzoom
is the meeting id (hyphens or no hyphens, not spaces).
The google configuration is the ID of the folder where the recordings will be stored.
cmd/google/findfolders
can assist in tracking down folders and IDs like:
$ go build ./cmd/google/findfolders$ ./findfolders -query 'name = "bar"'foo DpB3XhhzV87LfEeLrM-nCopTtHDWxqVGH https://drive.google.com/drive/folders/DpB3XhhzV87LfEeLrM-nCopTtHDWxqVGH$ ./findfolders -query '"DpB3XhhzV87LfEeLrM-nCopTtHDWxqVGH" in parents and name = "Meetings"'Meetings ycMAKmDuzwobv6eBf9-PLupEGJJ6BtyoJ https://drive.google.com/drive/folders/ycMAKmDuzwobv6eBf9-PLupEGJJ6BtyoJ
You'll likely get an "Access Not Configured" error for new projects. Follow the URL in the error to ensure the project is enabled for Google Drive API access, then wait a few minutes before retrying.
zat provides a web interface with similar functionality, eghttp://localhost:8080/google?q=name contains "Team weekly".
The zoom configuration is the meeting ID - the dashes are optional.
cmd/zoom/listrecordings
can assist in tracking down meeting IDs like:
$ go build ./cmd/zoom/listrecordings$ ./listrecordings -since 96h2019/11/25 12:22:54 listrecordings.go:41: 2 recordings found2019-11-21 945106202 UI Weeklyaudio_transcript https://zoom.us/recording/download/wwwwshared_screen_with_speaker_view https://zoom.us/recording/download/xxxxchat_file https://zoom.us/recording/download/yyyyaudio_only https://zoom.us/recording/download/zzzztimeline https://zoom.us/recording/download/11111111-1111-1111-1111-1111111111112019-11-21 906290321 Team Weeklyaudio_transcript https://zoom.us/recording/download/aaaashared_screen_with_speaker_view https://zoom.us/recording/download/bbbbchat_file https://zoom.us/recording/download/ccccaudio_only https://zoom.us/recording/download/ddddtimeline https://zoom.us/recording/download/22222222-2222-2222-2222-222222222222
zat provides a web interface with similar functionality athttp://localhost:8080/zoom.
The slack configuration is the ID of the channel where the message should be sent.
cmd/slack/listchannels
can assist in tracking down channel IDs like:
$ go build ./cmd/slack/listchannels$ ./listchannelsCAAAAAAAA generalCAAAAAAAB zat
One method for finding private channel IDs is to open Slack in a web browser and look at$$('.p-channel_sidebar__static_list__item')
elements.The application's bot user will need to be invited to the private channel to post messages there.
cmd/slack/chat
can assist in verifying permissions are correct.
On macOS pre-10.15 (Catalina) and Linux,cron
is sufficient, eg:
0 8,10,15,22 * * * zat -no-server -config-dir ~/path/to/zat/config/dir
On macOS 10.15+, new security restrictions makecron
less attractive.
Instead uselaunchd
.A sample configuration is included undercontrib/
.Load it with:
launchctl load contrib/zat.plist
If prompted the first time the job runs, grantzat
access to the config directory.