├── .eslintignore ├── .eslintrc.js ├── .github └── ISSUE_TEMPLATE │ ├── bug-report.md │ ├── feature.md │ └── new-site.md ├── .gitignore ├── .husky ├── .gitignore └── commit-msg ├── CHANGELOG.md ├── FUNDING.yml ├── LICENSE ├── README.md ├── assets └── cors.png ├── commitlint.config.js ├── dist └── douban-info-for-pt.user.js ├── package.json ├── scripts ├── build.js ├── dev.js ├── helper.js └── release.js ├── src ├── common.js ├── config │ ├── aither.cc.yaml │ ├── anthelion.me.yaml │ ├── asiancinema.me.yaml │ ├── avistaz.to.yaml │ ├── baconbits.org.yaml │ ├── beyond-hd.me.yaml │ ├── blutopia.xyz.yaml │ ├── broadcasthe.net.yaml │ ├── broadcity.in.yaml │ ├── filelist.io.yaml │ ├── hd-torrents.org.yaml │ ├── hdbits.org.yaml │ ├── iptorrents.com.yaml │ ├── karagarga.in.yaml │ ├── passthepopcorn.me.yaml │ ├── privatehd.to.yaml │ ├── secret-cinema.pw.yaml │ ├── shadowthein.net.yaml │ ├── tgx.rs.yaml │ ├── uhdbits.org.yaml │ ├── www.morethantv.me.yaml │ └── www.torrentleech.org.yaml ├── const.js ├── index.js └── style.js └── yarn.lock /.eslintignore: -------------------------------------------------------------------------------- 1 | dist -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | es6: true, 5 | jquery: true, 6 | greasemonkey: true, 7 | }, 8 | extends: [ 9 | 'standard', 10 | ], 11 | globals: { 12 | Atomics: 'readonly', 13 | $j: 'readonly', 14 | SharedArrayBuffer: 'readonly', 15 | }, 16 | parserOptions: { 17 | ecmaVersion: 2020, 18 | }, 19 | rules: { 20 | 'no-use-before-define': 0, 21 | semi: ['error', 'always'], 22 | 'comma-dangle': ['error', 'always-multiline'], 23 | }, 24 | }; 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 反馈BUG 3 | about: 反馈一个脚本存在的问题 4 | title: "[BUG]" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **为了更好地了解问题,请填写以下信息** 11 | * 浏览器名称: 12 | * 浏览器版本: 13 | * 所用用户脚本扩展名称: 14 | * douban-info-for-pt版本: 15 | 16 | **问题描述** 17 | 18 | 19 | **复现步骤** 20 | 21 | 22 | **问题截图** 23 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 功能请求 3 | about: 提出一个建议或者需要的新功能 4 | title: "[FEATURE]" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **这个功能是否与某个问题相关** 11 | 12 | 13 | **描述你的期望功能** 14 | 15 | 16 | **描述你的替代方案** 17 | 18 | 19 | **额外信息** 20 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-site.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 站点支持请求 3 | about: 发布一个脚本目前还没进行支持的站点 4 | title: "[NewSite]" 5 | labels: new site 6 | assignees: '' 7 | 8 | --- 9 | 10 | * 站点地址: 11 | * 种子页是否包含IMDB信息: 12 | * 其他信息: 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode/ 3 | .cache 4 | src/config.json 5 | .DS_Store -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn commitlint --edit $1 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [1.7.6](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.7.5...1.7.6) (2024-07-19) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * replace jquery cdn ([7041441](https://github.com/techmovie/DouBan-Info-for-PT/commit/7041441515748266925d04ef120697fd8e6ce4fe)) 7 | 8 | 9 | 10 | ## [1.7.5](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.7.4...1.7.5) (2023-09-23) 11 | 12 | 13 | ### Bug Fixes 14 | 15 | * fix body style ([138e915](https://github.com/techmovie/DouBan-Info-for-PT/commit/138e91500d6d677e39bfec95f95783466ad05467)) 16 | 17 | 18 | 19 | ## [1.7.4](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.7.3...1.7.4) (2023-08-30) 20 | 21 | 22 | ### Features 23 | 24 | * add ant remove rargb ([5c6158f](https://github.com/techmovie/DouBan-Info-for-PT/commit/5c6158f52f10a7f00a58c59761b9789e5c12a3ec)) 25 | 26 | 27 | 28 | ## [1.7.3](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.7.2...1.7.3) (2023-07-13) 29 | 30 | 31 | ### Bug Fixes 32 | 33 | * add css file of douban to script ([26103c5](https://github.com/techmovie/DouBan-Info-for-PT/commit/26103c536f6df7961638c98735fa2d46f3a8b2b5)) 34 | 35 | 36 | 37 | ## [1.7.2](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.7.1...1.7.2) (2023-06-12) 38 | 39 | 40 | ### Bug Fixes 41 | 42 | * 修复部分条目中文名不显示的问题 ([1df7fee](https://github.com/techmovie/DouBan-Info-for-PT/commit/1df7fee6d80ee779bde61e9dadfc0a41d3a666a5)) 43 | 44 | 45 | ### Features 46 | 47 | * **new site:** add TorrentGalaxy ([f1d6e24](https://github.com/techmovie/DouBan-Info-for-PT/commit/f1d6e241fe26e01d6dd36ea068faedd8128003e0)), closes [#12](https://github.com/techmovie/DouBan-Info-for-PT/issues/12) 48 | 49 | 50 | 51 | ## [1.7.1](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.7.0...1.7.1) (2023-05-06) 52 | 53 | 54 | ### Bug Fixes 55 | 56 | * 修改中文名获取逻辑 ([1aab56c](https://github.com/techmovie/DouBan-Info-for-PT/commit/1aab56c50f221757658a1fdefc7f009453c152eb)) 57 | 58 | 59 | 60 | # [1.7.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.6.4...1.7.0) (2023-05-04) 61 | 62 | 63 | 64 | ## [1.6.4](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.6.3...1.6.4) (2023-04-26) 65 | 66 | 67 | ### Bug Fixes 68 | 69 | * 替换imdb获取豆瓣id的方法 豆瓣需要在已登陆状态 ([ec46ca1](https://github.com/techmovie/DouBan-Info-for-PT/commit/ec46ca1ff639a1d30a5ab89b4b0a55c2ea0cafae)) 70 | 71 | 72 | 73 | ## [1.6.3](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.6.2...1.6.3) (2022-11-07) 74 | 75 | 76 | ### Bug Fixes 77 | 78 | * 豆瓣简介增加dom选择器 ([69ddb87](https://github.com/techmovie/DouBan-Info-for-PT/commit/69ddb87fcabf6598a47b4ce08ca7aba7960cac96)) 79 | 80 | 81 | 82 | ## [1.6.2](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.6.1...1.6.2) (2022-05-01) 83 | 84 | 85 | ### Bug Fixes 86 | 87 | * **mtv:** title selector ([5da51a7](https://github.com/techmovie/DouBan-Info-for-PT/commit/5da51a70aed2aae3536af645f5a71aa16b3f221e)) 88 | 89 | 90 | 91 | ## [1.6.1](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.6.0...1.6.1) (2022-04-25) 92 | 93 | 94 | ### Features 95 | 96 | * **new site:** support MTV ([cef8679](https://github.com/techmovie/DouBan-Info-for-PT/commit/cef8679e616a326a6b2a04575e21b8a112f0ac10)) 97 | 98 | 99 | 100 | # [1.6.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.5.0...1.6.0) (2022-02-27) 101 | 102 | 103 | ### Bug Fixes 104 | 105 | * add [@grant](https://github.com/grant) ([89dc341](https://github.com/techmovie/DouBan-Info-for-PT/commit/89dc341f1c2668a0eae1dc20a014fe64ff852d85)) 106 | 107 | 108 | ### Features 109 | 110 | * **new site:** support Bdc ([be7148d](https://github.com/techmovie/DouBan-Info-for-PT/commit/be7148d8f125b274763c988ed7ce4f45aa01f6f9)) 111 | 112 | 113 | 114 | # [1.5.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.4.1...1.5.0) (2022-02-22) 115 | 116 | 117 | ### Features 118 | 119 | * 访问过电影保存到本地 避免重复请求 ([e128e00](https://github.com/techmovie/DouBan-Info-for-PT/commit/e128e0070020d2611863c3d766129e8ad8e107fd)) 120 | 121 | 122 | 123 | ## [1.4.1](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.4.0...1.4.1) (2022-01-23) 124 | 125 | 126 | ### Features 127 | 128 | * 支持HDB request页面 ([4153253](https://github.com/techmovie/DouBan-Info-for-PT/commit/4153253b737a15be9a8e65733bee97898b7eb524)), closes [#8](https://github.com/techmovie/DouBan-Info-for-PT/issues/8) 129 | 130 | 131 | 132 | # [1.4.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.3.3...1.4.0) (2021-10-01) 133 | 134 | 135 | ### Features 136 | 137 | * **ptp:** 增加request页支持 ([a596e9f](https://github.com/techmovie/DouBan-Info-for-PT/commit/a596e9fce5f19b56b70d84e9bc108788c49438ff)), closes [#5](https://github.com/techmovie/DouBan-Info-for-PT/issues/5) 138 | 139 | 140 | 141 | ## [1.3.3](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.3.2...1.3.3) (2021-09-28) 142 | 143 | 144 | ### Bug Fixes 145 | 146 | * imdb检索改用豆瓣官方接口 ([9eca1c6](https://github.com/techmovie/DouBan-Info-for-PT/commit/9eca1c6324f501adb23e1a3dab523a864f588008)), closes [#4](https://github.com/techmovie/DouBan-Info-for-PT/issues/4) 147 | 148 | 149 | 150 | ## [1.3.2](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.3.1...1.3.2) (2021-09-12) 151 | 152 | 153 | ### Bug Fixes 154 | 155 | * **ipt:** adapt another host ([0b09b2c](https://github.com/techmovie/DouBan-Info-for-PT/commit/0b09b2c2c31f0fe657452d86678bbb61d9358f2c)), closes [#3](https://github.com/techmovie/DouBan-Info-for-PT/issues/3) 156 | 157 | 158 | 159 | ## [1.3.1](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.3.0...1.3.1) (2021-07-30) 160 | 161 | 162 | ### Bug Fixes 163 | 164 | * bhd imdb选择器修复 ([eac3449](https://github.com/techmovie/DouBan-Info-for-PT/commit/eac34493572479fe6b338d8f7d6c3bf6e724f075)) 165 | 166 | 167 | 168 | # [1.3.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.2.0...1.3.0) (2021-07-22) 169 | 170 | 171 | ### Bug Fixes 172 | 173 | * 适配BHD library页 ([bb92591](https://github.com/techmovie/DouBan-Info-for-PT/commit/bb92591fdf0c9c10790b1df005b7a0de72519d9d)) 174 | 175 | 176 | ### Features 177 | 178 | * **new site:** aither bB iTS SC ([308d224](https://github.com/techmovie/DouBan-Info-for-PT/commit/308d22453553f07ad1167f9fdcbe42dcba21f95f)) 179 | * **ptp:** 显示非中文标题 ([6a981ec](https://github.com/techmovie/DouBan-Info-for-PT/commit/6a981ecbbf77ce674ad9c75231d4ad02b7df72fd)) 180 | 181 | 182 | 183 | # [1.2.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.7...1.2.0) (2021-06-26) 184 | 185 | 186 | ### Features 187 | 188 | * 支持显示豆瓣简介 ([d967b5d](https://github.com/techmovie/DouBan-Info-for-PT/commit/d967b5d5b92aee727deb637e6b5055c536848851)) 189 | 190 | 191 | 192 | ## [1.1.7](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.6...1.1.7) (2021-06-19) 193 | 194 | 195 | ### Bug Fixes 196 | 197 | * 豆瓣信息获取改为直接请求豆瓣链接 ([06b8bec](https://github.com/techmovie/DouBan-Info-for-PT/commit/06b8bec4cf14daddaebf20efefaf33b644243b08)) 198 | 199 | 200 | ### Features 201 | 202 | * **new site:** add avz support ([a775647](https://github.com/techmovie/DouBan-Info-for-PT/commit/a7756470c659f7e85239b6ff2e1744c2b4a6becf)) 203 | * 替换imdb获取豆瓣id接口 ([e829394](https://github.com/techmovie/DouBan-Info-for-PT/commit/e829394c3d99ee8b40dc2f1cf458598f24ef58fa)) 204 | 205 | 206 | 207 | ## [1.1.6](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.5...1.1.6) (2021-05-21) 208 | 209 | 210 | ### Bug Fixes 211 | 212 | * 修改获奖情况样式 ([4d84783](https://github.com/techmovie/DouBan-Info-for-PT/commit/4d8478366ad68b21c55a9208bea32c5643074fa7)) 213 | 214 | 215 | 216 | ## [1.1.5](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.4...1.1.5) (2021-05-12) 217 | 218 | 219 | ### Bug Fixes 220 | 221 | * 替换豆瓣接口 ptp增加显示获奖信息 ([379ef30](https://github.com/techmovie/DouBan-Info-for-PT/commit/379ef302322810005bbc2c4f4303e248cd0a81fb)) 222 | 223 | 224 | 225 | ## [1.1.4](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.3...1.1.4) (2021-05-06) 226 | 227 | 228 | ### Features 229 | 230 | * **new site:** add BTN IPT TL support ([7678cc9](https://github.com/techmovie/DouBan-Info-for-PT/commit/7678cc995fe83405b258a6967b1a51c7db4b536b)) 231 | 232 | 233 | 234 | ## [1.1.3](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.2...1.1.3) (2021-04-30) 235 | 236 | 237 | ### Bug Fixes 238 | 239 | * 修复HDB部分主题样式 ([82070f0](https://github.com/techmovie/DouBan-Info-for-PT/commit/82070f052d02c43bf82f435032aa80c5e7c2287d)), closes [#1](https://github.com/techmovie/DouBan-Info-for-PT/issues/1) 240 | 241 | 242 | ### Features 243 | 244 | * 剧集显示更准确季数 ([e7cde7d](https://github.com/techmovie/DouBan-Info-for-PT/commit/e7cde7dbf6938137105c39c60fb067f356b906fa)) 245 | 246 | 247 | 248 | ## [1.1.2](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.1...1.1.2) (2021-04-28) 249 | 250 | 251 | ### Bug Fixes 252 | 253 | * hdb 样式修复 ([fce640f](https://github.com/techmovie/DouBan-Info-for-PT/commit/fce640fda63d21261b058c6797eac02ac8917aaa)) 254 | 255 | 256 | ### Features 257 | 258 | * 支持ragbg ([f390927](https://github.com/techmovie/DouBan-Info-for-PT/commit/f390927c4e31a1fe6db3a2977227c91f47a6d365)) 259 | 260 | 261 | 262 | ## [1.1.1](https://github.com/techmovie/DouBan-Info-for-PT/compare/1.1.0...1.1.1) (2021-04-28) 263 | 264 | 265 | ### Bug Fixes 266 | 267 | * 替换豆瓣卡片图片为ptpimg ([ad2eab2](https://github.com/techmovie/DouBan-Info-for-PT/commit/ad2eab2097ffef4360652ae2d65aca41284f546e)) 268 | 269 | 270 | 271 | # [1.1.0](https://github.com/techmovie/DouBan-Info-for-PT/compare/1bd1bc861f6de6fb08eaa42daa5b3d339b2496a6...1.1.0) (2021-04-27) 272 | 273 | 274 | ### Bug Fixes 275 | 276 | * 修改UHD BHD的插入节点 ([3a73903](https://github.com/techmovie/DouBan-Info-for-PT/commit/3a73903df5d326e20c7dc943b364bde1249d7b01)) 277 | * add hdt fl match ([79b877e](https://github.com/techmovie/DouBan-Info-for-PT/commit/79b877e73633c7811949914f28695cec81a6cb92)) 278 | 279 | 280 | ### Features 281 | 282 | * 插入节点改为从iframe替换为div ([67a5fcd](https://github.com/techmovie/DouBan-Info-for-PT/commit/67a5fcdd64680db9dc921e96d3a51d378bdda6ef)) 283 | * 增加poster配置 ([cd706a9](https://github.com/techmovie/DouBan-Info-for-PT/commit/cd706a9a0f87db8c79bddd2a5c25572c2530a8ce)) 284 | * **newsite:** 支持ACM KG PHD ([70d7a51](https://github.com/techmovie/DouBan-Info-for-PT/commit/70d7a51647d5219ca4ff46083f7d1723695b80c8)) 285 | * 支持PTP HDB BLU HDT BHD FL ([1bd1bc8](https://github.com/techmovie/DouBan-Info-for-PT/commit/1bd1bc861f6de6fb08eaa42daa5b3d339b2496a6)) 286 | 287 | 288 | 289 | -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ["https://www.paypal.com/paypalme/techmovie"] 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Rick Lee 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Douban-Info-for-PT 2 | 3 | ## 关于 4 | 5 | 为国外PT站增加中文信息,数据源来自于豆瓣。 6 | 7 | 目前支持`PTP` `BTN` `HDB` `KG` `BHD` `UHD` `FL` `PHD` `BLU` `ACM` `HDT` `IPT` `TL` `Aither` `AvistaZ` `bB` `iTS` `SC` `Bdc` `MTV` `ANT`. 8 | 9 | ## 安装 10 | 11 | [安装地址](https://greasyfork.org/zh-CN/scripts/410851-douban-info-for-pt) 12 | 13 | ## 注意事项 14 | 15 | 在脚本安装完成后,第一次访问种子详情页,会有一个弹框询问是否允许豆瓣的跨域请求,选择 *总是允许此域名* 即可。 16 | 17 | ![](/assets/cors.png) 18 | 19 | ## 声明 20 | 21 | 如需使用本脚本,请注明来源,谢谢合作! 22 | 23 | ## ☕️Buy Me a coffee 24 | 25 | 如果本项目对你有帮助,不妨通过微信或者支付宝进行小额捐赠,以支持该项目的持续维护和发展。 26 | 27 | 微信: 28 | 29 | wechat.png 30 | 31 | 支付宝: 32 | 33 | alipay.png 34 | -------------------------------------------------------------------------------- /assets/cors.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/techmovie/DouBan-Info-for-PT/b687ecb9cf5a5b99d7a82b829ab9c6d8fd3d1079/assets/cors.png -------------------------------------------------------------------------------- /commitlint.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ['@commitlint/config-conventional'] }; 2 | -------------------------------------------------------------------------------- /dist/douban-info-for-pt.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name douban-info-for-pt 3 | // @namespace https://github.com/techmovie/DouBan-Info-for-PT 4 | // @version 1.7.6 5 | // @description 在PT站电影详情页展示部分中文信息 6 | // @author birdplane 7 | // @require https://s4.zstatic.net/ajax/libs/jquery/1.7.1/jquery.min.js 8 | // @match *://passthepopcorn.me/torrents.php?id=* 9 | // @match *://passthepopcorn.me/requests.php?action=view&id=* 10 | // @match *://anthelion.me/torrents.php?id=* 11 | // @match *://anthelion.me/requests.php?action=view&id=* 12 | // @match *://beyond-hd.me/torrents/* 13 | // @match *://beyond-hd.me/library/title/* 14 | // @match *://blutopia.xyz/torrents/* 15 | // @match *://asiancinema.me/torrents/* 16 | // @match *://hdbits.org/details.php?id=* 17 | // @match *://hdbits.org/requests/show_request?id=* 18 | // @match *://uhdbits.org/torrents.php?id=* 19 | // @match *://filelist.io/details.php?id=* 20 | // @match *://hd-torrents.org/details.php?id=* 21 | // @match *://karagarga.in/details.php?id=* 22 | // @match *://privatehd.to/torrent/* 23 | // @match *://broadcasthe.net/series.php?id=* 24 | // @match *://iptorrents.com/torrent.php?id=* 25 | // @match *://www.iptorrents.com/torrent.php?id=* 26 | // @match *://www.torrentleech.org/torrent/* 27 | // @match *://avistaz.to/torrent/* 28 | // @match *://secret-cinema.pw/torrents.php?id=* 29 | // @match *://aither.cc/torrents/* 30 | // @match *://shadowthein.net/details.php?id=* 31 | // @match *://shadowthein.net/details.php?id=* 32 | // @match *://baconbits.org/torrents.php?id=* 33 | // @match *://broadcity.in/details.php?id=* 34 | // @match *://www.morethantv.me/torrents.php?id=* 35 | // @match *://www.morethantv.me/show/* 36 | // @match *://tgx.rs/torrent/* 37 | // @grant GM_addStyle 38 | // @grant GM_xmlhttpRequest 39 | // @grant GM_openInTab 40 | // @grant GM_getValue 41 | // @grant GM_setValue 42 | // @license MIT 43 | // ==/UserScript== 44 | (() => { 45 | var __assign = Object.assign; 46 | 47 | // src/config.json 48 | var PT_SITE = { 49 | "aither.cc": { 50 | url: "https://aither.cc", 51 | host: "aither.cc", 52 | siteName: "Aither", 53 | poster: "#meta-poster", 54 | imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)', 55 | insertDomSelector: ".torrent-buttons", 56 | doubanContainerDom: '
' 57 | }, 58 | "anthelion.me": { 59 | url: "https://anthelion.me", 60 | host: "anthelion.me", 61 | siteName: "ANT", 62 | siteType: "gazelle", 63 | imdb: { 64 | request: '.layout a[href*="imdb.com/title"]:first', 65 | torrent: '.torrent_ratings a[href*="imdb.com/title"]:first' 66 | } 67 | }, 68 | "asiancinema.me": { 69 | url: "https://asiancinema.me", 70 | host: "asiancinema.me", 71 | siteName: "ACM", 72 | poster: "img.movie-poster", 73 | imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)', 74 | insertDomSelector: "#vue", 75 | doubanContainerDom: '
' 76 | }, 77 | "avistaz.to": { 78 | url: "https://avistaz.to", 79 | host: "avistaz.to", 80 | siteName: "AvistaZ", 81 | imdb: '.movie-details .badge-extra a[href*="imdb.com/title"]:first', 82 | titleDom: ".title .torrent-filename", 83 | poster: ".movie-poster img", 84 | insertDomSelector: ".movie-poster", 85 | doubanContainerDom: '
' 86 | }, 87 | "baconbits.org": { 88 | url: "https://baconbits.org", 89 | host: "baconbits.org", 90 | siteName: "bB", 91 | imdb: '.box .body a[href*="imdb.com/title"]:first', 92 | insertDomSelector: ".linkbox:first", 93 | titleDom: "h1:first", 94 | doubanContainerDom: '
' 95 | }, 96 | "beyond-hd.me": { 97 | url: "https://beyond-hd.me", 98 | host: "beyond-hd.me", 99 | siteName: "BHD", 100 | imdb: '.movie-details a[href*="imdb.com/title"]:nth-child(1)', 101 | insertDomSelector: ".movie-wrapper", 102 | doubanContainerDom: '
' 103 | }, 104 | "blutopia.xyz": { 105 | url: "https://blutopia.xyz", 106 | host: "blutopia.xyz", 107 | siteName: "BLU", 108 | poster: "#meta-poster", 109 | imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)', 110 | insertDomSelector: ".torrent-buttons", 111 | doubanContainerDom: '
' 112 | }, 113 | "broadcasthe.net": { 114 | url: "https://broadcasthe.net", 115 | host: "broadcasthe.net", 116 | siteName: "BTN", 117 | imdb: '.stats td a[href*="imdb.com/title"]', 118 | insertDomSelector: "#content .linkbox", 119 | poster: ".sidebar .box img:first", 120 | doubanContainerDom: '
' 121 | }, 122 | "broadcity.in": { 123 | url: "https://broadcity.in", 124 | host: "broadcity.in", 125 | siteName: "Bdc", 126 | imdb: '#imdbdetails a[href*="imdb.com/title"]', 127 | titleDom: "#details>table>tbody>tr:first", 128 | insertDomSelector: "#imdbdetails", 129 | poster: "#ts_show_preview img", 130 | doubanContainerDom: '
' 131 | }, 132 | "filelist.io": { 133 | url: "https://filelist.io", 134 | host: "filelist.io", 135 | siteName: "FL", 136 | imdb: '.cblock-innercontent div a[href*="imdb.com/title"]:first', 137 | poster: 'img[width="300px"][src*="image.tmdb.org"]', 138 | titleDom: ".cblock-header h4", 139 | insertDomSelector: ".cblock-innercontent hr.separator:first", 140 | doubanContainerDom: '
' 141 | }, 142 | "hd-torrents.org": { 143 | url: "https://hd-torrents.org", 144 | host: "hd-torrents.org", 145 | siteName: "HDT", 146 | poster: "#IMDBDetailsInfoHideShowTR .imdbnew a img", 147 | imdb: '.imdbnew2 a[href*="imdb.com/title"]:first', 148 | insertDomSelector: "td.detailsleft:contains(IMDb)", 149 | doubanContainerDom: '\u8C46\u74E3' 150 | }, 151 | "hdbits.org": { 152 | url: "https://hdbits.org", 153 | host: "hdbits.org", 154 | siteName: "HDB", 155 | imdb: { 156 | movie: ".contentlayout h1 a", 157 | tv: "#details .showlinks li:nth-child(2) a", 158 | tvRequest: ".lottery_table2 .showlinks li:nth-child(2) a" 159 | }, 160 | titleDom: "h1:first", 161 | insertDomSelector: "#details>tbody>tr:nth-child(2),.lottery_table2>tbody>tr:nth-child(1)", 162 | doubanContainerDom: '
- \u8C46\u74E3\u4FE1\u606F
' 163 | }, 164 | "iptorrents.com": { 165 | url: "https://iptorrents.com", 166 | host: "iptorrents.com", 167 | siteName: "IPT", 168 | imdb: '.main td a[href*="imdb.com/title"]', 169 | titleDom: ".dBox h1", 170 | insertDomSelector: ".dBox .info", 171 | doubanContainerDom: '
' 172 | }, 173 | "karagarga.in": { 174 | url: "https://karagarga.in", 175 | host: "karagarga.in", 176 | siteName: "KG", 177 | imdb: 'td a[href*="imdb.com/title"]:first', 178 | insertDomSelector: ".outer h1~table:first", 179 | doubanContainerDom: '
' 180 | }, 181 | "passthepopcorn.me": { 182 | url: "https://passthepopcorn.me", 183 | host: "passthepopcorn.me", 184 | siteName: "PTP", 185 | siteType: "gazelle", 186 | imdb: { 187 | request: '#request-table a[href*="imdb.com/title"]:first', 188 | torrent: "#imdb-title-link" 189 | } 190 | }, 191 | "privatehd.to": { 192 | url: "https://privatehd.to", 193 | host: "privatehd.to", 194 | siteName: "PHD", 195 | imdb: '.movie-details .badge-extra a[href*="imdb.com/title"]:first', 196 | titleDom: ".title .torrent-filename", 197 | poster: ".movie-poster img", 198 | insertDomSelector: ".movie-poster", 199 | doubanContainerDom: '
' 200 | }, 201 | "secret-cinema.pw": { 202 | url: "https://secret-cinema.pw", 203 | host: "secret-cinema.pw", 204 | siteName: "SC", 205 | imdb: '.torrent_row a[href*="imdb.com/title"]:first', 206 | insertDomSelector: ".linkbox:first", 207 | doubanContainerDom: '
' 208 | }, 209 | "shadowthein.net": { 210 | url: "http://shadowthein.net", 211 | host: "shadowthein.net", 212 | siteName: "iTS", 213 | imdb: '.IMDBtable a[href*="imdb.com/title"]:first', 214 | insertDomSelector: "h1+table.line", 215 | titleDom: "h1:first", 216 | doubanContainerDom: '
' 217 | }, 218 | "tgx.rs": { 219 | url: "https://tgx.rs", 220 | host: "tgx.rs", 221 | siteName: "TorrentGalaxy", 222 | poster: "#covercell img", 223 | imdb: '#imdbpage[href*="imdb.com/title"]', 224 | titleDom: ".torrentpagetable.limitwidth:first a.textshadow", 225 | insertDomSelector: ".buttonbox", 226 | doubanContainerDom: '
' 227 | }, 228 | "uhdbits.org": { 229 | url: "https://uhdbits.org", 230 | host: "uhdbits.org", 231 | siteName: "UHD", 232 | imdb: ".tooltip.imdb_icon", 233 | poster: ".poster_box .imgbox img", 234 | insertDomSelector: "div.head:contains(IMDB)", 235 | doubanContainerDom: '
\u2191 \u8C46\u74E3
' 236 | }, 237 | "www.morethantv.me": { 238 | url: "www.morethantv.me", 239 | host: "morethantv.me", 240 | siteName: "MTV", 241 | imdb: '.metalinks a[href*="imdb.com/title"]', 242 | insertDomSelector: "#content>.thin>div:first", 243 | poster: ".sidebar img:first", 244 | titleDom: ".details h2:first", 245 | doubanContainerDom: '
' 246 | }, 247 | "www.torrentleech.org": { 248 | url: "https://www.torrentleech.org", 249 | host: "torrentleech.org", 250 | siteName: "IPT", 251 | imdb: '.imdb-info a[href*="imdb.com/title"]', 252 | titleDom: "#torrentnameid", 253 | poster: ".imdb_cover img", 254 | insertDomSelector: ".torrent-info .torrent-info-details", 255 | doubanContainerDom: '
' 256 | } 257 | }; 258 | 259 | // src/const.js 260 | var host = location.host; 261 | var _a, _b; 262 | var siteInfo = (_b = (_a = PT_SITE) == null ? void 0 : _a[host]) != null ? _b : ""; 263 | var _a2, _b2; 264 | if (host && host.match(/iptorrents/i)) { 265 | siteInfo = PT_SITE["iptorrents.com"]; 266 | } else { 267 | siteInfo = (_b2 = (_a2 = PT_SITE) == null ? void 0 : _a2[host]) != null ? _b2 : ""; 268 | } 269 | var CURRENT_SITE_INFO = siteInfo; 270 | var _a3; 271 | var CURRENT_SITE_NAME = (_a3 = CURRENT_SITE_INFO == null ? void 0 : CURRENT_SITE_INFO.siteName) != null ? _a3 : ""; 272 | var DOUBAN_SUBJECT_URL = "https://movie.douban.com/subject/{doubanId}"; 273 | var DOUBAN_API_URL = "https://api.douban.com/v2/movie"; 274 | var PIC_URLS = { 275 | border: "https://ptpimg.me/zz4632.png", 276 | icon2x: "https://ptpimg.me/n74cjc.png", 277 | icon: "https://ptpimg.me/yze1gz.png", 278 | line: "https://ptpimg.me/e11hb1.png" 279 | }; 280 | 281 | // src/common.js 282 | var addToPtpPage = (data) => { 283 | console.log(data); 284 | $(".page__title").prepend(`[${data.chineseTitle}] `); 285 | if (data.summary) { 286 | const synopsisDom = ` 287 |
288 |
\u4E2D\u6587\u7B80\u4ECB
289 |
290 |
${data.summary}
291 |
292 |
`; 293 | $("#synopsis-and-trailer,#request-table").after(synopsisDom); 294 | } 295 | $("#movieinfo").before(` 296 |
297 |
\u7535\u5F71\u4FE1\u606F
298 |
299 |
\u5BFC\u6F14: ${data.director}
300 |
\u7C7B\u578B: ${data.genre}
301 |
\u5236\u7247\u56FD\u5BB6/\u5730\u533A: ${data.region}
302 |
\u8BED\u8A00: ${data.language}
303 |
\u65F6\u957F: ${data.runtime}
304 |
\u53C8\u540D: ${data.aka}
\u83B7\u5956\u60C5\u51B5:
${data.awards}
`); 307 | if (data.average) { 308 | $("#movie-ratings-table tr").prepend(` 309 |
310 | 311 |
312 | \u8C46 313 | \u8C46\u74E3\u8BC4\u5206 314 |
315 |
316 |
317 | 318 | 319 | ${data.average} 320 | / 321 | 10 322 |
(${data.votes} votes)`); 323 | } 324 | }; 325 | var addToANTPage = (data) => { 326 | console.log(data); 327 | $(".header h2").prepend(`[${data.chineseTitle}] `); 328 | if (data.summary) { 329 | const synopsisDom = ` 330 |
331 |
\u2191 \u4E2D\u6587\u7B80\u4ECB
332 |
${data.summary}
333 |
`; 334 | $(".torrent_description,.box_request_desc").after(synopsisDom); 335 | } 336 | $(".box_details:first").before(` 337 |
338 |
\u7535\u5F71\u4FE1\u606F
339 |
340 |
    341 |
  • \u5BFC\u6F14: ${data.director}
  • 342 |
  • \u7C7B\u578B: ${data.genre}
  • 343 |
  • \u5236\u7247\u56FD\u5BB6/\u5730\u533A: ${data.region}
  • 344 |
  • \u8BED\u8A00: ${data.language}
  • 345 |
  • \u65F6\u957F: ${data.runtime}
  • 346 |
  • \u53C8\u540D: ${data.aka}
  • \u83B7\u5956\u60C5\u51B5:
    ${data.awards} 349 |
350 |
`); 351 | if (data.average) { 352 | $(".box.torrent_ratings .body tr").prepend(` 353 |
354 | 355 |
356 | \u8C46 357 |
358 |
359 |
360 | 361 | 362 | ${data.average} 363 | / 364 | 10 365 |
(${data.votes} votes)`); 366 | } 367 | }; 368 | var getImdbId = () => { 369 | var _a4, _b3; 370 | let imdbLink = ""; 371 | const imdbConfig = CURRENT_SITE_INFO.imdb; 372 | if (typeof imdbConfig === "object") { 373 | try { 374 | Object.keys(imdbConfig).forEach((key) => { 375 | if ($(`${imdbConfig[key]}`)[0]) { 376 | imdbLink = $(imdbConfig[key]).attr("href"); 377 | throw new Error("end loop"); 378 | } 379 | }); 380 | } catch (error) { 381 | if (error.message !== "end loop") { 382 | console.log(error); 383 | } 384 | } 385 | } else { 386 | imdbLink = $(imdbConfig).attr("href"); 387 | } 388 | console.log(imdbLink); 389 | return (_b3 = (_a4 = /tt\d+/.exec(imdbLink)) == null ? void 0 : _a4[0]) != null ? _b3 : ""; 390 | }; 391 | var getTvSeasonData = async (data) => { 392 | var _a4, _b3; 393 | const torrentTitle = getTorrentTitle(); 394 | const {episodes = "", chineseTitle} = data; 395 | if (episodes) { 396 | const seasonNumber = (_b3 = (_a4 = torrentTitle.match(/S(?!eason)\s*?0?(\d+)\.?(EP?\d+)?/i)) == null ? void 0 : _a4[1]) != null ? _b3 : 1; 397 | if (parseInt(seasonNumber) === 1) { 398 | return data; 399 | } else { 400 | const query = `${chineseTitle} \u7B2C${seasonNumber}\u5B63`; 401 | const params = encodeURI("apikey=0ab215a8b1977939201640fa14c66bab"); 402 | const searchData = await fetch(`${DOUBAN_API_URL}/search?q=${query}`, { 403 | data: params, 404 | method: "POST", 405 | headers: { 406 | "Content-Type": "application/x-www-form-urlencoded" 407 | } 408 | }); 409 | if (searchData.count > 0) { 410 | return {id: searchData.subjects[0].id}; 411 | } 412 | } 413 | } 414 | }; 415 | var getDoubanInfo = async (doubanId, imdbId) => { 416 | try { 417 | const url = DOUBAN_SUBJECT_URL.replace("{doubanId}", doubanId); 418 | const data = await fetch(url, { 419 | responseType: "text" 420 | }); 421 | if (data) { 422 | const doubanInfo = await formatDoubanInfo(data); 423 | const savedIds = GM_getValue("ids") || {}; 424 | savedIds[imdbId] = __assign({ 425 | doubanId, 426 | updateTime: Date.now() 427 | }, doubanInfo); 428 | GM_setValue("ids", savedIds); 429 | return doubanInfo; 430 | } else { 431 | console.log("\u8C46\u74E3\u6570\u636E\u83B7\u53D6\u5931\u8D25"); 432 | } 433 | } catch (error) { 434 | console.log(error); 435 | } 436 | }; 437 | var getDoubanInfoByIMDB = async (imdbId) => { 438 | var _a4, _b3, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; 439 | try { 440 | const params = encodeURI("apikey=0ab215a8b1977939201640fa14c66bab"); 441 | const doubanData = await fetch(`${DOUBAN_API_URL}/imdb/${imdbId}`, { 442 | data: params, 443 | method: "POST", 444 | headers: { 445 | "Content-Type": "application/x-www-form-urlencoded" 446 | } 447 | }); 448 | const {title, attrs = {}, image, summary, rating, alt_title: altTitle, mobile_link: mobileLink} = doubanData; 449 | let chineseTitle = title; 450 | const isChineseReg = /[\u4e00-\u9fa5]+/; 451 | if (!isChineseReg.test(title) && !title.match(/^\d+$/)) { 452 | if (altTitle) { 453 | chineseTitle = altTitle.split("/")[0].trim(); 454 | } else { 455 | chineseTitle = title; 456 | } 457 | } 458 | const subjectLink = mobileLink.replace("m.douban.com/movie", "movie.douban.com").replace(/\/$/, ""); 459 | const doubanId = (_b3 = (_a4 = subjectLink.match(/subject\/(\d+)/)) == null ? void 0 : _a4[1]) != null ? _b3 : ""; 460 | const awards = await getAwardInfo(subjectLink); 461 | const doubanInfo = { 462 | director: (_c = attrs.director) == null ? void 0 : _c.join(" / "), 463 | runtime: (_d = attrs.movie_duration) == null ? void 0 : _d.join(" / "), 464 | language: (_e = attrs.language) == null ? void 0 : _e.join(" / "), 465 | genre: (_g = (_f = attrs.movie_type) == null ? void 0 : _f.join(" / ")) != null ? _g : "", 466 | aka: altTitle || "", 467 | region: (_h = attrs.country) == null ? void 0 : _h.join(" / "), 468 | link: subjectLink, 469 | poster: image, 470 | summary, 471 | chineseTitle, 472 | votes: rating.numRaters, 473 | average: rating.average, 474 | awards, 475 | id: (_j = (_i = subjectLink.match(/subject\/(\d+)/)) == null ? void 0 : _i[1]) != null ? _j : "", 476 | episodes: (_l = (_k = attrs.episodes) == null ? void 0 : _k.join(" / ")) != null ? _l : "" 477 | }; 478 | if (!attrs.episodes) { 479 | const savedIds = GM_getValue("ids") || {}; 480 | savedIds[imdbId] = __assign({ 481 | doubanId, 482 | updateTime: Date.now() 483 | }, doubanInfo); 484 | GM_setValue("ids", savedIds); 485 | } 486 | return doubanInfo; 487 | } catch (error) { 488 | console.log(error); 489 | } 490 | }; 491 | var getAwardInfo = async (doubanLink) => { 492 | var _a4; 493 | const awardsPage = await fetch(`${doubanLink}/awards/`, { 494 | responseType: "text" 495 | }); 496 | const awardsDoc = new DOMParser().parseFromString(awardsPage, "text/html"); 497 | const awards = $("#content > div > div.article", awardsDoc).html().replace(/[ \n]/g, "").replace(/<\/li>
  • /g, "
  • ").replace(/<\/a> ]*>/g, "\n").replace(/<[^>]+>/g, "").replace(/ /g, " ").replace(/ +\n/g, "\n").trim(); 498 | return (_a4 = awards == null ? void 0 : awards.replace(/\n/g, "
    ")) != null ? _a4 : ""; 499 | }; 500 | var formatDoubanInfo = async (domString) => { 501 | var _a4, _b3; 502 | const dom = new DOMParser().parseFromString(domString, "text/html"); 503 | const chineseTitle = $("title", dom).text().replace("(\u8C46\u74E3)", "").trim(); 504 | const jsonData = JSON.parse($('head > script[type="application/ld+json"]', dom).html().replace(/(\r\n|\n|\r|\t)/gm, "")); 505 | const fetchAnchor = function(anchor) { 506 | var _a5, _b4, _c, _d; 507 | return (_d = (_c = (_b4 = (_a5 = anchor == null ? void 0 : anchor[0]) == null ? void 0 : _a5.nextSibling) == null ? void 0 : _b4.nodeValue) == null ? void 0 : _c.trim()) != null ? _d : ""; 508 | }; 509 | const rating = jsonData.aggregateRating ? jsonData.aggregateRating.ratingValue : 0; 510 | const votes = jsonData.aggregateRating ? jsonData.aggregateRating.ratingCount : 0; 511 | const director = jsonData.director ? jsonData.director : []; 512 | const poster = jsonData.image.replace(/s(_ratio_poster|pic)/g, "l$1").replace(/img\d/, "img9"); 513 | const link = `https://movie.douban.com${jsonData.url}`; 514 | const introductionDom = $('#link-report > span.all.hidden,#link-report-intra > [property="v:summary"], #link-report > [property="v:summary"]', dom); 515 | const summary = (introductionDom.length > 0 ? introductionDom.text() : "\u6682\u65E0\u76F8\u5173\u5267\u60C5\u4ECB\u7ECD").split("\n").map((a) => a.trim()).filter((a) => a.length > 0).join("\n"); 516 | const genre = $('#info span[property="v:genre"]', dom).map(function() { 517 | return $(this).text().trim(); 518 | }).toArray(); 519 | const language = fetchAnchor($('#info span.pl:contains("\u8BED\u8A00")', dom)); 520 | const region = fetchAnchor($('#info span.pl:contains("\u5236\u7247\u56FD\u5BB6/\u5730\u533A")', dom)); 521 | const runtimeAnchor = $('#info span.pl:contains("\u5355\u96C6\u7247\u957F")', dom); 522 | const runtime = runtimeAnchor[0] ? fetchAnchor(runtimeAnchor) : $('#info span[property="v:runtime"]', dom).text().trim(); 523 | const akaAnchor = $('#info span.pl:contains("\u53C8\u540D")', dom); 524 | let aka = []; 525 | if (akaAnchor.length > 0) { 526 | aka = fetchAnchor(akaAnchor).split(" / ").sort(function(a, b) { 527 | return a.localeCompare(b); 528 | }).join("/"); 529 | aka = aka.split("/"); 530 | } 531 | const awards = await getAwardInfo(link); 532 | return { 533 | director: director.map((item) => item.name), 534 | runtime, 535 | language, 536 | genre: (_a4 = genre == null ? void 0 : genre.join(" / ")) != null ? _a4 : "", 537 | aka: (_b3 = aka == null ? void 0 : aka.join(" / ")) != null ? _b3 : "", 538 | region, 539 | link, 540 | poster, 541 | summary, 542 | chineseTitle, 543 | votes, 544 | average: rating, 545 | awards 546 | }; 547 | }; 548 | var getTorrentTitle = () => { 549 | let {titleDom} = CURRENT_SITE_INFO; 550 | if (!titleDom) { 551 | if (CURRENT_SITE_NAME === "BHD") { 552 | titleDom = $(".dotborder").find("td:contains(Name)").next("td"); 553 | } else if (CURRENT_SITE_NAME.match(/ACM|BLU/)) { 554 | const keyMap = { 555 | Name: "Name", 556 | \u540D\u79F0: "Name", 557 | \u540D\u7A31: "Name" 558 | }; 559 | $("#vue+.panel table tr").each((index, element) => { 560 | const key = $(element).find("td:first").text().replace(/\s|\n/g, ""); 561 | if (keyMap[key]) { 562 | titleDom = $(element).find("td:last"); 563 | } 564 | }); 565 | } else if (CURRENT_SITE_NAME === "UHD") { 566 | const torrentId = getUrlParam("torrentid"); 567 | const torrentFilePathDom = $(`#files_${torrentId} .filelist_path`); 568 | const torrentFileDom = $(`#files_${torrentId} .filelist_table>tbody>tr:nth-child(2) td`).eq(0); 569 | titleDom = torrentFilePathDom || torrentFileDom; 570 | } else if (CURRENT_SITE_NAME === "HDT") { 571 | return document.title.replace(/HD-Torrents.org\s*-/ig, "").trim(); 572 | } 573 | } 574 | return $(titleDom).text(); 575 | }; 576 | var getUrlParam = (key) => { 577 | const reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)"); 578 | const regArray = location.search.substr(1).match(reg); 579 | if (regArray) { 580 | return unescape(regArray[2]); 581 | } 582 | return ""; 583 | }; 584 | var createDoubanDom = async (doubanId, imdbId, doubanInfo) => { 585 | const div = document.createElement("div"); 586 | let {doubanContainerDom, insertDomSelector, siteName, poster} = CURRENT_SITE_INFO; 587 | if (siteName.match(/(HDT)$/)) { 588 | insertDomSelector = $(insertDomSelector).parent(); 589 | } 590 | $(insertDomSelector).before(doubanContainerDom); 591 | const doubanLink = `https://movie.douban.com/subject/${doubanId}`; 592 | let htmlData = await fetch(`${doubanLink}/output_card`, { 593 | responseType: "text" 594 | }); 595 | htmlData = htmlData.replace(/wrapper/g, "douban-wrapper").replace(//g, ""); 596 | htmlData = htmlData.replace(/(html,)body,/, "$1"); 597 | htmlData = htmlData.replace(/url\(.+?output_card\/border.png\)/g, `url(${PIC_URLS.border})`); 598 | htmlData = htmlData.replace(/src=.+?output_card\/line\.png/g, `src="${PIC_URLS.line}`); 599 | let headDom = htmlData.match(/((.|\n)+)<\/head>/)[1]; 600 | headDom = headDom.replace(//g, ""); 601 | const bodyDom = htmlData.match(/((.|\n)+)<\/body>/)[1]; 602 | div.insertAdjacentHTML("beforeend", headDom); 603 | div.insertAdjacentHTML("beforeend", bodyDom); 604 | $(".douban-dom").append(div).attr("douban-link", doubanLink); 605 | $(".douban-dom .grid-col4").after(` 606 |
    607 |
    608 | 609 |
    610 |
    611 |
    `); 612 | const doubanData = doubanInfo || await getDoubanInfo(doubanId, imdbId); 613 | $(".douban-dom .grid-col5").html(`
    ${doubanData.summary || "\u6682\u65E0\u7B80\u4ECB"}
    `); 614 | let posterStyle = $(".picture-douban-wrapper").attr("style"); 615 | const posterImg = siteName === "MTV" ? $(poster).attr("src") : doubanData.poster; 616 | posterStyle = posterStyle == null ? void 0 : posterStyle.replace(/\(.+\)/, `(${posterImg})`); 617 | $(".picture-douban-wrapper").attr("style", posterStyle); 618 | $(".douban-dom").click(() => { 619 | GM_openInTab(doubanLink); 620 | }); 621 | }; 622 | function fetch(url, options = {}) { 623 | return new Promise((resolve, reject) => { 624 | GM_xmlhttpRequest(__assign(__assign({ 625 | method: "GET", 626 | url, 627 | responseType: "json" 628 | }, options), { 629 | onload: (res) => { 630 | const {statusText, status, response} = res; 631 | if (status !== 200) { 632 | reject(new Error(statusText || status)); 633 | } else { 634 | resolve(response); 635 | } 636 | }, 637 | ontimeout: () => { 638 | reject(new Error("timeout")); 639 | }, 640 | onerror: (error) => { 641 | reject(error); 642 | } 643 | })); 644 | }); 645 | } 646 | 647 | // src/style.js 648 | var style_default = GM_addStyle(` 649 | .bigstar50,.bigstar45,.bigstar40,.bigstar35,.bigstar30,.bigstar25,.bigstar20,.bigstar15,.bigstar10,.bigstar05,.bigstar00 { 650 | display: inline-block; 651 | *display: inline; 652 | zoom:1;background: https://ptpimg.me/yze1gz.png) no-repeat; 653 | background: -webkit-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 654 | background: -moz-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 655 | background: -o-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 656 | background: -ms-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 657 | width: 75px; 658 | height: 15px; 659 | margin: 1px 0 0 0; 660 | overflow: hidden 661 | } 662 | 663 | .bigstar50+span.rating_num,.bigstar45+span.rating_num,.bigstar40+span.rating_num,.bigstar35+span.rating_num,.bigstar30+span.rating_num,.bigstar25+span.rating_num,.bigstar20+span.rating_num,.bigstar15+span.rating_num,.bigstar10+span.rating_num,.bigstar05+span.rating_num,.bigstar00+span.rating_num { 664 | font-size: 16px; 665 | line-height: 1 666 | } 667 | 668 | .bigstar50 { 669 | background-position: 0 0px 670 | } 671 | 672 | .bigstar45 { 673 | background-position: 0 -15px 674 | } 675 | 676 | .bigstar40 { 677 | background-position: 0 -30px 678 | } 679 | 680 | .bigstar35 { 681 | background-position: 0 -45px 682 | } 683 | 684 | .bigstar30 { 685 | background-position: 0 -60px 686 | } 687 | 688 | .bigstar25 { 689 | background-position: 0 -75px 690 | } 691 | 692 | .bigstar20 { 693 | background-position: 0 -90px 694 | } 695 | 696 | .bigstar15 { 697 | background-position: 0 -105px 698 | } 699 | 700 | .bigstar10 { 701 | background-position: 0 -120px 702 | } 703 | 704 | .bigstar05 { 705 | background-position: 0 -135px 706 | } 707 | 708 | .bigstar00 { 709 | background-position: 0 -150px 710 | } 711 | 712 | .allstar50,.allstar45,.allstar40,.allstar35,.allstar30,.allstar25,.allstar20,.allstar15,.allstar10,.allstar05,.allstar00,.rating1-t,.rating15-t,.rating2-t,.rating25-t,.rating3-t,.rating35-t,.rating4-t,.rating45-t,.rating5-t,.rating-t,.starb~.stars5,.starb~.stars4,.starb~.stars3,.starb~.stars2,.starb~.stars1,.collectors .stars5,.collectors .stars4,.collectors .stars3,.collectors .stars2,.collectors .stars1 { 713 | display: inline-block; 714 | *display: inline; 715 | zoom:1;background: url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) no-repeat; 716 | background: -webkit-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 717 | background: -moz-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 718 | background: -o-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 719 | background: -ms-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 720 | width: 55px; 721 | height: 11px; 722 | margin: 0 3px 0 0; 723 | overflow: hidden 724 | } 725 | 726 | .status-item .allstar50,.status-item .allstar45,.status-item .allstar40,.status-item .allstar35,.status-item .allstar30,.status-item .allstar25,.status-item .allstar20,.status-item .allstar15,.status-item .allstar10,.status-item .allstar05,.status-item .allstar00,.status-item .rating1-t,.status-item .rating15-t,.status-item .rating2-t,.status-item .rating25-t,.status-item .rating3-t,.status-item .rating35-t,.status-item .rating4-t,.status-item .rating45-t,.status-item .rating5-t,.status-item .rating-t,.status-item .starb~.stars5,.status-item .starb~.stars4,.status-item .starb~.stars3,.status-item .starb~.stars2,.status-item .starb~.stars1,.status-item .collectors .stars5,.status-item .collectors .stars4,.status-item .collectors .stars3,.status-item .collectors .stars2,.status-item .collectors .stars1 { 727 | margin: 0 0 0 4px 728 | } 729 | 730 | .allstar50 { 731 | background-position: 0 0px 732 | } 733 | 734 | .allstar45 { 735 | background-position: 0 -11px 736 | } 737 | 738 | .allstar40 { 739 | background-position: 0 -22px 740 | } 741 | 742 | .allstar35 { 743 | background-position: 0 -33px 744 | } 745 | 746 | .allstar30 { 747 | background-position: 0 -44px 748 | } 749 | 750 | .allstar25 { 751 | background-position: 0 -55px 752 | } 753 | 754 | .allstar20 { 755 | background-position: 0 -66px 756 | } 757 | 758 | .allstar15 { 759 | background-position: 0 -77px 760 | } 761 | 762 | .allstar10 { 763 | background-position: 0 -88px 764 | } 765 | 766 | .allstar05 { 767 | background-position: 0 -99px 768 | } 769 | 770 | .allstar00 { 771 | background-position: 0 -110px 772 | } 773 | 774 | .rating5-t,.starb~.stars5,.collectors .stars5 { 775 | background-position: 0 0px 776 | } 777 | 778 | .rating45-t { 779 | background-position: 0 -11px 780 | } 781 | 782 | .rating4-t,.starb~.stars4,.collectors .stars4 { 783 | background-position: 0 -22px 784 | } 785 | 786 | .rating35-t { 787 | background-position: 0 -33px 788 | } 789 | 790 | .rating3-t,.starb~.stars3,.collectors .stars3 { 791 | background-position: 0 -44px 792 | } 793 | 794 | .rating25-t { 795 | background-position: 0 -55px 796 | } 797 | 798 | .rating2-t,.starb~.stars2,.collectors .stars2 { 799 | background-position: 0 -66px 800 | } 801 | 802 | .rating15-t { 803 | background-position: 0 -77px 804 | } 805 | 806 | .rating1-t,.starb~.stars1,.collectors .stars1 { 807 | background-position: 0 -88px 808 | } 809 | 810 | .rating1-t,.rating15-t,.rating2-t,.rating25-t,.rating3-t,.rating35-t,.rating4-t,.rating45-t,.rating5-t,.rating-t { 811 | padding-left: 5px 812 | } 813 | 814 | #stars { 815 | font-size: 0; 816 | vertical-align: text-bottom; 817 | cursor: pointer 818 | } 819 | 820 | #stars a img { 821 | vertical-align: text-bottom 822 | } 823 | 824 | .starstop,.stars { 825 | margin-right: 5px 826 | } 827 | 828 | .starstop { 829 | float: left 830 | } 831 | 832 | .rating_nums,.rating_num { 833 | color: #e09015; 834 | font-size: 12px; 835 | padding: 0 3px 836 | } 837 | 838 | .status-item .rating_num { 839 | font-size: 14px 840 | } 841 | 842 | .rating_nums { 843 | padding-left: 0 844 | } 845 | 846 | .star .rating_num { 847 | color: #e09015; 848 | padding: 0 5px 0 0 849 | } 850 | 851 | #interest_sect { 852 | overflow: hidden; 853 | word-wrap: break-word 854 | } 855 | 856 | #interest_sectl { 857 | float: left; 858 | width: 155px; 859 | margin: 2px 0 0 0; 860 | padding: 0 0 0 15px; 861 | border-left: 1px solid #eaeaea; 862 | color: #9b9b9b 863 | } 864 | 865 | #interest_sectl .rating_wrap { 866 | padding-bottom: 15px; 867 | font-size: 12px; 868 | line-height: 14px 869 | } 870 | 871 | #interest_sectl .rating_wrap .rating_logo { 872 | line-height: 1 873 | } 874 | 875 | #interest_sectl .rating_self { 876 | padding: 0; 877 | line-height: 2 878 | } 879 | 880 | #interest_sectl .rating_self:before,#interest_sectl .rating_self:after { 881 | content: ''; 882 | display: block; 883 | clear: both 884 | } 885 | 886 | #interest_sectl .rating_self .rating_sum { 887 | clear: both 888 | } 889 | 890 | #interest_sectl .rating_num { 891 | color: #494949; 892 | padding: 0; 893 | min-width: 30%; 894 | font-size: 28px 895 | } 896 | 897 | #interest_sectl .rating_right { 898 | float: left; 899 | padding: 10px 0 10px 6px 900 | } 901 | 902 | #interest_sectl .rating_right.not_showed { 903 | padding: 10px 0 904 | } 905 | 906 | #interest_sectl .power { 907 | height: 10px; 908 | float: left; 909 | margin: 1px 4px; 910 | background: #ffd596 none repeat scroll 0 0 911 | } 912 | 913 | #interest_sectl .power.color_gray { 914 | background: #ccc 915 | } 916 | 917 | #interest_sectl .rating_per { 918 | font-size: 11px 919 | } 920 | 921 | #interest_sectl .rating_betterthan { 922 | position: relative; 923 | padding: 15px 0; 924 | border-top: 1px solid #eaeaea; 925 | color: #9b9b9b; 926 | margin: 0 927 | } 928 | 929 | .rating_logo_wrap .content { 930 | display: inline-block; 931 | *display: inline; 932 | zoom:1;vertical-align: top; 933 | font-size: 12px; 934 | line-height: 20px; 935 | color: #9b9b9b; 936 | margin-right: 4px 937 | } 938 | 939 | .rating_helper_wrap { 940 | display: inline-block; 941 | *display: inline; 942 | zoom:1;vertical-align: top; 943 | position: relative; 944 | line-height: 18px 945 | } 946 | 947 | .rating_helper_wrap:hover .rating_helper_icon { 948 | background-position: 0 -12px 949 | } 950 | 951 | .rating_helper_wrap:hover .rating_helper_content { 952 | display: block 953 | } 954 | 955 | .rating_helper_icon { 956 | background: url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) no-repeat; 957 | background: -webkit-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 958 | background: -moz-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 959 | background: -o-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 960 | background: -ms-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 961 | display: inline-block; 962 | *display: inline; 963 | zoom:1;vertical-align: middle; 964 | width: 12px; 965 | height: 12px 966 | } 967 | 968 | .rating_helper_content { 969 | z-index: 10; 970 | color: #494949; 971 | display: none; 972 | position: absolute; 973 | left: 12px; 974 | bottom: 3px; 975 | width: 96px; 976 | background: #fef6e9; 977 | border: 1px solid #e3d9ca; 978 | padding: 8px 10px; 979 | border-radius: 4px; 980 | box-shadow: 0 2px 5px rgba(0,0,0,0.1) 981 | } 982 | 983 | .rating_content_wrap { 984 | width: 110%; 985 | padding-bottom: 8px 986 | } 987 | 988 | .rating_content_wrap .rating_avg { 989 | float: left; 990 | font-size: 16px; 991 | line-height: 28px; 992 | color: #494949; 993 | margin-right: 12px 994 | } 995 | 996 | .rating_content_wrap .friends { 997 | float: left; 998 | margin-right: 6px 999 | } 1000 | 1001 | .rating_content_wrap .avatar { 1002 | float: left; 1003 | margin-top: 6px; 1004 | margin-right: 2px; 1005 | line-height: 0; 1006 | border-radius: 50%; 1007 | overflow: hidden; 1008 | cursor: default 1009 | } 1010 | 1011 | .rating_content_wrap .avatar img { 1012 | width: 16px 1013 | } 1014 | 1015 | .rating_content_wrap .friends_count { 1016 | float: left; 1017 | line-height: 14px; 1018 | margin-top: 7px 1019 | } 1020 | 1021 | #screening .subject-rate { 1022 | color: #e09015; 1023 | font-size: 12px; 1024 | margin-left: 2px 1025 | } 1026 | 1027 | #screening .rating { 1028 | display: inline-block; 1029 | *display: inline; 1030 | zoom:1;margin: 4px auto 2px; 1031 | height: 19px 1032 | } 1033 | 1034 | #screening .rating span { 1035 | float: left 1036 | } 1037 | 1038 | #screening .rating .rating-star { 1039 | margin: 3px 3px 0 0; 1040 | width: 55px 1041 | } 1042 | 1043 | span.subject-rate,.rate,.subject-rating { 1044 | color: #e09015 1045 | } 1046 | 1047 | img.rating { 1048 | vertical-align: text-bottom 1049 | } 1050 | 1051 | img.rating:nth-child(1) { 1052 | padding-left: 10px 1053 | } 1054 | 1055 | .rec-list .score { 1056 | color: #e09015 1057 | } 1058 | 1059 | .album-item .star { 1060 | line-height: 1; 1061 | margin-top: 6px 1062 | } 1063 | 1064 | .album-item .star .allstar50,.album-item .star .allstar45,.album-item .star .allstar40,.album-item .star .allstar35,.album-item .star .allstar30,.album-item .star .allstar25,.album-item .star .allstar20,.album-item .star .allstar15,.album-item .star .allstar10,.album-item .star .allstar05,.album-item .star .allstar00 { 1065 | float: left 1066 | } 1067 | 1068 | .album-item .star .score { 1069 | color: #e09015 1070 | } 1071 | 1072 | .game-ratings strong { 1073 | margin: 0 6px; 1074 | color: #e09015 1075 | } 1076 | 1077 | .link-subject .rate-more span { 1078 | font-size: 10px; 1079 | color: #e09015 1080 | } 1081 | 1082 | .rating-controversy-reason { 1083 | background-color: #FFFBF4; 1084 | color: #494949; 1085 | line-height: 14px; 1086 | margin: 15px 0px 0px 0px; 1087 | padding: 6px 20px 6px 35px; 1088 | font-size: 11px; 1089 | position: relative 1090 | } 1091 | 1092 | .rating-controversy-reason:before { 1093 | content: ''; 1094 | display: block; 1095 | width: 14px; 1096 | height: 14px; 1097 | position: absolute; 1098 | left: 12px; 1099 | top: 50%; 1100 | transform: translateY(-50%); 1101 | background-image: url("data:image/svg+xml, %3Csvg%20width%3D%2216%22%20height%3D%2216%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%200a8%208%200%20110%2016A8%208%200%20018%200zm0%2010.667a1%201%200%20100%202%201%201%200%20000-2zm0-8a1.207%201.207%200%2000-1.2%201.326l.467%204.677a.737.737%200%20001.466%200l.468-4.677A1.207%201.207%200%20008%202.667z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E"); 1102 | background-size: contain 1103 | } 1104 | 1105 | body #douban-wrapper { 1106 | width: 770px; 1107 | height: 345px; 1108 | margin: 0; 1109 | font: 12px Helvetica,Arial,sans-serif 1110 | } 1111 | 1112 | #douban-wrapper .ll { 1113 | float: left 1114 | } 1115 | 1116 | #douban-wrapper .col-container .fix-col { 1117 | float: left 1118 | } 1119 | 1120 | #douban-wrapper #content { 1121 | background-repeat: no-repeat; 1122 | padding: 10px; 1123 | width: 750px; 1124 | height: 325px; 1125 | min-height: initial 1126 | } 1127 | 1128 | #douban-wrapper #content h1 { 1129 | font-size: 20px 1130 | } 1131 | 1132 | #douban-wrapper #content .grid { 1133 | width: 750px; 1134 | height: 325px; 1135 | border-radius: 9px 1136 | } 1137 | 1138 | #douban-wrapper #content .grid .grid-col1 { 1139 | width: 225px 1140 | } 1141 | 1142 | #douban-wrapper #content .grid .grid-col2 { 1143 | width: 254px; 1144 | padding: 24px 18px; 1145 | height: 277px; 1146 | overflow: hidden 1147 | } 1148 | 1149 | #douban-wrapper #content .grid .grid-col3 { 1150 | width: 18px 1151 | } 1152 | 1153 | #douban-wrapper #content .grid .grid-col4 { 1154 | font-size: 14px; 1155 | padding: 27px 14px 0 12px; 1156 | width: 190px 1157 | } 1158 | 1159 | #douban-wrapper #content .picture-douban-wrapper{ 1160 | width: 225px; 1161 | height: 325px; 1162 | border-top-left-radius: 9px; 1163 | border-bottom-left-radius: 9px; 1164 | background-size: cover; 1165 | background-position: center 1166 | } 1167 | 1168 | #douban-wrapper #content .main-title h1,#douban-wrapper #content .sub-title h2 { 1169 | overflow: hidden; 1170 | word-break: break-all; 1171 | max-height: 2.5em; 1172 | line-height: 1.2; 1173 | display: -webkit-box; 1174 | -webkit-line-clamp: 2; 1175 | -webkit-box-orient: vertical 1176 | } 1177 | 1178 | #douban-wrapper #content .main-title h1 { 1179 | font-weight: 500; 1180 | font-size: 30px; 1181 | color: #000000 1182 | } 1183 | 1184 | #douban-wrapper #content .sub-title { 1185 | margin-top: 9px 1186 | } 1187 | 1188 | #douban-wrapper #content .sub-title h2 { 1189 | font-size: 18px; 1190 | color: #ADADAD; 1191 | font-weight: normal 1192 | } 1193 | 1194 | #douban-wrapper #content .baseinfo { 1195 | font-size: 16px; 1196 | color: #000000; 1197 | line-height: 25px; 1198 | margin-top: 18px; 1199 | letter-spacing: 1px; 1200 | word-break: break-all; 1201 | font-weight: 400; 1202 | display: -webkit-box; 1203 | overflow: hidden; 1204 | -webkit-line-clamp: 5; 1205 | -webkit-box-orient: vertical 1206 | } 1207 | 1208 | #douban-wrapper #content .line-wrap { 1209 | width: 18px; 1210 | height: 100%; 1211 | position: relative 1212 | } 1213 | 1214 | #douban-wrapper #content .line-wrap img { 1215 | width: 100%; 1216 | height: 100% 1217 | } 1218 | 1219 | #douban-wrapper #content .douban-icon { 1220 | font-size: 0 1221 | } 1222 | 1223 | #douban-wrapper #content .douban-icon>span { 1224 | font-size: 14px; 1225 | display: inline-block; 1226 | text-align: center; 1227 | border: 1px solid #41BE57 1228 | } 1229 | 1230 | #douban-wrapper #content .douban-icon .icon-pt1 { 1231 | background-color: #41BE57; 1232 | color: white; 1233 | border-top-left-radius: 4px; 1234 | border-bottom-left-radius: 4px; 1235 | width: 24px; 1236 | height: 24px; 1237 | line-height: 24px 1238 | } 1239 | 1240 | #douban-wrapper #content .douban-icon .icon-pt2 { 1241 | color: #3BA94D; 1242 | background: #FFFFFF; 1243 | border-top-right-radius: 4px; 1244 | border-bottom-right-radius: 4px; 1245 | width: 69px; 1246 | height: 24px; 1247 | line-height: 24px 1248 | } 1249 | 1250 | #douban-wrapper #content .score-container .rating_self { 1251 | margin-top: 15px 1252 | } 1253 | 1254 | #douban-wrapper #content .score-container .rating_self .rating_num { 1255 | font-size: 48px; 1256 | line-height: 1; 1257 | padding: 0; 1258 | color: black; 1259 | font-weight: normal 1260 | } 1261 | 1262 | #douban-wrapper #content .score-container .rating_self .rating_right { 1263 | float: left; 1264 | padding-left: 10px; 1265 | padding-top: 5px 1266 | } 1267 | 1268 | #douban-wrapper #content .score-container .rating_self .rating_right .ll { 1269 | float: none 1270 | } 1271 | 1272 | #douban-wrapper #content .score-container .rating_self .rating_right .rating_sum { 1273 | color: #3B3B3B 1274 | } 1275 | 1276 | #douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:hover,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:visited,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:link { 1277 | color: #3B3B3B; 1278 | background: none 1279 | } 1280 | 1281 | #douban-wrapper #content .score-container .ratings-on-weight { 1282 | margin-top: 10px; 1283 | min-weight: 1px 1284 | } 1285 | 1286 | #douban-wrapper #content .score-container .ratings-on-weight .item { 1287 | line-height: 1.5 1288 | } 1289 | 1290 | #douban-wrapper #content .score-container .ratings-on-weight .item .starstop { 1291 | float: none; 1292 | margin-right: 0; 1293 | color: #3B3B3B 1294 | } 1295 | 1296 | #douban-wrapper #content .score-container .ratings-on-weight .item>span,#douban-wrapper #content .score-container .ratings-on-weight .item>div { 1297 | display: inline-block 1298 | } 1299 | 1300 | #douban-wrapper #content .score-container .ratings-on-weight .item .power { 1301 | height: 6px; 1302 | background: #FAA032; 1303 | border-radius: 3px; 1304 | vertical-align: middle 1305 | } 1306 | 1307 | #douban-wrapper #content .bottom-row { 1308 | display: flex; 1309 | align-items: center; 1310 | justify-content: space-between 1311 | } 1312 | 1313 | #douban-wrapper #content .bottom-row .rating-betterthan { 1314 | font-size: 14px; 1315 | color: #1C1C1C; 1316 | line-height: 21px; 1317 | width: 117px 1318 | } 1319 | 1320 | #douban-wrapper #content .bottom-row .rating-betterthan .number { 1321 | font-size: 14px; 1322 | color: #41BE57 1323 | } 1324 | 1325 | #douban-wrapper #content .bottom-row .qr-code { 1326 | width: 64px; 1327 | height: 64px; 1328 | overflow: hidden 1329 | } 1330 | 1331 | #douban-wrapper #content .bottom-row .qr-code img { 1332 | width: 100%; 1333 | height: 100% 1334 | } 1335 | 1336 | .contentlayout.douban-info { 1337 | display: flex; 1338 | justify-content: space-around; 1339 | } 1340 | .contentlayout.douban-info .detail{ 1341 | flex:1; 1342 | } 1343 | .detail .title{ 1344 | font-size: 26px; 1345 | font-weight: 600; 1346 | margin-bottom: 20px; 1347 | } 1348 | .detail .title a{ 1349 | text-decoration: none; 1350 | } 1351 | .movie-detail{ 1352 | display: flex; 1353 | justify-content: space-between; 1354 | } 1355 | .movie-detail .synopsis { 1356 | width: 60%; 1357 | } 1358 | .movie-detail .movieinfo { 1359 | margin-right: 20px; 1360 | max-width: 30%; 1361 | } 1362 | .icon-pt1{ 1363 | font-size: 14px; 1364 | display: inline-block; 1365 | text-align: center; 1366 | border: 1px solid #41be57; 1367 | background-color: #41be57; 1368 | color: white; 1369 | border-top-left-radius: 4px; 1370 | border-bottom-left-radius: 4px; 1371 | width: 24px; 1372 | height: 24px; 1373 | line-height: 24px; 1374 | } 1375 | .ant .icon-pt1{ 1376 | border-radius: 4px; 1377 | } 1378 | 1379 | .icon-pt2{ 1380 | display: inline-block; 1381 | text-align: center; 1382 | border: 1px solid #41be57; 1383 | color: #3ba94d; 1384 | background: #ffffff; 1385 | border-top-right-radius: 4px; 1386 | border-bottom-right-radius: 4px; 1387 | width: 69px; 1388 | height: 24px; 1389 | line-height: 24px; 1390 | font-size: 14px; 1391 | } 1392 | .douban-dom { 1393 | display: flex; 1394 | cursor: pointer; 1395 | } 1396 | .douban-dom { 1397 | text-align: left; 1398 | } 1399 | #douban-wrapper *{ 1400 | box-sizing: content-box; 1401 | } 1402 | #douban-wrapper .clearfix:after { 1403 | content: "."; 1404 | display: block; 1405 | height: 0; 1406 | clear: both; 1407 | visibility: hidden 1408 | } 1409 | #douban-wrapper .clearfix { 1410 | zoom: 1; 1411 | display: inline-block; 1412 | _height: 1px; 1413 | } 1414 | #douban-wrapper .clearfix { 1415 | height: 1% 1416 | } 1417 | #douban-wrapper .clearfix { 1418 | display: block 1419 | } 1420 | #douban-wrapper .rating_per{ 1421 | color: #111; 1422 | } 1423 | #douban-wrapper .grid{ 1424 | overflow: initial; 1425 | } 1426 | .content-rounded #douban-wrapper div{ 1427 | margin-left: 0; 1428 | } 1429 | #douban-wrapper #content .douban-icon .icon-pt1 { 1430 | background-image:none; 1431 | } 1432 | #douban-wrapper h2,#douban-wrapper h1{ 1433 | border:none; 1434 | background-image: none; 1435 | background-color: transparent; 1436 | text-shadow: none; 1437 | padding: 0; 1438 | margin: 0 1439 | line-height: normal; 1440 | } 1441 | #douban-wrapper .grid-col5 { 1442 | font-size: 14px; 1443 | padding: 27px 14px 0 12px; 1444 | width: 190px; 1445 | overflow-y: auto; 1446 | height: 277px; 1447 | width: calc(100% - 225px - 254px - 36px - 280px); 1448 | } 1449 | 1450 | #douban-wrapper .summary{ 1451 | padding-top: 10px; 1452 | color: #000000; 1453 | line-height: 25px; 1454 | letter-spacing: 1px; 1455 | word-break: break-all; 1456 | font-weight: 400; 1457 | } 1458 | #douban-wrapper { 1459 | width: 100% !important; 1460 | } 1461 | .douban-dom>div{ 1462 | width: 100%; 1463 | } 1464 | #douban-wrapper #content{ 1465 | background-image:none !important; 1466 | background: #fff; 1467 | width: calc(100% - 20px) !important; 1468 | } 1469 | #douban-wrapper #content .grid{ 1470 | width: 100% !important; 1471 | } 1472 | .bhd #douban-wrapper ::-webkit-scrollbar-track{ 1473 | background-color: #fff; 1474 | } 1475 | .bhd #douban-wrapper ::-webkit-scrollbar-thumb{ 1476 | background-color: #ddd; 1477 | } 1478 | .btn #douban-wrapper .grid-col1 { 1479 | display: none; 1480 | } 1481 | .hdb #douban-wrapper .grid-col1 { 1482 | display: none; 1483 | } 1484 | .hdt #douban-wrapper .grid-col1 { 1485 | display: none; 1486 | } 1487 | .sc #douban-wrapper .grid-col1 { 1488 | display: none; 1489 | } 1490 | .its #douban-wrapper .grid-col1 { 1491 | display: none; 1492 | } 1493 | .bb #douban-wrapper .grid-col1 { 1494 | display: none; 1495 | } 1496 | .btn #douban-wrapper .grid-col5 { 1497 | width: calc(100% - 254px - 36px - 280px); 1498 | } 1499 | .hdt #douban-wrapper .grid-col5 { 1500 | width: calc(100% - 254px - 36px - 280px); 1501 | } 1502 | .hdb #douban-wrapper .grid-col5 { 1503 | width: calc(100% - 254px - 36px - 280px); 1504 | } 1505 | .sc #douban-wrapper .grid-col5 { 1506 | width: calc(100% - 254px - 36px - 280px); 1507 | } 1508 | .its #douban-wrapper .grid-col5 { 1509 | width: calc(100% - 254px - 36px - 280px); 1510 | } 1511 | .bb #douban-wrapper .grid-col5 { 1512 | width: calc(100% - 254px - 36px - 280px); 1513 | } 1514 | .its #douban-wrapper { 1515 | background-color: #131313; 1516 | color: #fff; 1517 | } 1518 | `); 1519 | 1520 | // src/index.js 1521 | (async () => { 1522 | if (CURRENT_SITE_INFO) { 1523 | const imdbId = getImdbId(); 1524 | if (!imdbId) { 1525 | return; 1526 | } 1527 | try { 1528 | const savedIds = GM_getValue("ids") || {}; 1529 | if (!savedIds[imdbId] || savedIds[imdbId] && savedIds[imdbId].updateTime && Date.now() - savedIds[imdbId].updateTime >= 30 * 24 * 60 * 60 * 1e3) { 1530 | let doubanId = ""; 1531 | const movieData = await getDoubanInfoByIMDB(imdbId); 1532 | if (!movieData) { 1533 | throw new Error("\u6CA1\u6709\u627E\u5230\u8C46\u74E3\u6761\u76EE"); 1534 | } 1535 | const {id = "", episodes = ""} = movieData; 1536 | doubanId = id; 1537 | if (episodes) { 1538 | const tvData = await getTvSeasonData(movieData); 1539 | doubanId = tvData.id; 1540 | } 1541 | if (CURRENT_SITE_NAME.match(/PTP/)) { 1542 | addToPtpPage(movieData); 1543 | } else if (CURRENT_SITE_NAME.match(/ANT/)) { 1544 | addToANTPage(movieData); 1545 | } else { 1546 | createDoubanDom(doubanId, imdbId); 1547 | } 1548 | } else { 1549 | const savedData = savedIds[imdbId]; 1550 | if (CURRENT_SITE_NAME.match(/PTP/)) { 1551 | addToPtpPage(savedData); 1552 | } else if (CURRENT_SITE_NAME.match(/ANT/)) { 1553 | addToANTPage(savedData); 1554 | } else { 1555 | createDoubanDom(savedData.doubanId, imdbId, savedData); 1556 | } 1557 | } 1558 | } catch (error) { 1559 | console.log(error); 1560 | } 1561 | } 1562 | })(); 1563 | })(); 1564 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "douban-info-for-pt", 3 | "version": "1.7.6", 4 | "description": "在PT站电影详情页展示部分中文信息", 5 | "main": "index.js", 6 | "repository": "git@github.com:techmovie/DouBan-Info-for-PT.git", 7 | "author": "birdplane", 8 | "license": "MIT", 9 | "scripts": { 10 | "build": "node scripts/build.js", 11 | "dev": "node scripts/dev.js", 12 | "commit": "git-cz", 13 | "release": "node scripts/release.js", 14 | "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", 15 | "postinstall": "husky install" 16 | }, 17 | "config": { 18 | "commitizen": { 19 | "path": "node_modules/cz-conventional-changelog" 20 | } 21 | }, 22 | "husky": { 23 | "hooks": { 24 | "pre-commit": "lint-staged", 25 | "pre-push": "lint-staged" 26 | } 27 | }, 28 | "lint-staged": { 29 | "src/**/*.js": "eslint --max-warnings 0" 30 | }, 31 | "devDependencies": { 32 | "@commitlint/cli": "^12.1.1", 33 | "@commitlint/config-conventional": "^12.1.1", 34 | "@jsdevtools/version-bump-prompt": "^6.1.0", 35 | "@types/jquery": "^3.5.5", 36 | "chalk": "^4.1.0", 37 | "chokidar": "^3.5.1", 38 | "commitizen": "^4.2.3", 39 | "conventional-changelog-cli": "^2.1.1", 40 | "cz-conventional-changelog": "^3.3.0", 41 | "esbuild": "^0.8.38", 42 | "eslint": "^7.18.0", 43 | "eslint-config-standard": "^16.0.2", 44 | "eslint-plugin-import": "^2.22.1", 45 | "eslint-plugin-node": "^11.1.0", 46 | "eslint-plugin-promise": "^4.2.1", 47 | "execa": "^5.0.0", 48 | "husky": "^6.0.0", 49 | "lint-staged": "^10.5.3", 50 | "node-notifier": "^9.0.1", 51 | "ora": "^5.4.0", 52 | "yaml": "^1.10.0" 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /scripts/build.js: -------------------------------------------------------------------------------- 1 | const { userScriptComment, yamlToJSON } = require('./helper'); 2 | yamlToJSON(); 3 | require('esbuild').build({ 4 | entryPoints: ['src/index.js'], 5 | outfile: 'dist/douban-info-for-pt.user.js', 6 | bundle: true, 7 | target: 'chrome58', 8 | sourcemap: false, 9 | banner: userScriptComment, 10 | }).catch(() => process.exit(1)); 11 | -------------------------------------------------------------------------------- /scripts/dev.js: -------------------------------------------------------------------------------- 1 | const { notify, yamlToJSON } = require('./helper'); 2 | const chokidar = require('chokidar'); 3 | 4 | const notifyError = (error) => { 5 | if (error) { 6 | const { location, text } = error.errors[0]; 7 | const { file, line, column } = location; 8 | notify('Build failed', `${file}:${line}:${column} error:${text}`); 9 | } 10 | }; 11 | (async () => { 12 | require('esbuild').build({ 13 | entryPoints: ['src/index.js'], 14 | outfile: '.cache/douban-info-for-pt.js', 15 | bundle: true, 16 | target: 'es2016', 17 | define: { $: 'jQuery' }, 18 | incremental: true, 19 | watch: { 20 | onRebuild (error) { 21 | if (error) { 22 | notifyError(error); 23 | } 24 | }, 25 | }, 26 | }).catch(e => { 27 | notifyError(e); 28 | }); 29 | yamlToJSON(); 30 | chokidar.watch('src/config/*', { awaitWriteFinish: true, ignoreInitial: true }).on('all', (eventName, path) => { 31 | console.log(`${path}:${eventName}`); 32 | yamlToJSON(); 33 | }); 34 | })(); 35 | -------------------------------------------------------------------------------- /scripts/helper.js: -------------------------------------------------------------------------------- 1 | const notifier = require('node-notifier'); 2 | const fs = require('fs'); 3 | const path = require('path'); 4 | const YAML = require('yaml'); 5 | 6 | const srcFolder = path.join(__dirname, '..', 'src'); 7 | const yamlDir = path.join(srcFolder, 'config'); 8 | const notify = (title, message) => { 9 | notifier.notify( 10 | { 11 | title, 12 | message, 13 | sound: true, 14 | wait: false, 15 | }, 16 | ); 17 | }; 18 | exports.yamlToJSON = () => { 19 | const yamlFiles = fs.readdirSync(yamlDir); 20 | const JSON_DATA = { 21 | PT_SITE: { 22 | }, 23 | }; 24 | try { 25 | yamlFiles.forEach(file => { 26 | const fileName = file.replace('.yaml', ''); 27 | const source = fs.readFileSync(yamlDir + '/' + file, 'UTF-8'); 28 | JSON_DATA.PT_SITE[fileName] = YAML.parse(source); 29 | }); 30 | fs.writeFileSync(`${srcFolder}/config.json`, JSON.stringify(JSON_DATA, null, 2)); 31 | } catch (error) { 32 | notify('yamlToJSON Error', `${error.name}:${error.message}`); 33 | console.log(error); 34 | } 35 | }; 36 | 37 | const { version, author, description = '' } = require('../package.json'); 38 | 39 | // 油猴前置注释 40 | exports.userScriptComment = `// ==UserScript== 41 | // @name douban-info-for-pt 42 | // @namespace https://github.com/techmovie/DouBan-Info-for-PT 43 | // @version ${version} 44 | // @description ${description} 45 | // @author ${author} 46 | // @require https://s4.zstatic.net/ajax/libs/jquery/1.7.1/jquery.min.js 47 | // @match *://passthepopcorn.me/torrents.php?id=* 48 | // @match *://passthepopcorn.me/requests.php?action=view&id=* 49 | // @match *://anthelion.me/torrents.php?id=* 50 | // @match *://anthelion.me/requests.php?action=view&id=* 51 | // @match *://beyond-hd.me/torrents/* 52 | // @match *://beyond-hd.me/library/title/* 53 | // @match *://blutopia.xyz/torrents/* 54 | // @match *://asiancinema.me/torrents/* 55 | // @match *://hdbits.org/details.php?id=* 56 | // @match *://hdbits.org/requests/show_request?id=* 57 | // @match *://uhdbits.org/torrents.php?id=* 58 | // @match *://filelist.io/details.php?id=* 59 | // @match *://hd-torrents.org/details.php?id=* 60 | // @match *://karagarga.in/details.php?id=* 61 | // @match *://privatehd.to/torrent/* 62 | // @match *://broadcasthe.net/series.php?id=* 63 | // @match *://iptorrents.com/torrent.php?id=* 64 | // @match *://www.iptorrents.com/torrent.php?id=* 65 | // @match *://www.torrentleech.org/torrent/* 66 | // @match *://avistaz.to/torrent/* 67 | // @match *://secret-cinema.pw/torrents.php?id=* 68 | // @match *://aither.cc/torrents/* 69 | // @match *://shadowthein.net/details.php?id=* 70 | // @match *://shadowthein.net/details.php?id=* 71 | // @match *://baconbits.org/torrents.php?id=* 72 | // @match *://broadcity.in/details.php?id=* 73 | // @match *://www.morethantv.me/torrents.php?id=* 74 | // @match *://www.morethantv.me/show/* 75 | // @match *://tgx.rs/torrent/* 76 | // @grant GM_addStyle 77 | // @grant GM_xmlhttpRequest 78 | // @grant GM_openInTab 79 | // @grant GM_getValue 80 | // @grant GM_setValue 81 | // @license MIT 82 | // ==/UserScript==`; 83 | 84 | exports.notify = notify; 85 | -------------------------------------------------------------------------------- /scripts/release.js: -------------------------------------------------------------------------------- 1 | const chalk = require('chalk'); 2 | const bump = require('@jsdevtools/version-bump-prompt'); 3 | const execa = require('execa'); 4 | const ora = require('ora'); 5 | const CURRENT_BRANCH = 'main'; 6 | const log = console.log; 7 | const showCurrentBranch = () => { 8 | return execa.sync('git', ['branch', '--show-current']).stdout; 9 | }; 10 | const checkGitTreeClean = () => { 11 | const { stdout } = execa.sync('git', ['status', '--porcelain']); 12 | const infos = stdout.split('\n'); 13 | if (infos.length && !!stdout) { 14 | infos.unshift('Git working directory is not clean.'); 15 | infos.forEach(info => log(chalk.red('ERR!'), info.trim())); 16 | process.exit(); 17 | } 18 | }; 19 | const currentBranch = showCurrentBranch(); 20 | if (currentBranch !== CURRENT_BRANCH) { 21 | log(chalk.red('ERR!'), `请先切换到「${CURRENT_BRANCH}」分支再进行发布操作`); 22 | process.exit(); 23 | } 24 | checkGitTreeClean(); 25 | bump({ 26 | tag: false, 27 | commit: 'chore: update pkg version %s', 28 | }).then(data => { 29 | const { newVersion } = data; 30 | const spinner = ora({ 31 | text: '📦 打包中...', 32 | color: 'blue', 33 | }).start(); 34 | execa.sync('yarn', ['changelog']); 35 | execa.sync('yarn', ['build']); 36 | spinner.text = '🔨 提交代码...'; 37 | spinner.color = 'green'; 38 | execa.sync('git', ['add', '.']); 39 | execa.sync('git', ['commit', '-m', `chore(release): ${newVersion}`]); 40 | execa.sync('git', ['pull', '--rebase']); 41 | execa.sync('git', ['push']); 42 | setTimeout(() => { 43 | spinner.succeed(`🎉 v${newVersion}发布成功!`); 44 | }, 600); 45 | }); 46 | -------------------------------------------------------------------------------- /src/common.js: -------------------------------------------------------------------------------- 1 | import { 2 | CURRENT_SITE_INFO, PIC_URLS, 3 | DOUBAN_API_URL, DOUBAN_SEARCH_API, CURRENT_SITE_NAME, DOUBAN_SUGGEST_API, 4 | DOUBAN_SUBJECT_URL, 5 | } from './const'; 6 | const isChinese = (title) => { 7 | return /[\u4e00-\u9fa5]+/.test(title); 8 | }; 9 | const addToPtpPage = (data) => { 10 | console.log(data); 11 | $('.page__title').prepend(`[${data.chineseTitle}] `); 12 | if (data.summary) { 13 | const synopsisDom = ` 14 |
    15 |
    中文简介
    16 |
    17 |
    ${data.summary}
    18 |
    19 |
    `; 20 | $('#synopsis-and-trailer,#request-table').after(synopsisDom); 21 | } 22 | $('#movieinfo').before(` 23 |
    24 |
    电影信息
    25 |
    26 |
    导演: ${data.director}
    27 |
    类型: ${data.genre}
    28 |
    制片国家/地区: ${data.region}
    29 |
    语言: ${data.language}
    30 |
    时长: ${data.runtime}
    31 |
    又名: ${data.aka}
    获奖情况:
    ${data.awards}
    `); 34 | if (data.average) { 35 | $('#movie-ratings-table tr').prepend( 36 | ` 37 |
    38 | 39 |
    40 | 41 | 豆瓣评分 42 |
    43 |
    44 |
    45 | 46 | 47 | ${data.average} 48 | / 49 | 10 50 |
    (${data.votes} votes)`); 51 | } 52 | }; 53 | const addToANTPage = (data) => { 54 | console.log(data); 55 | $('.header h2').prepend(`[${data.chineseTitle}] `); 56 | if (data.summary) { 57 | const synopsisDom = ` 58 |
    59 |
     中文简介
    60 |
    ${data.summary}
    61 |
    `; 62 | $('.torrent_description,.box_request_desc').after(synopsisDom); 63 | } 64 | $('.box_details:first').before(` 65 |
    66 |
    电影信息
    67 |
    68 |
      69 |
    • 导演: ${data.director}
    • 70 |
    • 类型: ${data.genre}
    • 71 |
    • 制片国家/地区: ${data.region}
    • 72 |
    • 语言: ${data.language}
    • 73 |
    • 时长: ${data.runtime}
    • 74 |
    • 又名: ${data.aka}
    • 获奖情况:
      ${data.awards} 77 |
    78 |
    `); 79 | if (data.average) { 80 | $('.box.torrent_ratings .body tr').prepend( 81 | ` 82 |
    83 | 84 |
    85 | 86 |
    87 |
    88 |
    89 | 90 | 91 | ${data.average} 92 | / 93 | 10 94 |
    (${data.votes} votes)`); 95 | } 96 | }; 97 | const getImdbId = () => { 98 | let imdbLink = ''; 99 | const imdbConfig = CURRENT_SITE_INFO.imdb; 100 | if (typeof imdbConfig === 'object') { 101 | try { 102 | Object.keys(imdbConfig).forEach(key => { 103 | if ($(`${imdbConfig[key]}`)[0]) { 104 | imdbLink = $(imdbConfig[key]).attr('href'); 105 | throw new Error('end loop'); 106 | } 107 | }); 108 | } catch (error) { 109 | if (error.message !== 'end loop') { 110 | console.log(error); 111 | } 112 | } 113 | } else { 114 | imdbLink = $(imdbConfig).attr('href'); 115 | } 116 | console.log(imdbLink); 117 | return /tt\d+/.exec(imdbLink)?.[0] ?? ''; 118 | }; 119 | const getDoubanId = async (imdbId) => { 120 | try { 121 | const url = DOUBAN_SEARCH_API.replace('{query}', imdbId); 122 | const res = await fetch(url, { 123 | responseType: 'json', 124 | }); 125 | if (res && res.length > 0 && res[0].id) { 126 | const { id, title, episode } = res[0]; 127 | return { 128 | id, 129 | season: episode, 130 | title, 131 | }; 132 | } 133 | } catch (error) { 134 | console.log(error); 135 | } 136 | }; 137 | const getDoubanIdByIMDB = async (imdbId) => { 138 | try { 139 | const url = DOUBAN_SUGGEST_API.replace('{query}', imdbId); 140 | const options = { 141 | cookie: '', 142 | anonymous: false, 143 | responseType: undefined, 144 | }; 145 | const data = await fetch(url, options); 146 | const doc = new DOMParser().parseFromString(data, 'text/html'); 147 | const linkDom = doc.querySelector('.result-list .result h3 a'); 148 | if (!linkDom) { 149 | throw new Error('豆瓣ID获取失败'); 150 | } else { 151 | const { href, textContent } = linkDom; 152 | const season = textContent?.match(/第(.+?)季/)?.[1] ?? ''; 153 | const doubanId = decodeURIComponent(href).match(/subject\/(\d+)/)?.[1] ?? ''; 154 | return ({ 155 | id: doubanId, 156 | season, 157 | title: textContent || '', 158 | }); 159 | } 160 | } catch (error) { 161 | throw new Error(error.message); 162 | } 163 | }; 164 | // const getTvSeasonData = (data) => { 165 | // const torrentTitle = getTorrentTitle(); 166 | // return new Promise((resolve, reject) => { 167 | // const { season = '', title } = data; 168 | // if (season) { 169 | // const seasonNumber = torrentTitle.match(/S(?!eason)\s*?0?(\d+)\.?(EP?\d+)?/i)?.[1] ?? 1; 170 | // if (parseInt(seasonNumber) === 1) { 171 | // resolve(data); 172 | // } else { 173 | // const query = title.replace(/第.+?季/, `第${seasonNumber}季`); 174 | // getDoubanId(query).then(data => { 175 | // resolve(data); 176 | // }); 177 | // } 178 | // } 179 | // }); 180 | // }; 181 | const getTvSeasonData = async (data) => { 182 | const torrentTitle = getTorrentTitle(); 183 | const { episodes = '', chineseTitle } = data; 184 | if (episodes) { 185 | const seasonNumber = torrentTitle.match(/S(?!eason)\s*?0?(\d+)\.?(EP?\d+)?/i)?.[1] ?? 1; 186 | if (parseInt(seasonNumber) === 1) { 187 | return data; 188 | } else { 189 | const query = `${chineseTitle} 第${seasonNumber}季`; 190 | const params = encodeURI('apikey=0ab215a8b1977939201640fa14c66bab'); 191 | const searchData = await fetch(`${DOUBAN_API_URL}/search?q=${query}`, { 192 | data: params, 193 | method: 'POST', 194 | headers: { 195 | 'Content-Type': 'application/x-www-form-urlencoded', 196 | }, 197 | }); 198 | if (searchData.count > 0) { 199 | return { id: searchData.subjects[0].id }; 200 | } 201 | } 202 | } 203 | }; 204 | const getDoubanInfo = async (doubanId, imdbId) => { 205 | try { 206 | const url = DOUBAN_SUBJECT_URL.replace('{doubanId}', doubanId); 207 | const data = await fetch(url, { 208 | responseType: 'text', 209 | }); 210 | if (data) { 211 | const doubanInfo = await formatDoubanInfo(data); 212 | const savedIds = GM_getValue('ids') || {}; 213 | savedIds[imdbId] = { 214 | doubanId, 215 | updateTime: Date.now(), 216 | ...doubanInfo, 217 | }; 218 | GM_setValue('ids', savedIds); 219 | return doubanInfo; 220 | } else { 221 | console.log('豆瓣数据获取失败'); 222 | } 223 | } catch (error) { 224 | console.log(error); 225 | } 226 | }; 227 | const getDoubanInfoByIMDB = async (imdbId) => { 228 | try { 229 | const params = encodeURI('apikey=0ab215a8b1977939201640fa14c66bab'); 230 | const doubanData = await fetch(`${DOUBAN_API_URL}/imdb/${imdbId}`, { 231 | data: params, 232 | method: 'POST', 233 | headers: { 234 | 'Content-Type': 'application/x-www-form-urlencoded', 235 | }, 236 | }); 237 | const { title, attrs = {}, image, summary, rating, alt_title: altTitle, mobile_link: mobileLink } = doubanData; 238 | let chineseTitle = title; 239 | const isChineseReg = /[\u4e00-\u9fa5]+/; 240 | if (!isChineseReg.test(title) && !title.match(/^\d+$/)) { 241 | if (altTitle) { 242 | chineseTitle = altTitle.split('/')[0].trim(); 243 | } else { 244 | chineseTitle = title; 245 | } 246 | } 247 | const subjectLink = mobileLink.replace('m.douban.com/movie', 'movie.douban.com').replace(/\/$/, ''); 248 | const doubanId = subjectLink.match(/subject\/(\d+)/)?.[1] ?? ''; 249 | const awards = await getAwardInfo(subjectLink); 250 | const doubanInfo = { 251 | director: attrs.director?.join(' / '), 252 | runtime: attrs.movie_duration?.join(' / '), 253 | language: attrs.language?.join(' / '), 254 | genre: attrs.movie_type?.join(' / ') ?? '', 255 | aka: altTitle || '', 256 | region: attrs.country?.join(' / '), 257 | link: subjectLink, 258 | poster: image, 259 | summary, 260 | chineseTitle, 261 | votes: rating.numRaters, 262 | average: rating.average, 263 | awards: awards, 264 | id: subjectLink.match(/subject\/(\d+)/)?.[1] ?? '', 265 | episodes: attrs.episodes?.join(' / ') ?? '', 266 | }; 267 | // no need to save series info 268 | if (!attrs.episodes) { 269 | const savedIds = GM_getValue('ids') || {}; 270 | savedIds[imdbId] = { 271 | doubanId, 272 | updateTime: Date.now(), 273 | ...doubanInfo, 274 | }; 275 | GM_setValue('ids', savedIds); 276 | } 277 | return doubanInfo; 278 | } catch (error) { 279 | console.log(error); 280 | } 281 | }; 282 | const getAwardInfo = async (doubanLink) => { 283 | const awardsPage = await fetch(`${doubanLink}/awards/`, { 284 | responseType: 'text', 285 | }); 286 | const awardsDoc = new DOMParser().parseFromString(awardsPage, 'text/html'); 287 | const awards = $('#content > div > div.article', awardsDoc).html() 288 | .replace(/[ \n]/g, '') 289 | .replace(/<\/li>
  • /g, '
  • ') 290 | .replace(/<\/a> ]*>/g, '\n') 292 | .replace(/<[^>]+>/g, '') 293 | .replace(/ /g, ' ') 294 | .replace(/ +\n/g, '\n') 295 | .trim(); 296 | return awards?.replace(/\n/g, '
    ') ?? ''; 297 | }; 298 | const formatDoubanInfo = async (domString) => { 299 | const dom = new DOMParser().parseFromString(domString, 'text/html'); 300 | const chineseTitle = $('title', dom).text().replace('(豆瓣)', '').trim(); 301 | const jsonData = JSON.parse($('head > script[type="application/ld+json"]', dom).html().replace(/(\r\n|\n|\r|\t)/gm, '')); 302 | const fetchAnchor = function (anchor) { 303 | return anchor?.[0]?.nextSibling?.nodeValue?.trim() ?? ''; 304 | }; 305 | const rating = jsonData.aggregateRating ? jsonData.aggregateRating.ratingValue : 0; 306 | const votes = jsonData.aggregateRating ? jsonData.aggregateRating.ratingCount : 0; 307 | const director = jsonData.director ? jsonData.director : []; 308 | const poster = jsonData.image 309 | .replace(/s(_ratio_poster|pic)/g, 'l$1') 310 | .replace(/img\d/, 'img9'); 311 | const link = `https://movie.douban.com${jsonData.url}`; 312 | const introductionDom = $('#link-report > span.all.hidden,#link-report-intra > [property="v:summary"], #link-report > [property="v:summary"]', dom); 313 | const summary = ( 314 | introductionDom.length > 0 ? introductionDom.text() : '暂无相关剧情介绍' 315 | ).split('\n').map(a => a.trim()).filter(a => a.length > 0).join('\n'); // 处理简介缩进 316 | const genre = $('#info span[property="v:genre"]', dom).map(function () { // 类别 317 | return $(this).text().trim(); 318 | }).toArray(); // 类别 319 | const language = fetchAnchor($('#info span.pl:contains("语言")', dom)); 320 | const region = fetchAnchor($('#info span.pl:contains("制片国家/地区")', dom)); // 产地 321 | const runtimeAnchor = $('#info span.pl:contains("单集片长")', dom); 322 | const runtime = runtimeAnchor[0] ? fetchAnchor(runtimeAnchor) : $('#info span[property="v:runtime"]', dom).text().trim(); 323 | const akaAnchor = $('#info span.pl:contains("又名")', dom); 324 | let aka = []; 325 | if (akaAnchor.length > 0) { 326 | aka = fetchAnchor(akaAnchor).split(' / ').sort(function (a, b) { // 首字(母)排序 327 | return a.localeCompare(b); 328 | }).join('/'); 329 | aka = aka.split('/'); 330 | } 331 | const awards = await getAwardInfo(link); 332 | return { 333 | director: director.map(item => item.name), 334 | runtime, 335 | language, 336 | genre: genre?.join(' / ') ?? '', 337 | aka: aka?.join(' / ') ?? '', 338 | region, 339 | link, 340 | poster, 341 | summary, 342 | chineseTitle, 343 | votes, 344 | average: rating, 345 | awards, 346 | }; 347 | }; 348 | const getTorrentTitle = () => { 349 | let { titleDom } = CURRENT_SITE_INFO; 350 | if (!titleDom) { 351 | if (CURRENT_SITE_NAME === 'BHD') { 352 | titleDom = $('.dotborder').find('td:contains(Name)').next('td'); 353 | } else if (CURRENT_SITE_NAME.match(/ACM|BLU/)) { 354 | const keyMap = { 355 | Name: 'Name', 356 | 名称: 'Name', 357 | 名稱: 'Name', 358 | }; 359 | $('#vue+.panel table tr').each((index, element) => { 360 | const key = $(element).find('td:first').text().replace(/\s|\n/g, ''); 361 | if (keyMap[key]) { 362 | titleDom = $(element).find('td:last'); 363 | } 364 | }); 365 | } else if (CURRENT_SITE_NAME === 'UHD') { 366 | const torrentId = getUrlParam('torrentid'); 367 | const torrentFilePathDom = $(`#files_${torrentId} .filelist_path`); 368 | const torrentFileDom = $(`#files_${torrentId} .filelist_table>tbody>tr:nth-child(2) td`).eq(0); 369 | titleDom = torrentFilePathDom || torrentFileDom; 370 | } else if (CURRENT_SITE_NAME === 'HDT') { 371 | return document.title.replace(/HD-Torrents.org\s*-/ig, '').trim(); 372 | } 373 | } 374 | return $(titleDom).text(); 375 | }; 376 | const getUrlParam = (key) => { 377 | const reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)'); 378 | const regArray = location.search.substr(1).match(reg); 379 | if (regArray) { 380 | return unescape(regArray[2]); 381 | } 382 | return ''; 383 | }; 384 | const createDoubanDom = async (doubanId, imdbId, doubanInfo) => { 385 | const div = document.createElement('div'); 386 | let { doubanContainerDom, insertDomSelector, siteName, poster } = CURRENT_SITE_INFO; 387 | if (siteName.match(/(HDT)$/)) { 388 | insertDomSelector = $(insertDomSelector).parent(); 389 | } 390 | $(insertDomSelector).before(doubanContainerDom); 391 | const doubanLink = `https://movie.douban.com/subject/${doubanId}`; 392 | 393 | let htmlData = await fetch(`${doubanLink}/output_card`, { 394 | responseType: 'text', 395 | }); 396 | htmlData = htmlData.replace(/wrapper/g, 'douban-wrapper').replace(//g, ''); 397 | htmlData = htmlData.replace(/(html,)body,/, '$1');// HDB body样式覆盖 398 | htmlData = htmlData.replace(/url\(.+?output_card\/border.png\)/g, `url(${PIC_URLS.border})`); 399 | htmlData = htmlData.replace(/src=.+?output_card\/line\.png/g, `src="${PIC_URLS.line}`); 400 | let headDom = htmlData.match(/((.|\n)+)<\/head>/)[1]; 401 | headDom = headDom.replace(//g, ''); 402 | const bodyDom = htmlData.match(/((.|\n)+)<\/body>/)[1]; 403 | div.insertAdjacentHTML('beforeend', headDom); 404 | div.insertAdjacentHTML('beforeend', bodyDom); 405 | $('.douban-dom').append(div).attr('douban-link', doubanLink); 406 | $('.douban-dom .grid-col4').after(` 407 |
    408 |
    409 | 410 |
    411 |
    412 |
    `); 413 | const doubanData = doubanInfo || await getDoubanInfo(doubanId, imdbId); 414 | $('.douban-dom .grid-col5').html(`
    ${doubanData.summary || '暂无简介'}
    `); 415 | let posterStyle = $('.picture-douban-wrapper').attr('style'); 416 | const posterImg = siteName === 'MTV' ? $(poster).attr('src') : doubanData.poster; 417 | posterStyle = posterStyle?.replace(/\(.+\)/, `(${posterImg})`); 418 | $('.picture-douban-wrapper').attr('style', posterStyle); 419 | $('.douban-dom').click(() => { 420 | GM_openInTab(doubanLink); 421 | }); 422 | }; 423 | function fetch (url, options = {}) { 424 | return new Promise((resolve, reject) => { 425 | GM_xmlhttpRequest({ 426 | method: 'GET', 427 | url, 428 | responseType: 'json', 429 | ...options, 430 | onload: (res) => { 431 | const { statusText, status, response } = res; 432 | if (status !== 200) { 433 | reject(new Error(statusText || status)); 434 | } else { 435 | resolve(response); 436 | } 437 | }, 438 | ontimeout: () => { 439 | reject(new Error('timeout')); 440 | }, 441 | onerror: (error) => { 442 | reject(error); 443 | }, 444 | }); 445 | }); 446 | } 447 | export { 448 | isChinese, 449 | getImdbId, 450 | getDoubanInfo, 451 | addToPtpPage, 452 | addToANTPage, 453 | getDoubanId, 454 | createDoubanDom, 455 | getTvSeasonData, 456 | getDoubanIdByIMDB, 457 | getDoubanInfoByIMDB, 458 | }; 459 | -------------------------------------------------------------------------------- /src/config/aither.cc.yaml: -------------------------------------------------------------------------------- 1 | url: https://aither.cc 2 | host: aither.cc 3 | siteName: Aither 4 | poster: '#meta-poster' 5 | imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)' 6 | insertDomSelector: '.torrent-buttons' 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/anthelion.me.yaml: -------------------------------------------------------------------------------- 1 | url: https://anthelion.me 2 | host: anthelion.me 3 | siteName: ANT 4 | siteType: gazelle 5 | imdb: 6 | request: '.layout a[href*="imdb.com/title"]:first' 7 | torrent: '.torrent_ratings a[href*="imdb.com/title"]:first' -------------------------------------------------------------------------------- /src/config/asiancinema.me.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://asiancinema.me' 2 | host: asiancinema.me 3 | siteName: ACM 4 | poster: 'img.movie-poster' 5 | imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)' 6 | insertDomSelector: '#vue' 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/avistaz.to.yaml: -------------------------------------------------------------------------------- 1 | url: https://avistaz.to 2 | host: avistaz.to 3 | siteName: AvistaZ 4 | imdb: '.movie-details .badge-extra a[href*="imdb.com/title"]:first' 5 | titleDom: '.title .torrent-filename' 6 | poster: '.movie-poster img' 7 | insertDomSelector: '.movie-poster' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/baconbits.org.yaml: -------------------------------------------------------------------------------- 1 | url: https://baconbits.org 2 | host: baconbits.org 3 | siteName: bB 4 | imdb: '.box .body a[href*="imdb.com/title"]:first' 5 | insertDomSelector: '.linkbox:first' 6 | titleDom: h1:first 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/beyond-hd.me.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://beyond-hd.me' 2 | host: beyond-hd.me 3 | siteName: BHD 4 | imdb: '.movie-details a[href*="imdb.com/title"]:nth-child(1)' 5 | insertDomSelector: '.movie-wrapper' 6 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/blutopia.xyz.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://blutopia.xyz' 2 | host: blutopia.xyz 3 | siteName: BLU 4 | poster: '#meta-poster' 5 | imdb: '.badge-user a[href*="imdb.com/title"]:nth-child(1)' 6 | insertDomSelector: '.torrent-buttons' 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/broadcasthe.net.yaml: -------------------------------------------------------------------------------- 1 | url: https://broadcasthe.net 2 | host: broadcasthe.net 3 | siteName: BTN 4 | imdb: '.stats td a[href*="imdb.com/title"]' 5 | insertDomSelector: '#content .linkbox' 6 | poster: '.sidebar .box img:first' 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/broadcity.in.yaml: -------------------------------------------------------------------------------- 1 | url: https://broadcity.in 2 | host: broadcity.in 3 | siteName: Bdc 4 | imdb: '#imdbdetails a[href*="imdb.com/title"]' 5 | titleDom: '#details>table>tbody>tr:first' 6 | insertDomSelector: '#imdbdetails' 7 | poster: '#ts_show_preview img' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/filelist.io.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://filelist.io' 2 | host: filelist.io 3 | siteName: FL 4 | imdb: '.cblock-innercontent div a[href*="imdb.com/title"]:first' 5 | poster: 'img[width="300px"][src*="image.tmdb.org"]' 6 | titleDom: '.cblock-header h4' 7 | insertDomSelector: '.cblock-innercontent hr.separator:first' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/hd-torrents.org.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://hd-torrents.org' 2 | host: hd-torrents.org 3 | siteName: HDT 4 | poster: '#IMDBDetailsInfoHideShowTR .imdbnew a img' 5 | imdb: '.imdbnew2 a[href*="imdb.com/title"]:first' 6 | insertDomSelector: 'td.detailsleft:contains(IMDb)' 7 | doubanContainerDom: '豆瓣' -------------------------------------------------------------------------------- /src/config/hdbits.org.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://hdbits.org' 2 | host: hdbits.org 3 | siteName: HDB 4 | imdb: 5 | movie: '.contentlayout h1 a' 6 | tv: '#details .showlinks li:nth-child(2) a' 7 | tvRequest: '.lottery_table2 .showlinks li:nth-child(2) a' 8 | titleDom: h1:first 9 | insertDomSelector: '#details>tbody>tr:nth-child(2),.lottery_table2>tbody>tr:nth-child(1)' 10 | doubanContainerDom: '
    - 豆瓣信息
    ' -------------------------------------------------------------------------------- /src/config/iptorrents.com.yaml: -------------------------------------------------------------------------------- 1 | url: https://iptorrents.com 2 | host: iptorrents.com 3 | siteName: IPT 4 | imdb: '.main td a[href*="imdb.com/title"]' 5 | titleDom: '.dBox h1' 6 | insertDomSelector: '.dBox .info' 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/karagarga.in.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://karagarga.in' 2 | host: karagarga.in 3 | siteName: KG 4 | imdb: 'td a[href*="imdb.com/title"]:first' 5 | insertDomSelector: '.outer h1~table:first' 6 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/passthepopcorn.me.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://passthepopcorn.me' 2 | host: passthepopcorn.me 3 | siteName: PTP 4 | siteType: gazelle 5 | imdb: 6 | request: '#request-table a[href*="imdb.com/title"]:first' 7 | torrent: '#imdb-title-link' -------------------------------------------------------------------------------- /src/config/privatehd.to.yaml: -------------------------------------------------------------------------------- 1 | url: https://privatehd.to 2 | host: privatehd.to 3 | siteName: PHD 4 | imdb: '.movie-details .badge-extra a[href*="imdb.com/title"]:first' 5 | titleDom: '.title .torrent-filename' 6 | poster: '.movie-poster img' 7 | insertDomSelector: '.movie-poster' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/secret-cinema.pw.yaml: -------------------------------------------------------------------------------- 1 | url: https://secret-cinema.pw 2 | host: secret-cinema.pw 3 | siteName: SC 4 | imdb: '.torrent_row a[href*="imdb.com/title"]:first' 5 | insertDomSelector: '.linkbox:first' 6 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/shadowthein.net.yaml: -------------------------------------------------------------------------------- 1 | url: http://shadowthein.net 2 | host: shadowthein.net 3 | siteName: iTS 4 | imdb: '.IMDBtable a[href*="imdb.com/title"]:first' 5 | insertDomSelector: 'h1+table.line' 6 | titleDom: h1:first 7 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/tgx.rs.yaml: -------------------------------------------------------------------------------- 1 | url: https://tgx.rs 2 | host: tgx.rs 3 | siteName: TorrentGalaxy 4 | poster: '#covercell img' 5 | imdb: '#imdbpage[href*="imdb.com/title"]' 6 | titleDom: '.torrentpagetable.limitwidth:first a.textshadow' 7 | insertDomSelector: '.buttonbox' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/uhdbits.org.yaml: -------------------------------------------------------------------------------- 1 | url: 'https://uhdbits.org' 2 | host: uhdbits.org 3 | siteName: UHD 4 | imdb: '.tooltip.imdb_icon' 5 | poster: '.poster_box .imgbox img' 6 | insertDomSelector: 'div.head:contains(IMDB)' 7 | doubanContainerDom: '
     豆瓣
    ' -------------------------------------------------------------------------------- /src/config/www.morethantv.me.yaml: -------------------------------------------------------------------------------- 1 | url: www.morethantv.me 2 | host: morethantv.me 3 | siteName: MTV 4 | imdb: '.metalinks a[href*="imdb.com/title"]' 5 | insertDomSelector: '#content>.thin>div:first' 6 | poster: '.sidebar img:first' 7 | titleDom: '.details h2:first' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/config/www.torrentleech.org.yaml: -------------------------------------------------------------------------------- 1 | url: https://www.torrentleech.org 2 | host: torrentleech.org 3 | siteName: IPT 4 | imdb: '.imdb-info a[href*="imdb.com/title"]' 5 | titleDom: '#torrentnameid' 6 | poster: '.imdb_cover img' 7 | insertDomSelector: '.torrent-info .torrent-info-details' 8 | doubanContainerDom: '
    ' -------------------------------------------------------------------------------- /src/const.js: -------------------------------------------------------------------------------- 1 | import { PT_SITE } from './config.json'; 2 | 3 | const host = location.host; 4 | let siteInfo = PT_SITE?.[host] ?? ''; 5 | if (host && host.match(/iptorrents/i)) { 6 | siteInfo = PT_SITE['iptorrents.com']; 7 | } else { 8 | siteInfo = PT_SITE?.[host] ?? ''; 9 | } 10 | const CURRENT_SITE_INFO = siteInfo; 11 | const CURRENT_SITE_NAME = CURRENT_SITE_INFO?.siteName ?? ''; 12 | const DOUBAN_SUBJECT_URL = 'https://movie.douban.com/subject/{doubanId}'; 13 | const DOUBAN_SEARCH_API = 'https://movie.douban.com/j/subject_suggest?q={query}'; 14 | const DOUBAN_SUGGEST_API = 'https://www.douban.com/search?cat=1002&q={query}'; 15 | const DOUBAN_API_URL = 'https://api.douban.com/v2/movie'; 16 | const PIC_URLS = { 17 | border: 'https://ptpimg.me/zz4632.png', 18 | icon2x: 'https://ptpimg.me/n74cjc.png', 19 | icon: 'https://ptpimg.me/yze1gz.png', 20 | line: 'https://ptpimg.me/e11hb1.png', 21 | }; 22 | export { 23 | CURRENT_SITE_INFO, 24 | CURRENT_SITE_NAME, 25 | DOUBAN_API_URL, 26 | DOUBAN_SEARCH_API, 27 | PIC_URLS, 28 | DOUBAN_SUGGEST_API, 29 | DOUBAN_SUBJECT_URL, 30 | }; 31 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | CURRENT_SITE_INFO, CURRENT_SITE_NAME, 3 | } from './const'; 4 | import { 5 | getImdbId, getTvSeasonData, createDoubanDom, 6 | addToPtpPage, getDoubanInfoByIMDB, addToANTPage, 7 | } from './common'; 8 | import './style.js'; 9 | (async () => { 10 | if (CURRENT_SITE_INFO) { 11 | const imdbId = getImdbId(); 12 | if (!imdbId) { 13 | return; 14 | } 15 | try { 16 | const savedIds = GM_getValue('ids') || {}; 17 | if (!savedIds[imdbId] || 18 | (savedIds[imdbId] && savedIds[imdbId].updateTime && Date.now() - savedIds[imdbId].updateTime >= 30 * 24 * 60 * 60 * 1000)) { 19 | let doubanId = ''; 20 | const movieData = await getDoubanInfoByIMDB(imdbId); 21 | if (!movieData) { 22 | throw new Error('没有找到豆瓣条目'); 23 | } 24 | const { id = '', episodes = '' } = movieData; 25 | doubanId = id; 26 | if (episodes) { 27 | const tvData = await getTvSeasonData(movieData); 28 | doubanId = tvData.id; 29 | } 30 | if (CURRENT_SITE_NAME.match(/PTP/)) { 31 | addToPtpPage(movieData); 32 | } else if (CURRENT_SITE_NAME.match(/ANT/)) { 33 | addToANTPage(movieData); 34 | } else { 35 | createDoubanDom(doubanId, imdbId); 36 | } 37 | } else { 38 | const savedData = savedIds[imdbId]; 39 | if (CURRENT_SITE_NAME.match(/PTP/)) { 40 | addToPtpPage(savedData); 41 | } else if (CURRENT_SITE_NAME.match(/ANT/)) { 42 | addToANTPage(savedData); 43 | } else { 44 | createDoubanDom(savedData.doubanId, imdbId, savedData); 45 | } 46 | } 47 | } catch (error) { 48 | console.log(error); 49 | } 50 | } 51 | })(); 52 | -------------------------------------------------------------------------------- /src/style.js: -------------------------------------------------------------------------------- 1 | export default GM_addStyle(` 2 | .bigstar50,.bigstar45,.bigstar40,.bigstar35,.bigstar30,.bigstar25,.bigstar20,.bigstar15,.bigstar10,.bigstar05,.bigstar00 { 3 | display: inline-block; 4 | *display: inline; 5 | zoom:1;background: https://ptpimg.me/yze1gz.png) no-repeat; 6 | background: -webkit-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 7 | background: -moz-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 8 | background: -o-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 9 | background: -ms-image-set(https://ptpimg.me/yze1gz.png) 1x, url(https://ptpimg.me/n74cjc.png) 2x) no-repeat; 10 | width: 75px; 11 | height: 15px; 12 | margin: 1px 0 0 0; 13 | overflow: hidden 14 | } 15 | 16 | .bigstar50+span.rating_num,.bigstar45+span.rating_num,.bigstar40+span.rating_num,.bigstar35+span.rating_num,.bigstar30+span.rating_num,.bigstar25+span.rating_num,.bigstar20+span.rating_num,.bigstar15+span.rating_num,.bigstar10+span.rating_num,.bigstar05+span.rating_num,.bigstar00+span.rating_num { 17 | font-size: 16px; 18 | line-height: 1 19 | } 20 | 21 | .bigstar50 { 22 | background-position: 0 0px 23 | } 24 | 25 | .bigstar45 { 26 | background-position: 0 -15px 27 | } 28 | 29 | .bigstar40 { 30 | background-position: 0 -30px 31 | } 32 | 33 | .bigstar35 { 34 | background-position: 0 -45px 35 | } 36 | 37 | .bigstar30 { 38 | background-position: 0 -60px 39 | } 40 | 41 | .bigstar25 { 42 | background-position: 0 -75px 43 | } 44 | 45 | .bigstar20 { 46 | background-position: 0 -90px 47 | } 48 | 49 | .bigstar15 { 50 | background-position: 0 -105px 51 | } 52 | 53 | .bigstar10 { 54 | background-position: 0 -120px 55 | } 56 | 57 | .bigstar05 { 58 | background-position: 0 -135px 59 | } 60 | 61 | .bigstar00 { 62 | background-position: 0 -150px 63 | } 64 | 65 | .allstar50,.allstar45,.allstar40,.allstar35,.allstar30,.allstar25,.allstar20,.allstar15,.allstar10,.allstar05,.allstar00,.rating1-t,.rating15-t,.rating2-t,.rating25-t,.rating3-t,.rating35-t,.rating4-t,.rating45-t,.rating5-t,.rating-t,.starb~.stars5,.starb~.stars4,.starb~.stars3,.starb~.stars2,.starb~.stars1,.collectors .stars5,.collectors .stars4,.collectors .stars3,.collectors .stars2,.collectors .stars1 { 66 | display: inline-block; 67 | *display: inline; 68 | zoom:1;background: url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) no-repeat; 69 | background: -webkit-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 70 | background: -moz-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 71 | background: -o-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 72 | background: -ms-image-set(url(/f/movie/b8f4c3672ef81106701071831e22422a745d3b74/pics/rating_icons/ic_rating_s.png) 1x, url(/f/movie/076dc86067c402ced53eee7c09cd45402235733c/pics/rating_icons/ic_rating_s@2x.png) 2x) no-repeat; 73 | width: 55px; 74 | height: 11px; 75 | margin: 0 3px 0 0; 76 | overflow: hidden 77 | } 78 | 79 | .status-item .allstar50,.status-item .allstar45,.status-item .allstar40,.status-item .allstar35,.status-item .allstar30,.status-item .allstar25,.status-item .allstar20,.status-item .allstar15,.status-item .allstar10,.status-item .allstar05,.status-item .allstar00,.status-item .rating1-t,.status-item .rating15-t,.status-item .rating2-t,.status-item .rating25-t,.status-item .rating3-t,.status-item .rating35-t,.status-item .rating4-t,.status-item .rating45-t,.status-item .rating5-t,.status-item .rating-t,.status-item .starb~.stars5,.status-item .starb~.stars4,.status-item .starb~.stars3,.status-item .starb~.stars2,.status-item .starb~.stars1,.status-item .collectors .stars5,.status-item .collectors .stars4,.status-item .collectors .stars3,.status-item .collectors .stars2,.status-item .collectors .stars1 { 80 | margin: 0 0 0 4px 81 | } 82 | 83 | .allstar50 { 84 | background-position: 0 0px 85 | } 86 | 87 | .allstar45 { 88 | background-position: 0 -11px 89 | } 90 | 91 | .allstar40 { 92 | background-position: 0 -22px 93 | } 94 | 95 | .allstar35 { 96 | background-position: 0 -33px 97 | } 98 | 99 | .allstar30 { 100 | background-position: 0 -44px 101 | } 102 | 103 | .allstar25 { 104 | background-position: 0 -55px 105 | } 106 | 107 | .allstar20 { 108 | background-position: 0 -66px 109 | } 110 | 111 | .allstar15 { 112 | background-position: 0 -77px 113 | } 114 | 115 | .allstar10 { 116 | background-position: 0 -88px 117 | } 118 | 119 | .allstar05 { 120 | background-position: 0 -99px 121 | } 122 | 123 | .allstar00 { 124 | background-position: 0 -110px 125 | } 126 | 127 | .rating5-t,.starb~.stars5,.collectors .stars5 { 128 | background-position: 0 0px 129 | } 130 | 131 | .rating45-t { 132 | background-position: 0 -11px 133 | } 134 | 135 | .rating4-t,.starb~.stars4,.collectors .stars4 { 136 | background-position: 0 -22px 137 | } 138 | 139 | .rating35-t { 140 | background-position: 0 -33px 141 | } 142 | 143 | .rating3-t,.starb~.stars3,.collectors .stars3 { 144 | background-position: 0 -44px 145 | } 146 | 147 | .rating25-t { 148 | background-position: 0 -55px 149 | } 150 | 151 | .rating2-t,.starb~.stars2,.collectors .stars2 { 152 | background-position: 0 -66px 153 | } 154 | 155 | .rating15-t { 156 | background-position: 0 -77px 157 | } 158 | 159 | .rating1-t,.starb~.stars1,.collectors .stars1 { 160 | background-position: 0 -88px 161 | } 162 | 163 | .rating1-t,.rating15-t,.rating2-t,.rating25-t,.rating3-t,.rating35-t,.rating4-t,.rating45-t,.rating5-t,.rating-t { 164 | padding-left: 5px 165 | } 166 | 167 | #stars { 168 | font-size: 0; 169 | vertical-align: text-bottom; 170 | cursor: pointer 171 | } 172 | 173 | #stars a img { 174 | vertical-align: text-bottom 175 | } 176 | 177 | .starstop,.stars { 178 | margin-right: 5px 179 | } 180 | 181 | .starstop { 182 | float: left 183 | } 184 | 185 | .rating_nums,.rating_num { 186 | color: #e09015; 187 | font-size: 12px; 188 | padding: 0 3px 189 | } 190 | 191 | .status-item .rating_num { 192 | font-size: 14px 193 | } 194 | 195 | .rating_nums { 196 | padding-left: 0 197 | } 198 | 199 | .star .rating_num { 200 | color: #e09015; 201 | padding: 0 5px 0 0 202 | } 203 | 204 | #interest_sect { 205 | overflow: hidden; 206 | word-wrap: break-word 207 | } 208 | 209 | #interest_sectl { 210 | float: left; 211 | width: 155px; 212 | margin: 2px 0 0 0; 213 | padding: 0 0 0 15px; 214 | border-left: 1px solid #eaeaea; 215 | color: #9b9b9b 216 | } 217 | 218 | #interest_sectl .rating_wrap { 219 | padding-bottom: 15px; 220 | font-size: 12px; 221 | line-height: 14px 222 | } 223 | 224 | #interest_sectl .rating_wrap .rating_logo { 225 | line-height: 1 226 | } 227 | 228 | #interest_sectl .rating_self { 229 | padding: 0; 230 | line-height: 2 231 | } 232 | 233 | #interest_sectl .rating_self:before,#interest_sectl .rating_self:after { 234 | content: ''; 235 | display: block; 236 | clear: both 237 | } 238 | 239 | #interest_sectl .rating_self .rating_sum { 240 | clear: both 241 | } 242 | 243 | #interest_sectl .rating_num { 244 | color: #494949; 245 | padding: 0; 246 | min-width: 30%; 247 | font-size: 28px 248 | } 249 | 250 | #interest_sectl .rating_right { 251 | float: left; 252 | padding: 10px 0 10px 6px 253 | } 254 | 255 | #interest_sectl .rating_right.not_showed { 256 | padding: 10px 0 257 | } 258 | 259 | #interest_sectl .power { 260 | height: 10px; 261 | float: left; 262 | margin: 1px 4px; 263 | background: #ffd596 none repeat scroll 0 0 264 | } 265 | 266 | #interest_sectl .power.color_gray { 267 | background: #ccc 268 | } 269 | 270 | #interest_sectl .rating_per { 271 | font-size: 11px 272 | } 273 | 274 | #interest_sectl .rating_betterthan { 275 | position: relative; 276 | padding: 15px 0; 277 | border-top: 1px solid #eaeaea; 278 | color: #9b9b9b; 279 | margin: 0 280 | } 281 | 282 | .rating_logo_wrap .content { 283 | display: inline-block; 284 | *display: inline; 285 | zoom:1;vertical-align: top; 286 | font-size: 12px; 287 | line-height: 20px; 288 | color: #9b9b9b; 289 | margin-right: 4px 290 | } 291 | 292 | .rating_helper_wrap { 293 | display: inline-block; 294 | *display: inline; 295 | zoom:1;vertical-align: top; 296 | position: relative; 297 | line-height: 18px 298 | } 299 | 300 | .rating_helper_wrap:hover .rating_helper_icon { 301 | background-position: 0 -12px 302 | } 303 | 304 | .rating_helper_wrap:hover .rating_helper_content { 305 | display: block 306 | } 307 | 308 | .rating_helper_icon { 309 | background: url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) no-repeat; 310 | background: -webkit-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 311 | background: -moz-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 312 | background: -o-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 313 | background: -ms-image-set(url(/f/movie/16305b59f6b69b8acde51c880de2a5b6cde0155a/pics/icon/ic_qmark.png) 1x, url(/f/movie/1fb4f85391f82c3286d7318d840577daae1c2eee/pics/icon/ic_qmark@2x.png) 2x) no-repeat; 314 | display: inline-block; 315 | *display: inline; 316 | zoom:1;vertical-align: middle; 317 | width: 12px; 318 | height: 12px 319 | } 320 | 321 | .rating_helper_content { 322 | z-index: 10; 323 | color: #494949; 324 | display: none; 325 | position: absolute; 326 | left: 12px; 327 | bottom: 3px; 328 | width: 96px; 329 | background: #fef6e9; 330 | border: 1px solid #e3d9ca; 331 | padding: 8px 10px; 332 | border-radius: 4px; 333 | box-shadow: 0 2px 5px rgba(0,0,0,0.1) 334 | } 335 | 336 | .rating_content_wrap { 337 | width: 110%; 338 | padding-bottom: 8px 339 | } 340 | 341 | .rating_content_wrap .rating_avg { 342 | float: left; 343 | font-size: 16px; 344 | line-height: 28px; 345 | color: #494949; 346 | margin-right: 12px 347 | } 348 | 349 | .rating_content_wrap .friends { 350 | float: left; 351 | margin-right: 6px 352 | } 353 | 354 | .rating_content_wrap .avatar { 355 | float: left; 356 | margin-top: 6px; 357 | margin-right: 2px; 358 | line-height: 0; 359 | border-radius: 50%; 360 | overflow: hidden; 361 | cursor: default 362 | } 363 | 364 | .rating_content_wrap .avatar img { 365 | width: 16px 366 | } 367 | 368 | .rating_content_wrap .friends_count { 369 | float: left; 370 | line-height: 14px; 371 | margin-top: 7px 372 | } 373 | 374 | #screening .subject-rate { 375 | color: #e09015; 376 | font-size: 12px; 377 | margin-left: 2px 378 | } 379 | 380 | #screening .rating { 381 | display: inline-block; 382 | *display: inline; 383 | zoom:1;margin: 4px auto 2px; 384 | height: 19px 385 | } 386 | 387 | #screening .rating span { 388 | float: left 389 | } 390 | 391 | #screening .rating .rating-star { 392 | margin: 3px 3px 0 0; 393 | width: 55px 394 | } 395 | 396 | span.subject-rate,.rate,.subject-rating { 397 | color: #e09015 398 | } 399 | 400 | img.rating { 401 | vertical-align: text-bottom 402 | } 403 | 404 | img.rating:nth-child(1) { 405 | padding-left: 10px 406 | } 407 | 408 | .rec-list .score { 409 | color: #e09015 410 | } 411 | 412 | .album-item .star { 413 | line-height: 1; 414 | margin-top: 6px 415 | } 416 | 417 | .album-item .star .allstar50,.album-item .star .allstar45,.album-item .star .allstar40,.album-item .star .allstar35,.album-item .star .allstar30,.album-item .star .allstar25,.album-item .star .allstar20,.album-item .star .allstar15,.album-item .star .allstar10,.album-item .star .allstar05,.album-item .star .allstar00 { 418 | float: left 419 | } 420 | 421 | .album-item .star .score { 422 | color: #e09015 423 | } 424 | 425 | .game-ratings strong { 426 | margin: 0 6px; 427 | color: #e09015 428 | } 429 | 430 | .link-subject .rate-more span { 431 | font-size: 10px; 432 | color: #e09015 433 | } 434 | 435 | .rating-controversy-reason { 436 | background-color: #FFFBF4; 437 | color: #494949; 438 | line-height: 14px; 439 | margin: 15px 0px 0px 0px; 440 | padding: 6px 20px 6px 35px; 441 | font-size: 11px; 442 | position: relative 443 | } 444 | 445 | .rating-controversy-reason:before { 446 | content: ''; 447 | display: block; 448 | width: 14px; 449 | height: 14px; 450 | position: absolute; 451 | left: 12px; 452 | top: 50%; 453 | transform: translateY(-50%); 454 | background-image: url("data:image/svg+xml, %3Csvg%20width%3D%2216%22%20height%3D%2216%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M8%200a8%208%200%20110%2016A8%208%200%20018%200zm0%2010.667a1%201%200%20100%202%201%201%200%20000-2zm0-8a1.207%201.207%200%2000-1.2%201.326l.467%204.677a.737.737%200%20001.466%200l.468-4.677A1.207%201.207%200%20008%202.667z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E"); 455 | background-size: contain 456 | } 457 | 458 | body #douban-wrapper { 459 | width: 770px; 460 | height: 345px; 461 | margin: 0; 462 | font: 12px Helvetica,Arial,sans-serif 463 | } 464 | 465 | #douban-wrapper .ll { 466 | float: left 467 | } 468 | 469 | #douban-wrapper .col-container .fix-col { 470 | float: left 471 | } 472 | 473 | #douban-wrapper #content { 474 | background-repeat: no-repeat; 475 | padding: 10px; 476 | width: 750px; 477 | height: 325px; 478 | min-height: initial 479 | } 480 | 481 | #douban-wrapper #content h1 { 482 | font-size: 20px 483 | } 484 | 485 | #douban-wrapper #content .grid { 486 | width: 750px; 487 | height: 325px; 488 | border-radius: 9px 489 | } 490 | 491 | #douban-wrapper #content .grid .grid-col1 { 492 | width: 225px 493 | } 494 | 495 | #douban-wrapper #content .grid .grid-col2 { 496 | width: 254px; 497 | padding: 24px 18px; 498 | height: 277px; 499 | overflow: hidden 500 | } 501 | 502 | #douban-wrapper #content .grid .grid-col3 { 503 | width: 18px 504 | } 505 | 506 | #douban-wrapper #content .grid .grid-col4 { 507 | font-size: 14px; 508 | padding: 27px 14px 0 12px; 509 | width: 190px 510 | } 511 | 512 | #douban-wrapper #content .picture-douban-wrapper{ 513 | width: 225px; 514 | height: 325px; 515 | border-top-left-radius: 9px; 516 | border-bottom-left-radius: 9px; 517 | background-size: cover; 518 | background-position: center 519 | } 520 | 521 | #douban-wrapper #content .main-title h1,#douban-wrapper #content .sub-title h2 { 522 | overflow: hidden; 523 | word-break: break-all; 524 | max-height: 2.5em; 525 | line-height: 1.2; 526 | display: -webkit-box; 527 | -webkit-line-clamp: 2; 528 | -webkit-box-orient: vertical 529 | } 530 | 531 | #douban-wrapper #content .main-title h1 { 532 | font-weight: 500; 533 | font-size: 30px; 534 | color: #000000 535 | } 536 | 537 | #douban-wrapper #content .sub-title { 538 | margin-top: 9px 539 | } 540 | 541 | #douban-wrapper #content .sub-title h2 { 542 | font-size: 18px; 543 | color: #ADADAD; 544 | font-weight: normal 545 | } 546 | 547 | #douban-wrapper #content .baseinfo { 548 | font-size: 16px; 549 | color: #000000; 550 | line-height: 25px; 551 | margin-top: 18px; 552 | letter-spacing: 1px; 553 | word-break: break-all; 554 | font-weight: 400; 555 | display: -webkit-box; 556 | overflow: hidden; 557 | -webkit-line-clamp: 5; 558 | -webkit-box-orient: vertical 559 | } 560 | 561 | #douban-wrapper #content .line-wrap { 562 | width: 18px; 563 | height: 100%; 564 | position: relative 565 | } 566 | 567 | #douban-wrapper #content .line-wrap img { 568 | width: 100%; 569 | height: 100% 570 | } 571 | 572 | #douban-wrapper #content .douban-icon { 573 | font-size: 0 574 | } 575 | 576 | #douban-wrapper #content .douban-icon>span { 577 | font-size: 14px; 578 | display: inline-block; 579 | text-align: center; 580 | border: 1px solid #41BE57 581 | } 582 | 583 | #douban-wrapper #content .douban-icon .icon-pt1 { 584 | background-color: #41BE57; 585 | color: white; 586 | border-top-left-radius: 4px; 587 | border-bottom-left-radius: 4px; 588 | width: 24px; 589 | height: 24px; 590 | line-height: 24px 591 | } 592 | 593 | #douban-wrapper #content .douban-icon .icon-pt2 { 594 | color: #3BA94D; 595 | background: #FFFFFF; 596 | border-top-right-radius: 4px; 597 | border-bottom-right-radius: 4px; 598 | width: 69px; 599 | height: 24px; 600 | line-height: 24px 601 | } 602 | 603 | #douban-wrapper #content .score-container .rating_self { 604 | margin-top: 15px 605 | } 606 | 607 | #douban-wrapper #content .score-container .rating_self .rating_num { 608 | font-size: 48px; 609 | line-height: 1; 610 | padding: 0; 611 | color: black; 612 | font-weight: normal 613 | } 614 | 615 | #douban-wrapper #content .score-container .rating_self .rating_right { 616 | float: left; 617 | padding-left: 10px; 618 | padding-top: 5px 619 | } 620 | 621 | #douban-wrapper #content .score-container .rating_self .rating_right .ll { 622 | float: none 623 | } 624 | 625 | #douban-wrapper #content .score-container .rating_self .rating_right .rating_sum { 626 | color: #3B3B3B 627 | } 628 | 629 | #douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:hover,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:visited,#douban-wrapper #content .score-container .rating_self .rating_right .rating_sum .rating_people:link { 630 | color: #3B3B3B; 631 | background: none 632 | } 633 | 634 | #douban-wrapper #content .score-container .ratings-on-weight { 635 | margin-top: 10px; 636 | min-weight: 1px 637 | } 638 | 639 | #douban-wrapper #content .score-container .ratings-on-weight .item { 640 | line-height: 1.5 641 | } 642 | 643 | #douban-wrapper #content .score-container .ratings-on-weight .item .starstop { 644 | float: none; 645 | margin-right: 0; 646 | color: #3B3B3B 647 | } 648 | 649 | #douban-wrapper #content .score-container .ratings-on-weight .item>span,#douban-wrapper #content .score-container .ratings-on-weight .item>div { 650 | display: inline-block 651 | } 652 | 653 | #douban-wrapper #content .score-container .ratings-on-weight .item .power { 654 | height: 6px; 655 | background: #FAA032; 656 | border-radius: 3px; 657 | vertical-align: middle 658 | } 659 | 660 | #douban-wrapper #content .bottom-row { 661 | display: flex; 662 | align-items: center; 663 | justify-content: space-between 664 | } 665 | 666 | #douban-wrapper #content .bottom-row .rating-betterthan { 667 | font-size: 14px; 668 | color: #1C1C1C; 669 | line-height: 21px; 670 | width: 117px 671 | } 672 | 673 | #douban-wrapper #content .bottom-row .rating-betterthan .number { 674 | font-size: 14px; 675 | color: #41BE57 676 | } 677 | 678 | #douban-wrapper #content .bottom-row .qr-code { 679 | width: 64px; 680 | height: 64px; 681 | overflow: hidden 682 | } 683 | 684 | #douban-wrapper #content .bottom-row .qr-code img { 685 | width: 100%; 686 | height: 100% 687 | } 688 | 689 | .contentlayout.douban-info { 690 | display: flex; 691 | justify-content: space-around; 692 | } 693 | .contentlayout.douban-info .detail{ 694 | flex:1; 695 | } 696 | .detail .title{ 697 | font-size: 26px; 698 | font-weight: 600; 699 | margin-bottom: 20px; 700 | } 701 | .detail .title a{ 702 | text-decoration: none; 703 | } 704 | .movie-detail{ 705 | display: flex; 706 | justify-content: space-between; 707 | } 708 | .movie-detail .synopsis { 709 | width: 60%; 710 | } 711 | .movie-detail .movieinfo { 712 | margin-right: 20px; 713 | max-width: 30%; 714 | } 715 | .icon-pt1{ 716 | font-size: 14px; 717 | display: inline-block; 718 | text-align: center; 719 | border: 1px solid #41be57; 720 | background-color: #41be57; 721 | color: white; 722 | border-top-left-radius: 4px; 723 | border-bottom-left-radius: 4px; 724 | width: 24px; 725 | height: 24px; 726 | line-height: 24px; 727 | } 728 | .ant .icon-pt1{ 729 | border-radius: 4px; 730 | } 731 | 732 | .icon-pt2{ 733 | display: inline-block; 734 | text-align: center; 735 | border: 1px solid #41be57; 736 | color: #3ba94d; 737 | background: #ffffff; 738 | border-top-right-radius: 4px; 739 | border-bottom-right-radius: 4px; 740 | width: 69px; 741 | height: 24px; 742 | line-height: 24px; 743 | font-size: 14px; 744 | } 745 | .douban-dom { 746 | display: flex; 747 | cursor: pointer; 748 | } 749 | .douban-dom { 750 | text-align: left; 751 | } 752 | #douban-wrapper *{ 753 | box-sizing: content-box; 754 | } 755 | #douban-wrapper .clearfix:after { 756 | content: "."; 757 | display: block; 758 | height: 0; 759 | clear: both; 760 | visibility: hidden 761 | } 762 | #douban-wrapper .clearfix { 763 | zoom: 1; 764 | display: inline-block; 765 | _height: 1px; 766 | } 767 | #douban-wrapper .clearfix { 768 | height: 1% 769 | } 770 | #douban-wrapper .clearfix { 771 | display: block 772 | } 773 | #douban-wrapper .rating_per{ 774 | color: #111; 775 | } 776 | #douban-wrapper .grid{ 777 | overflow: initial; 778 | } 779 | .content-rounded #douban-wrapper div{ 780 | margin-left: 0; 781 | } 782 | #douban-wrapper #content .douban-icon .icon-pt1 { 783 | background-image:none; 784 | } 785 | #douban-wrapper h2,#douban-wrapper h1{ 786 | border:none; 787 | background-image: none; 788 | background-color: transparent; 789 | text-shadow: none; 790 | padding: 0; 791 | margin: 0 792 | line-height: normal; 793 | } 794 | #douban-wrapper .grid-col5 { 795 | font-size: 14px; 796 | padding: 27px 14px 0 12px; 797 | width: 190px; 798 | overflow-y: auto; 799 | height: 277px; 800 | width: calc(100% - 225px - 254px - 36px - 280px); 801 | } 802 | 803 | #douban-wrapper .summary{ 804 | padding-top: 10px; 805 | color: #000000; 806 | line-height: 25px; 807 | letter-spacing: 1px; 808 | word-break: break-all; 809 | font-weight: 400; 810 | } 811 | #douban-wrapper { 812 | width: 100% !important; 813 | } 814 | .douban-dom>div{ 815 | width: 100%; 816 | } 817 | #douban-wrapper #content{ 818 | background-image:none !important; 819 | background: #fff; 820 | width: calc(100% - 20px) !important; 821 | } 822 | #douban-wrapper #content .grid{ 823 | width: 100% !important; 824 | } 825 | .bhd #douban-wrapper ::-webkit-scrollbar-track{ 826 | background-color: #fff; 827 | } 828 | .bhd #douban-wrapper ::-webkit-scrollbar-thumb{ 829 | background-color: #ddd; 830 | } 831 | .btn #douban-wrapper .grid-col1 { 832 | display: none; 833 | } 834 | .hdb #douban-wrapper .grid-col1 { 835 | display: none; 836 | } 837 | .hdt #douban-wrapper .grid-col1 { 838 | display: none; 839 | } 840 | .sc #douban-wrapper .grid-col1 { 841 | display: none; 842 | } 843 | .its #douban-wrapper .grid-col1 { 844 | display: none; 845 | } 846 | .bb #douban-wrapper .grid-col1 { 847 | display: none; 848 | } 849 | .btn #douban-wrapper .grid-col5 { 850 | width: calc(100% - 254px - 36px - 280px); 851 | } 852 | .hdt #douban-wrapper .grid-col5 { 853 | width: calc(100% - 254px - 36px - 280px); 854 | } 855 | .hdb #douban-wrapper .grid-col5 { 856 | width: calc(100% - 254px - 36px - 280px); 857 | } 858 | .sc #douban-wrapper .grid-col5 { 859 | width: calc(100% - 254px - 36px - 280px); 860 | } 861 | .its #douban-wrapper .grid-col5 { 862 | width: calc(100% - 254px - 36px - 280px); 863 | } 864 | .bb #douban-wrapper .grid-col5 { 865 | width: calc(100% - 254px - 36px - 280px); 866 | } 867 | .its #douban-wrapper { 868 | background-color: #131313; 869 | color: #fff; 870 | } 871 | `); 872 | --------------------------------------------------------------------------------