Giter VIP home page Giter VIP logo

tohrusky / telgalereya Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 6.0 604 KB

ТелГалерея: a RESTful API for image hosting with Cloudflare Workers.

Home Page: https://img-worker-nsfw.vercel.app

License: BSD 3-Clause "New" or "Revised" License

JavaScript 2.55% TypeScript 93.84% Dockerfile 3.61%
cloudflare cloudflare-workers image-hosting telegram typescript nsfwjs tensorflowjs sensitive-word-filter cloud-functions serverless

telgalereya's Introduction

ТелГалерея

ТелГалерея is a Cloudflare Workers service for image hosting. It uses Telegraph's file API and provides a simple Reverse Proxy for it. To use ТелГалерея, deploy it to Cloudflare Workers using the provided deployment button. Then use Custom Domains to bind your own domain name.

By Set Enviroment Variables in config, you can enable the NSFW Detector. See @img-worker/nsfw for more details.

Deploy to Cloudflare Workers

API Endpoint /api/v1

/upload - Upload an Image

Request

  • Method: POST
  • Content-Type: multipart/form-data
  • Parameters:
    • file (single file) - The image file to upload.

Response

The response is in protobuf3 format and has the following structure:

message UploadResponse {
  string status = 1;
  string message = 2;
  ImageResponse data = 3;
}

message ImageResponse {
  string origin_img = 1;
  string img = 2;
}
  • status (string): The status of the upload operation. Possible values are "success" or "error".
  • message (string): A message providing information about the upload operation.
  • data (ImageResponse): An optional field containing the uploaded image URLs.

Example Response (Success):

{
  "status": "success",
  "message": "Upload success!",
  "data": {
    "origin_img": "https://telegra.ph/file/a5418e5f4313b65fba5b8.png",
    "img": "https://xx.114514.org/image/YTU0MThlNWY0MzEzYjY1ZmJhNWI4LnBuZw=="
  }
}

/nsfw-check - Check if an Image is NSFW

Request

  • Method: GET
  • Query Parameters:
    • url (string) - The image URL to check.

Response

The response is in protobuf3 format and has the following structure:

message NSFWCheckResponse {
    string status = 1;
    string message = 2;
    string url = 3;
    string sensitive = 4;
    bool nsfw = 4;
    NSFWScore score = 5;
}

message NSFWScore {
    double drawing = 1;
    double hentai = 2;
    double neutral = 3;
    double sexy = 4;
    double porn = 5;
}
  • status (string): The status of the check operation. Possible values are "success" or "error".
  • message (string): A message providing information about the check operation.
  • nsfw (bool): Whether the image is NSFW. When the value is true, the image is NSFW.

Example Response (Success):

{
  "status": "success",
  "message": "NSFW content: Sexy",
  "url": "https://telegra.ph/file/1145141919810.png",
  "sensitive": "null",
  "nsfw": true,
  "score": {
    "drawing": 0.00007909037958597764,
    "hentai": 0.0010020226472988725,
    "neutral": 0.21883316338062286,
    "sexy": 0.003355648135766387,
    "porn": 0.7767300605773926
  }
}

License

This project is licensed under the BSD 3-Clause - see the LICENSE file for details.

telgalereya's People

Contributors

tohrusky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.