Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
"recievingFromBot_id": "886331989043609620",
"chromePath": "C:/Program Files/Google/Chrome/Application/chrome.exe",
"headless": false,
"optimize": true,
"golden_code_channels": ["975328045865009162"],
"useragent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36",
"selectors": {
Expand Down
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async function run() {
fs.readdirSync('./cookies').filter(filename => filename.endsWith('.json')).forEach(async filename => {
let context = await browser.createIncognitoBrowserContext();
let page = await context.newPage();
await optimize(page);
contextArr.push(context);
pagesArr.push(page);
await page.setCookie(...require(`./cookies/${filename}`));
Expand Down Expand Up @@ -112,6 +113,7 @@ const findRecaptchaClients = () => {
const claimDaily = async (context) => {
console.log('[Daily] Claiming daily case');
let dailyPage = await context.newPage();
await optimize(dailyPage);
await dailyPage.goto("https://key-drop.com/en/Daily_free");
console.log('[Daily] Successfully reached daily page');
await dailyPage.waitForSelector(config.selectors.daily_open);
Expand Down Expand Up @@ -334,4 +336,16 @@ Discord.Message.prototype.getCode = function() {
return false;
}

run();
const optimize = async (page) => {
if (!config.optimize) return;
await page.setRequestInterception(true)
page.on('request', (request) => {
if (['media', 'image', 'stylesheet', 'font'].indexOf(request.resourceType()) !== -1) {
request.abort();
} else {
request.continue();
}
});
}

run();