ryu-js / lib /all.js
randydev's picture
Update lib/all.js
9ee814f verified
raw
history blame
5.18 kB
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;
}
}
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,
PinterestDownloader,
InstagramDownloader,
InstagramDLV2,
InstagramDLV3,
InstagramDLV4,
XsearchDownloaderV2,
XInfoDownloaderV2,
TelegramUseLog,
TelegramUseLogNotif,
audioContent,
generateRandomTimestamp,
SendWaifuRandom,
};