Skip to content

A Mirror & Extractor from site nekopoi.care, build with python flask, bootstrap, sqlachemy ORM database, .etc

License

Notifications You must be signed in to change notification settings

motebaya/nekogitv2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nekogitv2

a nekopoi site mirror and extractor.

python Flask Jinja2 BeautifulSoup4

A mirror site built with Flask, Bootstrap, and other libraries. The web server is designed to have no direct interaction (live scrape) with the original website at all. Therefore, it will extract all hanime content to JSON and convert it to an SQLite3 database.

Lets, see a simple flow:

graph TB
A[Manage CLI]

A ---> B[Extract all index]

A ---> C[Extract all genre]

A ---> D[Extract all hanime]

E[download all covers/thumbnails]

C ---> F[To RAW Json]

D ---> F

F ---> E

B ---> F

E ---> G[Migrate TO sqlite3]

Note

The project is just aimed at filling free time while learning about web scraping, bootstrap, and other libraries. No other intention like stealing and uploading it without the owner's permission!

Setup

$ git clone https://github.com/motebaya/nekogitv2
$ cd nekogitv2
$ python3.10 -m pip install -r requirements.txt
$ python manage.py --help

Usage (CLI)

  • -e, --extract: extract content such as covers, thumbnails, index/list from site. you need extract hanime-list first before download all thumbnails/covers.

    python3.10 manage.py --extract hanime-list
    
  • -m, --migrate: migrate a raw json database from app/models/database/hanime/Json/hanime-list.json to sqlite3 database, default path (app/models/database/nekodata.db)

    python3.10 manage.py --migrate

Usage (web server)

  • see .env / environment file, feel free to change anything. e.g:
DEBUG=false
PORT="3000"
HOST="0.0.0.0"
FLASK_SECRET_KEY="this_is_secret123"
DBPATH="/root/custom/dbath.db"
  • run index file:
$ python3.10 index.py
* Serving Flask app 'app.App'
* Debug mode: off
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:5000
Press CTRL+C to quit

Important

before run the web server, make sure you've set everything up via the CLI, like downloading all the covers/thumbnails and migrating the JSON to the SQLite3 database. The web server won't run until you've migrated it to the SQLite3 database.

License

This project is licensed under the MIT License.