Update index.js
Browse files
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 |
-
|
| 313 |
-
|
|
|
|
| 314 |
return res.json({
|
| 315 |
-
result: data
|
| 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 |
-
|
|
|
|
| 329 |
return res.json({
|
| 330 |
-
result: data
|
| 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);
|