Skip to content

Commit

Permalink
Dev (#7)
Browse files Browse the repository at this point in the history
* fix(audiences): 支持Microsoft Edge浏览器获取做种体积 (pt-plugins#1851)

Co-authored-by: Shl-Cool <cool@cool.com>

* fix: chrome as onBeforeSendHeaders default

* build: full use vite to build pkg

* build: ignore extra `README.md` file in resource folder

* fix(ts): add shim-env for vite

* fix(SSD): 修复SSD副标题显示问题

同时增加 MiniDB 标签

* deps: remove webpack loader

* deps: use vite plugin to provide node polyfills

* feat (x-ite): 搜索关键词替换, 结果更精确 (pt-plugins#1860)

* feat: 启用 `searchEntryConfig.area.keyAutoMatch` 正则 Unicode 支持

* feat: 增加禁用 `searchEntryConfig.area` 选项

* feat: support x-ite (pt-plugins#1862)

* build: disable rollup treeshake because we use eval

* fix(mt): 拖放链接到助手图标无效 pt-plugins#1870

* feat: qb 自定义标签 pt-plugins#1883

* 不需要留空即可,逗号分隔. 比如: PTPP,MOVIEPILOT

* fix(mt): keep upload task

* fix(hh): level requirements

* fix(hdh): pt-plugins#1850 level requirements

* fix(ss): pt-plugins#1736 uploads

* site(YemaPT): 初步支持搜索和部分个人信息获取

* ci: lock pr action build version to `1.x.x.1`

closed: pt-plugins#1890

* fix(hdd): bonusPerHour

* fix fsm

* fix(fsm): join time

* fix(pig): HnR count (pt-plugins#1898)

* fix(fsm): search result link

* feat: 适配新站点ToSky (pt-plugins#1886)

* feat(blu): remove domain xyz

* fix(userData): 升级用户数据时,先并入最新的hosts下数据(如有)

may closed: pt-plugins#1907

* fix(ad): seeding and seedingSize

* feat(u3d): seeding status (pt-plugins#1901)

* feat(blu): remove domain xyz

* feat(u3d): support seeding status

* fix(u3d): remove wrong progress

* feat(aihter): support complete status

* Revert "feat(aihter): support complete status"

This reverts commit 6735f83.

* feat(u3d): support more status

* fix(u3d): unsuitable judgment conditions

* fix(bhd): unsuitable judgment condition

* fix(u3d): progess

* fix(xhb): 更新升级条件

* fix(mt): 搜索页下载种子到本地 pt-plugins#1808

---------

Co-authored-by: SHL-COOL <31879581+SHL-COOL@users.noreply.github.com>
Co-authored-by: Shl-Cool <cool@cool.com>
Co-authored-by: IITII <ccmejx@gmail.com>
Co-authored-by: Rhilip <admin@rhilip.info>
Co-authored-by: 栽培者 <ronggang.zhou@gmail.com>
Co-authored-by: Rhilip <rhilipruan@gmail.com>
Co-authored-by: Rhilip <Rhilip@users.noreply.github.com>
Co-authored-by: Dawei Huang <davidxuang@live.com>
Co-authored-by: Trim21 <trim21.me@gmail.com>
Co-authored-by: fzlins <fzlins2013@gmail.com>
Co-authored-by: Hui-Shao <31568606+hui-shao@users.noreply.github.com>
Co-authored-by: halehal <haleyhrid@gmail.com>
Co-authored-by: ted423 <priston910423@gmail.com>
Co-authored-by: LovelyBaibai <1633480356@qq.com>
  • Loading branch information
15 people authored Jun 14, 2024
1 parent 0d083b2 commit d780cef
Show file tree
Hide file tree
Showing 54 changed files with 1,721 additions and 1,211 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
fetch-depth: ${{ github.event_name == 'pull_request' && 1 || 0 }}

- name: Setup Node
uses: actions/setup-node@v4
Expand Down
27 changes: 7 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@
"displayName": "PT 助手 Plus",
"homepage": "https://github.com/pt-plugins/PT-Plugin-Plus",
"scripts": {
"build": "yarn build:background && yarn build:content && yarn build:index",
"lint": "eslint ./src/ --ext ts,vue,js",
"background": "webpack --config webpack/prod-background.cjs && webpack --config webpack/prod-content.cjs",
"dev": "yarn dev:background && yarn dev:content && yarn dev:index",
"dev-s": "cd debug && yarn install && tsc && node ./dist/index.js",
"build": "yarn build:index && yarn build:content && yarn build:background",
"dev:index": "vite build --watch",
"dev:background": "webpack --config webpack/dev-background.cjs --progress",
"dev:content": "webpack --config webpack/dev-content.cjs --progress",
"dev:bc": "yarn dev:background && yarn dev:content",
"resource": "cd debug && yarn install && tsc && node ./dist/buildResource.js",
"dev:background": "yarn build:background -- --mode development",
"dev:content": "yarn build:content -- --mode development",
"build:index": "vite build",
"build:background": "webpack --config webpack/prod-background.cjs --progress",
"build:content": "webpack --config webpack/prod-content.cjs --progress"
"build:background": "vite build --config vite.config.background.ts",
"build:content": "vite build --config vite.config.content.ts"
},
"dependencies": {
"basiccontext": "^3.5.1",
Expand All @@ -36,12 +31,9 @@
"file-saver": "^2.0.5",
"highcharts": "^10.2.1",
"highcharts-vue": "^1.4.0",
"https-browserify": "^1.0.0",
"i18next": "^21.9.1",
"jszip": "^3.10.1",
"parse-torrent": "^11.0.16",
"path-browserify": "^1.0.1",
"stream-http": "^3.2.0",
"ua-parser-js": "^1.0.2",
"url-parse": "^1.5.10",
"vue": "~2.7.0",
Expand Down Expand Up @@ -69,20 +61,15 @@
"@typescript-eslint/parser": "^7.7.1",
"@vitejs/plugin-vue2": "^2.3.1",
"@vue/eslint-config-typescript": "^13.0.0",
"copy-webpack-plugin": "^12.0.2",
"esbuild-loader": "^4.1.0",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.25.0",
"git-rev-sync": "^3.0.2",
"sass": "^1.75.0",
"sass-loader": "^14.2.1",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vue-template-compiler": "~2.7.0",
"vuetify-loader": "~1.7.3",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.10.0"
"vite-plugin-node-polyfills": "^0.21.0",
"vue-template-compiler": "~2.7.0"
},
"browserslist": [
"> 1%",
Expand Down
6 changes: 2 additions & 4 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"libs/types.expand.js",
"libs/jquery/jquery-3.3.1.min.js",
"libs/Base64.js",
"js/background/libs.js",
"js/background/background.js"
"background/index.js"
]
},
"content_scripts": [{
Expand All @@ -65,8 +64,7 @@
"libs/notice/notice.js",
"libs/basicContext/basicContext.min.js",
"libs/drag.js",
"js/content/libs.js",
"js/content/content.js"
"contentScripts/index.js"
]
}],
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
Expand Down
15 changes: 11 additions & 4 deletions resource/clients/qbittorrent/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,19 +199,26 @@
}

if (clientOptions && siteConfig) {
let tmpTags = []
// 以 frds 为例, 这里是 keepfrds
if (clientOptions.hostnameAsTag) {
let url = new URL(siteConfig.activeURL).hostname
let arr = url.split('.')
arr.pop()
tags.push(arr.pop())
tmpTags.push(arr.pop())
}
// 以 frds 为例, 这里是 pt@keepfrds
if (clientOptions.siteNameAsTag) {
tags.push(siteConfig.name)
tmpTags.push(siteConfig.name)
}
tmpTags = tmpTags.filter(_ => !!_).map(_ => _.toLowerCase())
if (clientOptions.customTags && clientOptions.customTags.length > 0) {
tmpTags = tmpTags.concat(clientOptions.customTags)
}
tags = tags.concat(tmpTags)
}
tags = tags.filter(_ => !!_).map(_ => _.toLowerCase()).join(',')

tags = tags.filter(_ => !!_).join(',')

if (autoTMM !== undefined) {
formData.append("autoTMM", autoTMM);
Expand Down Expand Up @@ -261,7 +268,7 @@
params: params
},
resultData => {
console.log(`/api/v2/torrents/add: ${resultData}`)
console.log(`/api/v2/torrents/add: ${JSON.stringify(resultData)}`)
let result
switch (typeof resultData) {
case 'object':
Expand Down
5 changes: 4 additions & 1 deletion resource/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,8 @@
"enableCategory": "Automatically add QB categories when sending torrents (Beta)",
"enableCategoryText": "QB category list",
"enableCategoryTextTip": "Fill in one address per line, with commas separating the category name and path. Only support FULL PATH (e.g. movie,/tmp/movie) or '_' (e.g. movie,_) to represent qbit's default path. The category will be assigned if corresponding path matched user-selected one,with automatic seed management enabled.",
"customTagText": "QB custom tag list",
"customTagTextTip": "Leave blank for disable, separated by commas. eg: PTPP,MOVIEPILOT",
"autoCreate": "<Automatically generated after saving>",
"test": "Test if the server can connect",
"testSuccess": "Server can be connected",
Expand Down Expand Up @@ -760,7 +762,8 @@
"urlTip": "The full address of the website, such as: https:\/\/www.github.com\/",
"passkey": "Passkey",
"passkeyTip": "The key is only used to copy the download address operation. If you do not need this function, please leave it blank.",
"allowSearch": "Allow Search",
"allowSearch": "Allow search",
"disableSearchTransform": "Disable search transform",
"allowGetUserInfo": "Allow access to user information (Beta)",
"cdn": "Site CDN list",
"cdnTip": "If you use a different URL than the system definition, you can fill in the currently used website address, fill in one address per line, the first one will be used as the address used for the search.",
Expand Down
3 changes: 3 additions & 0 deletions resource/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,8 @@
"enableCategory": "发送种子时自动添加 QB 分类 (Beta)",
"enableCategoryText": "QB 分类列表",
"enableCategoryTextTip": "每行填写一个地址,逗号分隔分类名称和路径, 不支持路径关键字。如:'movie,/tmp/movie'。默认分类请使用'movie,_'的格式。还需在下载目录设置里面填写一样的下载路径. 当指定了下载路径且下载路径命中了某一个分类, 才会添加分类并启用自动种子管理.",
"customTagText": "QB 自定义标签列表",
"customTagTextTip": "不需要留空即可,逗号分隔. 比如: PTPP,MOVIEPILOT",
"autoCreate": "<保存后自动生成>",
"test": "测试服务器是否可连接",
"testSuccess": "服务器可连接",
Expand Down Expand Up @@ -756,6 +758,7 @@
"passkey": "密钥",
"passkeyTip": "密钥仅用于复制下载地址操作,如果不需要用到此功能,请留空",
"allowSearch": "允许搜索",
"disableSearchTransform": "禁用搜索替换",
"allowGetUserInfo": "允许获取用户信息(Beta)",
"cdn": "站点CDN列表",
"cdnTip": "如您使用的网址和系统定义的不同,可在此填写当前使用的网站地址,每行填写一个地址,第一个将做为搜索时使用的地址",
Expand Down
12 changes: 8 additions & 4 deletions resource/schemas/UNIT3D/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,24 @@
}],
"fieldSelector": {
"progress": {
"selector": ["button.btn.btn-success.btn-circle, i[title*='Seeding']", "button.btn.btn-warning.btn-circle, button.btn.btn-info.btn-circle", ""],
"selector": [
"span.torrent-icons > i.fas.fa-arrow-circle-up.text-success.torrent-icons, i.fas.fa-thumbs-down",
"span.torrent-icons > i.fas.fa-do-not-enter.torrent-icons, span.torrent-icons > i.fa-arrow-circle-down.text-danger.torrent-icons",
""
],
"switchFilters": [
["100"],
["0"],
["null"]
]
},
"status": {
"selector": ["button.btn.btn-success.btn-circle, i[title*='Currently Seeding']", "button.btn.btn-warning.btn-circle", "button.btn.btn-info.btn-circle", "i[title*='Completed']"],
"selector": ["span.torrent-icons > i.fas.fa-arrow-circle-up.text-success.torrent-icons", "span.torrent-icons > i.fa-arrow-circle-down.text-danger.torrent-icons", "span.torrent-icons > i.fas.fa-thumbs-down.text-warning.torrent-icons", "span.torrent-icons > i.fas.fa-do-not-enter.torrent-icons"],
"switchFilters": [
["2"],
["1"],
["3"],
["255"]
["255"],
["3"]
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion resource/schemas/UNIT3D/getSearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@
}
result = cell.text().trim();
}
if(result == "")return null;
if(result === "")return null;
return result;
}
}
Expand Down
9 changes: 5 additions & 4 deletions resource/sites/audiences.me/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,18 +146,19 @@
"fields": {
"seeding": {
"selector": [
"tr:not(:eq(0))"
"b:first"
],
"filters": [
"let l={}; query.each(function() { l[jQuery(this).find('td.rowfollow:eq(1) a').attr('href')] = jQuery(this).find('td.rowfollow:eq(2)').text(); }); Object.keys(l).length;"
"query.text()"
]
},
"seedingSize": {
"selector": [
"tr:not(:eq(0))"
""
],
"filters": [
"let l={}; query.each(function() { l[jQuery(this).find('td.rowfollow:eq(1) a').attr('href')] = jQuery(this).find('td.rowfollow:eq(2)').text(); }); _self.getTotalSize(Object.values(l));"
"query.clone().children().remove().end().text().replace(/,/g,'').match(/([\\d.]+ ?[ZEPTGMK]?i?B)/)",
"(query && query.length>1)?(query[1]).sizeToNumber():0"
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion resource/sites/beyond-hd.me/getSearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
}
result = cell.text().trim();
}
if(result == "")return null;
if(result === "")return null;
return result;
}
}
Expand Down
1 change: 0 additions & 1 deletion resource/sites/blutopia.cc/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
}
}
},
"cdn": ["https://blutopia.cc/","https://blutopia.xyz/"],
"searchEntryConfig": {
"skipNonLatinCharacters": true
}
Expand Down
64 changes: 64 additions & 0 deletions resource/sites/crabpt.vip/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,71 @@
"interval": "4",
"downloaded": "50GB",
"ratio": "1.05",
"seedingPoints": "40000",
"privilege": "得到一个邀请名额;可以直接发布种子;可以查看NFO文档;可以查看用户列表;可以请求续种; 可以发送邀请; 可以查看排行榜;可以查看其它用户的种子历史(如果用户隐私等级未设置为\"\"); 可以删除自己上传的字幕。"
},
{
"level": "2",
"name": "Elite User",
"interval": "8",
"downloaded": "120GB",
"ratio": "1.55",
"seedingPoints": "80000",
"privilege": "Elite User及以上用户封存账号后不会被删除。"
},
{
"level": "3",
"name": "Crazy User",
"interval": "15",
"downloaded": "300GB",
"ratio": "2.05",
"seedingPoints": "150000",
"privilege": "得到两个邀请名额; 可以在做种/下载/发布的时候选择匿名模式。"
},
{
"level": "4",
"name": "Insane User",
"interval": "25",
"downloaded": "500GB",
"ratio": "2.55",
"seedingPoints": "250000",
"privilege": "可以查看普通日志。"
},
{
"level": "5",
"name": "Veteran User",
"interval": "40",
"downloaded": "750GB",
"ratio": "3.05",
"seedingPoints": "400000",
"privilege": "得到三个邀请名额;可以查看其它用户的评论、帖子历史;Veteran User及以上用户会永远保留账号。"
},
{
"level": "6",
"name": "Extreme User",
"interval": "60",
"downloaded": "1TB",
"ratio": "3.55",
"seedingPoints": "600000",
"privilege": "可以更新过期的外部信息;可以查看Extreme User论坛。"
},
{
"level": "7",
"name": "Ultimate User",
"interval": "80",
"downloaded": "1.5TB",
"ratio": "4.05",
"seedingPoints": "800000",
"privilege": "得到五个邀请名额。"
},
{
"level": "8",
"name": "Nexus Master",
"interval": "100",
"downloaded": "3TB",
"ratio": "4.55",
"seedingPoints": "1000000",
"privilege": "得到十个邀请名额。"
}
],
"collaborator": "trim21",
Expand Down
7 changes: 2 additions & 5 deletions resource/sites/fsm.name/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,8 @@
"data.peers.upload"
]
},
"joinTime": {
"value": "1711715887"
},
"bonusPerHour": {
"value": "未知,注册时间也未知"
"value": "N/A"
}
}
},
Expand Down Expand Up @@ -206,4 +203,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion resource/sites/fsm.name/getSearchResult.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
let data = {
title: group.title,
subTitle: group.tags,
link: `${site.url}/detail/?tid=${group.tid}`,
link: `${site.url}/Torrents/details?tid=${group.tid}`,
url: `${site.url}/api/Torrents/download?tid=${group.tid}&passkey=${site.passkey}`,
size: Number(group.fileRawSize),
time: Date(group.createdTs),
Expand Down
28 changes: 25 additions & 3 deletions resource/sites/hddolby.com/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,10 @@
"privilege": ""
}
],
"collaborator": ["iceyuamao0510", "tongyifan"],
"collaborator": [
"iceyuamao0510",
"tongyifan"
],
"searchEntryConfig": {
"fieldSelector": {
"progress": {
Expand Down Expand Up @@ -223,8 +226,27 @@
"merge": true,
"fields": {
"bonus": {
"selector": ["td.rowhead:contains('鲸币') + td", "td.rowhead:contains('Karma Points') + td"],
"filters": ["query.text().replace(/,/g,'')", "parseFloat(query)"]
"selector": [
"td.rowhead:contains('鲸币') + td",
"td.rowhead:contains('Karma Points') + td"
],
"filters": [
"query.text().replace(/,/g,'')",
"parseFloat(query)"
]
}
}
},
"bonusExtendInfo": {
"page": "/mybonus.php",
"fields": {
"bonusPerHour": {
"selector": [
"table[width='800'] > tbody > tr:contains('合计') > td:last-of-type"
],
"filters": [
"parseFloat(query.text().split('/')[0].trim())"
]
}
}
},
Expand Down
Loading

0 comments on commit d780cef

Please sign in to comment.