ilhamdev commited on
Commit
f651013
·
verified ·
1 Parent(s): 28cb668

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +8 -2
index.js CHANGED
@@ -266,7 +266,7 @@ async function fileDitch(media, ext){
266
 
267
  form.append("files[]", media, `${Date.now()}.${ext ? ext : mime?.ext || "bin"}`)
268
 
269
- axios.post("https://up1.fileditch.com/temp/upload.php", form, {
270
  headers: {
271
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
272
  "accept": "*/*",
@@ -282,7 +282,13 @@ async function fileDitch(media, ext){
282
  "Referrer-Policy": "strict-origin-when-cross-origin",
283
  ...form.getHeaders()
284
  }
285
- }).then(async ({ data }) => { console.log(data); return data?.files[0]?.url}).catch(e => {return null})
 
 
 
 
 
 
286
  //https://up1.fileditch.com/upload.php
287
  }
288
  async function ytAPI(url) {
 
266
 
267
  form.append("files[]", media, `${Date.now()}.${ext ? ext : mime?.ext || "bin"}`)
268
 
269
+ let {data } = await axios.post("https://up1.fileditch.com/temp/upload.php", form, {
270
  headers: {
271
  "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36",
272
  "accept": "*/*",
 
282
  "Referrer-Policy": "strict-origin-when-cross-origin",
283
  ...form.getHeaders()
284
  }
285
+ })
286
+ console.log(data)
287
+ if (data?.files[0]?.url) {
288
+ return data?.files[0]?.url
289
+ } else {
290
+ return data
291
+ }
292
  //https://up1.fileditch.com/upload.php
293
  }
294
  async function ytAPI(url) {