ilhamdev commited on
Commit
cb87e78
·
verified ·
1 Parent(s): b045f37

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +7 -5
index.js CHANGED
@@ -309,10 +309,11 @@ const app = express()
309
  let regex = /https?:\/\/(www\.|v(t|m|vt)\.|t\.)?tiktok\.com/;
310
  if (!regex.test(url)) return res.json({ message: 'Invalid URL' });
311
  let data = await fetch(`https://tikwm.com/api/?url=` + url)
312
- console.log(data.json())
313
- if (!data.json()) return res.json({ message: 'API TO API KOID:v' });
 
314
  return res.json({
315
- result: data?.json()
316
  })
317
  } catch (e) {
318
  console.log(e);
@@ -325,9 +326,10 @@ const app = express()
325
  let regex = /https:\/\/pin\.it\/\w+|https:\/\/[a-z]{2}\.pinterest\.com\/pin\/\d+/;
326
  if (!regex.test(url)) return res.json({ message: 'Invalid URL' });
327
  let data = await fetch(`https://pinterestdownloader.io/id/frontendService/DownloaderService?url=` + url)
328
- if (!data.json()) return res.json({ message: 'API TO API KOID:v' });
 
329
  return res.json({
330
- result: data.json()
331
  })
332
  } catch (e) {
333
  console.log(e);
 
309
  let regex = /https?:\/\/(www\.|v(t|m|vt)\.|t\.)?tiktok\.com/;
310
  if (!regex.test(url)) return res.json({ message: 'Invalid URL' });
311
  let data = await fetch(`https://tikwm.com/api/?url=` + url)
312
+ data = await data.json()
313
+ console.log(data)
314
+ if (!data) return res.json({ message: 'API TO API KOID:v' });
315
  return res.json({
316
+ result: await data
317
  })
318
  } catch (e) {
319
  console.log(e);
 
326
  let regex = /https:\/\/pin\.it\/\w+|https:\/\/[a-z]{2}\.pinterest\.com\/pin\/\d+/;
327
  if (!regex.test(url)) return res.json({ message: 'Invalid URL' });
328
  let data = await fetch(`https://pinterestdownloader.io/id/frontendService/DownloaderService?url=` + url)
329
+ data = await data.json()
330
+ if (!data) return res.json({ message: 'API TO API KOID:v' });
331
  return res.json({
332
+ result: data
333
  })
334
  } catch (e) {
335
  console.log(e);