Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetInk committed Feb 6, 2020
1 parent b2834f5 commit 15f6184
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,46 @@ mvn package

3. 搜索你想要下载的图书,然后打开书的主页,这里以*https://lib-nuanxin.wqxuetang.com/#/Book/`2175744`* 为例,我们获取到了书的编号:`2175744`

4. 使用工具
4. Cookie获取

打开浏览器调试工具,进行如下截图步骤

![操作步骤.png](http://ww1.sinaimg.cn/large/005ViNx8gy1gbn4zpkd7uj315u0k4q66.jpg)

把截图中`Cookie:` 后面的内容全部`复制`下来,然后`粘贴``config.properties`文件中的`config.cookie`配置项后面

5. 使用工具

```shell
java -jar pdfd.jar -b <arg> -c <arg> -w <arg>
java -jar pdfd.jar -b <arg> -c <arg>

```
*参数说明*
**参数说明**

* `b` 上述获取到的书籍编号
* `c` 成功登录网站后,PHPSESSID的值
* `w` 工作目录

eg:
* `c` 该选项不指定时,程序会默认在pdf.jar所在目录读取`config.properties`文件

**配置文件样例**

```properties
#线程数,目前最好配置为1,请求过快时,服务器会限流,将会导致无法请求
config.threadCount=1
#登录文泉学堂后,cookie值
config.cookie=123456
#工作路径,用于存储临时图片、pdf文件
config.workPath=d:\\temp
# 连续请求最大阈值数,程序将停顿后再执行
config.maxRequestThreshold=45
#超过一定请求后,程序停顿多少秒继续执行(单位秒)
config.waitingSeconds=60
#默认休眠时间(单位毫秒)
config.defaultSleepTime=1000
```
*eg:*
```shell script
java -jar pdfd.jar -b 2175744 -w d:\\temp -c abcdefghijklmn
java -jar pdfd.jar -b 2175744
```

这时候等个几十秒后你就会在`d:\\temp\\pdfTest\\`看到下载好的PDF文件.


0 comments on commit 15f6184

Please sign in to comment.