Skip to content

Commit

Permalink
add files remove
Browse files Browse the repository at this point in the history
  • Loading branch information
gaowanliang committed Dec 4, 2020
1 parent 55fcc16 commit 4cc6fd7
Show file tree
Hide file tree
Showing 9 changed files with 299 additions and 188 deletions.
57 changes: 34 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
- [x] Aria2 control
- [ ] [SimpleTorrent](https://github.com/boypt/simple-torrent) control
- [ ] qbittorrent control
- [ ] Multi download server control at the same time

#### The robot protocol supports
- [x] Telegram Bot
- [ ] DingTalk robot
- [ ] DingTalk Bot

#### Function
- [x] Control server files
- [x] Delete file
- [x] Download files
- [x] Download HTTP/FTP link
- [x] Download Magnet link
- [ ] Download the files in the BT file
- [x] Download the files in the BT file
- [ ] Custom Torrent/Magnet download
- [ ] Do not download files smaller than the specified size
- [ ] Download Torrent/Magnet according to the size of storage space
Expand Down Expand Up @@ -57,37 +60,45 @@
## Setup

1. Create your own bot and get its access token by using [@BotFather](https://telegram.me/botfather)
2. (Optional) Telegram blocked in your region/country? be sure to have a HTTP proxy up and running,and You can set your system environment variable `HTTPS_ Proxy` is the proxy address.
2. (Optional) Telegram blocked in your region/country? be sure to have a HTTP proxy up and running,and You can set your system environment variable `HTTPS_Proxy` is the proxy address.
3. Download this program
4. Configure `config.json` at the root of the program that you want to execute.
5. Run the executable file

## 3 ways to pass parameters
You can pass parameters to `DownloadBot in three ways:
* [X] configuration file
* [ ] cli
* [ ] environment variable

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

| | Aria2 server | Aria2 key | Telegram bot key | Telegram user id | Max items in range(default 20) | language |
|-----------------------------|-----------------|--------------|------------------|------------------|--------------------------------|-------------|
| configuration file option | aria2-server | aria2-key | bot-key | user-id | max-index | language |
| cli option | --aria2-server | --aria2-key | --bot-key | --user-id | --max-index | --language |
| environment variable option | ta.aria2-server | ta.aria2-key | ta.bot-key | ta.user-id | ta.max-index | ta.language |

## Example of a profile

```json
{
"aria2-server": "ws://192.168.1.154:6800/jsonrpc",
"aria2-key": "xxx",
"bot-key": "123456789:xxx",
"user-id": "123456",
"max-index": 10,
"language":"en"
"aria2-server": "ws://127.0.0.1:5800/jsonrpc",
"aria2-key": "xxxxxxxx",
"bot-key": "123456789:xxxxxxxxx",
"user-id": "123456789",
"max-index": 10,
"sign":"Main Aria2",
"language":"zh-CN",
"downloadFolder":"C:/aria2/Aria2Data"
}
```
#### Corresponding explanations
* aria2-server : Aria2 server address. Websocket connection is used by default. If you want to use websocket to connect to aria2, be sure to set `enable-rpc=true` in `aria2.conf`. If not necessary, please try to **set the local aria2 address**, in order to maximize the use of this program
* aria2-key : The value of `rpc-secret` in aria2.conf
* bot-key : ID of telegram BOT
* user-id : The ID of the administrator
* max-index:Maximum display quantity of download information, 10 pieces are recommended (to be improved in the future)
* sign: Identification of this Bot, If multiple servers are required to connect to the same Bot, the specific server can be determined through this item.
* language: Language of Bot output
* downloadFolder: Aria2 download file save address

#### Currently supported languages and language tags
| Languages | Tag |
|---------------------|-------|
| English | en |
| Simplified Chinese | zh-CN |
| Traditional Chinese | zh-TW |

When you fill in the above language tag in `config.json`, the program will automatically download the language pack

#### About user-id
If you don't know your `user-id`, you can leave this field blank and enter `/myid` after running the robot, and the robot will return your `user-id`


53 changes: 31 additions & 22 deletions README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
- [x] Aria2 控制
- [ ] [SimpleTorrent](https://github.com/boypt/simple-torrent) 控制
- [ ] qbittorrent 控制
- [ ] 多下载服务器同时控制

#### 机器人协议支持
- [x] Telegram Bot
- [ ] 钉钉机器人

#### 功能
- [x] 控制服务器文件
- [x] 删除文件
- [x] 下载文件
- [x] 下载 HTTP/FTP 链接
- [x] 下载 Magnet 链接
Expand Down Expand Up @@ -63,33 +66,39 @@
4. 在想要执行本程序的根目录配置`config.json`
5. 运行可执行文件

## 三种方式传递参数
您可以通过三种方式将参数传递给`DownloadBot`
* [X] 配置文件
* [ ] Cil 命令行
* [ ] 系统环境变量


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

| | Aria2 server | Aria2 key | Telegram bot key | Telegram user id |Max items in range(default 20) |language|
|----------------------------- |----------------- |-------------- |------------------ |------------------ |-------------------------------- |---|
| 配置文件 参数 | aria2-server | aria2-key | bot-key | user-id |max-index |language|
| Cil 命令行 参数 | --aria2-server | --aria2-key | --bot-key | --user-id |--max-index |--language|
| 系统环境变量参数 | ta.aria2-server | ta.aria2-key | ta.bot-key | ta.user-id |ta.max-index |ta.language|


### 配置文件示例

```json
{
"aria2-server": "ws://192.168.1.154:6800/jsonrpc",
"aria2-key": "xxx",
"bot-key": "123456789:xxx",
"user-id": "123456",
"max-index": 10,
"language":"en"
"aria2-server": "ws://127.0.0.1:5800/jsonrpc",
"aria2-key": "xxxxxxxx",
"bot-key": "123456789:xxxxxxxxx",
"user-id": "123456789",
"max-index": 10,
"sign":"Main Aria2",
"language":"zh-CN",
"downloadFolder":"C:/aria2/Aria2Data"
}
```
#### 各项对应解释
* aria2-server:aria2服务器地址,默认使用websocket连接。如果要使用websocket连接aria2,请务必设置`aria2.conf`内的`enable-rpc=true`。如果不是必须,请尽量设置本地的aria2地址,以便于最大化的使用本程序
* aria2-key:aria2.conf中rpc-secret的值
* bot-key:Telegram Bot的标识
* user-id:管理员的ID
* max-index:下载信息最大显示数量,建议10条(以后会改进)
* sign:此机器人的标识,如果需要多个服务器连接同一个机器人,通过这一项可以确定具体是哪一台服务器
* language:机器人输出的语言
* downloadFolder:Aria2下载文件保存的地址

#### 目前支持的语言及语言标签
| 语言 | 标签 |
|----------|-------|
| 英语 | en |
| 简体中文 | zh-CN |
| 繁体中文 | zh-TW |

当您在`config.json`中填写上面语言的标签的时候,程序会自动下载语言包

#### 关于user-id
如果您不知道您的 `user-id` ,可以将此项留空,在运行这个机器人后输入`/myid`,此机器人就会返回您的`user-id`.

53 changes: 32 additions & 21 deletions README_zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@
- [x] Aria2 控制
- [ ] [SimpleTorrent](https://github.com/boypt/simple-torrent) 控制
- [ ] qbittorrent 控制
- [ ] 多下載伺服器同時控制

#### 機器人協定支援
- [x] Telegram Bot
- [ ] 釘釘機器人

#### 功能
- [x] 控制伺服器檔
- [x] 刪除檔
- [x] 下載檔案
- [x] 下載 HTTP/FTP 連結
- [x] 下載 Magnet 連結
Expand All @@ -28,7 +31,7 @@
- [ ] 下載完成後,向 OneDrive 上傳檔
- [ ] 下載完成後,向 Google Drive 上傳檔
- [ ] 下載完成後,向 Mega 上傳檔
- [ ] 下載完成後,向 天翼網盤 上傳檔
- [ ] 下載完成後,向 天翼網盤 上傳文件
- [x] 附加其他功能
- [x] 多語言支援
- [x] 簡體中文
Expand Down Expand Up @@ -61,32 +64,40 @@
4. 在想要執行本程式的根目錄配置`config.json`
5. 運行可執行檔

## 三種方式傳遞參數
您可以通過三種方式將參數傳遞給`DownloadBot`
* [X] 設定檔
* [ ] Cil 命令列
* [ ] 系統環境變數

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

| | Aria2 server | Aria2 key | Telegram bot key | Telegram user id | Max items in range(default 20) | language |
|------------------|-----------------|--------------|------------------|------------------|--------------------------------|-------------|
| 設定檔 參數 | aria2-server | aria2-key | bot-key | user-id | max-index | language |
| Cil 命令列 參數 | --aria2-server | --aria2-key | --bot-key | --user-id | --max-index | --language |
| 系統環境變數參數 | ta.aria2-server | ta.aria2-key | ta.bot-key | ta.user-id | ta.max-index | ta.language |

### 設定檔示例

```json
{
"aria2-server": "ws://192.168.1.154:6800/jsonrpc",
"aria2-key": "xxx",
"bot-key": "123456789:xxx",
"user-id": "123456",
"max-index": 10,
"language":"en"
"aria2-server": "ws://127.0.0.1:5800/jsonrpc",
"aria2-key": "xxxxxxxx",
"bot-key": "123456789:xxxxxxxxx",
"user-id": "123456789",
"max-index": 10,
"sign":"Main Aria2",
"language":"zh-CN",
"downloadFolder":"C:/aria2/Aria2Data"
}
```
#### 各項對應解釋
* aria2-server:aria2伺服器位址,默認使用websocket連接。如果要使用websocket連接aria2,請務必設置`aria2.conf`內的`enable-rpc=true`。如果不是必須,請儘量設置本地的aria2位址,以便於最大化的使用本程式
* aria2-key:aria2.conf中rpc-secret的值
* bot-key:Telegram Bot的標識
* user-id:管理員的ID
* max-index:下載資訊最大顯示數量,建議10條(以後會改進)
* sign:此機器人的標識,如果需要多個伺服器連接同一個機器人,通過這一項可以確定具體是哪一台伺服器
* language:機器人輸出的語言
* downloadFolder:Aria2下載檔案保存的位址

#### 目前支援的語言及語言標籤
| 語言 | 標籤 |
|----------|-------|
| 英語 | en |
| 簡體中文 | zh-CN |
| 繁體中文 | zh-TW |

當您在`config.json`中填寫上面語言的標籤的時候,程式會自動下載語言包

#### 關於user-id
如果您不知道您的 `user-id` ,可以將此項留空,在運行這個機器人後輸入`/myid`,此機器人就會返回您的`user-id`.


Loading

0 comments on commit 4cc6fd7

Please sign in to comment.