𝐃𝐀𝐑𝐑𝐄𝐋𝐋 𝐌𝐔𝐂𝐇𝐄𝐑𝐈 ⚡ commited on
Commit
618501b
·
unverified ·
1 Parent(s): 358e549

Update dl-mediafire.js

Browse files
Files changed (1) hide show
  1. plugins/dl-mediafire.js +4 -69
plugins/dl-mediafire.js CHANGED
@@ -55,11 +55,11 @@ cmd({
55
  try {
56
  const text = body.trim().replace(command, '').trim();
57
  if (!text) return reply(`*Example*: ${command} https://www.mediafire.com/file/n6tgcrktbnov1oy/Queen_Anita-V4.zip/file`);
58
-
59
- await reply('> *Subzero Processing...*');
60
 
61
  const apiUrl = `https://api.davidcyriltech.my.id/mediafire?url=${encodeURIComponent(text)}`;
62
-
63
  let retries = 0;
64
  const maxRetries = 3;
65
  const retryDelay = 500; // 500ms
@@ -76,7 +76,7 @@ cmd({
76
  document: { url: downloadLink },
77
  mimetype: mimeType,
78
  fileName: fileName,
79
- caption: `📦 *File Name:* ${fileName}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴍʀ ғʀᴀɴᴋ`
80
  }, { quoted: m });
81
  return;
82
  } else {
@@ -101,68 +101,3 @@ cmd({
101
  reply(`*An error occurred while processing your request. Please try again later.*\n\nError details: ${error.message}\n${error.stack}`);
102
  }
103
  });
104
-
105
-
106
- /*cmd({
107
- pattern: 'mediafirepro',
108
- desc: 'Download MediaFire files',
109
- category: 'download',
110
- filename: __filename
111
- }, async (conn, mek, m, {
112
- body,
113
- from,
114
- quoted,
115
- isCmd,
116
- command,
117
- args,
118
- q,
119
- isGroup,
120
- sender,
121
- senderNumber,
122
- botNumber2,
123
- botNumber,
124
- pushname,
125
- isMe,
126
- isOwner,
127
- groupMetadata,
128
- groupName,
129
- participants,
130
- groupAdmins,
131
- isBotAdmins,
132
- isAdmins,
133
- reply
134
- }) => {
135
- try {
136
- const text = body.trim().replace(command, '').trim();
137
- if (!text) return reply(`*Example*: ${command} https://www.mediafire.com/file/n6tgcrktbnov1oy/Queen_Anita-V4.zip/file`);
138
-
139
- await reply('> *Processing...*');
140
-
141
- const apiUrl = `https://api.davidcyriltech.my.id/mediafire?url=${encodeURIComponent(text)}`;
142
-
143
- try {
144
- const apiResponse = await axios.get(apiUrl);
145
- console.log('API response:', apiResponse);
146
-
147
- if (apiResponse.data && apiResponse.data.downloadLink) {
148
- const { fileName, mimeType, downloadLink } = apiResponse.data;
149
-
150
- await conn.sendMessage(m.chat, {
151
- document: { url: downloadLink },
152
- mimetype: mimeType,
153
- fileName: fileName,
154
- caption: `📦 *File Name:* ${fileName}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ ᴅᴀᴠɪᴅ ᴄʏʀɪʟ ᴛᴇᴄʜ`
155
- }, { quoted: m });
156
- } else {
157
- reply(`*Failed to fetch file details! Please check the MediaFire URL and try again.*`);
158
- }
159
- } catch (error) {
160
- console.error('Error fetching API response:', error);
161
- reply(`*Error fetching API response: ${error.message}*`);
162
- }
163
- } catch (error) {
164
- console.error('Error during MediaFire command:', error);
165
- reply(`*An error occurred while processing your request. Please try again later.*\n\nError details: ${error.message}\n${error.stack}`);
166
- }
167
- });
168
- */
 
55
  try {
56
  const text = body.trim().replace(command, '').trim();
57
  if (!text) return reply(`*Example*: ${command} https://www.mediafire.com/file/n6tgcrktbnov1oy/Queen_Anita-V4.zip/file`);
58
+ console.log(text);
59
+ await reply('> *Processing...*');
60
 
61
  const apiUrl = `https://api.davidcyriltech.my.id/mediafire?url=${encodeURIComponent(text)}`;
62
+ console.log(apiUrl);
63
  let retries = 0;
64
  const maxRetries = 3;
65
  const retryDelay = 500; // 500ms
 
76
  document: { url: downloadLink },
77
  mimetype: mimeType,
78
  fileName: fileName,
79
+ caption: `📦 *File Name:* ${fileName}\n\n> ᴘᴏᴡᴇʀᴇᴅ ʙʏ sᴜʙᴢᴇʀᴏ ᴍᴅ`
80
  }, { quoted: m });
81
  return;
82
  } else {
 
101
  reply(`*An error occurred while processing your request. Please try again later.*\n\nError details: ${error.message}\n${error.stack}`);
102
  }
103
  });