Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amasecocoa/media-proxy
Pythonで作成されたMedia Proxyの代替実装
https://github.com/amasecocoa/media-proxy
Last synced: about 1 month ago
JSON representation
Pythonで作成されたMedia Proxyの代替実装
- Host: GitHub
- URL: https://github.com/amasecocoa/media-proxy
- Owner: AmaseCocoa
- License: mit
- Created: 2024-08-27T10:06:36.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-27T18:24:47.000Z (4 months ago)
- Last Synced: 2024-08-28T11:31:39.273Z (4 months ago)
- Language: Python
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Media-Proxy
Media-Proxy is a lightweight media proxy for Misskey servers. It is approximately 3KB in size and provides minimal functionality for proxying media.## Features
- Lightweight and fast
- Easy to set up
- Responses are cached for a fixed period of time
- Docker support## Install
### Install from Source
1. Clone the repository.
```sh
git clone https://github.com/AmaseCocoa/media-proxy.git
cd media-proxy
```2. Install the required dependencies.
```sh
pip install -r requirements.txt
```### Install With Docker
1. Pull the Docker image.
```sh
docker pull amasecocoa/media-proxy:latest
```2. Start the container.
```sh
docker run -d --name media-proxy -p 3003:3003 -e PORT=3030 amasecocoa/media-proxy:latest
```## How To Use
### Start ServerStart the server with the following command.
```sh
python server.py
````### Configuration
Use environment variables to configure settings.
- `PORT`: The port number the server listens on (default: 3003)
- `EXPIRES`: The length of time to cache media (default: 86400 (seconds))
~~`CHUNK_SIZE`: The chunk size of the file to be read at a time. (default: 1048576 (bytes))~~ Discontinued in 0.3.0Example:
```sh
export PORT=8000
export EXPIRES=86400
```### Example
To send an image request to a media proxy, use the following URL format:
```
http://host/proxy/image.webp?url=https://example.com/image.png
```The `url` parameter is the URL of the image you wish to proxy.
## Develop
To set up the development environment, do the following:
1. Install the dependencies.
```sh
pdm install
```2. Start the server.
```sh
pdm run python server.py
```## License
This project is released under the MIT License. See the [LICENSE](LICENSE) file for more information.