Skip to content

Instantly share code, notes, and snippets.

@SaeedX302
Forked from tayyabali8677/M-Makki-gdrive-dl.js
Last active June 4, 2025 13:35
Show Gist options
  • Select an option

  • Save SaeedX302/72f7d8579fc1c3481bc617c88c007632 to your computer and use it in GitHub Desktop.

Select an option

Save SaeedX302/72f7d8579fc1c3481bc617c88c007632 to your computer and use it in GitHub Desktop.
Download gdrive file
const { bot, isUrl, getImgUrl } = require('../lib/')
bot(
{
pattern: 'mdrive ?(.*)',
desc: 'Download from Google Drive link',
type: 'download',
},
async (x, y) => {
y = y || x.reply_message.text;
if (!y || !y.includes('drive.google.com')) return await x.send('Example: mdrive <Google Drive URL>');
const z = y.match(/\/file\/d\/(.*?)\//);
if (!z) return await x.send('Invalid Google Drive link');
const a = z[1];
const b = `https://drive.google.com/uc?id=${a}&authuser=0&export=download`;
try {
await x.sendFromUrl(b, {
buffer: true,
caption: 'Developed By ╰°【〆༯𝙎ค૯𝙀𝘿】✘,【.ISHU.】╯ ',
});
} catch (c) {
await x.send('Failed to download the file. Please check the link.');
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment