Google Drive Access and API

86 Views Asked by At

I have been trying to understand how Access to Google Drive works. I have seen websites that embed Videos from their Google Drive account, but that link expires, something like below:

https://storage.googleapis.com/lucky-union-315809/BHWDLNDIA7KC/24d_1625365896_262739.mp4

How can I create similar links to my Video files in Google Drive, where I dont show direct link to video, but similar link above that automatically expires after a while, I also want to generate similar links with PHP on the fly. I spent almost 3 hours but I couldn't even reach the starting point. Is there any PHP script that accesses Google Drive and generate such links ? even if its paid, OR where to get started as I am totally confused, I created an API under my Google Drive Account, and if I click click on Video -> Share, it gives me a direct link to the video, which can be shared but is permanent, I want a link that automatically generated with my API and expires after a while. Please guide me what should I look for, is there any such SDK or how to achieve this ? thanks

EDITED: see below is an example, following url worked for sometime, next time when I check the links was different but same file:

Initial link..

https://storage.googleapis.com/earnest-diagram-316509/GCV266V2PRI/23d_1625329229_264852.mp4

After some time, a new link to same video..

https://storage.googleapis.com/dotted-medley-315816/UUZSFE4NFD62/22d_1625383635_264852.mp4

0

There are 0 best solutions below