Skip to content

Commit

Permalink
new version is coming up with typescript base code and more clean
Browse files Browse the repository at this point in the history
  • Loading branch information
fdciabdul committed Jan 8, 2025
1 parent ec68ff0 commit 5cc538f
Show file tree
Hide file tree
Showing 20 changed files with 627 additions and 235 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ ublock
succesCommenting.log
errorCommenting.log
package-lock.json
bin
tmp
.env
120 changes: 1 addition & 119 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,125 +7,7 @@
Youtube Bot Auto Commenter Using Puppeter and NodeJS
</p>

## Quick Links

* [Demo](https://www.youtube.com/watch?v=tkeWv0z8bqM)
* [Installation](#run--installation)
* [Feature](#feature)
* [Configuration](#configuration)



## Demo
<a href="https://www.youtube.com/watch?v=tkeWv0z8bqM"> <image src="https://user-images.githubusercontent.com/31664438/177520285-2cecfe81-0ae4-477a-a5e6-908a05adef27.gif" align="center" width="100%" /> </a>

```bash
$ see this DEMO in here > https://www.youtube.com/watch?v=C7AOauxguSc

```

## Run / Installation
How to run ?

```bash
> git clone https://github.com/tegal1337/Youtube-Auto-Commenter/
> cd Youtube-Auto-Commenter
> npm install
> node main.js
```

dont forget to change the google username and password in ` config.js`

```javascript
module.exports = {
keywords: "keywords",
usernamegoogle: "username",
passwordgoogle: "pass",
};

```
## Feature

Feature | Status |
| -------------:|------------- |
| Random Copy Comment | Ok|
| Manual Comment | Ok|
| AI Comment (GPT BASED) | Ok|
| Comment On Trending | Ok |
| Comment based on Keyword | Ok |
| Multi Account | Ok|

## Requirements

- Windows / Linux
- Google Chrome
- a Youtube account

## Running on android

yes of course the bot is still works on android
but you need ubuntu installed on your android , use Termux for it!
and install ubuntu desktop with Andronix
i prefer ubuntu 20 , cuz it's more stable than 18

command for installing inside the ubuntu

copy and paste one by one , don't be lazy dude 🤨

```bash
> apt instal
> apt update
> apt upgrade
> apt install chromium-browser
> apt install npm
> npm install -g n
> n install lts
> hash -r
> apt install curl
> curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
> echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
> apt install yarn
```

go to directory of this project , then install the dependency

```bash
yarn
```


also you need to change `executableFilePath` in `main.js`
you can set to /usr/bin/chromium

## Configuration

Config | Info |
| -------------:|------------- |
| keyword | fill the keyword , for searching videos of course|
| comments | list of the comment |
| usernamegoogle | your username google |
| password | your google password|
| delaycomment | delay commenting / seconds |
| trending | Comment based on trending videos on your location|
| multiaccount | Multiple account account |
| ai | Auto commenting with AI|

## Support this project by

- Give me an idea to create something amazing with this
or

- support by donating
( i won't use your money , i will give to charity to kitabisa.com , or you dont have to send any money to me , do it by yourself .. it also supporting me :) )

# Contact
[email protected]

[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.me/fdciabdul)




New Version is developing ~


Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion index.ts

This file was deleted.

7 changes: 7 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"dependencies": {
"axios": "^0.27.2",
"chalk": "5.4.1",
"cheerio": "^1.0.0-rc.12",
"cli-spinners": "^2.6.1",
"date-format": "^4.0.13",
"dotenv": "^16.4.7",
"karma-chrome-launcher": "^3.1.1",
"module-alias": "^2.2.3",
"node-unzip-2": "^0.2.8",
"openai": "^3.2.1",
"puppeteer": "^23.11.1",
Expand All @@ -16,13 +19,13 @@
"name": "yt-commenter",
"version": "1.0.0",
"description": "Auto Comment Youtube Videos",
"main": "main.js",
"main": "index.ts",
"directories": {
"lib": "lib"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node main.js"
"start": "bun src/index.ts"
},
"repository": {
"type": "git",
Expand All @@ -36,6 +39,13 @@
"bugs": {
"url": "https://github.com/tegal1337/Youtube-Auto-Commenter/issues"
},
"_moduleAliases": {
"#lib/*": "src/lib/",
"#src/*": "src/",
"#test/*": "test/",
"#utils/*": "src/utils/",
"#config/*": "src/config/"
},
"homepage": "https://github.com/tegal1337/Youtube-Auto-Commenter#readme",
"devDependencies": {
"eslint": "^8.33.0",
Expand Down
31 changes: 31 additions & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import dotenv from 'dotenv';
import path from 'path';
import fs from 'fs';
dotenv.config();
function getEnv(key: any) {
return process.env[key];
}

function setEnv(key: string, value: string) {
process.env[key] = value;
}

function getPort() {
const port = getEnv('PORT_APP');
return port ? parseInt(port) : 3000;
}

function uploadDir() {
const uploadDir = path.join(__dirname, '..', '../public/uploads');
if (!fs.existsSync(uploadDir)) {
fs.mkdirSync(uploadDir, { recursive: true });
}
return path.join(uploadDir);
}

export {
getEnv,
setEnv,
getPort,
uploadDir
}
27 changes: 27 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import 'module-alias/register';
import YOMEN from '#lib/Bot/YoutubeBot';
import { LaunchBrowser } from '#lib/Browser';
import LoginYoutube from '#lib/LoginYoutube';
import Logger from '#utils/Logger';
import { banner } from '#utils/banner';
import { randomDelay } from '#utils/randomDelay';

async function main() {
const browser = new LaunchBrowser();
await browser.init();
Logger.divider();
Logger.banner(banner);
Logger.divider();
const pages = await browser.page;
const login = new LoginYoutube(pages);
await login.login();
const yomen = new YOMEN(pages);
const urls = await yomen.searchKeyword('mr beast');

for (let i = 0; i < urls.length; i++) {
await yomen.goToVideo(urls[i]);
await randomDelay(5000, 10000);
}
}

main();
Loading

0 comments on commit 5cc538f

Please sign in to comment.