Save Zoom recordings to Google Drive, then email me link
@dylburger
code:
data:privatelast updated:4 years ago
today
Build integrations remarkably fast!
You're viewing a public workflow template.
Sign up to customize, add steps, modify code and more.
Join 1,000,000+ developers using the Pipedream platform
steps.
trigger
active
last updated:-last event:-
steps.
construct_filename_and_download_url
auth
to use OAuth tokens and API keys in code via theauths object
code
Write any Node.jscodeand use anynpm package. You can alsoexport datafor use in later steps via return or this.key = 'value', pass input data to your code viaparams, and maintain state across executions with$checkpoint.
async (event, steps) => {
1
2
3
4
5
6
7
8
9
}
10
const shortid = require('shortid')

// A recording with a topic "Test Recording" and file type MP4 becomes "test_recording-abc123.mp4"
// We append a "short ID" to avoid collisions for recordigs with the same topic name
const meetingTopic = event.meeting_topic.replace(/[^a-zA-Z0-9]/g, '_').toLowerCase()
this.filename = `${meetingTopic}-${shortid.generate()}.${event.file_type.toLowerCase()}`

this.downloadURL = `${event.download_url}?access_token=${event.download_token}`
steps.
upload_url_content_to_folder
Given a URL, this downloads the contents and uploads it to Google Drive as a file, to the specified folders
auth
(auths.google_drive)
params
File URL

The URL of the file you want to stream to Google Drive

{{steps.construct_filename_and_download_url.downloadURL}}
string ·params.fileURL
Filename

The filename you want to assign to the file in Google Drive

{{steps.construct_filename_and_download_url.filename}}
string ·params.filename
Parent Folders

A list of parent folder IDs, entered manually or retrieved from a previous file list operation

[0]:
 
array ·params.parents
Filetype

The MIME / Media type of the file

videp/mp4
string ·params.filetype
code
async (params, auths) => {
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
}
25
const {google} = require('googleapis')
const got = require('got');

// First, get a ReadableStream for the content of the URL you want to download
const urlResponse = await got.stream(params.fileURL)

const driveAuth = new google.auth.OAuth2()
driveAuth.setCredentials({ access_token: auths.google_drive.oauth_access_token })
const drive = await google.drive({ version: 'v3', auth: driveAuth });

this.uploadResponse = (await drive.files.create({
  resource: {
    name: params.filename,
    originalFilename: params.filename,
    parents: params.parents,
  },
  media: {
    mimeType: params.filetype,
    uploadType: "media",
    body: urlResponse,
  },
  fields: '*'
})).data
steps.
email_me
Customize and send an email to the email address you registered with Pipedream. The email will be sent by notifications@pipedream.com.
params
Subject
Zoom recording completed for meeting {{event.meeting_topic}}
string ·params.subject
Text
View the file here: {{steps.upload_url_content_to_folder.uploadResponse.webViewLink}}
string ·params.text
Optional
code
async params => {
1
2
3
4
5
6
7
8
9
10
11
12
}
13
const options = {
  subject: params.subject,
  text: params.text,
}
if (params.html) {
  options.html = params.html
}
if (params.include_collaborators) {
  options.include_collaborators = params.include_collaborators
}
$send.email(options)