Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Allow user to listen multiple pages from OneJAV #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ npm i
{
"driver": "OneJAV",
"url": "https://onejav.com/popular/",
"interval": 300
"interval": 300,
"pages" : 5
}
],
"qbittorrent": {
Expand All @@ -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/` 即可

Expand Down
3 changes: 2 additions & 1 deletion config/dev.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
{
"driver": "OneJAV",
"url": "https://onejav.com/popular/",
"interval": 300
"interval": 300,
"pages" : 5
}
],
"qbittorrent": {
Expand Down
2 changes: 1 addition & 1 deletion src/module/qbittorrent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions src/pull/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down