randydev commited on
Commit
d07479f
·
verified ·
1 Parent(s): 5e3cfba

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +7 -1
plugins/alldownloader.js CHANGED
@@ -710,6 +710,7 @@ AllDlRoutes.get('/api/v1/dl/tiktok-v2', authenticateApiKey, apiLimiter, async (r
710
  const db = dbClient.collection("api_keys");
711
  try {
712
  const apiKey = req.headers['x-api-key'];
 
713
  const keyDoc = await db.findOne({key: apiKey});
714
 
715
  if (!keyDoc) {
@@ -721,7 +722,12 @@ AllDlRoutes.get('/api/v1/dl/tiktok-v2', authenticateApiKey, apiLimiter, async (r
721
  return res.status(400).json({ error: "URL parameter is required." });
722
  }
723
 
724
- // await TelegramUseLog(keyDoc.owner, keyDoc.key, `Accessed: ${req.path}`);
 
 
 
 
 
725
 
726
  const results = await tiktokdl(url);
727
  res.json({ results });
 
710
  const db = dbClient.collection("api_keys");
711
  try {
712
  const apiKey = req.headers['x-api-key'];
713
+ const xRealIP = req.headers['x-real-ip'];
714
  const keyDoc = await db.findOne({key: apiKey});
715
 
716
  if (!keyDoc) {
 
722
  return res.status(400).json({ error: "URL parameter is required." });
723
  }
724
 
725
+ await TelegramUseLog(
726
+ keyDoc.owner,
727
+ keyDoc.key,
728
+ `Accessed: ${req.path}`,
729
+ xRealIP
730
+ );
731
 
732
  const results = await tiktokdl(url);
733
  res.json({ results });