README.md (view raw)
1# GoPipe
2Embed YouTube videos on Telegram, Discord and more!
3
4## How to use:
5Replace `www.youtube.com` or `youtu.be` with `y.outube.duckdns.org` to fix embeds for short videos.
6
7https://github.com/birabittoh/FixYouTube-legacy/assets/26506860/e1ad5397-41c8-4073-9b3e-598c66241255
8
9### Advanced usage
10Some services require video previews to be smaller than a certain file size. This app gets the best-looking format by default, so it's not uncommon to have previews that are too big, thus being ignored by crawlers.
11
12Enter the `/{videoID}/{formatID}` endpoint.
13
14You can change `formatID` to cycle through the available formats for a given video. These formats are also filtered based on file size, in a way that makes them viable Telegram previews.
15
16In short, if `/{videoID}` does not generate a preview, you can try `/{videoID}/1`, which should be the best-looking format within Telegram's filesize bounds.
17
18The next values of `formatID` (2 to infinity) are even smaller formats within those bounds.
19
20If the video is too long, there might not be small enough formats. In that case, the app returns error 500.
21
22## Instructions
23
24First of all, you should create a `.env` file:
25```
26cp .env.example .env
27```
28
29### Docker with reverse proxy
30Copy the template config file and make your adjustments. My configuration is based on [DuckDNS](http://duckdns.org/) but you can use whatever provider you find [here](https://docs.linuxserver.io/general/swag#docker-compose).
31
32```
33cp docker/swag.env.example docker/swag.env
34nano docker/swag.env
35```
36
37Finally: `docker compose up -d`.
38
39### Docker without reverse proxy
40Just run:
41```
42docker compose -f docker-compose.simple.yaml up -d
43```
44
45## Test and debug locally
46```
47go test -v ./...
48go run .
49```