Giter Club home page Giter Club logo

tele-aria2's Introduction

tele-aria2

⚠️ I don't have time to maintain this project, please find other alternatives

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 server Aria2 key Telegram bot key Telegram user id Proxy Max items in range(default 20)
cli option --aria2-server --aria2-key --bot-key --user-id --proxy --max-index
environment variable option ta.aria2-server ta.aria2-key ta.bot-key ta.user-id https_proxy ta.max-index
configuration file option aria2-server aria2-key bot-key user-id proxy max-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:

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!

start

But I want to download from a torrent file

No worries, just send your torrent file to chat!

start

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.

tele-aria2's People

Contributors

agneevx avatar aipeach avatar dependabot[bot] avatar houcoder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

tele-aria2's Issues

pass aria2c flags

is it possible it pass along flags for out put name, directory etc along with the links???

请加入中文。

虽然之后简单的几句和几个简单的词,但如果能加入中文会看来舒服点,如果没计划的话我自己改改就好,如果有需要,我可以帮忙翻译好"Telegram.ts"文本给你。

The bot won't function properly

When I start the docker on my vps, it shows the error message below ```

Error: Telegraf: "reply" isn't available for "undefined::"
at TelegrafContext.assert (/usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/context.js:172:13)
at TelegrafContext.reply (/usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/context.js:314:10)
at /usr/local/lib/node_modules/tele-aria2/dist/Telegram.js:73:24
at execute (/usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:370:13)
at /usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:370:49
at /usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:135:56
at execute (/usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:370:13)
at /usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:355:14
at execute (/usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:370:13)
at /usr/local/lib/node_modules/tele-aria2/node_modules/telegraf/composer.js:355:14

[Help] Not sure how to get started.

Hi,
I installed tele-aria2 using npm install tele-aria2 -g and got help by tele-aria2 --help without any issue. But when I try to configure it using the given commands, the below error pops up. Please Help me out!

I tried to configure using both:

  1. Terminal by adding tele-aria2 -b 12345:xxxxx -s http://192.168.1.250:6800 -u 123455
  2. Creating Config file and adding by tele-aria2 --config /home/pi/Tele-aria2/tele.conf

But Both the methods shows the same error below.

/usr/local/lib/node_modules/tele-aria2/dist/Aria2.js:62
        this.logger.warn(error.message);
                    ^

TypeError: Cannot read property 'warn' of undefined
    at WebSocket.Aria2.onWsError (/usr/local/lib/node_modules/tele-aria2/dist/Aria2.js:62:21)
    at WebSocket.emit (events.js:198:13)
    at abortHandshake (/usr/local/lib/node_modules/tele-aria2/node_modules/ws/lib/websocket.js:697:15)
    at ClientRequest.req.on (/usr/local/lib/node_modules/tele-aria2/node_modules/ws/lib/websocket.js:579:7)
    at ClientRequest.emit (events.js:198:13)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:111:17)
    at Socket.socketOnData (_http_client.js:451:20)
    at Socket.emit (events.js:198:13)
    at addChunk (_stream_readable.js:288:12)

As i'm new to this, I am not sure how to get started. I have both telegram bot token and the unique user ID.
It would be great if I receive instruction on how to configure tele-aria2 and how to run it as well.

Thank you.

现在还能使用吗

看到作者说打算重新发布一个,如果不能用的话就先等等不折腾了

tele-aria2 --bot-key not working for me :(

Hi,

anyone can help me or abandoned ?

billou@billou-serveur:~$ tele-aria2 --bot-key ***
/usr/lib/node_modules/tele-aria2/dist/run.js:58
var userId = options.userId.split(',').map(Number);
                            ^

TypeError: Cannot read property 'split' of undefined
    at Object.<anonymous> (/usr/lib/node_modules/tele-aria2/dist/run.js:58:29)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47

Thanks

Docker error

Hi, I'm trying to run the docker on my raspbian but I'm getting this error instead

     
internal/fs/utils.js:230

    throw err;

    ^



Error: EISDIR: illegal operation on a directory, read

    at Object.readSync (fs.js:564:3)

    at tryReadSync (fs.js:349:20)

    at Object.readFileSync (fs.js:386:19)

    at Object.<anonymous> (/usr/local/lib/node_modules/tele-aria2/dist/run.js:44:46)

    at Module._compile (internal/modules/cjs/loader.js:1138:30)

    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)

    at Module.load (internal/modules/cjs/loader.js:986:32)

    at Function.Module._load (internal/modules/cjs/loader.js:879:14)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)

    at internal/main/run_main_module.js:17:47 {

  errno: -21,

  syscall: 'read',

  code: 'EISDIR'

}

What could be the issue here?

Bot 在频道中表现异常

在将 bot 添加到频道后,在频道内广播/修改任意消息都会触发 bot 的 You're not allowed to use this bot 😢.
image

可以考虑直接禁止在频道中发消息

Bot trying to download everything that was downloaded if restart it

If restart tele-aria2 bot, eg. with system restart, it starts to download everything that was downloaded before.
Also in chat, bot sends me all messages history.
Looks like after restart, bot read the whole chat, found links/commands, etc., and start to process all of them

Hide notifications for certain actions.

It would be nice if there were options to turn off notifications for specific actions.

For e.g. adding/pausing a torrent triggers a notification that is not necessary since I'm actively aware of performing such operations.

接下来应该怎么操作呢?

我是一个新手。稍微学了一点点的创建的bot的东西。
希望您可以和我解释一下执行完main.py之后要怎么操作呢?

突然不能用了

报错信息如下:
internal/fs/utils.js:230
throw err;
^

Error: EISDIR: illegal operation on a directory, read
at Object.readSync (fs.js:564:3)
at tryReadSync (fs.js:349:20)
at Object.readFileSync (fs.js:386:19)
at Object. (/usr/local/lib/node_modules/tele-aria2/dist/run.js:44:46)
at Module._compile (internal/modules/cjs/loader.js:1138:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
at Module.load (internal/modules/cjs/loader.js:986:32)
at Function.Module._load (internal/modules/cjs/loader.js:879:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
errno: -21,
syscall: 'read',
code: 'EISDIR'
}

Download isn't started

After restarting the bot, it starts to process all messages from the chat #29 and handle links, but if I try to add the new one I see

....
info: Received message from Aria2 server {"timestamp":"2021-07-18 13:29:47"}
info: Received message from Aria2 server {"timestamp":"2021-07-18 13:29:48"}
info: Sending message to Aria2 server {"timestamp":"2021-07-18 13:29:48"}
info: Received message from Aria2 server {"timestamp":"2021-07-18 13:29:48"}
(node:6295) UnhandledPromiseRejectionWarning: FetchError: request to https://api.telegram.org/bot..../sendMessage failed, reason: connect ETIMEDOUT 149.154.167.220:443
at ClientRequest. (/usr/local/lib/node_modules/tele-aria2/node_modules/node-fetch/lib/index.js:1461:11)
at ClientRequest.emit (events.js:198:13)
at TLSSocket.socketErrorListener (_http_client.js:401:9)
at TLSSocket.emit (events.js:198:13)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:6295) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6295) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

If restart bot, it download this file, but a new one will fail with the same error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.