Last active
October 22, 2020 17:42
-
-
Save py7hon/ef2618fa5fe8783268bca5d1c75552cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($_GET['id'] == ""){ | |
http_response_code(404); | |
die("ID Not Found"); | |
} else { | |
$drive_id = $_GET['id']; | |
$apikey = "AIzaSyBPO_VhHtvTL-gs35Nb24cSsjuxQasjlN0"; | |
$data = json_decode(file_get_contents("https://www.googleapis.com/drive/v2/files/$drive_id?supportsTeamDrives=true&key=$apikey"), true); | |
$mime = $data["mimeType"]; | |
$link = file_get_contents("https://www.googleapis.com/drive/v3/files/$drive_id?key=$apikey&supportsTeamDrives=true&alt=media"); | |
header('Content-type: $mime'); | |
http_response_code(200); | |
echo $link; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment