MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / webp2mp4File

Function webp2mp4File

lib/uploader.js:60–96  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

58}
59
60function webp2mp4File(path) {
61 return new Promise((resolve, reject) => {
62 const form = new BodyForm()
63 form.append('new-image-url', '')
64 form.append('new-image', fs.createReadStream(path))
65 axios({
66 method: 'post',
67 url: 'https://s6.ezgif.com/webp-to-mp4',
68 data: form,
69 headers: {
70 'Content-Type': `multipart/form-data; boundary=${form._boundary}`
71 }
72 }).then(({ data }) => {
73 const bodyFormThen = new BodyForm()
74 const $ = cheerio.load(data)
75 const file = $('input[name="file"]').attr('value')
76 bodyFormThen.append('file', file)
77 bodyFormThen.append('convert', "Convert WebP to MP4!")
78 axios({
79 method: 'post',
80 url: 'https://ezgif.com/webp-to-mp4/' + file,
81 data: bodyFormThen,
82 headers: {
83 'Content-Type': `multipart/form-data; boundary=${bodyFormThen._boundary}`
84 }
85 }).then(({ data }) => {
86 const $ = cheerio.load(data)
87 const result = 'https:' + $('div#output > p.outfile > video > source').attr('src')
88 resolve({
89 status: true,
90 message: "Created By MRHRTZ",
91 result: result
92 })
93 }).catch(reject)
94 }).catch(reject)
95 })
96}
97
98async function floNime(medianya, options = {}) {
99const { ext } = await fromBuffer(medianya) || options.ext

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected