-
-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new version is coming up with typescript base code and more clean
- Loading branch information
Showing
20 changed files
with
627 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ ublock | |
succesCommenting.log | ||
errorCommenting.log | ||
package-lock.json | ||
bin | ||
tmp | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
Oops, something went wrong.