Stream from GDrive link in your favourite video player using your GDrive API_KEY.
- file_id from GDrive link.
- api_key from your Google Cloud Console.
- file_id can be obtained:
- from a GDrive link which is already publicly (or)
- by making a shareable link from a your GDrive
- For example, here,
https://drive.google.com/open?id=1hpBqbuHQr6UhVawkcsANAe63P70s9Ycu
1hpBqbuHQr6UhVawkcsANAe63P70s9Ycu is the file_id.
api_key can be obtained from Google Cloud Console. Following pictures guide you on how to get api_key:
-
Go to Google Cloud Console and create a new project.
-
Copy and save the api_key somewhere.
This is where you obtain the streamable link. As this is my first project, I thought of writing it in python with just two functions. That is print
and input
. You can get the py from here
prompt = "Enter your file_id:"
file_id = input(prompt)
prompt = "Enter your api_key:"
api_key = input(prompt)
print(f"https://www.googleapis.com/drive/v3/files/{file_id}/?key={api_key}&alt=media")
Thanks to Yuno.