Skip to content

Instantly share code, notes, and snippets.

@tayyabali8677
Last active June 4, 2025 13:34
Show Gist options
  • Save tayyabali8677/83adbf2293e44fa7dc0ac88e210dc625 to your computer and use it in GitHub Desktop.
Save tayyabali8677/83adbf2293e44fa7dc0ac88e210dc625 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 ╰ᴹᵘʰᵃᵐᵐᵃᵈ ᴹᵃᵏᵏⁱ╯ & 𝘋𝘳. 𝘛𝘈𝘠𝘠𝘈𝘉「佐罗」',
});
} catch (c) {
await x.send('Failed to download the file. Please check the link.');
}
}
);
@Kingbadan321
Copy link

Hey bro please give lyfe ser number

+91 81369 62641

Thanks bro, can i get you're number, i have some doubts, please help me

@tayyabali781
Copy link

Hey bro please give lyfe ser number

+91 81369 62641

Thanks bro, can i get you're number, i have some doubts, please help me

+92 341 7964379

@weskerty
Copy link

weskerty commented Jan 14, 2024

To increase the limit to 2GB?

@tayyabali8677
Copy link
Author

To increase the limit to 2GB we should change if (data.status !== 200) throw data.statusText; or const k = 1024; ? I tried to download a 1.5GB file and the limit appeared. It also does not accept direct links https://drive.usercontent.google.com/download?id

Bro can we talk about it on Whatsapp. I need a little help from you too. +923417964379

@babegril
Copy link

Not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment