Uploading Zoom recordings to google Drive

Description
I use this code to try upload from recording zoom download_url to Google Drive using the GDrive API

$token=$this->zoom->get_zoom_token();
$file_path = "https://mydomain.zoom.us/rec/download/largecode?access_token=$token";
$topic='Video example';
$filename = $topic. '.' . 'mp4';

// drive service
$file = new Google_Service_Drive_DriveFile();
$file->setName($filename);
// dir
$file->setParents(array("1vBEW6cY47Fip3cTY5..."));

// upload
$service->files->create(
	$file,
	array(
	'data' => $file_path,
	'mimeType' => $mimeType,
	'uploadType' => 'resumable'
 )
);

// status
$DateTime = new DateTime();
$now = $DateTime->format("Y-m-d H:i:s");
echo $now.' Upload OK :: '.$filename.PHP_EOL;

Error
The video size is 143MB (30min aprox), but in the GDrive the size is much less, when I download and reproduce, the video works but like a streaming (reproduce it only with an internet connection). I need to upload the entire file.

Which App Type (OAuth / Chatbot / JWT / Webhook)?
Knowing the endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

OAuth

Which Endpoint/s?
Knowing the API endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.

To get the recordings information:
'GET', "/v2/users/$user_id/recordings?from=$from&to=$to&page_size=$size&next_page_token="

To get the zoom oauth token for the download_url:

public function get_zoom_token() {
        $this->refresh_token();
		$arr_token = $this->get_access_token();
        return $arr_token->access_token;        		

    }

	private function refresh_token()
	{
		$refresh_token = $this->get_refresh_token();
		
		try {
			$response = $this->client->request('POST', '/oauth/token', [
				"headers" => [
					"Authorization" => "Basic ". base64_encode($this->config->item('CLIENT_ID').':'.$this->config->item('CLIENT_SECRET'))
				],
				'form_params' => [
					"grant_type" => "refresh_token",
					"refresh_token" => $refresh_token
				],
			]);
			$access_token = json_decode($response->getBody()->getContents(), true);
            $this->set_access_token(json_encode($access_token));
		}
		catch(Exception $e) {
			 return false;
		}
	}

Why I can’t upload the complete file?

I hope your help, let me know if you need more information

Thanks in advance

Hi @app2,

Thank you for reaching out about this.

To clarify, is the issue you’re running into that you’re trying to upload a Zoom Recording file to Google Drive, but the Zoom file exceeds the file size requirements of Google Drive? Let me know if I’m misunderstanding!

If I’m understanding correctly, I should note that it’s not possible to adjust the size of the zoom recording file. Recording files must be downloaded directly, in one file. If you need to reduce the size of the file for compatibility with Google Drive, you will need to compress the file after downloading from Zoom.

Let me know if this helps to clarify.

Thanks,
Will

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.