Skip to content

Commit 2129e34

Browse files
authored
Merge pull request #24 from reaitten/reaitten-patch-1
Added English Guide
2 parents 598b2a0 + 6efd443 commit 2129e34

File tree

1 file changed

+270
-0
lines changed

1 file changed

+270
-0
lines changed

docs/DownloadBot_Guide_en.md

+270
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
# Step by Step Guide for DownloadBot
2+
Written in [GoLang](https://golang.org)
3+
4+
Original Author by [gaowanliang](https://github.com/gaowanliang)
5+
6+
Guide by [reaitten](https://github.com/reaitten)
7+
8+
### Please note that the project in Beta!
9+
### I reccomend you to treat this as a preview only!!
10+
11+
## Useful Links
12+
[Github Repository](https://github.com/gaowanliang/DownloadBot)
13+
14+
[Very useful for getting a VPS and more!](https://free-for.dev/#/)
15+
16+
## Prerequisites
17+
You'll need a Linux system, preferably Debian or Debian based systems such as Ubuntu or Linux Mint
18+
19+
Any other Linux distros should work, although switch the commands for your package manager.
20+
21+
For Windows users, you may use the [Windows Subsystem for Linux (WSL)](https://docs.microsoft.com/en-us/windows/wsl/install-win10) (you may face problems deploying, I haven't tried yet)
22+
23+
A basic knowledge of Linux commands
24+
25+
A VPS (Not needed if deploying locally)
26+
27+
## Installing the Go Language
28+
29+
You'll need to install the GoLang in order to build the project.
30+
31+
Open a terminal or SSH into your VPS.
32+
33+
### Update Linux
34+
```
35+
sudo apt-get update && sudo apt-get upgrade -y
36+
```
37+
### Install needed dependencies
38+
```
39+
sudo apt-get install nano wget curl ca-certificates git -y
40+
```
41+
### Download GoLang Ver. 1.16.3
42+
#### x64 based System (for newer hardware, common)
43+
44+
Will be saved to user's Downloads folder.
45+
```
46+
wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz -P "$HOME/Downloads"
47+
```
48+
#### x86-32 based System (older architecture)
49+
```
50+
wget https://golang.org/dl/go1.16.3.linux-386.tar.gz -P "$HOME/Downloads"
51+
```
52+
### Extract from .tar.gz archive /usr/local/
53+
54+
We extract GoLang.tar.gz archive to /usr/local for easy convenience.
55+
```
56+
cd $HOME/Downloads
57+
sudo tar -C /usr/local/ -xzf go1.16.3.linux-amd64.tar.gz
58+
```
59+
### Check if everything has been extracted correctly
60+
61+
If you see files with the following command, everything extracted correctly.
62+
```
63+
ls /usr/local/go
64+
```
65+
### Set the PATH for GoLang
66+
If you don't know what everything means, it's okay since we're just linking GoLang to the system so whever we need to use GoLang, the system will know where the GoLang is e.g: /usr/local/go
67+
68+
You'll be adding a line of text at the bottom of .profile, follow carefully.
69+
70+
Edit .profile using a command-line editor.
71+
```
72+
sudo nano $HOME/.profile
73+
```
74+
Move all the way down at the bottom of the page using DownArrowKey
75+
76+
Then, add the follow line:
77+
```
78+
export PATH=$PATH:/usr/local/go/bin
79+
```
80+
Everything should look like this:
81+
```
82+
# ~/.profile: executed by the command interpreter for login shells.
83+
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
84+
# exists.
85+
# see /usr/share/doc/bash/examples/startup-files for examples.
86+
# the files are located in the bash-doc package.
87+
88+
# the default umask is set in /etc/profile; for setting the umask
89+
# for ssh logins, install and configure the libpam-umask package.
90+
#umask 022
91+
92+
# if running bash
93+
if [ -n "$BASH_VERSION" ]; then
94+
# include .bashrc if it exists
95+
if [ -f "$HOME/.bashrc" ]; then
96+
. "$HOME/.bashrc"
97+
fi
98+
fi
99+
100+
# set PATH so it includes user's private bin if it exists
101+
if [ -d "$HOME/bin" ] ; then
102+
PATH="$HOME/bin:$PATH"
103+
fi
104+
105+
# set PATH so it includes user's private bin if it exists
106+
if [ -d "$HOME/.local/bin" ] ; then
107+
PATH="$HOME/.local/bin:$PATH"
108+
fi
109+
110+
export PATH=$PATH:/usr/local/go/bin
111+
```
112+
Do ``ctrl+o, enter, ctrl+x`` to save, & exit
113+
114+
After, you'll need to apply the changes to the system
115+
```
116+
cd $HOME/
117+
source .profile
118+
```
119+
Now, to make sure GoLang is installed correctly, do
120+
```
121+
go version
122+
```
123+
If you get ```go version go1.16.3 linux/amd64```, you have successfully install GoLang!
124+
125+
## Installing Aria2
126+
We need aria2 for the download process of DownloadBot.
127+
128+
This script that we're going to need to use is in Chinese.
129+
130+
Will be saved in user's Downloads folder
131+
### Download Script
132+
```
133+
wget -N git.io/aria2.sh -P $HOME/Downloads && chmod +x $HOME/Downloads/aria2.sh
134+
```
135+
### Run Script
136+
```
137+
./aria2.sh
138+
```
139+
### To use the script:
140+
Just enter 1 to install and configure aria2 automatically, If you want to use it on azure, pay attention to limit the upload of BT download. The configuration file is in /$HOME/.aria2c/aria2.conf. you can refer to this website to customize the information in it.
141+
142+
### Start aria2
143+
You'll need to start aria2. Use:
144+
```
145+
sudo service aria2 start
146+
```
147+
148+
### Simple translation of Aria2 Script
149+
```
150+
Aria2 one click installation management script enhanced version [v2.7.4] by P3 TERX.COM
151+
0. Upgrade script
152+
———————————————————————
153+
1. Install aria2
154+
2. Update aria2
155+
3. Unload aria2
156+
———————————————————————
157+
4. Start aria2
158+
5. Stop aria2
159+
6. Restart aria2
160+
———————————————————————
161+
7. Modify the configuration
162+
8. View configuration
163+
9. View log
164+
10. Clear log
165+
———————————————————————
166+
11. Update BT tracker manually
167+
12. Update BT tracker automatically
168+
———————————————————————
169+
Aria2 status: installed | started
170+
Auto update BT Tracker: on
171+
Please enter the number [0-12]:
172+
```
173+
174+
## Cloning DownloadBot Repository
175+
Now, you'll need to copy the DownloadBot repo to your computer.
176+
Run the following to clone the repository to your Downloads folder:
177+
```
178+
cd $HOME/Downloads
179+
git clone https://github.com/gaowanliang/DownloadBot.git
180+
```
181+
## Setup Configs
182+
183+
After we clone the repository, we need to configure DownloadBot with ``config.json``.
184+
185+
Use this command, copy everything listed & paste it somewhere that you can refer to.
186+
```
187+
cat $HOME/aria2/aria2.conf
188+
```
189+
190+
191+
### config.json
192+
193+
You'll need to create a config file.
194+
195+
This command will create and let you edit ``config.json`` file.
196+
```
197+
nano config.json
198+
```
199+
Copy everything below onto ``config.json`` and edit with your own values.
200+
201+
```
202+
{
203+
"aria2-server": "ws://127.0.0.1:6800/jsonrpc",
204+
"aria2-key": "xxxxxxxx",
205+
"bot-key": "123456789:xxxxxxxxx",
206+
"user-id": "123456789",
207+
"max-index": 10,
208+
"sign":"Main Aria2",
209+
"language":"en",
210+
"downloadFolder":"/home/user/aria2/Aria2Data",
211+
"moveFolder":"/home/user/aria2/GoogleDrive"
212+
}
213+
```
214+
Note: aria2-server should be ``ws://127.0.0.1:6800/jsonrpc``
215+
216+
You need to only fill out the following:
217+
```
218+
"aria2-key" # from $HOME/aria2/aria2.conf
219+
"bot-key" # from @BotFather (Telegram)
220+
"user-id" # from @userinfobot (Telegram)
221+
"downloadFolder" # create folder
222+
"moveFolder" # create folder
223+
```
224+
225+
You'll also need to create two folders for ``downloadFolder`` & ``moveFolder`` using `mkdir`. e.g:
226+
```
227+
mkdir $HOME/Downloads/Aria2Data # downloadFolder
228+
mkdir $HOME/Downlaods/GoogleDrive # moveFolder
229+
```
230+
231+
#### Corresponding explanations
232+
* 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
233+
* aria2-key : The value of `rpc-secret` in `aria2.conf`
234+
* bot-key : ID of telegram Bot, get it by using [@BotFather](https://telegram.me/botfather)
235+
* user-id : The ID of the administrator. You can get this value from [@userinfobot](https://telegram.me/userinfobot). It supports setting multiple users as administrators. Different users are separated by commas `,` . If you want to set the users whose `user-id` are 123465789, 987654321 and 963852741 as administrators, you need to set them as follows:
236+
```json
237+
{
238+
···
239+
"user-id": "123456789,987654321,963852741",
240+
···
241+
}
242+
```
243+
* max-index:Maximum display quantity of download information, 10 pieces are recommended (to be improved in the future)
244+
* 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.
245+
* language: Language of Bot output
246+
* downloadFolder: Aria2 download file save address. If you do not use this parameter, enter `""`
247+
* moveFolder: The folder to which you want to move the files for the `downloadFolder`. If you do not use this parameter, enter `""`
248+
249+
250+
## Build DownloadBot
251+
Last part, you'll need to build DownloadBot & run it.
252+
253+
``go build`` will build the program,
254+
255+
``sudo chmod u+x ./DownloadBot`` will add the required permissions to run DownloadBot,
256+
257+
``./DownloadBot`` will run DownloadBot.
258+
259+
```
260+
go build
261+
sudo chmod u+x ./DownloadBot
262+
./DownloadBot
263+
```
264+
Sources:
265+
266+
https://golangdocs.com/install-go-linux
267+
268+
https://github.com/gaowanliang/DownloadBot/issues/12
269+
270+
https://github.com/gaowanliang/DownloadBot#corresponding-explanations

0 commit comments

Comments
 (0)