Coder Social home page Coder Social logo

la-lo-go / man-go Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 75 KB

Go RESTful API for search mangas, their chapters and pages from different websites simultaneously

Home Page: https://hub.docker.com/r/lalogo/man-go

License: Mozilla Public License 2.0

Go 98.43% Dockerfile 1.57%
docker-image gin-gonic http manga-api manga-scraper

man-go's Introduction

Man-go

Work in progress, currently arround 50% until 1.0 release

GetMangas GetMangaPage GetChapter
In Manga
Nyaa
Manga Oni

Run in Docker-compose

version: '3.8'
services:
    man-go:
        image: man-go
        ports:
        - "7070:7070"

Clone and run the repository

  1. Clone the repository
    git clone https://github.com/la-lo-go/man-go
  2. Create a new .env file in the root of the repository with the following scheme:
    # API
    API_IP="0.0.0.0"
    API_PORT="7070"
    
    # DB
    DB_NAME="mango.sqlite3"
  3. Compile and run
    go run main.go 

API responses

Search

Query

/busqueda?search=[search_string]&max=[int (optional)]

Response

Example: /busqueda?search=jujutsu&max=1

[
    {
        "name": "jujutsu-kaisen",
        "site": "InManga",
        "link": "https://inmanga.com/ver/manga/Jujutsu-Kaisen/d88692a5-c341-47fc-8e39-da11a8fdee82",
        "chapters_number": 0,
        "cover": "https://pack-yak.intomanga.com/thumbnails/manga/Jujutsu-Kaisen/d88692a5-c341-47fc-8e39-da11a8fdee82"
    },
    {
        "name": "jujutsu-kaisen",
        "site": "Nyaa",
        "link": "https://manganyaa.com/jujutsu-kaisen/leer-online-gratis-espanol",
        "chapters_number": 99,
        "cover": "https://content.manganyaa.com/file/mnyaaa/jujutsu-kaisen/description/1.jpg"
    },
    {
        "name": "jujutsu-kaisen",
        "site": "TuManga.net",
        "link": "https://tumanga.net/manga/jujutsu-kaisen",
        "chapters_number": 99,
        "cover": ""
    }
]

Manga Page

Query

/manga/[site]/[manga_name]

Response

Example: /manga/jujutsu-kaisen/nyaa

{
    "name": "Jujutsu Kaisen",
    "site": "Nyaa",
    "cover": "https://content.manganyaa.com/file/mnyaaa/jujutsu-kaisen/description/1.jpg",
    "chaptersNumber": 186,
    "chaptersListed": [
        {
            "number": 186,
            "linkOriginal": "https://manganyaa.com/jujutsu-kaisen/leer-online-gratis-espanol/capitulo/186"
        },
        {
            "number": 185,
            "linkOriginal": "https://manganyaa.com/jujutsu-kaisen/leer-online-gratis-espanol/capitulo/185"
        },
        ...
        {
            "number": 2,
            "linkOriginal": "https://manganyaa.com/jujutsu-kaisen/leer-online-gratis-espanol/capitulo/2"
        },
        {
            "number": 1,
            "linkOriginal": "https://manganyaa.com/jujutsu-kaisen/leer-online-gratis-espanol/capitulo/1"
        }
    ]
}

Cache

  • searches table: all the results of the searches with the date.

    • The search is exact: the results are returned.
    • The has a key that is included in the search: the results are filtered.
    • Else: do a full search
  • API_linksMangas.json: JSON returned by the Nyaa API with all the mangas listed in the page. Has a 12 hour expire time.

File structure

man-go
├───endpoints           <- endpoints functions
├───gorm                <- gorm database functions
├───general_functions   <- handy custom functions
├───json                <- cached information
├───models              <- api's structs
├───routers             <- gin-gonic router
└───sites               <- sites using the interface
    ├───inManga
    ├───mangaMx
    ├───nyaa
    └───tuMangaNet

License

Mozilla Public License 2.0

License: MPL 2.0

man-go's People

Contributors

la-lo-go avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.