0.2.2 • Published 4 years ago

tele-aria2 v0.2.2

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

tele-aria2

Logo

NPM Version Docker Image Size GitHub Actions TypeScript Style Guide deps

The newly rewritten project has a few advantages over the old one:

  1. Fully touch based, more easy to use, no command required to use this bot.
  2. Real time notification, it's now using Aria2's Websocket protocol to communicate.
  3. Better cli interface and config file support.

Setup

  1. Create your own bot and get its access token by using @BotFather.
  2. Get your unique user ID - https://stackoverflow.com/a/32777943/4480674.
  3. (Optional) Telegram blocked in your region/country? be sure to have a HTTP proxy up and running.
  4. $ npm install tele-aria2 -g.
  5. $ tele-aria2 --help to see how to get started.

3 ways to pass parameters

You can pass parameters to tele-aria2 in 3 ways:

  1. cli
  2. environment variable
  3. configuration file

Option priorities also follow this order, so cli has the highest priority.

Aria2 serverAria2 keyTelegram bot keyTelegram user idProxyMax items in range(default 20)
cli option--aria2-server--aria2-key--bot-key--user-id--proxy--max-index
environment variable optionta.aria2-serverta.aria2-keyta.bot-keyta.user-idhttps_proxyta.max-index
configuration file optionaria2-serveraria2-keybot-keyuser-idproxymax-index

configuration file example

{
  "aria2-server": "ws://192.168.1.154:6800/jsonrpc",
  "aria2-key": "xxx",
  "proxy": "http://127.0.0.1:7890",
  "bot-key": "123456789:xxx",
  "user-id": "123456",
  "max-index": 10
}

Need to add more users? no problem, just add user-id like this: "user-id": "123,456,789".

Usage

Once your bot is up and running, go back to Telegram and click Start:

As you can see, all the action menus are instantly available to use, no command required!

How can I add a new task?

It's really simple, you just send any HTTP/FTP/SFTP/Magnet url to chat, it will recognize and add it to Aria2 server!

But I want to download from a torrent file

No worries, just send your torrent file to chat!

Docker

Run this bot as a Docker container, multi-architecture supported:

$ docker run -it \
  -v ~/.tele-aria2.json:/tele-aria2/config.json \
  --net=host \
  houcoder/tele-aria2

Keep in mind, the --net=host option is required if you have proxy set in your config file.