Skip to content

NoamNol/Findevil

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Findevil

Find evil content in YouTube comments

Get started

# in Linux replace 'set' with 'export'
set YOUTUBE_API_KEY=<your_key>
docker-compose up -d --build

Before docker-compose up, you can set more optional settings:

# in Linux replace 'set' with 'export'
set ASYNC_WORKERS=<number>
set MONGODB_FLASK_USERNAME=<name>
set MONGODB_FLASK_PASSWORD=<password>
set MONGODB_ADMIN_USERNAME=<name>
set MONGODB_ADMIN_PASSWORD=<password>

Send a request

You can use tools like Postman to send HTTP requests.

Scan all comments of a YouTube video:
http://127.0.0.1:5001/youtube/videos/<video_id>/comments [PUT]

Or with max parameter:
http://127.0.0.1:5001/youtube/videos/<video_id>/comments?max=<max> [PUT]

Connect to MongoDB

Now you can connect to the database and view the new data in flaskdb db.
The connection string is: mongodb://mongodbadmin:temp_admin_password@localhost:27019

Change mongodbadmin and temp_admin_password if you used custom MONGODB_ADMIN_USERNAME and MONGODB_ADMIN_PASSWORD.

Clean the database

To delete the users and data in MongoDB, run:

docker-compose down
docker volume rm findevil_mongodbdata

Now you can start again with fresh db and run docker-compose up as described above.

Development

Requirements

  • Python 3.9
  • Docker

Build and run MongoDB for development

cd mongo
docker build -t mongo-findevil:latest .
docker run --name mongodb-dev -p 27018:27017 --env-file .env.dev -d mongo-findevil:latest

Use port 27018 to connect to the dev database:
mongodb://mongodbadmin:temp_admin_password@localhost:27018

Build and run Flask

Windows:

cd flask
copy .env.dev .env
# edit your .env file...
py -m venv env
.\env\Scripts\activate
pip install -r requirements-dev.txt
flask run

Linux:

cd flask
cp .env.dev .env
# edit your .env file...
python3 -m venv env
source env/bin/activate
pip install -r requirements-dev.txt
flask run

Use port 5000 to send requests to the dev server:
http://127.0.0.1:5000/youtube/videos/<video_id>/comments [PUT]

Debugging

To debug Flask, instead of flask run use the debugger in VSCode.

Todo

  • Find evil content in comments.
  • Performance: Find links in comments by using another service.
  • Performance: Consider using Aiogoogle for better async.
  • Performance: Add load balancing to handle multiple requests.

About

Find evil content in YouTube comments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published