Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Google Drive File Downloader</title>
- <style>
- body {
- font-family: Arial, sans-serif;
- max-width: 600px;
- margin: 20px auto;
- text-align: center;
- }
- textarea {
- width: 100%;
- height: 100px;
- margin-bottom: 10px;
- padding: 10px;
- border: 1px solid #ddd;
- border-radius: 4px;
- resize: vertical;
- }
- button {
- background-color: #4285f4;
- color: white;
- border: none;
- padding: 10px 20px;
- border-radius: 4px;
- cursor: pointer;
- }
- button:hover {
- background-color: #357ae8;
- }
- </style>
- </head>
- <body>
- <h1>Google Drive File Downloader</h1>
- <p>Paste Google Drive file link:</p>
- <textarea
- id="fileLink"
- placeholder="https://drive.google.com/file/d/FILE_ID/view?usp=sharing"
- ></textarea>
- <br />
- <button onclick="downloadFile()">Download</button>
- <script>
- function extractFileId(link) {
- const match = link.match(/\/d\/([^/]+)/);
- return match ? match[1] : null;
- }
- function downloadFile() {
- const input = document.getElementById("fileLink").value.trim();
- const fileId = extractFileId(input);
- if (!fileId) {
- alert("Invalid Google Drive link!");
- return;
- }
- const downloadUrl = `https://cors-proxy-l1ru.onrender.com/download?fileId=${fileId}`;
- window.open(downloadUrl, "_blank");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement