Skip to content

AndrielFR/aikgo

Repository files navigation

Aikgo

A REST API to stream or download Telegram video files.

It is a Rust-based application that uses the Telegram MTProto library grammers to fetch video files and stream them to clients.

Usage

  1. Clone the repository.
  2. Create a .env file with the following content:
# Rust
RUST_LOG=trace    # Log level
RUST_BACKTRACE=1  # Expand backtrace

# Database
DATABASE_URL=postgres://user:password@host:port/database # Your database URL

# Server
JWT_SECRET=YourSecretKey
SERVER_HOST=127.0.0.1 # Your server host
SERVER_PORT=3000      # Your server port

# Telegram
TELEGRAM_API_ID=YOUR_API_ID     # Your Telegram API ID
TELEGRAM_API_HASH=YOUR_API_HASH # Your Telegram API hash
  1. Install sqlx-cli:
cargo install sqlx-cli --no-default-features --features postgres
  1. After initializing the postgres database, run the migrations:
sqlx migrate run
  1. Add a new session with cargo run -- -n.
  2. Run the server with cargo run.
  3. Access the API documentation at http://localhost:3000/api/v1.

Notes

When you add a new session, it's necessary for the added session to ‘know’ the chat, i.e. receive some update from Telegram regarding the chat in which the video is, it could be anything, a message from a user or the user of the session in that chat, a service message or even a status update, such as ‘someone is typing’ or things like that.

This is only necessary the first time the session is added, after which the chat will be saved in the cache.

License

All the libraries and binaries contained in this repository are licensed under either of

at your option.

Contribution

Thank you for considering to contribute! I'll try my best to provide quick, constructive feedback on your issues or pull requests. Please do call me out if you think my behaviour is not acceptable at any time. I will try to keep the discussion as technical as possible. Similarly, I will not tolerate poor behaviour from your side towards other people (including myself).

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A REST API to stream or download Telegram video files.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages