Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tohrusky/telgalereya
ТелГалерея: a RESTful API for image hosting with Cloudflare Workers.
https://github.com/tohrusky/telgalereya
cloud-functions cloudflare cloudflare-workers docker image-hosting machine-learning nsfwjs sensitive-word-filter serverless telegram tensorflowjs typescript
Last synced: 10 days ago
JSON representation
ТелГалерея: a RESTful API for image hosting with Cloudflare Workers.
- Host: GitHub
- URL: https://github.com/tohrusky/telgalereya
- Owner: Tohrusky
- License: bsd-3-clause
- Created: 2023-09-10T03:11:42.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-11T11:04:24.000Z (11 months ago)
- Last Synced: 2024-10-10T19:14:51.064Z (27 days ago)
- Topics: cloud-functions, cloudflare, cloudflare-workers, docker, image-hosting, machine-learning, nsfwjs, sensitive-word-filter, serverless, telegram, tensorflowjs, typescript
- Language: TypeScript
- Homepage: https://img-worker-nsfw.vercel.app
- Size: 590 KB
- Stars: 10
- Watchers: 2
- Forks: 7
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ТелГалерея
`ТелГалерея` 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](packages/img-worker/wrangler.toml), you can enable the NSFW Detector. See [@img-worker/nsfw](./packages/nsfw/README.md) for more details.
[![Deploy to Cloudflare Workers](https://deploy.workers.cloudflare.com/button)](https://deploy.workers.cloudflare.com/?url=https://github.com/Tohrusky/TelGalereya)
## 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:
```protobuf
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):
```json
{
"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:
```protobuf
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):
```json
{
"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.