-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathigdl-fb-tk.js
128 lines (92 loc) · 3.52 KB
/
igdl-fb-tk.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
const {zokou} = require('../framework/zokou');
const fs = require('fs');
const getFBInfo = require("@xaviabot/fb-downloader");
const { default: axios } = require('axios');
zokou({nomCom : "instagram" , categorie : "Download"},async (dest , zk , commandeOptions)=>{
const {ms,repondre,arg} = commandeOptions ;
let link = arg.join(' ')
if (!arg[0]) { repondre('Veillez insérer un lien video instagramme');return};
try {
let igvid = await axios('https://vihangayt.me/download/instagram?url='+link)
if (igvid.data.data.data[0].type == 'video') {
zk.sendMessage(dest,{video : {url : igvid.data.data.data[0].url},caption : "ig video downloader powered by *Bmw-Md*",gifPlayback : false },{quoted : ms})
}
else {
zk.sendMessage(dest,{image : {url : igvid.data.data.data[0].url},caption : "ig image downloader powered by *Bmw-Md*"})
}
} catch (e) {repondre("erreur survenue lors du téléchargement \n " + e)}
});
zokou({
nomCom: "facabook",
categorie: "Download",
reaction: "📽️"
},
async (dest, zk, commandeOptions) => {
const { repondre, ms, arg } = commandeOptions;
if (!arg[0]) {
repondre('Insert a public facebook video link!');
return;
}
const queryURL = arg.join(" ");
try {
getFBInfo(queryURL)
.then((result) => {
let caption = `
titre: ${result.title}
Lien: ${result.url}
`;
zk.sendMessage(dest,{image : { url : result.thumbnail}, caption : caption},{quoted : ms}) ;
zk.sendMessage(dest, { video: { url: result.hd }, caption: 'facebook video downloader powered by *Bmw-MD*' }, { quoted: ms });
})
.catch((error) => {console.log("Error:", error)
repondre('try fbdl2 on this link')});
} catch (error) {
console.error('Erreur lors du téléchargement de la vidéo :', error);
repondre('Erreur lors du téléchargement de la vidéo.' , error);
}
});
zokou({ nomCom: "tiktok", categorie: "Download", reaction: "🎵" }, async (dest, zk, commandeOptions) => {
const { arg, ms, prefixe,repondre } = commandeOptions;
if (!arg[0]) {
repondre(`how to use this command:\n ${prefixe}tiktok tiktok_video_link`);
return;
}
const videoUrl = arg.join(" ");
let data = await axios.get('https://vihangayt.me/download/tiktok?url='+ videoUrl) ;
let tik = data.data.data
// Envoi du message avec le thumbnail de la vidéo
const caption = `
Author: ${tik.author}
Description: ${tik.desc}
`;
zk.sendMessage(dest, { video: { url: tik.links[0].a} , caption : caption },{quoted : ms});
});
zokou({
nomCom: "facebook2",
categorie: "Download",
reaction: "📽️"
},
async (dest, zk, commandeOptions) => {
const { repondre, ms, arg } = commandeOptions;
if (!arg[0]) {
repondre('Insert a public facebook video link! !');
return;
}
const queryURL = arg.join(" ");
try {
getFBInfo(queryURL)
.then((result) => {
let caption = `
titre: ${result.title}
Lien: ${result.url}
`;
zk.sendMessage(dest,{image : { url : result.thumbnail}, caption : caption},{quoted : ms}) ;
zk.sendMessage(dest, { video: { url: result.sd }, caption: 'facebook video downloader powered by *Bmw-MD*' }, { quoted: ms });
})
.catch((error) => {console.log("Error:", error)
repondre(error)});
} catch (error) {
console.error('Erreur lors du téléchargement de la vidéo :', error);
repondre('Erreur lors du téléchargement de la vidéo.' , error);
}
});