Skip to content

Commit

Permalink
Create mediafire.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SkulZOnTheYT authored Nov 16, 2023
1 parent 696330c commit 56dcd2c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions plugins/download/mediafire.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { niceBytes } from '../../lib/func.js';

let handler = async (m, { conn, text, usedPrefix, command }) => {
try{
let anu = await (await fetch(`https://oni-chan.my.id/api/download/mediafire-dl?url=${text}`)).json();
let data = anu.link;
let url = data;
if (data.fileSize > 400000) return m.reply(`Filesize: ${data.fileSizeH}\nTidak dapat mengirim, maksimal file 400 MB`);
let txt = `*${anu.name}*\n\n`
+ `⭔ Extension : ${anu.ext}\n`
+ `⭔ Size : ${anu.size}`
await conn.sendFile(m.chat, url, txt, m)
} catch (e) {
console.log(e);
throw 'invalid url / server down.';
}
};

handler.help = ['mediafire <url>', 'mediafiredl <url>'];
handler.tags = ['download'];
handler.command = /^(mediafire(dl)?(ext|file)?)$/i;
handler.premium = false;
handler.limit = true;

export default handler;

0 comments on commit 56dcd2c

Please sign in to comment.