media-downloader-ez
v2.0.3
Published
download videos from URLs and autocrop (Instagram, YouTube, TikTok, X, etc.) to send directly to Discord or other!
Downloads
78
Maintainers
Readme
media-downloader-ez
A npm package to download video from url (insta, youtube, tiktok, X...) .
Autocrop : auto crop video to remove black bars
Supporting videos :
facebook, tiktok, twitter, instagram, youtube, pinterest, gdrive, capcut, likee, threads
Exemple ez
const MediaDownloader = require('media-downloader-ez');
let url = "http://"
MediaDownloader(url, {autocrop: true}); // auto crop black bars (like tiktok, or insta videos)
Exemple for discord js :
const MediaDownloader = require('media-downloader-ez');
const Discord = require('discord.js-v11-stable');
const client = new Discord.Client({
disableEveryone: true
});
client.on('message', async (message) => {
try {
if(message.content.startsWith('!download') && message.content.includes('http')){
let attachment = await MediaDownloader(message.content, {autocrop: true});
message.channel.send({ content: `Téléchargé par: \`${message.author.username}\``, files: [attachment] });
}
} catch (error) {
console.error('Erreur lors du téléchargement de la vidéo :', error);
message.reply('Une erreur est survenue lors du téléchargement de la vidéo.').then((m) => { deleteMessage(m); });
}
});
client.login("your token").catch((err) => {
console.log('INCORECT TOKEN LOGIN !')
})
Only safe links :
if (MediaDownloader.isVideoLink(url)) {
let attachment = await MediaDownloader(url, {autocrop: true});
}