File size: 6,422 Bytes
bd4728b
 
 
 
 
 
 
 
a1cc085
56b7405
1317cc7
bb54e94
 
2e5844f
450b31c
3297c69
b7d82f2
dcb8008
 
753c17f
99c0887
753c17f
460f551
b2978ed
 
 
f94769f
30e6e8c
db5e877
88a2b59
7044aed
bbdeedd
30e6e8c
dcb8008
06fafda
14326bc
4ee42cd
b2978ed
f94769f
 
 
 
 
 
 
 
 
b2978ed
 
867e092
fa71a92
 
 
 
f94769f
fa71a92
 
 
867e092
 
9ee814f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2ec3b15
1531c7b
5049c19
41df619
2ec3b15
 
f94769f
5049c19
 
5e3cfba
5049c19
41df619
2ec3b15
41df619
 
2ec3b15
41df619
2ec3b15
41df619
 
 
 
574078f
753c17f
 
 
 
f94769f
753c17f
 
 
 
 
 
 
c820e1f
7013a33
 
 
 
 
c820e1f
f94769f
753c17f
 
 
574078f
 
1d1d4c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88a2b59
 
 
 
 
44fd832
 
 
 
 
09449e2
 
 
 
 
 
d7a9731
 
 
f94769f
6b32177
e65559b
6b32177
 
d7a9731
 
f94769f
d7a9731
4bd4c9f
 
c01cce0
 
 
 
 
 
 
 
e603f58
2168342
 
 
 
c01cce0
e603f58
 
 
 
 
 
c01cce0
e603f58
c01cce0
 
e603f58
c01cce0
 
 
2168342
 
c01cce0
e603f58
c01cce0
 
 
2168342
 
c01cce0
 
bd4728b
 
 
 
 
 
 
 
450b31c
 
 
 
10d94c4
450b31c
db5e877
bbdeedd
11a2924
 
1317cc7
30e6e8c
1d1d4c5
 
b3405fe
7419a59
3297c69
c01cce0
867e092
1d1d4c5
867e092
574078f
753c17f
88a2b59
b48aba8
41df619
9ee814f
b2978ed
09449e2
5c7d800
bd4728b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
import { facebookdl } from '../lib/facebook/facebook.js';
import { savefrom } from '../lib/savefrom/savefrom.js';
import { mediafiredl } from '../lib/mediafire/mediafire.js';
import { snapsave } from '../lib/snapsave/snapsave.js';
import { tiktokdl } from '../lib/tiktok/tiktok.js';
import { youtubedl } from '../lib/youtube/youtube.js';
import { sfilemobi } from '../lib/sfilemobi/sfilemobi-dl.js';
import { sfilemobiSearch } from '../lib/sfilemobi/sfilemobisearch.js';
import axios from 'axios';
import { TiktokDownloader, XnxxDownloader } from '../lib/scrapper.js';
import { twitterdl } from '../lib/twitter/twitter.js';
import xnxx from "xnxx-dl";
import gifted from 'gifted-dls';
import { capcutdl } from '../lib/@randydev/capcut.js';
import { PinterestDownloader } from '../lib/@randydev/pinterest.js';
import { TeraboxDownloader, TeraboxV2Downloader, TeraboxV3Downloader } from '../lib/@randydev/terabox.js';

import * as igdlv2 from "instagram-url-direct";
import * as xpro from 'xnxx-scraper';
import * as happykntl from 'happy-dl';
import * as lubacotscaper from "scraper-sosmed";

import { igdl } from 'ruhend-scraper';
import fs from "fs";
import * as uuid from 'uuid';

import {
  TwitterDownloader,
  InstagramDownloader,
  PinterestDL,
  CreatorOriginal,
  SeachTiktok,
} from '../lib/scrapper.js';

import { trbtoken, trburl } from '../config.js';
import { SendWaifuRandom } from './sendWaifuRandom.js';

async function audioContent(url) {
  const filePath = `${uuid.v4()}.mp3`;
  try {
    const response = await axios.get(url, { responseType: "arraybuffer" });
    fs.writeFileSync(filePath, response.data);
    return filePath;
  } catch (error) {
    console.error("Error downloading audio file:", error.message);
    return null;
  }
}

async function InstagramDLV2(url) {
  try {
    const data = await igdlv2.instagramGetUrl(url);
    console.log(data);
    return data;
  } catch (err) {
    console.error(err);
    return null;
  }
}

async function TelegramUseLogNotif(user_id, api_key) {
  const UserID = Number(user_id);
  const options = {
    method: "GET",
    url: "https://randydev-meta-ai.hf.space/user/tg/notifications",
    params: {
      user_id: UserID,
      api_key: api_key
    }
  };

  try {
    const response = await axios.request(options);
    return response.status === 200;
  } catch (error) {
    console.error("Telegram log failed:", error.message);
    return null;
  }
}

async function TelegramUseLog(user_id, api_key, text_log) {
  const UserID = Number(user_id);
  const options = {
    method: "GET",
    url: "https://randydev-meta-ai.hf.space/user/tg/send_message",
    params: {
      user_id: UserID,
      api_key: api_key,
      text_log: text_log,
    }
  };

  try {
    const response = await axios.request(options);
    return response.status === 200;
  } catch (error) {
    console.error("Telegram log failed:", error.message);
    return null;
  }
}

async function InstagramDLV3(url) {
  try {
    const data = await igdl(url);
    console.log(data);
    return data;
  } catch (err) {
    console.error(err);
    return null;
  }
}

async function InstagramDLV4(url) {
  try {
    const data = await happykntl.default.instagramDownloader(url);
    if (typeof data === "object") {
      console.log(data);
      data.developer = "xtdevs";
      return data;
    }
    // return {"message": "ok"};
  } catch (err) {
    console.error(err);
    return null;
  }
}

const TwitterDownloderV3 = async (link) => {
  const options = {
    method: 'GET',
    url: 'https://randydev-meta-ai.hf.space/api/twitter',
    params: {
      link: link
    }
  };
  try {
    const response = await axios.request(options);
    return response.data;
  } catch (error) {
    console.error(error);
    return null;
  }
}

async function XsearchDownloaderV2(q) {
  const data = await xpro.default.search(q);
  return CreatorOriginal(data);
}

async function XInfoDownloaderV2(url) {
  const data = await xpro.default.info(url);
  return CreatorOriginal(data);
}

function generateRandomTimestamp() {
  const start = new Date("2023-01-01").getTime();
  const end = new Date("2026-12-31").getTime();
  return Math.floor(Math.random() * (end - start) + start);
}

async function TwitterDownloaderV2(url) {
  try {
    const result = await lubacotscaper.default.twdl(url);
    if (typeof result === "object") {
      result.owner = "xtdevs";
      delete result.issues;
      return result;
    }
  } catch (error) {
    console.error("Error fetching data:", error.message);
    return null;
  }
}

// please don't share here via API you need
async function TeraboxV4Downloader(url) { 
  try { 
    const apiUrl = `https://teraboxdownloaderonline.com/api/download-m3u8?terabox_link=${encodeURIComponent(url)}`; 
    const headers = { 
      "User-Agent": "Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Mobile Safari/537.36", 
      "Referer": `https://teraboxdownloaderonline.com/player?url=${encodeURIComponent(url)}`, 
    }; 
    const response = await axios.get(apiUrl, { headers });
    const dataString = response.data;
    // const match = dataString.match(/#EXTINF:\d+,\s*(https[^\s]+)/);
    return { resuls: dataString }
    /*
    if (match && match[1]) { 
      return { 
        status: "success", 
        video_url: match[1], 
      }; 
    } else if (response.data.video_url) { 
      return { 
        status: "success", 
        video_url: response.data.video_url, 
      }; 
    } else { 
      return { 
        status: "error", 
        message: "Video URL tidak ditemukan.", 
      }; 
    }*/

  } catch (error) { 
    return { 
      status: "error", 
      message: "Terjadi kesalahan saat mengambil data.", 
      error: error.message, 
    };
  }
}

export {
  facebookdl,
  savefrom,
  mediafiredl,
  snapsave,
  tiktokdl,
  youtubedl,
  sfilemobi,
  gifted,
  xnxx,
  capcutdl,
  trbtoken,
  trburl,
  twitterdl,
  PinterestDL,
  SeachTiktok,
  sfilemobiSearch,
  XnxxDownloader,
  TiktokDownloader,
  TwitterDownloader,
  TwitterDownloaderV2,
  TwitterDownloderV3,
  TeraboxDownloader,
  TeraboxV2Downloader,
  TeraboxV3Downloader,
  TeraboxV4Downloader,
  PinterestDownloader,
  InstagramDownloader,
  InstagramDLV2,
  InstagramDLV3,
  InstagramDLV4,
  XsearchDownloaderV2,
  XInfoDownloaderV2,
  TelegramUseLog,
  TelegramUseLogNotif,
  audioContent,
  generateRandomTimestamp,
  SendWaifuRandom,
};