diff --git a/README.md b/README.md index 1b9bf82..5c88f56 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,8 @@ npm i { "driver": "OneJAV", "url": "https://onejav.com/popular/", - "interval": 300 + "interval": 300, + "pages" : 5 } ], "qbittorrent": { @@ -75,6 +76,7 @@ npm i - **type:** RSS 的解析方法 (仅在驱动为 RSS 时生效) - **MT:** MT 代表 PT 站 M-Team 的 RSS 格式; 具体: 以车牌号开头(XXX-0NN), 车牌号后紧跟空格, 以大小结尾([xx.xxG]), 可在 Nexus RSS 订阅中勾选包括大小得到 - **url:** 订阅地址(OneJAV 直接填写列表页地址即可) + - **pages:** OneJAV自动抓取页数 (/popular/只有5页) - **qbittorrent** - **savePath:** 下载文件保存路径, 非 Docker 使用留空即可, 若使用 [JAVClub/docker](https://github.com/JAVClub/docker) 部署则填写 `/usr/app/tmp/downloads/JAVClub/` 即可 diff --git a/config/dev.example.json b/config/dev.example.json index 795644d..98a30d8 100644 --- a/config/dev.example.json +++ b/config/dev.example.json @@ -12,7 +12,8 @@ { "driver": "OneJAV", "url": "https://onejav.com/popular/", - "interval": 300 + "interval": 300, + "pages" : 5 } ], "qbittorrent": { diff --git a/src/module/qbittorrent.js b/src/module/qbittorrent.js index 9e844d5..8f22277 100644 --- a/src/module/qbittorrent.js +++ b/src/module/qbittorrent.js @@ -63,7 +63,7 @@ class Qbittorrent { logger.debug('Getting torrent list') const apiURI = '/api/v2/torrents/info?limit=10' - const uri = apiURI + '&category=JAVClub&filter=paused&sort=completion_on&reverse=true' + const uri = apiURI + '&category=JAVClub&filter=completed&sort=completion_on&reverse=true' const result = await this.sendRequest(uri) return result diff --git a/src/pull/init.js b/src/pull/init.js index 4d65331..33c5c83 100644 --- a/src/pull/init.js +++ b/src/pull/init.js @@ -56,12 +56,14 @@ for (const i in remoteList) { break case 'OneJAV': - logger.debug(`[${i}] Creating OneJAV driver stack`) - driverStack[i] = new DriverOnejav(item.url) - runAndSetInterval(async () => { - const res = await driverStack[i].run() - return res - }, item.interval, 'OneJAV: ' + i, addContent) + for (t = 1; t <= item.pages; t++) { + logger.debug(`[${i}-${t}] Creating OneJAV driver stack`) + driverStack[i] = new DriverOnejav(item.url + `?page=${t}`) + runAndSetInterval(async () => { + const res = await driverStack[i].run() + return res + }, item.interval, 'OneJAV: ' + `${i}-${t}`, addContent) + } break default: logger.warn(`Unknown driver ${item.driver}`)