Skip to content

Commit

Permalink
* fix browser insecure #47
Browse files Browse the repository at this point in the history
* delete incognito mode
* add auto download UblockOrigin
  • Loading branch information
fdciabdul committed Oct 2, 2023
1 parent f259099 commit e2d2666
Show file tree
Hide file tree
Showing 369 changed files with 559 additions and 338,246 deletions.
32 changes: 0 additions & 32 deletions accs.js

This file was deleted.

12 changes: 12 additions & 0 deletions config.example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
keywords: ["mr beast", "pass"],
comments: ["hello","let's be a friend","subs to subs ahaha"],
usernamegoogle: "username_google/email_google",
passwordgoogle: "password_google",
trending: false, // set true if you want comment on trending videos or false if you want comment on search videos
newVideos: false, // set true if you want comment on new videos or false if you want comment on top videos
copycomment:true, // set tru if you want copy comment from array or false if you want random comment
userdatadir : "fdciabdul", // set your userdatadir
ai : false, //set true if you want use ai comment or false if you want use random comment or copy comment
apiKey : "", // set your api key from
};
File renamed without changes.
7 changes: 7 additions & 0 deletions logs/succesCommenting.log
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@

[1:36:32 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=6x_b11Kyrco&pp=ygUIbXIgYmVhc3Q%3D | Status: success
[2:05:34 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=kX3nB4PpJko&pp=ygUIbXIgYmVhc3Q%3D | Status: success
[2:05:50 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=vBpQ1SlfVtU&pp=ygUIbXIgYmVhc3Q%3D | Status: success
[2:06:06 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=NigrQ9UcJy4&pp=ygUIbXIgYmVhc3Q%3D | Status: success
[2:06:20 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=HBMmK1c44sE&pp=ygUIbXIgYmVhc3Q%3D | Status: success
[2:06:35 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=Ooke4YZv8Ts&pp=ygUIbXIgYmVhc3Q%3D | Status: success
[2:06:52 PM] | User: chanmenme2 | Link: https://www.youtube.com/watch?v=d1010B3sKNQ&pp=ygUIbXIgYmVhc3Q%3D | Status: success
46 changes: 35 additions & 11 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ const {
aiCommented,
Banner,
} = require('./modules');
const { uBlockOriginDownloader } = require('./modules/src/AdblockerUpdate');
const config = require('./config');


const spinners = new Spinners(cliSpinners.star.frames, {
text: 'Loading',
stream: process.stdout,
Expand All @@ -37,6 +39,7 @@ const spinners = new Spinners(cliSpinners.star.frames, {
},
});
puppeteer.use(StealthPlugin);

const paths = `${process.cwd()}/ublock`;
const delay = (Math.floor(Math.random() * 60) + 60) * 1000;
StealthPlugin.enabledEvasions.delete('iframe.contentWindow');
Expand All @@ -45,17 +48,14 @@ console.log(Banner.show);
async function startApp(config, browserconfig) {
const keyword = config.keywords;

const context = await puppeteer.launch(browserconfig);
const browser = await context.createIncognitoBrowserContext();

const browser = await puppeteer.launch(browserconfig);
const page = await browser.newPage();
await page.setBypassCSP(true);
await page.setViewport({
width: 1366,
height: 768,
});
await page.evaluateOnNewDocument(() => {
delete navigator.__proto__.webdriver;
});

await page.setUserAgent(randomUserAgent.UA());
await page.goto('https://accounts.google.com/signin/v2/identifier?service=youtube', {
waituntil: 'domcontentloaded',
Expand All @@ -80,8 +80,7 @@ async function startApp(config, browserconfig) {
await page.waitForNavigation({
waituntil: 'domcontentloaded',
});
await page.waitForSelector(selector.showpass);
// await page.click(selector.showpass , {delay :1000});

await page.waitForTimeout(2000);
await page.type(selector.password, config.passwordgoogle, {
delay: 400,
Expand All @@ -90,6 +89,20 @@ async function startApp(config, browserconfig) {
await page.waitForNavigation({
waituntil: 'domcontentloaded',
});
const twoStepVerificationElement = await page.evaluate(() => {
const headings = document.querySelectorAll('h1.oO8pQe');
for (let heading of headings) {
if (heading.textContent === "2-Step Verification") {
return true;
}
}
return false;
});

if (twoStepVerificationElement) {
console.log("I need to 2-step verification");
}

}
console.log('=========== Start Commenting ==============');
try {
Expand Down Expand Up @@ -222,8 +235,8 @@ async function startApp(config, browserconfig) {
text: 'While delaying .. we actin like human to scroll comment',
color: 'yellow',
});
// await autoscroll._autoScroll(pages);

await autoscroll._autoScroll(pages);
await page.waitForTimeout(delay);
await pages.close();
spinners.succeed('comment', {
text: 'Success commenting',
Expand All @@ -244,9 +257,20 @@ async function startApp(config, browserconfig) {
});
await browser.close();
}
startApp(config, Config(paths, config, executablePath('chrome'), config.userdatadir));

function readLog() {
const data = fs.readFileSync('./logs/succesCommenting.log', 'utf8');
return data;
}

if (!fs.existsSync('./ublock')) {
uBlockOriginDownloader().then((success) => {
if(success) {
startApp(config, Config(paths, config, executablePath('chrome'), config.userdatadir));
} else {
console.log("Error downloading and extracting uBlock Origin.");
}
});
} else {
startApp(config, Config(paths, config, executablePath('chrome'), config.userdatadir));
}
99 changes: 99 additions & 0 deletions modules/src/AdblockerUpdate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
const axios = require('axios');
const fs = require('fs');
const zl = require("zip-lib");
const fsExtra = require('fs-extra');
const path = require('path');

async function uBlockOriginDownloader() {
const releasesUrl = 'https://api.github.com/repos/gorhill/uBlock/releases/latest';
try {
const response = await axios.get(releasesUrl);
const assets = response.data.assets;
if (assets && assets.length > 0) {
const downloadUrl = assets[0].browser_download_url;
const fileName = assets[0].name;
logInfo(`Downloading ${fileName} ...`);
const downloadResponse = await axios.get(downloadUrl, {
responseType: 'stream'
});

const writer = fs.createWriteStream(fileName);

const downloadPromise = new Promise((resolve, reject) => {
downloadResponse.data.pipe(writer);
writer.on('finish', async () => {
logSuccess(`Downloaded ${fileName} successfully!`);
const unzip = await unzipFile(fileName);
resolve(unzip);
});
writer.on('error', (error) => {
logError(`Error writing file: ${error}`);
reject(false);
});
});

return await downloadPromise;
} else {
logError('No assets found for the latest release.');
return false;
}
} catch (error) {
logError(`Failed to fetch the latest release: ${error.message}`);
return false;
}
}

async function unzipFile(filePath) {
const tempDir = './temp_unzipped_content';

const unzip = new zl.Unzip({
onEntry: function (event) {
logInfo(`Extracting ${event.entryCount}: ${event.entryName}`);
}
});

try {
await unzip.extract(filePath, tempDir);
logSuccess('File unzipped to temporary location!');
const subdirs = fs.readdirSync(tempDir).filter(subdir => fs.statSync(path.join(tempDir, subdir)).isDirectory());
if (subdirs.length > 0) {
const mainSubdir = path.join(tempDir, subdirs[0]);
const finalDir = './ublock';

// Remove the final directory if it exists
if (fs.existsSync(finalDir)) {
fsExtra.removeSync(finalDir);
}

// Move the content from the main subdirectory to the final directory
await fsExtra.move(mainSubdir, finalDir);
fsExtra.removeSync(tempDir);
logSuccess('Content moved to final location!');
return true;
} else {
logError('No subdirectories found. Content remains in the temporary location.');
return false;
}
} catch (err) {
logError(`Error during unzip or move operation: ${err.message}`);
return false;
}
}


function logInfo(message) {
console.log('\x1b[34m%s\x1b[0m', message); // Blue for info messages
}

function logSuccess(message) {
console.log('\x1b[32m%s\x1b[0m', message); // Green for success messages
}

function logError(message) {
console.error('\x1b[31m%s\x1b[0m', message); // Red for error messages
}


module.exports = {
uBlockOriginDownloader
}
5 changes: 4 additions & 1 deletion modules/src/bannerMain.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
const packageJSON = require('../../package.json');

const version = packageJSON.version;
module.exports = {
show: `⡏⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠋⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠙⠉⠉⠉⠹
⡇⢸⣿⡟⠛⢿⣷⠀⢸⣿⡟⠛⢿⣷⡄⢸⣿⡇⠀⢸⣿⡇⢸⣿⡇⠀⢸⣿⡇⠀
⡇⢸⣿⣧⣤⣾⠿⠀⢸⣿⣇⣀⣸⡿⠃⢸⣿⡇⠀⢸⣿⡇⢸⣿⣇⣀⣸⣿⡇⠀
⡇⢸⣿⡏⠉⢹⣿⡆⢸⣿⡟⠛⢻⣷⡄⢸⣿⡇⠀⢸⣿⡇⢸⣿⡏⠉⢹⣿⡇⠀
⡇⢸⣿⣧⣤⣼⡿⠃⢸⣿⡇⠀⢸⣿⡇⠸⣿⣧⣤⣼⡿⠁⢸⣿⡇⠀⢸⣿⡇⠀ YOUTUBE AUTO COMMENTER V.2.5
⡇⢸⣿⣧⣤⣼⡿⠃⢸⣿⡇⠀⢸⣿⡇⠸⣿⣧⣤⣼⡿⠁⢸⣿⡇⠀⢸⣿⡇⠀ YOUTUBE AUTO COMMENTER ${version}
⣇⣀⣀⣀⣀⣀⣀⣄⣀⣀⣀⣀⣀⣀⣀⣠⣀⡈⠉⣁⣀⣄⣀⣀⣀⣠⣀⣀⣀⣰
⣇⣿⠘⣿⣿⣿⡿⡿⣟⣟⢟⢟⢝⠵⡝⣿⡿⢂⣼⣿⣷⣌⠩⡫⡻⣝⠹⢿⣿⣷ Created by: @fdciabdul
⡆⣿⣆⠱⣝⡵⣝⢅⠙⣿⢕⢕⢕⢕⢝⣥⢒⠅⣿⣿⣿⡿⣳⣌⠪⡪⣡⢑⢝⣇ Github : https://github.com/tegal1337/YOMEN
Expand Down
9 changes: 3 additions & 6 deletions modules/src/userAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
module.exports = {
UA: function () {
let agent = [
"Mozilla/5.0 (X11; Linux x86_64; en-US; rv:110.0) Gecko/20161401 Firefox/110.0",
"Mozilla/5.0 (Windows NT 10.0; Win64; rv:112.0) Gecko/20100101 Firefox/112.0/j5hg1lrPIFtn2H",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5385.99 Safari/537.36",
"Mozilla/5.0 (X11; U; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5410.179 Safari/537.36",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.5369.190 Safari/537.36 OPR/92.0.4395.174",
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5398.168 Safari/537.36 OPR/93.0.4065.40",
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:118.0) Gecko/20100101 Firefox/118.0",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Vivaldi/6.2.3105.54",
];
return agent[Math.floor(Math.random() * agent.length)];
},
Expand Down
Loading

0 comments on commit e2d2666

Please sign in to comment.