randydev commited on
Commit
e39bc94
·
verified ·
1 Parent(s): a1cc085

Update plugins/alldownloader.js

Browse files
Files changed (1) hide show
  1. plugins/alldownloader.js +4 -1
plugins/alldownloader.js CHANGED
@@ -23,6 +23,7 @@ import {
23
  InstagramDLV4,
24
  XInfoDownloaderV2,
25
  SeachTiktok,
 
26
  } from '../lib/all.js';
27
 
28
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
@@ -704,12 +705,14 @@ AllDlRoutes.get('/api/v1/dl/tiktok', authenticateApiKey, apiLimiter, async (req,
704
  */
705
  AllDlRoutes.get('/api/v1/dl/tiktok-v2', authenticateApiKey, apiLimiter, async (req, res) => {
706
  try {
 
 
707
  const url = req.query.url;
708
 
709
  if (!url) {
710
  return res.status(400).json({ error: "URL parameter is required." });
711
  }
712
-
713
  const results = await tiktokdl(url);
714
  res.json({ results });
715
  } catch (error) {
 
23
  InstagramDLV4,
24
  XInfoDownloaderV2,
25
  SeachTiktok,
26
+ TelegramUseLog,
27
  } from '../lib/all.js';
28
 
29
  import { authenticateApiKey, apiLimiter } from '../middleware/midware.js';
 
705
  */
706
  AllDlRoutes.get('/api/v1/dl/tiktok-v2', authenticateApiKey, apiLimiter, async (req, res) => {
707
  try {
708
+ const apiKey = req.headers['x-api-key'];
709
+ const keyData = await ApiKey.findOne({ key: apiKey });
710
  const url = req.query.url;
711
 
712
  if (!url) {
713
  return res.status(400).json({ error: "URL parameter is required." });
714
  }
715
+ await TelegramUseLog(keyData.user_id, keyData.key, req.path)
716
  const results = await tiktokdl(url);
717
  res.json({ results });
718
  } catch (error) {