5

It's known that by simply retrieving a Google API key that one can download any file (of any size) directly (and even embed a video to a website etc...), the problem is: when using the standard Google API URL in the form:

https://www.googleapis.com/drive/v3/files/### fileId ###?alt=media&key=### API key ### inserting the file ID and API key in place.

This works if I want to embed, lets say, a video already in .mp4 format, but lets say if I want to embed a .mpg video to an HTMLwebsite: by default, the .mpg format is not embeddable, but its known that Google Drive automatically converts all of its video files into various formats that cna be played in the browser, so:

How can I access the different video formats of a video in Google Drive? Preferably, I'm looking for a programmatic way to get it (like Node.js or PHP).

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449

2 Answers2

0

You need to integrate your Google Drive with Cloud Convert (this is a manual job) https://zapier.com/apps/cloudconvert/integrations/google-drive

OR

You can make use of Integromat to do it for you (it comes with various automation scripts) https://www.integromat.com/en/integrations/cloudconvert/google-drive

Once done - you can consume Cloud Convert's APIs using nodejs, php, python, angular etc. https://cloudconvert.com/api/v1/
(The free plan supports max 1GB file conversion per session)


Most Important - The API has Google Cloud Integration
https://cloudconvert.com/api/v1/googlecloud


Converters:
Cloud Convert for php
https://github.com/cloudconvert/cloudconvert-php

Cloud Convert for nodejs
https://github.com/cloudconvert/cloudconvert-node


Hope that's a good starting point for you..

abhijat_saxena
  • 705
  • 5
  • 20
0

I think this is a classic x\y problem. https://meta.stackexchange.com/questions/66377/what-is-the-xy-problem You want access to auto converted, embeddable videos AND you want it using a specific tool -- but the tool isn't the right tool because it doesn't do that.

So, forget about the tool, and focus on the problem: there are two other Google services that auto convert video and allow embedding: YouTube, and Google photos.

Photos is interesting because if you can choose "high quality" or original storage, where high quality converts almost anything to an embeddable, web friendly format. YouTube, of course, also makes it easy to convert and embed.

On the photos side, downloading is natively available, and on the YouTube side, there are numerous sites that will provide a download link to your video in a variety of formats.

So, if you really don't want to use ffmpeg* or other standard conversion tools, I'd look into the APIs of the other two mentioned services.

*Unless you are doing a large volume of conversions, you could do this via a free tier node\firebase project.

ultraGentle
  • 5,084
  • 1
  • 19
  • 45
  • is it legal to download a direct link from youtube? If so can you post the legal solution in the answer? and you say by photos"downloading is natively available" -- even programmatically? Can you prove a code example? – B''H Bi'ezras -- Boruch Hashem Apr 30 '20 at 06:22