Advertisement
pvcodes

Untitled

Mar 18th, 2025
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.53 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.     <head>
  4.         <meta charset="UTF-8" />
  5.         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6.         <title>Google Drive File Downloader</title>
  7.         <style>
  8.             body {
  9.                 font-family: Arial, sans-serif;
  10.                 max-width: 600px;
  11.                 margin: 20px auto;
  12.                 text-align: center;
  13.             }
  14.             textarea {
  15.                 width: 100%;
  16.                 height: 100px;
  17.                 margin-bottom: 10px;
  18.                 padding: 10px;
  19.                 border: 1px solid #ddd;
  20.                 border-radius: 4px;
  21.                 resize: vertical;
  22.             }
  23.             button {
  24.                 background-color: #4285f4;
  25.                 color: white;
  26.                 border: none;
  27.                 padding: 10px 20px;
  28.                 border-radius: 4px;
  29.                 cursor: pointer;
  30.             }
  31.             button:hover {
  32.                 background-color: #357ae8;
  33.             }
  34.         </style>
  35.     </head>
  36.     <body>
  37.         <h1>Google Drive File Downloader</h1>
  38.         <p>Paste Google Drive file link:</p>
  39.         <textarea
  40.             id="fileLink"
  41.             placeholder="https://drive.google.com/file/d/FILE_ID/view?usp=sharing"
  42.         ></textarea>
  43.         <br />
  44.         <button onclick="downloadFile()">Download</button>
  45.  
  46.         <script>
  47.             function extractFileId(link) {
  48.                 const match = link.match(/\/d\/([^/]+)/);
  49.                 return match ? match[1] : null;
  50.             }
  51.  
  52.             function downloadFile() {
  53.                 const input = document.getElementById("fileLink").value.trim();
  54.                 const fileId = extractFileId(input);
  55.  
  56.                 if (!fileId) {
  57.                     alert("Invalid Google Drive link!");
  58.                     return;
  59.                 }
  60.  
  61.                 const downloadUrl = `https://cors-proxy-l1ru.onrender.com/download?fileId=${fileId}`;
  62.                 window.open(downloadUrl, "_blank");
  63.             }
  64.         </script>
  65.     </body>
  66. </html>
  67.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement