Compare commits
275 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2c93d755c7 | ||
|
|
fe75084dd0 | ||
|
|
047224ce80 | ||
|
|
31ea52e267 | ||
|
|
088cd70e41 | ||
|
|
6bfd96942d | ||
|
|
5d6579326c | ||
|
|
334933ce82 | ||
|
|
9fd3e5e2ed | ||
|
|
1e7199af3f | ||
|
|
0d83b277e7 | ||
|
|
08cbd1a73c | ||
|
|
01e58f458b | ||
|
|
3ac21ad1e5 | ||
|
|
f098198448 | ||
|
|
35e6e59b73 | ||
|
|
bf9eaf09eb | ||
|
|
03ec267c1f | ||
|
|
97aea7b98d | ||
|
|
f8ad00b4d0 | ||
|
|
607d4baae4 | ||
|
|
51208892d0 | ||
|
|
516b791719 | ||
|
|
8032645c25 | ||
|
|
9d0536a3f8 | ||
|
|
85a39d67ce | ||
|
|
3184147910 | ||
|
|
9d8a09e90d | ||
|
|
5d08e715aa | ||
|
|
98378788fd | ||
|
|
af768d527a | ||
|
|
4e5aab6f66 | ||
|
|
fda305a8ae | ||
|
|
21487e2754 | ||
|
|
0f934413d0 | ||
|
|
96c68da8b7 | ||
|
|
0e0de8f23c | ||
|
|
2b24ac7d0c | ||
|
|
458144a6ea | ||
|
|
69113c7a9a | ||
|
|
d247a2fa23 | ||
|
|
c14c78b68f | ||
|
|
cc4e2c5cad | ||
|
|
073e111af8 | ||
|
|
fea076318d | ||
|
|
df867fa919 | ||
|
|
a7f0030462 | ||
|
|
b5274c79b0 | ||
|
|
a2de1984e3 | ||
|
|
81b5391f64 | ||
|
|
2c6ad44974 | ||
|
|
e1c942dc7b | ||
|
|
4420e6961e | ||
|
|
2deffab3ba | ||
|
|
05a07bee62 | ||
|
|
025d1606f7 | ||
|
|
b72c88dfb9 | ||
|
|
db240cc163 | ||
|
|
0ef55f0139 | ||
|
|
0ad9b49224 | ||
|
|
ccbf4fb5d7 | ||
|
|
46e376a351 | ||
|
|
23e693a314 | ||
|
|
3a3e37f4bd | ||
|
|
e568053b95 | ||
|
|
fe9cd9f5bc | ||
|
|
8cf3ec94d9 | ||
|
|
112f92d3e0 | ||
|
|
88db766337 | ||
|
|
205b9d7979 | ||
|
|
d5a7771a67 | ||
|
|
655ed7fb16 | ||
|
|
808f3d2012 | ||
|
|
ee4b944abf | ||
|
|
b4abd9369f | ||
|
|
079da637ec | ||
|
|
0c8a100d1c | ||
|
|
0cc330463f | ||
|
|
f50d669a5f | ||
|
|
57fd1d325e | ||
|
|
e31b921486 | ||
|
|
08b39a5bb1 | ||
|
|
1fefc792fc | ||
|
|
b9a4784de2 | ||
|
|
855472fe68 | ||
|
|
4834d4423c | ||
|
|
4de2177cc7 | ||
|
|
ca9f9c9160 | ||
|
|
7c0f688f9d | ||
|
|
4bfae63201 | ||
|
|
419a56518f | ||
|
|
36efdcd869 | ||
|
|
a297aca812 | ||
|
|
0b4dd2e859 | ||
|
|
3142306a0c | ||
|
|
9d4765c1ea | ||
|
|
547dffb922 | ||
|
|
84e61acde7 | ||
|
|
11c756466c | ||
|
|
06291ffc4b | ||
|
|
1f65e5ba0a | ||
|
|
392f0fd326 | ||
|
|
a6b6407679 | ||
|
|
96678bf5df | ||
|
|
3c37b8286f | ||
|
|
38862f6ad8 | ||
|
|
35213238f4 | ||
|
|
2a03388d6b | ||
|
|
ef704a9d45 | ||
|
|
946978fa86 | ||
|
|
70b03e67fb | ||
|
|
1ee7c6f032 | ||
|
|
f2f58fb888 | ||
|
|
5286568801 | ||
|
|
2a9f8ed0dc | ||
|
|
eb3d064cb5 | ||
|
|
a0ec282cc2 | ||
|
|
ea61dca27b | ||
|
|
fd0be9e96b | ||
|
|
775247e28b | ||
|
|
ded5c39790 | ||
|
|
16e44d71bd | ||
|
|
ae0858319f | ||
|
|
3c6733648b | ||
|
|
06bd915964 | ||
|
|
dfcd786f53 | ||
|
|
d0f6282b81 | ||
|
|
ab3a6e1fd2 | ||
|
|
0cb540d3e5 | ||
|
|
1d0123d69f | ||
|
|
6dbcb8e621 | ||
|
|
b1a6d58974 | ||
|
|
bb45006ff7 | ||
|
|
e9f81faf70 | ||
|
|
b864c6ca15 | ||
|
|
9f98231eed | ||
|
|
3bcf5b1618 | ||
|
|
d7a6245f8a | ||
|
|
2abf2aeda7 | ||
|
|
c3129c7cee | ||
|
|
3b0ec94d2b | ||
|
|
9902d98342 | ||
|
|
b5f5baeb8f | ||
|
|
f396d5ea05 | ||
|
|
e616aa5e2a | ||
|
|
f041093fe9 | ||
|
|
e66c056283 | ||
|
|
d33bbcff06 | ||
|
|
992c2f152f | ||
|
|
118bc5058c | ||
|
|
19c11f2694 | ||
|
|
0a812ff6c4 | ||
|
|
1e6a98df88 | ||
|
|
b1b4e61244 | ||
|
|
2a05b2abdb | ||
|
|
74beb47ad5 | ||
|
|
325a7f3b0d | ||
|
|
9b5b5a1334 | ||
|
|
74dee7a892 | ||
|
|
d07436d876 | ||
|
|
e283152a89 | ||
|
|
bdeeccedb9 | ||
|
|
5931266770 | ||
|
|
bbeb75631d | ||
|
|
c0f4940289 | ||
|
|
db1b81243a | ||
|
|
97b6a8259f | ||
|
|
4c92ff9e70 | ||
|
|
b8dc7f4526 | ||
|
|
0d6e0d6e9f | ||
|
|
1a5bac68ad | ||
|
|
83e302aeb7 | ||
|
|
2196eaa68c | ||
|
|
40aae02af6 | ||
|
|
f078df6f8e | ||
|
|
ee44bfe0a8 | ||
|
|
9d9a808226 | ||
|
|
d78784c0d9 | ||
|
|
1ead8a5594 | ||
|
|
b63c8f4daf | ||
|
|
011400f714 | ||
|
|
1d725579de | ||
|
|
93749c3841 | ||
|
|
4b0c67b8fa | ||
|
|
165040872c | ||
|
|
27773be1c7 | ||
|
|
fadb50a28b | ||
|
|
518a9c3492 | ||
|
|
d5eb4dc49f | ||
|
|
e76bee574f | ||
|
|
b7779a3e6f | ||
|
|
4cb5b48985 | ||
|
|
b2128113ba | ||
|
|
58d0ae6da1 | ||
|
|
2bd821f59d | ||
|
|
8d002225fd | ||
|
|
0243c2f0fe | ||
|
|
b8edd7f440 | ||
|
|
4683aecf7b | ||
|
|
16d38ba2b4 | ||
|
|
fe7fe06d48 | ||
|
|
c1220ef752 | ||
|
|
f0c221a863 | ||
|
|
1df6726a3b | ||
|
|
1a9e939f9c | ||
|
|
39cb188604 | ||
|
|
aba4d12302 | ||
|
|
17c77fd48a | ||
|
|
1cfc12ec19 | ||
|
|
b0aa1dc28a | ||
|
|
0c12b394a7 | ||
|
|
9e468bc82e | ||
|
|
973a15b593 | ||
|
|
253c1e7723 | ||
|
|
7b44051190 | ||
|
|
a25ac77ebc | ||
|
|
d187167fbe | ||
|
|
b34347cf43 | ||
|
|
829d9447a4 | ||
|
|
39067c6a35 | ||
|
|
6dbb64a4f2 | ||
|
|
f8041290d2 | ||
|
|
f772ac2e9d | ||
|
|
ef485ef64a | ||
|
|
b164d5e83e | ||
|
|
8a5800df93 | ||
|
|
8cd2b920c8 | ||
|
|
5b4cb43aa5 | ||
|
|
de1472e668 | ||
|
|
0f846b996b | ||
|
|
2bd5e31a28 | ||
|
|
9d8dc9ecb1 | ||
|
|
2a073e4092 | ||
|
|
b1daa73afe | ||
|
|
18940ff9f7 | ||
|
|
76d4d68401 | ||
|
|
f91200e609 | ||
|
|
b64f500710 | ||
|
|
cf1cfe9f77 | ||
|
|
da4fe162f6 | ||
|
|
d949c52020 | ||
|
|
1ce9e0525b | ||
|
|
4ebf82eae0 | ||
|
|
e0b1a5332d | ||
|
|
3ecb4302ba | ||
|
|
5c39db8ca6 | ||
|
|
4f45045d18 | ||
|
|
b7733179f2 | ||
|
|
e1f7044ae0 | ||
|
|
93e76db444 | ||
|
|
6eaa281e4a | ||
|
|
490d34e1fb | ||
|
|
0d0d6bd90f | ||
|
|
ecdc96d2f3 | ||
|
|
234f6dd069 | ||
|
|
f80fe7ecf1 | ||
|
|
6876721567 | ||
|
|
bedd1339df | ||
|
|
0a3a7a4d57 | ||
|
|
786e23f5a2 | ||
|
|
418f14bcc1 | ||
|
|
a9e4a34e4f | ||
|
|
fede7e4ef2 | ||
|
|
956ebbf8b8 | ||
|
|
014dac0b64 | ||
|
|
5fc1020e79 | ||
|
|
aca487f796 | ||
|
|
429eb4aac0 | ||
|
|
e032f86d3d | ||
|
|
f92af48a4e | ||
|
|
eff69db063 | ||
|
|
a5c8d20635 | ||
|
|
da22abd25d | ||
|
|
2dd91f78c9 | ||
|
|
a8b0e7e6a8 |
@@ -12,6 +12,7 @@ module.exports = {
|
||||
},
|
||||
rules: {
|
||||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
|
||||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
|
||||
'standard/no-callback-literal': 0
|
||||
}
|
||||
}
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/bug.md
vendored
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: 报告Bug(请先查看常见问题及搜索issue列表中有无你要提的问题)
|
||||
name: 报告Bug(请先查看常见问题及搜索已关闭issue列表中有无你要提的问题)
|
||||
about: 创建报告以帮助我们改进
|
||||
title: '(未回答的问题请删除)'
|
||||
title: '(未回答的问题请删除,减少多余信息干扰)'
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
|
||||
20
README.md
@@ -46,6 +46,17 @@
|
||||
- 🍉 [蓝奏云 -- 快速下载](https://www.lanzoux.com/b04s6a3re) 密码:95px
|
||||
- 🍒 适用于32位操作系统的x86软件,在蓝奏云网盘里, 后缀名: ZY Player * 32位.exe
|
||||
|
||||
### 🎠 平台
|
||||
|
||||
| 平台 | 链接 |
|
||||
| :------------------------------------ | :---------------------------------------------------------- |
|
||||
| 🖥️ 电脑端 ( Windows & Mac & Linux ) | [ZY Player](https://github.com/Hunlongyu/ZY-Player) |
|
||||
| 📱 手机端 ( Android & IOS ) | [ZY Player APP](https://github.com/Hunlongyu/ZY-Player-APP) |
|
||||
| 📺 电视端 ( Android & Mac ) ( 进行中 ) | [ZY Player TV](https://github.com/cuiocean/ZY-Player-TV) |
|
||||
| 🌐 浏览器 ( Web ) | [ZY Player Web](https://github.com/Hunlongyu/ZY-Player-Web) |
|
||||
|
||||
|
||||
|
||||
### 🚀 快捷键
|
||||
|
||||
播放窗口 和 Mini窗口
|
||||
@@ -81,7 +92,8 @@
|
||||
|
||||
### 🍭 开发者
|
||||
|
||||
| [Hunlongyu](https://github.com/Hunlongyu) | [cuiocean](https://github.com/cuiocean) |
|
||||
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||
| <img width="120" src="https://avatars2.githubusercontent.com/u/15273630?s=460&u=48cf3299e2a842c0252233d8be42ef4c5d792138&v=4"/> | <img width="120" src="https://avatars0.githubusercontent.com/u/5760235?s=460&u=9d969dd8d83f069ce7ebd60516770c93ac07a330&v=4" /> |
|
||||
| 💻 🎨 🐛 | 💻 🐛 |
|
||||
| [Hunlongyu](https://github.com/Hunlongyu) | [cuiocean](https://github.com/cuiocean) | [buvta](https://github.com/buvta) |
|
||||
| :----------------------------------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||
| <img width="120" src="https://avatars2.githubusercontent.com/u/15273630?s=460&u=48cf3299e2a842c0252233d8be42ef4c5d792138&v=4"/> | <img width="120" src="https://avatars0.githubusercontent.com/u/5760235?s=460&u=9d969dd8d83f069ce7ebd60516770c93ac07a330&v=4" /> | <img width="120" src="https://avatars3.githubusercontent.com/u/12312540?s=400&v=4" /> |
|
||||
| 💻 🎨 🐛 | 💻 🐛 | 💻 🐛 |
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 73 KiB |
|
Before Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 224 KiB |
BIN
docs/assets/img/gallery/01.png
Normal file
|
After Width: | Height: | Size: 944 KiB |
BIN
docs/assets/img/gallery/02.png
Normal file
|
After Width: | Height: | Size: 927 KiB |
BIN
docs/assets/img/gallery/03.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
docs/assets/img/gallery/04.png
Normal file
|
After Width: | Height: | Size: 691 KiB |
BIN
docs/assets/img/gallery/05.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
docs/assets/img/gallery/06.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
docs/assets/img/gallery/07.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
docs/assets/img/gallery/08.png
Normal file
|
After Width: | Height: | Size: 206 KiB |
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 1.1 MiB |
@@ -89,7 +89,7 @@
|
||||
|
||||
<div class="section-title">
|
||||
<h2>软件特色</h2>
|
||||
<p>经过三个大版本更迭, 软件功能丰富, 操作简单.</p>
|
||||
<p>软件功能丰富, 操作简单.</p>
|
||||
</div>
|
||||
|
||||
<div class="row no-gutters">
|
||||
@@ -99,7 +99,7 @@
|
||||
<div class="col-md-6 icon-box" data-aos="fade-up">
|
||||
<i class="bx bx-receipt"></i>
|
||||
<h4>浏览</h4>
|
||||
<p>浏览全网热门视频, 支持切换视频源. 详细的电影分类.支持搜索电影名和演员名称. </p>
|
||||
<p>浏览全网热门视频, 支持切换视频源. 详细的电影分类. </p>
|
||||
</div>
|
||||
<div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="100">
|
||||
<i class="icofont-play-alt-3"></i>
|
||||
@@ -124,7 +124,7 @@
|
||||
<div class="col-md-6 icon-box" data-aos="fade-up" data-aos-delay="500">
|
||||
<i class="icofont-cubes"></i>
|
||||
<h4>其他</h4>
|
||||
<p>多主题, 多语言, 自动更新</p>
|
||||
<p>多主题, 自动更新</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,14 +146,14 @@
|
||||
</div>
|
||||
|
||||
<div class="owl-carousel gallery-carousel" data-aos="fade-up">
|
||||
<a href="assets/img/gallery/001.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/001.png" alt=""></a>
|
||||
<a href="assets/img/gallery/002.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/002.png" alt=""></a>
|
||||
<a href="assets/img/gallery/003.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/003.png" alt=""></a>
|
||||
<a href="assets/img/gallery/004.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/004.png" alt=""></a>
|
||||
<a href="assets/img/gallery/005.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/005.png" alt=""></a>
|
||||
<a href="assets/img/gallery/006.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/006.png" alt=""></a>
|
||||
<a href="assets/img/gallery/007.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/007.png" alt=""></a>
|
||||
<a href="assets/img/gallery/008.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/008.png" alt=""></a>
|
||||
<a href="assets/img/gallery/01.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/01.png" alt=""></a>
|
||||
<a href="assets/img/gallery/02.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/02.png" alt=""></a>
|
||||
<a href="assets/img/gallery/03.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/03.png" alt=""></a>
|
||||
<a href="assets/img/gallery/04.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/04.png" alt=""></a>
|
||||
<a href="assets/img/gallery/05.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/05.png" alt=""></a>
|
||||
<a href="assets/img/gallery/06.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/06.png" alt=""></a>
|
||||
<a href="assets/img/gallery/07.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/07.png" alt=""></a>
|
||||
<a href="assets/img/gallery/08.png" class="venobox" data-gall="gallery-carousel"><img src="assets/img/gallery/08.png" alt=""></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -193,7 +193,7 @@
|
||||
<i class="bx bx-help-circle icon-help"></i> <a data-toggle="collapse" href="#accordion-list-3" class="collapsed">跨平台<i class="bx bx-chevron-down icon-show"></i><i class="bx bx-chevron-up icon-close"></i></a>
|
||||
<div id="accordion-list-3" class="collapse" data-parent=".accordion-list">
|
||||
<p>
|
||||
目前支持 Windows, Mac, Linux 桌面系统. 暂不支持手机端或者电视端. 未来会考虑实现全平台.
|
||||
目前支持 Windows, Mac, Linux, Android, IOS, TV, Web 全平台.
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
58
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zy",
|
||||
"version": "2.6.6",
|
||||
"version": "2.7.2",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@@ -17,58 +17,56 @@
|
||||
},
|
||||
"main": "background.js",
|
||||
"dependencies": {
|
||||
"axios": "^0.21.0",
|
||||
"cheerio": "^1.0.0-rc.3",
|
||||
"core-js": "^3.7.0",
|
||||
"cors": "^2.8.5",
|
||||
"dexie": "^3.0.2",
|
||||
"axios": "^0.21.1",
|
||||
"cheerio": "^1.0.0-rc.5",
|
||||
"core-js": "^3.8.2",
|
||||
"dexie": "^3.0.3",
|
||||
"electron-localshortcut": "^3.2.1",
|
||||
"electron-proxy-agent": "^1.2.0",
|
||||
"electron-updater": "^4.3.5",
|
||||
"element-ui": "^2.14.0",
|
||||
"express": "^4.17.1",
|
||||
"fast-xml-parser": "^3.17.4",
|
||||
"element-ui": "^2.15.0",
|
||||
"fast-xml-parser": "^3.17.6",
|
||||
"html2canvas": "^1.0.0-rc.7",
|
||||
"iptv-playlist-parser": "^0.5.0",
|
||||
"iptv-playlist-parser": "^0.5.4",
|
||||
"m3u": "0.0.2",
|
||||
"m3u8-parser": "^4.5.0",
|
||||
"m3u8-parser": "^4.5.2",
|
||||
"memcached": "^2.2.2",
|
||||
"modern-normalize": "^1.0.0",
|
||||
"mousetrap": "^1.6.5",
|
||||
"pinyin-match": "^1.1.1",
|
||||
"pinyin-match": "^1.1.7",
|
||||
"qrcode.vue": "^1.7.0",
|
||||
"randomstring": "^1.1.5",
|
||||
"session": "^0.1.0",
|
||||
"sortablejs": "^1.12.0",
|
||||
"sortablejs": "^1.13.0",
|
||||
"v-fit-columns": "^0.2.0",
|
||||
"vue": "^2.6.12",
|
||||
"vue-clickaway": "^2.2.2",
|
||||
"vue-infinite-loading": "^2.4.5",
|
||||
"vue-waterfall-plugin": "^1.1.0",
|
||||
"vuedraggable": "^2.24.3",
|
||||
"vuex": "^3.5.1",
|
||||
"xgplayer": "^2.13.0",
|
||||
"xgplayer-hls.js": "^2.2.5"
|
||||
"vuex": "^3.6.0",
|
||||
"xgplayer": "^2.16.0",
|
||||
"xgplayer-flv.js": "^2.1.2",
|
||||
"xgplayer-hls.js": "^2.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "~4.4.0",
|
||||
"@vue/cli-plugin-eslint": "~4.4.0",
|
||||
"@vue/cli-plugin-vuex": "~4.4.0",
|
||||
"@vue/cli-service": "~4.4.0",
|
||||
"@vue/eslint-config-standard": "^5.1.2",
|
||||
"@vue/cli-plugin-babel": "~4.5.10",
|
||||
"@vue/cli-plugin-eslint": "~4.5.10",
|
||||
"@vue/cli-plugin-vuex": "~4.5.10",
|
||||
"@vue/cli-service": "~4.5.10",
|
||||
"@vue/eslint-config-standard": "^6.0.0",
|
||||
"babel-eslint": "^10.1.0",
|
||||
"babel-plugin-component": "^1.1.1",
|
||||
"electron": "^10.1.5",
|
||||
"electron-devtools-installer": "^3.1.0",
|
||||
"eslint": "^6.7.2",
|
||||
"electron": "^11.1.1",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"eslint": "^7.16.0",
|
||||
"eslint-plugin-import": "^2.22.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^4.2.1",
|
||||
"eslint-plugin-standard": "^4.0.2",
|
||||
"eslint-plugin-vue": "^6.2.2",
|
||||
"sass": "^1.29.0",
|
||||
"sass-loader": "^8.0.2",
|
||||
"vue-cli-plugin-electron-builder": "2.0.0-rc.4",
|
||||
"eslint-plugin-standard": "^4.1.0",
|
||||
"eslint-plugin-vue": "^7.3.0",
|
||||
"sass": "^1.30.0",
|
||||
"sass-loader": "^10.1.0",
|
||||
"vue-cli-plugin-electron-builder": "2.0.0-rc.5",
|
||||
"vue-template-compiler": "^2.6.12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<meta name="referrer" content="same-origin"/>
|
||||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
||||
</head>
|
||||
|
||||
@@ -111,16 +111,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.play{
|
||||
.popper {
|
||||
font-size: 1rem;;
|
||||
border: none;
|
||||
li {
|
||||
font-size: 1rem;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Page of list using el-table
|
||||
.listpage{
|
||||
position: absolute;
|
||||
@@ -133,7 +123,7 @@
|
||||
border-radius: 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.listpage-header{
|
||||
.listpage-header, .toolbar{
|
||||
height: 60px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
@@ -185,7 +175,39 @@
|
||||
font-size: 1rem;
|
||||
border: none;
|
||||
}
|
||||
.el-select-dropdown__item.selected.hover{ //是上游的bug吗?临时性修补
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.el-select-dropdown__wrap{
|
||||
max-height: 574px
|
||||
}
|
||||
}
|
||||
> span{
|
||||
.el-input-number{
|
||||
width:120px;
|
||||
.el-input{
|
||||
width: 100px;
|
||||
}
|
||||
.el-input__inner{
|
||||
padding-left: 5px;
|
||||
padding-right: 5px;
|
||||
width: 88px;
|
||||
}
|
||||
.el-input-number__increase, .el-input-number__decrease {
|
||||
background-color: inherit;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.el-divider{
|
||||
.el-divider--horizontal{
|
||||
margin: 12px 0;
|
||||
}
|
||||
}
|
||||
.toolbar{
|
||||
z-index: 5;
|
||||
}
|
||||
.listpage-body{
|
||||
height: calc(100% - 60px);
|
||||
|
||||
@@ -131,6 +131,12 @@
|
||||
border-color: var(--d-c-8);
|
||||
}
|
||||
}
|
||||
.selected {
|
||||
background-color: var(--d-c-5);
|
||||
&:hover{
|
||||
background-color: var(--d-c-5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +145,19 @@
|
||||
.play{
|
||||
background-color: var(--d-bgc-1);
|
||||
box-shadow: var(--d-bsc);
|
||||
.el-switch__label {
|
||||
color: var(--d-fc-2)
|
||||
}
|
||||
.el-switch__label.is-active {
|
||||
color: #409EFF
|
||||
}
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--d-bgc-1);
|
||||
border: 1px solid var(--d-bgc-1);
|
||||
color: var(--d-fc-2);
|
||||
}
|
||||
}
|
||||
.title{
|
||||
color: var(--d-fc-1);
|
||||
.right {
|
||||
@@ -148,6 +167,21 @@
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.title{
|
||||
.right{
|
||||
color: var(--d-fc-2);
|
||||
svg{
|
||||
stroke: var(--d-c-5);
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
&:hover{
|
||||
stroke: var(--d-c-8);
|
||||
stroke-width: 1.5;
|
||||
fill: var(--d-c-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.more{
|
||||
span{
|
||||
svg{
|
||||
@@ -309,40 +343,35 @@
|
||||
box-shadow: var(--d-bsc);
|
||||
}
|
||||
|
||||
.play{
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--d-bgc-1);
|
||||
border: 1px solid var(--d-bgc-1);
|
||||
color: var(--d-fc-2);
|
||||
}
|
||||
}
|
||||
.popper {
|
||||
color: var(--d-fc-1);
|
||||
background-color: var(--d-bgc-1);
|
||||
box-shadow: var(--d-bsc);
|
||||
li {
|
||||
color: var(--d-fc-1);
|
||||
background-color: var(--d-bgc-1);
|
||||
&:hover{
|
||||
background-color: var(--d-bgc-2);
|
||||
}
|
||||
}
|
||||
.popper__arrow, .popper__arrow::after{
|
||||
border-bottom-color: var(--d-bgc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Page of list using table and picture
|
||||
.listpage{
|
||||
color: var(--d-fc-2);
|
||||
.listpage-header{
|
||||
.listpage-header-divider{
|
||||
background-color: var(--d-bgc-1);
|
||||
.el-divider__text {
|
||||
background-color: var(--d-bgc-2);
|
||||
}
|
||||
.el-button{
|
||||
background-color: var(--d-bgc-2);
|
||||
color: var(--d-fc-2);
|
||||
&:hover{
|
||||
color: var(--d-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.listpage-header, .toolbar{
|
||||
border-bottom-color: var(--d-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
color: var(--d-fc-3)
|
||||
}
|
||||
}
|
||||
.el-switch__label {
|
||||
color: var(--d-fc-2)
|
||||
}
|
||||
.el-switch__label.is-active {
|
||||
color: #409EFF
|
||||
}
|
||||
.el-button{
|
||||
background-color: var(--d-bgc-2);
|
||||
color: var(--d-fc-2);
|
||||
|
||||
@@ -131,6 +131,12 @@
|
||||
border-color: var(--g-c-8);
|
||||
}
|
||||
}
|
||||
.selected {
|
||||
background-color: var(--g-c-5);
|
||||
&:hover{
|
||||
background-color: var(--g-c-5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +145,13 @@
|
||||
.play{
|
||||
background-color: var(--g-bgc-1);
|
||||
box-shadow: var(--g-bsc);
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--g-bgc-1);
|
||||
border: 1px solid var(--g-bgc-1);
|
||||
color: var(--g-fc-2);
|
||||
}
|
||||
}
|
||||
.title{
|
||||
color: var(--g-fc-1);
|
||||
.right {
|
||||
@@ -148,6 +161,21 @@
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.title{
|
||||
.right{
|
||||
color: var(--g-fc-2);
|
||||
svg{
|
||||
stroke: var(--g-c-5);
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
&:hover{
|
||||
stroke: var(--g-c-8);
|
||||
stroke-width: 1.5;
|
||||
fill: var(--g-c-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.more{
|
||||
span{
|
||||
svg{
|
||||
@@ -309,34 +337,23 @@
|
||||
box-shadow: var(--g-bsc);
|
||||
}
|
||||
|
||||
.play{
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--g-bgc-1);
|
||||
border: 1px solid var(--g-bgc-1);
|
||||
color: var(--g-fc-2);
|
||||
}
|
||||
}
|
||||
.popper {
|
||||
color: var(--g-fc-1);
|
||||
background-color: var(--g-bgc-1);
|
||||
box-shadow: var(--g-bsc);
|
||||
li {
|
||||
color: var(--g-fc-1);
|
||||
background-color: var(--g-bgc-1);
|
||||
&:hover{
|
||||
background-color: var(--g-bgc-2);
|
||||
}
|
||||
}
|
||||
.popper__arrow, .popper__arrow::after{
|
||||
border-bottom-color: var(--g-bgc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Page of list using table and picture
|
||||
.listpage{
|
||||
color: var(--g-fc-2);
|
||||
.listpage-header{
|
||||
.listpage-header-divider{
|
||||
background-color: var(--g-bgc-1);
|
||||
.el-divider__text {
|
||||
background-color: var(--g-bgc-2);
|
||||
}
|
||||
.el-button{
|
||||
background-color: var(--g-bgc-2);
|
||||
color: var(--g-fc-2);
|
||||
&:hover{
|
||||
color: var(--g-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.listpage-header, .toolbar{
|
||||
border-bottom-color: var(--g-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
|
||||
@@ -131,6 +131,12 @@
|
||||
border-color: var(--l-c-8);
|
||||
}
|
||||
}
|
||||
.selected {
|
||||
background-color: var(--l-c-5);
|
||||
&:hover{
|
||||
background-color: var(--l-c-5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +145,13 @@
|
||||
.play{
|
||||
background-color: var(--l-bgc-1);
|
||||
box-shadow: var(--l-bsc);
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--l-bgc-1);
|
||||
border: 1px solid var(--l-bgc-1);
|
||||
color: var(--l-fc-2);
|
||||
}
|
||||
}
|
||||
.title{
|
||||
color: var(--l-fc-1);
|
||||
.right {
|
||||
@@ -148,6 +161,21 @@
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.title{
|
||||
.right{
|
||||
color: var(--l-fc-2);
|
||||
svg{
|
||||
stroke: var(--l-c-5);
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
&:hover{
|
||||
stroke: var(--l-c-8);
|
||||
stroke-width: 1.5;
|
||||
fill: var(--l-c-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.more{
|
||||
span{
|
||||
svg{
|
||||
@@ -309,34 +337,23 @@
|
||||
box-shadow: var(--l-bsc);
|
||||
}
|
||||
|
||||
.play{
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--l-bgc-1);
|
||||
border: 1px solid var(--l-bgc-1);
|
||||
color: var(--l-fc-2);
|
||||
}
|
||||
}
|
||||
.popper {
|
||||
color: var(--l-fc-1);
|
||||
background-color: var(--l-bgc-1);
|
||||
box-shadow: var(--l-bsc);
|
||||
li {
|
||||
color: var(--l-fc-1);
|
||||
background-color: var(--l-bgc-1);
|
||||
&:hover{
|
||||
background-color: var(--l-bgc-2);
|
||||
}
|
||||
}
|
||||
.popper__arrow, .popper__arrow::after{
|
||||
border-bottom-color: var(--l-bgc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Page of list using table and picture
|
||||
.listpage{
|
||||
color: var(--l-fc-2);
|
||||
.listpage-header{
|
||||
.listpage-header-divider{
|
||||
background-color: var(--l-bgc-1);
|
||||
.el-divider__text {
|
||||
background-color: var(--l-bgc-2);
|
||||
}
|
||||
.el-button{
|
||||
background-color: var(--l-bgc-2);
|
||||
color: var(--l-fc-2);
|
||||
&:hover{
|
||||
color: var(--l-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.listpage-header, .toolbar{
|
||||
border-bottom-color: var(--l-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
|
||||
@@ -131,6 +131,12 @@
|
||||
border-color: var(--p-c-8);
|
||||
}
|
||||
}
|
||||
.selected {
|
||||
background-color: var(--p-c-5);
|
||||
&:hover{
|
||||
background-color: var(--p-c-5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -139,6 +145,13 @@
|
||||
.play{
|
||||
background-color: var(--p-bgc-1);
|
||||
box-shadow: var(--p-bsc);
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--p-bgc-1);
|
||||
border: 1px solid var(--p-bgc-1);
|
||||
color: var(--p-fc-2);
|
||||
}
|
||||
}
|
||||
.title{
|
||||
color: var(--p-fc-1);
|
||||
.right {
|
||||
@@ -148,6 +161,21 @@
|
||||
}
|
||||
}
|
||||
.box{
|
||||
.title{
|
||||
.right{
|
||||
color: var(--p-fc-2);
|
||||
svg{
|
||||
stroke: var(--p-c-5);
|
||||
stroke-width: 1;
|
||||
fill: none;
|
||||
&:hover{
|
||||
stroke: var(--p-c-8);
|
||||
stroke-width: 1.5;
|
||||
fill: var(--p-c-2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.more{
|
||||
span{
|
||||
svg{
|
||||
@@ -309,34 +337,23 @@
|
||||
box-shadow: var(--p-bsc);
|
||||
}
|
||||
|
||||
.play{
|
||||
.el-input{
|
||||
input{
|
||||
background-color: var(--p-bgc-1);
|
||||
border: 1px solid var(--p-bgc-1);
|
||||
color: var(--p-fc-2);
|
||||
}
|
||||
}
|
||||
.popper {
|
||||
color: var(--p-fc-1);
|
||||
background-color: var(--p-bgc-1);
|
||||
box-shadow: var(--p-bsc);
|
||||
li {
|
||||
color: var(--p-fc-1);
|
||||
background-color: var(--p-bgc-1);
|
||||
&:hover{
|
||||
background-color: var(--p-bgc-2);
|
||||
}
|
||||
}
|
||||
.popper__arrow, .popper__arrow::after{
|
||||
border-bottom-color: var(--p-bgc-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Page of list using table and picture
|
||||
.listpage{
|
||||
color: var(--p-fc-2);
|
||||
.listpage-header{
|
||||
.listpage-header-divider{
|
||||
background-color: var(--p-bgc-1);
|
||||
.el-divider__text {
|
||||
background-color: var(--p-bgc-2);
|
||||
}
|
||||
.el-button{
|
||||
background-color: var(--p-bgc-2);
|
||||
color: var(--p-fc-2);
|
||||
&:hover{
|
||||
color: var(--p-fc-3)
|
||||
}
|
||||
}
|
||||
}
|
||||
.listpage-header, .toolbar{
|
||||
border-bottom-color: var(--p-c-3);
|
||||
.btn{
|
||||
&:hover{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
'use strict'
|
||||
|
||||
import './lib/site/server'
|
||||
import { app, protocol, BrowserWindow, globalShortcut, ipcMain } from 'electron'
|
||||
import { app, protocol, BrowserWindow, globalShortcut } from 'electron'
|
||||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
|
||||
import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
|
||||
import { initUpdater } from './lib/update/update'
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||
// const log = require('electron-log') // 用于调试主程序
|
||||
|
||||
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors') // 允许跨域
|
||||
// app.commandLine.appendSwitch('--ignore-certificate-errors', 'true') // 忽略证书相关错误
|
||||
app.commandLine.appendSwitch('--ignore-certificate-errors', 'true') // 忽略证书相关错误
|
||||
|
||||
let win
|
||||
|
||||
@@ -23,7 +23,8 @@ function createWindow () {
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
enableRemoteModule: true,
|
||||
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION
|
||||
nodeIntegration: process.env.ELECTRON_NODE_INTEGRATION,
|
||||
allowRunningInsecureContent: false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -34,7 +35,24 @@ function createWindow () {
|
||||
createProtocol('app')
|
||||
win.loadURL('app://./index.html')
|
||||
}
|
||||
|
||||
|
||||
// 修改request headers
|
||||
// Sec-Fetch下禁止修改,浏览器自动加上请求头 https://www.cnblogs.com/fulu/p/13879080.html 暂时先用index.html的meta referer policy替代
|
||||
const filter = {
|
||||
urls: ['http://*/*', 'http://*/*']
|
||||
}
|
||||
win.webContents.session.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
|
||||
const url = new URL(details.url)
|
||||
details.requestHeaders.Origin = url.origin
|
||||
if (!details.url.includes('//localhost') && details.requestHeaders.Referer && details.requestHeaders.Referer.includes('//localhost')) {
|
||||
details.requestHeaders.Referer = url.origin
|
||||
}
|
||||
callback({
|
||||
cancel: false,
|
||||
requestHeaders: details.requestHeaders
|
||||
})
|
||||
})
|
||||
|
||||
initUpdater(win)
|
||||
|
||||
win.on('closed', () => {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="operate">
|
||||
<span @click="playEvent(0)">播放</span>
|
||||
<span @click="playEvent(selectedEpisode)">播放</span>
|
||||
<span @click="starEvent">收藏</span>
|
||||
<span @click="downloadEvent">下载</span>
|
||||
<span @click="shareEvent">分享</span>
|
||||
@@ -52,10 +52,16 @@
|
||||
</span>
|
||||
</div>
|
||||
<div
|
||||
class="desc" v-show="info.des">{{info.des}}</div>
|
||||
class="desc" v-show="info.des">{{info.des}}
|
||||
</div>
|
||||
<div class="m3u8" v-if="videoFullList.length > 1">
|
||||
<div class="box">
|
||||
<span v-bind:class="{ selected: i.flag === videoFlag }" v-for="(i, j) in videoFullList" :key="j" @click="updateVideoList(i)">{{i.flag}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="m3u8">
|
||||
<div class="box">
|
||||
<span v-for="(i, j) in m3u8List" :key="j" @click="playEvent(j)">{{i | ftName}}</span>
|
||||
<span v-bind:class="{ selected: j === selectedEpisode }" v-for="(i, j) in videoList" :key="j" @click="playEvent(j)" @mouseenter="() => { selectedEpisode = j }">{{ i | ftName(j) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -76,17 +82,24 @@ export default {
|
||||
data () {
|
||||
return {
|
||||
loading: true,
|
||||
m3u8List: [],
|
||||
videoFlag: '',
|
||||
videoList: [],
|
||||
videoFullList: [],
|
||||
info: {},
|
||||
playOnline: false,
|
||||
selectedEpisode: 0, // 选定集数
|
||||
selectedOnlineSite: '哔嘀',
|
||||
onlineSites: ['哔嘀', '素白白', '简影', '极品', '喜欢看', '1080影视']
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
ftName (e) {
|
||||
const name = e.split('$')[0]
|
||||
return name
|
||||
ftName (e, n) {
|
||||
const num = e.split('$')
|
||||
if (num.length > 1) {
|
||||
return e.split('$')[0]
|
||||
} else {
|
||||
return `第${(n + 1)}集`
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -121,26 +134,52 @@ export default {
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
DetailCache: {
|
||||
get () {
|
||||
return this.$store.getters.getDetailCache
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DetailCache(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_VIDEO', 'SET_DETAIL', 'SET_SHARE']),
|
||||
...mapMutations(['SET_VIEW', 'SET_VIDEO', 'SET_DETAIL', 'SET_SHARE', 'SET_DetailCache']),
|
||||
addClass (flag) {
|
||||
if (flag === this.videoFlag) {
|
||||
return 'selectedBox'
|
||||
} else {
|
||||
return 'box'
|
||||
}
|
||||
},
|
||||
close () {
|
||||
this.detail.show = false
|
||||
},
|
||||
async updateVideoList (e) {
|
||||
this.videoFlag = e.flag
|
||||
this.videoList = e.list
|
||||
const db = await history.find({ site: this.detail.key, ids: this.detail.info.id })
|
||||
if (db) {
|
||||
const doc = { ...db }
|
||||
doc.videoFlag = e.flag
|
||||
delete doc.id
|
||||
history.update(db.id, doc)
|
||||
}
|
||||
},
|
||||
async playEvent (n) {
|
||||
if (!this.playOnline) {
|
||||
const db = await history.find({ site: this.detail.key, ids: this.detail.info.id })
|
||||
if (db) {
|
||||
this.video = { key: db.site, info: { id: db.ids, name: db.name, index: n, site: this.detail.site } }
|
||||
this.video = { key: db.site, info: { id: db.ids, name: db.name, index: n, site: this.detail.site, videoFlag: this.videoFlag } }
|
||||
} else {
|
||||
this.video = { key: this.detail.key, info: { id: this.detail.info.id, name: this.detail.info.name, index: n, site: this.detail.site } }
|
||||
this.video = { key: this.detail.key, info: { id: this.detail.info.id, name: this.detail.info.name, index: n, site: this.detail.site, videoFlag: this.videoFlag } }
|
||||
}
|
||||
this.video.detail = this.info
|
||||
this.view = 'Play'
|
||||
this.detail.show = false
|
||||
} else {
|
||||
const db = await history.find({ site: this.detail.key, ids: this.detail.info.id })
|
||||
const db = await history.find({ site: this.detail.key, ids: this.info.id })
|
||||
if (db) {
|
||||
db.index = n
|
||||
db.detail = this.info
|
||||
@@ -211,64 +250,58 @@ export default {
|
||||
}
|
||||
},
|
||||
downloadEvent () {
|
||||
zy.download(this.detail.key, this.info.id).then(res => {
|
||||
if (res && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = res.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
const list = [...this.m3u8List]
|
||||
let downloadUrl = this.detail.info.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
}
|
||||
zy.download(this.detail.key, this.info.id, this.videoFlag).then(res => {
|
||||
clipboard.writeText(res.downloadUrls)
|
||||
this.$message.success(res.info)
|
||||
}).catch((err) => {
|
||||
this.$message.error(err.info)
|
||||
})
|
||||
},
|
||||
shareEvent () {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: this.detail.key,
|
||||
info: this.detail.info
|
||||
info: this.info,
|
||||
index: this.selectedEpisode
|
||||
}
|
||||
},
|
||||
doubanLinkEvent () {
|
||||
const name = this.detail.info.name.trim()
|
||||
zy.doubanLink(name).then(link => {
|
||||
const name = this.info.name.trim()
|
||||
const year = this.info.year
|
||||
zy.doubanLink(name, year).then(link => {
|
||||
const open = require('open')
|
||||
open(link)
|
||||
})
|
||||
},
|
||||
getDoubanRate () {
|
||||
const name = this.detail.info.name.trim()
|
||||
zy.doubanRate(name).then(res => {
|
||||
this.info.rate = res
|
||||
})
|
||||
async getDoubanRate () {
|
||||
const name = this.info.name.trim()
|
||||
const year = this.info.year
|
||||
this.info.rate = await zy.doubanRate(name, year)
|
||||
},
|
||||
getDetailInfo () {
|
||||
async getDetailInfo () {
|
||||
const id = this.detail.info.ids || this.detail.info.id
|
||||
zy.detail(this.detail.key, id).then(res => {
|
||||
if (res) {
|
||||
this.info = res
|
||||
this.$set(this.info, 'rate', '')
|
||||
this.m3u8List = res.m3u8List
|
||||
this.getDoubanRate()
|
||||
this.loading = false
|
||||
const cacheKey = this.detail.key + '@' + id
|
||||
const db = await history.find({ site: this.detail.key, ids: id })
|
||||
if (db) {
|
||||
this.videoFlag = db.videoFlag
|
||||
this.selectedEpisode = db.index
|
||||
}
|
||||
if (!this.DetailCache[cacheKey]) {
|
||||
this.DetailCache[cacheKey] = await zy.detail(this.detail.key, id)
|
||||
}
|
||||
const res = this.DetailCache[cacheKey]
|
||||
if (res) {
|
||||
this.info = res
|
||||
this.$set(this.info, 'rate', this.DetailCache[cacheKey].rate || '')
|
||||
this.videoFlag = this.videoFlag || res.fullList[0].flag
|
||||
this.videoList = res.fullList[0].list
|
||||
this.videoFullList = res.fullList
|
||||
this.loading = false
|
||||
if (!this.info.rate) {
|
||||
await this.getDoubanRate()
|
||||
this.DetailCache[cacheKey].rate = this.info.rate
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
@@ -390,6 +423,15 @@ export default {
|
||||
margin: 6px 10px 0px 0px;
|
||||
padding: 8px 22px;
|
||||
}
|
||||
.selected {
|
||||
display: inline-block;
|
||||
font-size: 12px;
|
||||
border: 1px solid;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
margin: 6px 10px 0px 0px;
|
||||
padding: 8px 22px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
<el-switch v-model="enableBatchEdit" active-text="批处理分组">></el-switch>
|
||||
<el-checkbox v-model="setting.excludeR18Films" @change="excludeR18FilmsChangeEvent">屏蔽福利片</el-checkbox>
|
||||
<el-button @click="addSite" icon="el-icon-document-add">新增</el-button>
|
||||
<el-button @click="exportSites" icon="el-icon-upload2" >导出</el-button>
|
||||
<el-button @click="importSites" icon="el-icon-download">导入</el-button>
|
||||
<el-button @click="checkAllSite" icon="el-icon-refresh" :loading="checkAllSitesLoading">检测{{ this.checkAllSitesLoading ? this.checkProgress + '/' + this.sites.length : '' }}</el-button>
|
||||
<el-button @click="exportSites" icon="el-icon-upload2" title="导出全部,自动添加扩展名">导出</el-button>
|
||||
<el-button @click="importSites" icon="el-icon-download" title="支持同时导入多个文件">导入</el-button>
|
||||
<el-button @click="checkAllSite" icon="el-icon-refresh" :loading="checkAllSitesLoading" title="可在后台运行">检测{{ this.checkAllSitesLoading ? this.checkProgress + '/' + this.sites.length : '' }}</el-button>
|
||||
<el-button @click="resetSitesEvent" icon="el-icon-refresh-left">重置</el-button>
|
||||
</div>
|
||||
<div class="listpage-header" v-show="enableBatchEdit">
|
||||
<el-switch v-model="enableBatchEdit" active-text="批处理分组"></el-switch>
|
||||
<el-input placeholder="新组名" v-model="batchGroupName"></el-input>
|
||||
<el-switch v-model="batchIsActive" active-text="启用"></el-switch>
|
||||
<el-button type="primary" icon="el-icon-edit" @click.stop="saveBatchEdit">保存</el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" @click.stop="saveBatchEdit" title="输入框组名为空时仅保存开关状态">保存分组与开关状态</el-button>
|
||||
<el-button @click="removeSelectedSites" icon="el-icon-delete-solid">删除</el-button>
|
||||
</div>
|
||||
<div class="listpage-body" id="sites-body">
|
||||
@@ -94,6 +94,9 @@
|
||||
<el-form-item label="下载接口" prop='download'>
|
||||
<el-input v-model="siteInfo.download" :autosize="{ minRows: 2, maxRows: 4}" type="textarea" placeholder="请输入Download接口地址,可以空着"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="解析接口" prop='jiexiUrl'>
|
||||
<el-input v-model="siteInfo.jiexiUrl" :autosize="{ minRows: 2, maxRows: 4}" type="textarea" placeholder="请输入解析接口地址,默认源自带解析,若要调用应用默认解析接口请输入默认或default"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分组" prop='group'>
|
||||
<el-select v-model="siteInfo.group" allow-create filterable default-first-option placeholder="请输入分组">
|
||||
<el-option v-for="item in siteGroup" :key="item" :label="item" :value="item"></el-option>
|
||||
@@ -133,6 +136,7 @@ export default {
|
||||
name: '',
|
||||
api: '',
|
||||
download: '',
|
||||
jiexiUrl: '',
|
||||
group: '',
|
||||
isActive: true
|
||||
},
|
||||
@@ -169,9 +173,9 @@ export default {
|
||||
},
|
||||
getFilters () {
|
||||
const groups = [...new Set(this.sites.map(site => site.group))]
|
||||
var filters = []
|
||||
const filters = []
|
||||
groups.forEach(g => {
|
||||
var doc = {
|
||||
const doc = {
|
||||
text: g,
|
||||
value: g
|
||||
}
|
||||
@@ -186,6 +190,17 @@ export default {
|
||||
this.$message.info('正在检测, 请勿操作.')
|
||||
this.enableBatchEdit = false
|
||||
}
|
||||
if (this.enableBatchEdit) {
|
||||
if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5
|
||||
if (this.setting.shiftTooltipLimitTimes) {
|
||||
this.$message.info('多选时支持shift快捷键')
|
||||
this.setting.shiftTooltipLimitTimes--
|
||||
setting.find().then(res => {
|
||||
res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -260,6 +275,7 @@ export default {
|
||||
name: '',
|
||||
api: '',
|
||||
download: '',
|
||||
jiexiUrl: '',
|
||||
group: '',
|
||||
isActive: true
|
||||
}
|
||||
@@ -311,13 +327,14 @@ export default {
|
||||
if (!this.checkSiteKey()) {
|
||||
return false
|
||||
}
|
||||
var randomstring = require('randomstring')
|
||||
var doc = {
|
||||
const randomstring = require('randomstring')
|
||||
const doc = {
|
||||
key: this.dialogType === 'edit' ? this.siteInfo.key : this.siteInfo.key ? this.siteInfo.key : randomstring.generate(6),
|
||||
id: this.dialogType === 'edit' ? this.siteInfo.id : this.sites.length ? this.sites[this.sites.length - 1].id + 1 : 1,
|
||||
name: this.siteInfo.name,
|
||||
api: this.siteInfo.api,
|
||||
download: this.siteInfo.download,
|
||||
jiexiUrl: this.siteInfo.jiexiUrl,
|
||||
group: this.siteInfo.group,
|
||||
isActive: this.siteInfo.isActive
|
||||
}
|
||||
@@ -328,6 +345,7 @@ export default {
|
||||
name: '',
|
||||
api: '',
|
||||
download: '',
|
||||
jiexiUrl: '',
|
||||
group: ''
|
||||
}
|
||||
this.dialogType === 'edit' ? this.$message.success('修改成功!') : this.$message.success('新增源成功!')
|
||||
@@ -342,13 +360,12 @@ export default {
|
||||
const str = JSON.stringify(arr, null, 2)
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
{ name: 'JSON file', extensions: ['json'] }
|
||||
]
|
||||
}
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
if (!result.filePath.endsWith('.json')) result.filePath += '.json'
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
this.$message.success('已保存成功')
|
||||
}
|
||||
@@ -363,16 +380,14 @@ export default {
|
||||
}
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
{ name: 'JSON file', extensions: ['json'] }
|
||||
],
|
||||
properties: ['openFile', 'multiSelections']
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
result.filePaths.forEach(file => {
|
||||
var str = fs.readFileSync(file)
|
||||
const str = fs.readFileSync(file)
|
||||
const json = JSON.parse(str)
|
||||
json.forEach(ele => {
|
||||
if (ele.api && this.sites.filter(x => x.key === ele.key).length === 0 && this.sites.filter(x => x.name === ele.name && x.api === ele.api).length === 0) {
|
||||
@@ -421,7 +436,7 @@ export default {
|
||||
sites.add(row)
|
||||
},
|
||||
resetId (inArray) {
|
||||
var id = 1
|
||||
let id = 1
|
||||
inArray.forEach(ele => {
|
||||
ele.id = id
|
||||
id += 1
|
||||
@@ -431,7 +446,7 @@ export default {
|
||||
// 因为el-table的数据是单向绑定,我们先同步el-table里的数据和其绑定的数据
|
||||
this.syncTableData()
|
||||
sites.clear().then(res => {
|
||||
var id = 1
|
||||
let id = 1
|
||||
this.sites.forEach(ele => {
|
||||
ele.id = id
|
||||
id += 1
|
||||
@@ -452,7 +467,7 @@ export default {
|
||||
return false
|
||||
}
|
||||
const tbody = document.getElementById('sites-table').querySelector('.el-table__body-wrapper tbody')
|
||||
var _this = this
|
||||
const _this = this
|
||||
Sortable.create(tbody, {
|
||||
onEnd ({ newIndex, oldIndex }) {
|
||||
const currRow = _this.sites.splice(oldIndex, 1)[0]
|
||||
@@ -462,6 +477,7 @@ export default {
|
||||
})
|
||||
},
|
||||
async checkAllSite () {
|
||||
if (this.checkAllSitesLoading) return
|
||||
this.checkAllSitesLoading = true
|
||||
this.stopFlag = false
|
||||
this.checkProgress = 0
|
||||
@@ -471,6 +487,7 @@ export default {
|
||||
await Promise.all(other.map(site => this.checkSingleSite(site))).then(res => {
|
||||
this.checkAllSitesLoading = false
|
||||
this.getSites()
|
||||
if (!this.stopFlag) this.$message.success('视频点播源站批量检测已完成!')
|
||||
})
|
||||
},
|
||||
async checkSingleSite (row) {
|
||||
|
||||
@@ -9,9 +9,7 @@
|
||||
:value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-switch v-model="searchViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateSearchViewMode"
|
||||
v-if="show.find"></el-switch>
|
||||
<el-select v-model="selectedClassName" size="small" placeholder="类型" :popper-append-to-body="false" popper-class="popper" @change="classClick" v-show="show.class">
|
||||
<el-select v-model="selectedClassName" size="small" placeholder="类型" :popper-append-to-body="false" popper-class="popper" @change="classClick" v-if="classList && classList.length" v-show="!showFind">
|
||||
<el-option
|
||||
v-for="item in classList"
|
||||
:key="item.tid"
|
||||
@@ -19,6 +17,14 @@
|
||||
:value="item.name">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="selectedSearchClassNames" size="small" multiple placeholder="类型" :popper-append-to-body="false" popper-class="popper" v-if="searchClassList && searchClassList.length" v-show="showFind && showToolbar" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
|
||||
<el-option
|
||||
v-for="(item, index) in searchClassList"
|
||||
:key='index'
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-autocomplete
|
||||
clearable
|
||||
size="small"
|
||||
@@ -44,12 +50,42 @@
|
||||
</el-option>
|
||||
</el-select>
|
||||
<!--方便触屏-->
|
||||
<el-button icon="el-icon-search" @click.stop="searchEvent" slot="append" />
|
||||
<el-button icon="el-icon-search" @click.stop="searchEvent" slot="append" v-if="!searchRunning"/>
|
||||
<el-button icon="el-icon-loading" @click.stop="stopSearchEvent" slot="append" v-if="searchRunning" title='点击可停止搜索'/>
|
||||
</el-autocomplete>
|
||||
</div>
|
||||
<div class="toolbar" v-show="showToolbar">
|
||||
<el-select v-model="selectedAreas" size="small" multiple placeholder="地区" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
|
||||
<el-option
|
||||
v-for="item in areas"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false" @change="refreshFilteredList">
|
||||
<el-option
|
||||
v-for="item in sortKeywords"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<span>
|
||||
上映区间:
|
||||
<el-input-number size="small" v-model="selectedYears.start" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
|
||||
至
|
||||
<el-input-number size="small" v-model="selectedYears.end" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
|
||||
</span>
|
||||
</div>
|
||||
<el-divider class="listpage-header-divider" content-position="right">
|
||||
<el-button type="text" size="mini" @click="toggleViewMode">视图切换</el-button>
|
||||
<el-button type="text" size="mini" @click='() => { showToolbar = !showToolbar; if (!showToolbar) this.refreshFilteredList() }' title="收起工具栏会重置筛选排序">{{ showToolbar ? '隐藏工具栏' : '显示工具栏' }}</el-button>
|
||||
<el-button type="text" size="mini" @click="backTop">回到顶部</el-button>
|
||||
</el-divider>
|
||||
<div class="listpage-body" id="film-body" infinite-wrapper>
|
||||
<div class="show-picture" v-if="setting.view === 'picture' && !show.find">
|
||||
<Waterfall ref="filmWaterfall" :list="list" :gutter="20" :width="240"
|
||||
<div class="show-picture" v-if="setting.view === 'picture' && !showFind">
|
||||
<Waterfall ref="filmWaterfall" :list="filteredList" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
rowPerView: 4,
|
||||
@@ -64,7 +100,7 @@
|
||||
animationEffect="fadeIn"
|
||||
backgroundColor="rgba(0, 0, 0, 0)">
|
||||
<template slot="item" slot-scope="props">
|
||||
<div class="card" v-show="!setting.excludeR18Films || !containsR18Keywords(props.data.type)">
|
||||
<div class="card">
|
||||
<div class="img">
|
||||
<img style="width: 100%" :src="props.data.pic" alt="" @load="$refs.filmWaterfall.refresh()" @click="detailEvent(site, props.data)">
|
||||
<div class="operate">
|
||||
@@ -87,10 +123,11 @@
|
||||
</Waterfall>
|
||||
<infinite-loading force-use-infinite-wrapper :identifier="infiniteId" @infinite="infiniteHandler"></infinite-loading>
|
||||
</div>
|
||||
<div class="show-table" v-if="setting.view === 'table' && !show.find">
|
||||
<div class="show-table" v-if="setting.view === 'table' && !showFind">
|
||||
<el-table
|
||||
size="mini"
|
||||
:data="list.filter(res => !setting.excludeR18Films || !containsR18Keywords(res.type))"
|
||||
:data="filteredList"
|
||||
ref="filmTable"
|
||||
height="100%"
|
||||
:empty-text="statusText"
|
||||
@row-click="(row) => detailEvent(site, row)"
|
||||
@@ -99,7 +136,7 @@
|
||||
prop="name"
|
||||
label="片名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<el-table-column v-if="type.name === '最新'"
|
||||
prop="type"
|
||||
label="类型"
|
||||
width="100">
|
||||
@@ -120,16 +157,16 @@
|
||||
label="语言"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="note"
|
||||
label="备注"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<el-table-column v-if="showTableLastColumn"
|
||||
prop="last"
|
||||
label="最近更新"
|
||||
:formatter="dateFormat"
|
||||
align="left">
|
||||
align="left"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="note"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
@@ -152,10 +189,10 @@
|
||||
</infinite-loading>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-table" v-show="searchViewMode=== 'table' && show.find">
|
||||
<div class="show-table" v-if="setting.searchViewMode === 'table' && showFind">
|
||||
<el-table size="mini"
|
||||
ref="searchResultTable"
|
||||
:data="searchContents.filter(res => !setting.excludeR18Films || (res.type !== undefined && !containsR18Keywords(res.type)))"
|
||||
:data="filteredSearchContents"
|
||||
height="100%"
|
||||
:empty-text="statusText"
|
||||
@filter-change="filterChange"
|
||||
@@ -181,36 +218,38 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
:filters="getFilters('type')"
|
||||
:filter-method="(value, row, column) => { this.currentColumn = column; return value === row.type }"
|
||||
label="类型"
|
||||
width="90">
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
sortable
|
||||
prop="year"
|
||||
label="上映"
|
||||
width="90">
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="area"
|
||||
:filters="getFilters('area')"
|
||||
:filter-method="(value, row, column) => { this.currentColumn = column; return value === row.area }"
|
||||
label="地区"
|
||||
width="90">
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:filters="getFilters('lang')"
|
||||
:filter-method="(value, row, column) => { this.currentColumn = column; return value === row.lang }"
|
||||
prop="lang"
|
||||
label="语言"
|
||||
width="70">
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="showTableLastColumn"
|
||||
prop="last"
|
||||
label="最近更新"
|
||||
:formatter="dateFormat"
|
||||
align="left"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
sortable
|
||||
prop="note"
|
||||
label="备注"
|
||||
width="120">
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
@@ -226,8 +265,8 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-picture" v-show="searchViewMode === 'picture' && show.find">
|
||||
<Waterfall ref="filmSearchWaterfall" :list="searchContents.filter(res => !setting.excludeR18Films || (res.type !== undefined && !containsR18Keywords(res.type)))" :gutter="20" :width="240"
|
||||
<div class="show-picture" v-if="setting.searchViewMode === 'picture' && showFind">
|
||||
<Waterfall ref="filmSearchWaterfall" :list="filteredSearchContents" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
rowPerView: 4,
|
||||
@@ -277,24 +316,25 @@ import zy from '../lib/site/tools'
|
||||
import Waterfall from 'vue-waterfall-plugin'
|
||||
import InfiniteLoading from 'vue-infinite-loading'
|
||||
const { clipboard } = require('electron')
|
||||
const FILM_DATA_CACHE = {} // key = site.key, value = classList; key = site.key + '@' + type.tid, value = {list, pageCount}
|
||||
export default {
|
||||
name: 'film',
|
||||
data () {
|
||||
return {
|
||||
show: {
|
||||
body: false,
|
||||
site: false,
|
||||
class: false,
|
||||
classList: false,
|
||||
find: false
|
||||
},
|
||||
showFind: false,
|
||||
showToolbar: false,
|
||||
showTableLastColumn: false,
|
||||
sites: [],
|
||||
site: {},
|
||||
classList: [],
|
||||
searchClassList: [],
|
||||
type: {},
|
||||
selectedClassName: '最新',
|
||||
selectedSiteName: '',
|
||||
selectedClassName: '',
|
||||
selectedSearchClassNames: [],
|
||||
totalpagecount: 0,
|
||||
pagecount: 0,
|
||||
recordcount: 0,
|
||||
list: [],
|
||||
statusText: ' ',
|
||||
infiniteId: +new Date(),
|
||||
@@ -302,12 +342,21 @@ export default {
|
||||
searchList: [],
|
||||
searchTxt: '',
|
||||
searchContents: [],
|
||||
filteredSearchContents: [],
|
||||
currentColumn: '',
|
||||
searchGroup: '',
|
||||
searchGroups: [],
|
||||
// 福利片关键词
|
||||
r18KeyWords: ['伦理', '论理', '倫理', '福利', '激情', '理论', '写真', '情色', '美女', '街拍', '赤足', '性感', '里番'],
|
||||
searchViewMode: 'picture'
|
||||
filteredList: [],
|
||||
areas: [],
|
||||
selectedAreas: [],
|
||||
sortKeyword: '',
|
||||
sortKeywords: ['按片名', '按上映年份', '按更新时间'],
|
||||
selectedYears: { start: 0, end: new Date().getFullYear() },
|
||||
searchRunning: false,
|
||||
siteSearchCount: 0,
|
||||
infiniteHandlerCount: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -355,8 +404,21 @@ export default {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
},
|
||||
DetailCache: {
|
||||
get () {
|
||||
return this.$store.getters.getDetailCache
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DetailCache(val)
|
||||
}
|
||||
},
|
||||
filterSettings () {
|
||||
return this.$store.getters.getSetting.excludeR18Films // 需要监听的数据
|
||||
},
|
||||
searchSites () {
|
||||
if (this.searchGroup === '站内') return [this.site]
|
||||
if (this.searchGroup === '全站') return this.sites
|
||||
return this.sites.filter(site => site.group === this.searchGroup)
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
@@ -367,7 +429,11 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
this.changeView()
|
||||
if (this.view === 'Film') {
|
||||
this.getAllSites()
|
||||
if (this.$refs.filmWaterfall) this.$refs.filmWaterfall.resize() // 瀑布插件resize和refresh功能相同,只是延时不同
|
||||
if (this.$refs.filmSearchWaterfall) this.$refs.filmSearchWaterfall.resize()
|
||||
}
|
||||
},
|
||||
searchTxt () {
|
||||
if (this.searchTxt === '清除历史记录...') {
|
||||
@@ -378,13 +444,99 @@ export default {
|
||||
},
|
||||
filterSettings () {
|
||||
this.siteClick(this.site.name)
|
||||
},
|
||||
list: {
|
||||
handler (list) {
|
||||
this.areas = [...new Set(list.map(ele => ele.area))].filter(x => x)
|
||||
this.refreshFilteredList()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
siteSearchCount () {
|
||||
if (this.siteSearchCount === this.searchSites.length) this.searchRunning = false
|
||||
},
|
||||
searchContents: {
|
||||
handler (list) {
|
||||
this.areas = [...new Set(list.map(ele => ele.area))].filter(x => x)
|
||||
this.searchClassList = [...new Set(list.map(ele => ele.type))].filter(x => x)
|
||||
this.refreshFilteredList()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
selectedAreas: {
|
||||
handler () {
|
||||
this.infiniteHandlerCount = 0
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
selectedYears: {
|
||||
handler () {
|
||||
this.infiniteHandlerCount = 0
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
|
||||
updateSearchViewMode () {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING', 'SET_DetailCache']),
|
||||
backTop () {
|
||||
const viewMode = this.showFind ? this.setting.searchViewMode : this.setting.view
|
||||
if (viewMode === 'picture') {
|
||||
document.getElementById('film-body').scrollTop = 0
|
||||
} else {
|
||||
const table = this.showFind ? this.$refs.searchResultTable : this.$refs.filmTable
|
||||
table.bodyWrapper.scrollTop = 0
|
||||
}
|
||||
},
|
||||
refreshFilteredList () {
|
||||
if (!this.showToolbar) {
|
||||
this.sortKeyword = ''
|
||||
this.selectedAreas = []
|
||||
this.selectedSearchClassNames = []
|
||||
this.selectedYears.start = 0
|
||||
this.selectedYears.end = new Date().getFullYear()
|
||||
}
|
||||
let filteredData = this.showFind ? this.searchContents : this.list
|
||||
if (this.showFind) filteredData = filteredData.filter(x => (this.selectedSearchClassNames.length === 0) || this.selectedSearchClassNames.includes(x.type))
|
||||
filteredData = filteredData.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.area))
|
||||
filteredData = filteredData.filter(res => !this.setting.excludeR18Films || !this.containsR18Keywords(res.type))
|
||||
filteredData = filteredData.filter(res => res.year >= this.selectedYears.start)
|
||||
filteredData = filteredData.filter(res => res.year <= this.selectedYears.end)
|
||||
if (!this.showFind) this.selectedClassName = this.type.name + ' ' + filteredData.length + '/' + this.recordcount
|
||||
switch (this.sortKeyword) {
|
||||
case '按上映年份':
|
||||
filteredData.sort(function (a, b) {
|
||||
return a.year - b.year
|
||||
})
|
||||
break
|
||||
case '按片名':
|
||||
filteredData.sort(function (a, b) {
|
||||
return a.name.localeCompare(b.name, 'zh')
|
||||
})
|
||||
break
|
||||
case '按更新时间':
|
||||
filteredData.sort(function (a, b) {
|
||||
return new Date(b.last) - new Date(a.last)
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
if (this.showFind) {
|
||||
this.filteredSearchContents = filteredData
|
||||
} else {
|
||||
this.filteredList = filteredData
|
||||
}
|
||||
},
|
||||
toggleViewMode () {
|
||||
if (this.showFind) {
|
||||
this.setting.searchViewMode = this.setting.searchViewMode === 'picture' ? 'table' : 'picture'
|
||||
setTimeout(() => { if (this.$refs.filmSearchWaterfall) this.$refs.filmSearchWaterfall.refresh() }, 700)
|
||||
} else {
|
||||
this.setting.view = this.setting.view === 'picture' ? 'table' : 'picture'
|
||||
}
|
||||
setting.find().then(res => {
|
||||
res.searchViewMode = this.searchViewMode
|
||||
res.searchViewMode = this.setting.searchViewMode
|
||||
res.view = this.setting.view
|
||||
setting.update(res)
|
||||
})
|
||||
},
|
||||
@@ -392,16 +544,15 @@ export default {
|
||||
return a.localeCompare(b, 'zh')
|
||||
},
|
||||
dateFormat (row, column) {
|
||||
var date = row[column.property]
|
||||
const date = row[column.property]
|
||||
if (date === undefined) {
|
||||
return ''
|
||||
}
|
||||
return date.split(/\s/)[0]
|
||||
},
|
||||
getFilters (column) {
|
||||
const searchContents = this.searchContents.filter(res => !this.setting.excludeR18Films || (res.type !== undefined && !this.containsR18Keywords(res.type)))
|
||||
if (column === 'siteName') return [...new Set(searchContents.map(row => row.site.name))].map(e => { return { text: e, value: e } }) // 有方法合并这两行吗?
|
||||
return [...new Set(searchContents.map(row => row[column]))].map(e => { return { text: e, value: e } })
|
||||
if (column === 'siteName') return [...new Set(this.filteredSearchContents.map(row => row.site.name))].map(e => { return { text: e, value: e } }) // 有方法合并这两行吗?
|
||||
return [...new Set(this.filteredSearchContents.map(row => row[column]))].map(e => { return { text: e, value: e } })
|
||||
},
|
||||
filterChange (filters) {
|
||||
// 一次只能一列
|
||||
@@ -409,7 +560,7 @@ export default {
|
||||
const otherColumns = this.$refs.searchResultTable.columns.filter(col => col.id !== this.currentColumn.id)
|
||||
otherColumns.forEach(col => { col.filterable = false })
|
||||
} else {
|
||||
const filterLabels = ['源站', '类型', '地区', '语言']
|
||||
const filterLabels = ['源站', '语言']
|
||||
const columns = this.$refs.searchResultTable.columns.filter(col => filterLabels.includes(col.label))
|
||||
columns.forEach(col => { col.filterable = true })
|
||||
}
|
||||
@@ -417,28 +568,51 @@ export default {
|
||||
siteClick (siteName) {
|
||||
this.list = []
|
||||
this.site = this.sites.find(x => x.name === siteName)
|
||||
if (this.searchTxt.length > 0 && this.searchGroup === '站内') {
|
||||
if (this.searchGroup === '站内' && this.searchTxt) {
|
||||
this.searchEvent()
|
||||
return
|
||||
} else {
|
||||
this.searchTxt = ''
|
||||
this.show.find = false
|
||||
this.classList = []
|
||||
this.type = {}
|
||||
}
|
||||
this.showFind = false
|
||||
this.classList = []
|
||||
if (FILM_DATA_CACHE[this.site.key]) {
|
||||
this.classList = FILM_DATA_CACHE[this.site.key].classList
|
||||
this.classClick(this.type.name)
|
||||
} else {
|
||||
this.getClass().then(res => {
|
||||
this.infiniteId += 1
|
||||
this.classClick(this.classList[0].name)
|
||||
this.classList = res
|
||||
// cache classList data
|
||||
FILM_DATA_CACHE[this.site.key] = {
|
||||
classList: this.classList
|
||||
}
|
||||
this.classClick(this.type.name)
|
||||
})
|
||||
}
|
||||
},
|
||||
classClick (className) {
|
||||
this.show.classList = false
|
||||
this.list = []
|
||||
this.type = this.classList.find(x => x.name === className)
|
||||
this.getPage().then(res => {
|
||||
if (res) {
|
||||
this.infiniteHandlerCount = 0
|
||||
if (!this.type) {
|
||||
this.type = this.classList[0]
|
||||
}
|
||||
if (this.type.name.endsWith('剧')) this.selectedAreas = []
|
||||
const cacheKey = this.site.key + '@' + this.type.tid
|
||||
if (FILM_DATA_CACHE[cacheKey]) {
|
||||
this.totalpagecount = FILM_DATA_CACHE[cacheKey].totalpagecount
|
||||
this.pagecount = FILM_DATA_CACHE[cacheKey].pagecount
|
||||
this.recordcount = FILM_DATA_CACHE[cacheKey].recordcount
|
||||
this.list = FILM_DATA_CACHE[cacheKey].list
|
||||
this.areas = FILM_DATA_CACHE[cacheKey].areas
|
||||
} else {
|
||||
zy.page(this.site.key, this.type.tid).then(res => {
|
||||
this.totalpagecount = res.pagecount
|
||||
this.pagecount = res.pagecount
|
||||
this.recordcount = res.recordcount
|
||||
this.infiniteId += 1
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
getClass () {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -446,7 +620,7 @@ export default {
|
||||
// 屏蔽主分类
|
||||
const classToHide = ['电影', '电影片', '电视剧', '连续剧', '综艺', '动漫']
|
||||
zy.class(key).then(res => {
|
||||
var allClass = [{ name: '最新', tid: 0 }]
|
||||
const allClass = [{ name: '最新', tid: 0 }]
|
||||
res.class.forEach(element => {
|
||||
if (!this.setting.excludeRootClasses || !classToHide.includes(element.name)) {
|
||||
if (this.setting.excludeR18Films) {
|
||||
@@ -459,66 +633,74 @@ export default {
|
||||
}
|
||||
}
|
||||
})
|
||||
this.classList = allClass
|
||||
this.show.class = true
|
||||
this.pagecount = res.pagecount
|
||||
this.type = this.classList[0]
|
||||
resolve(true)
|
||||
resolve(allClass)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
containsR18Keywords (name) {
|
||||
var containKeyWord = false
|
||||
const containKeyWord = false
|
||||
if (!name) {
|
||||
return containKeyWord
|
||||
}
|
||||
return this.r18KeyWords.some(v => name.includes(v))
|
||||
},
|
||||
getPage () {
|
||||
return new Promise((resolve, reject) => {
|
||||
const key = this.site.key
|
||||
const type = this.type.tid
|
||||
zy.page(key, type).then(res => {
|
||||
this.pagecount = res.pagecount
|
||||
this.show.body = true
|
||||
resolve(true)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
toFlipPagecount () {
|
||||
// 似乎需要解析的网站的视频排序和其他m3u8采集站的顺序正好相反
|
||||
if (this.site.jiexiUrl) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
infiniteHandler ($state) {
|
||||
const key = this.site.key
|
||||
const type = this.type.tid
|
||||
const page = this.pagecount
|
||||
const typeTid = this.type.tid
|
||||
let page = this.pagecount
|
||||
if (this.toFlipPagecount()) {
|
||||
page = this.totalpagecount - this.pagecount + 1
|
||||
}
|
||||
this.statusText = ' '
|
||||
if (key && page < 1) { // OK资源前几类硬是去不掉
|
||||
if (key === undefined || page < 1 || page > this.totalpagecount || typeTid === undefined) {
|
||||
$state.complete()
|
||||
this.statusText = '暂无数据'
|
||||
return false
|
||||
}
|
||||
zy.list(key, page, type).then(res => {
|
||||
if (res) {
|
||||
this.pagecount -= 1
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Undefined]') {
|
||||
$state.complete()
|
||||
if (this.showToolbar && this.filteredList.length && this.filteredList.length < 10) {
|
||||
this.infiniteHandlerCount++
|
||||
}
|
||||
const interval = this.setting.view === 'picture' ? 1200 : 300
|
||||
setTimeout(() => {
|
||||
zy.list(key, page, typeTid).then(res => {
|
||||
if (res) {
|
||||
this.pagecount -= 1
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Array]') {
|
||||
// 过滤掉无链接的项
|
||||
res = res.filter(e => e.dl.dd && (e.dl.dd._t || (Object.prototype.toString.call(e.dl.dd) === '[object Array]' && e.dl.dd.some(i => i._t))))
|
||||
if (!this.toFlipPagecount()) {
|
||||
// zy.list 返回的是按时间从旧到新排列, 我门需要翻转为从新到旧
|
||||
this.list.push(...res.reverse())
|
||||
} else {
|
||||
// 如果是需要解析的视频网站,zy.list已经是按从新到旧排列
|
||||
this.list.push(...res)
|
||||
}
|
||||
} else if (type === '[object Object]') {
|
||||
if (res.dl.dd && (res.dl.dd._t || (Object.prototype.toString.call(res.dl.dd) === '[object Array]' && res.dl.dd.some(e => e._t)))) {
|
||||
this.list.push(res)
|
||||
}
|
||||
}
|
||||
$state.loaded()
|
||||
// 更新缓存数据
|
||||
const cacheKey = this.site.key + '@' + typeTid
|
||||
FILM_DATA_CACHE[cacheKey] = {
|
||||
pagecount: this.pagecount,
|
||||
recordcount: this.recordcount,
|
||||
list: this.list
|
||||
}
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
// zy.list 返回的是按时间从旧到新排列, 我门需要翻转为从新到旧
|
||||
this.list.push(...res.reverse())
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
this.list.push(res)
|
||||
}
|
||||
$state.loaded()
|
||||
} else {
|
||||
$state.complete()
|
||||
this.statusText = '暂无数据'
|
||||
}
|
||||
})
|
||||
})
|
||||
}, (this.infiniteHandlerCount <= 1 ? 0 : this.infiniteHandlerCount - 1) * interval)
|
||||
},
|
||||
detailEvent (site, e) {
|
||||
this.detail = {
|
||||
@@ -535,9 +717,6 @@ export default {
|
||||
} else {
|
||||
this.video = { key: site.key, info: { id: e.id, name: e.name, index: 0, site: site } }
|
||||
}
|
||||
zy.detail(site.key, e.id).then(detailRes => {
|
||||
this.video.detail = detailRes
|
||||
})
|
||||
this.view = 'Play'
|
||||
},
|
||||
async starEvent (site, e) {
|
||||
@@ -545,17 +724,19 @@ export default {
|
||||
if (db) {
|
||||
this.$message.info('已存在')
|
||||
} else {
|
||||
zy.detail(site.key, e.id).then(detailRes => {
|
||||
const docs = {
|
||||
key: site.key,
|
||||
ids: e.id,
|
||||
site: site,
|
||||
name: e.name,
|
||||
detail: detailRes
|
||||
}
|
||||
star.add(docs).then(res => {
|
||||
this.$message.success('收藏成功')
|
||||
})
|
||||
const cacheKey = site.key + '@' + e.id
|
||||
if (!this.DetailCache[cacheKey]) {
|
||||
this.DetailCache[cacheKey] = await zy.detail(site.key, e.id)
|
||||
}
|
||||
const docs = {
|
||||
key: site.key,
|
||||
ids: e.id,
|
||||
site: site,
|
||||
name: e.name,
|
||||
detail: this.DetailCache[cacheKey]
|
||||
}
|
||||
star.add(docs).then(res => {
|
||||
this.$message.success('收藏成功')
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -566,61 +747,20 @@ export default {
|
||||
info: e
|
||||
}
|
||||
},
|
||||
downloadEvent (site, row) {
|
||||
zy.download(site.key, row.id).then(res => {
|
||||
if (res && res.length > 0) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = res.name + '\n'
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
let m3u8List = []
|
||||
const dd = row.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
m3u8List = i._t.split('#')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m3u8List = dd._t.split('#')
|
||||
}
|
||||
let downloadUrl = row.name + '\n'
|
||||
for (const i of m3u8List) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
}
|
||||
async downloadEvent (site, row) {
|
||||
const db = await history.find({ site: site.key, ids: row.id })
|
||||
let videoFlag
|
||||
if (db) videoFlag = db.videoFlag
|
||||
zy.download(site.key, row.id, videoFlag).then(res => {
|
||||
clipboard.writeText(res.downloadUrls)
|
||||
this.$message.success(res.info)
|
||||
}).catch((err) => {
|
||||
this.$message.error(err.info)
|
||||
})
|
||||
},
|
||||
changeView () {
|
||||
if (this.view === 'Film') {
|
||||
this.getAllSites()
|
||||
if (this.setting.view === 'picture') {
|
||||
if (this.$refs.filmWaterfall) {
|
||||
this.$refs.filmWaterfall.refresh()
|
||||
}
|
||||
this.getPage().then(() => {
|
||||
this.infiniteId += 1
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
querySearch (queryString, cb) {
|
||||
var searchList = this.searchList.slice(0, -1)
|
||||
var results = queryString ? searchList.filter(this.createFilter(queryString)) : this.searchList
|
||||
const searchList = this.searchList.slice(0, -1)
|
||||
const results = queryString ? searchList.filter(this.createFilter(queryString)) : this.searchList
|
||||
// 调用 callback 返回建议列表的数据
|
||||
cb(results)
|
||||
},
|
||||
@@ -651,6 +791,9 @@ export default {
|
||||
this.searchList.push({ id: this.searchList.length + 1, keywords: '清除历史记录...' })
|
||||
})
|
||||
},
|
||||
stopSearchEvent () {
|
||||
this.searchRunning = false
|
||||
},
|
||||
searchEvent () {
|
||||
const wd = this.searchTxt
|
||||
if (this.setting.searchGroup !== this.searchGroup) {
|
||||
@@ -659,71 +802,57 @@ export default {
|
||||
}
|
||||
if (!wd) return
|
||||
this.searchID += 1
|
||||
var searchSites = []
|
||||
if (this.searchGroup === '站内') searchSites.push(this.site)
|
||||
if (this.searchGroup === '全站') searchSites = this.sites
|
||||
if (!searchSites.length) {
|
||||
searchSites = this.sites.filter(site => site.group === this.searchGroup)
|
||||
}
|
||||
this.searchContents = []
|
||||
this.pagecount = 0
|
||||
this.show.find = true
|
||||
this.show.class = false
|
||||
this.showFind = true
|
||||
this.statusText = ' '
|
||||
if (wd) {
|
||||
searchSites.forEach(site => {
|
||||
const id = this.searchID
|
||||
zy.search(site.key, wd).then(res => {
|
||||
if (id !== this.searchID) return
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Array]') {
|
||||
res.forEach(element => {
|
||||
zy.detail(site.key, element.id).then(detailRes => {
|
||||
detailRes.site = site
|
||||
if (id !== this.searchID) return
|
||||
this.searchRunning = true
|
||||
this.siteSearchCount = 0
|
||||
this.searchSites.forEach(site => {
|
||||
const id = this.searchID
|
||||
zy.search(site.key, wd).then(res => {
|
||||
if (id !== this.searchID || !this.searchRunning) return
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Array]') {
|
||||
let count = 0
|
||||
res.forEach(element => {
|
||||
zy.detail(site.key, element.id).then(detailRes => {
|
||||
if (id !== this.searchID || !this.searchRunning) return
|
||||
detailRes.site = site
|
||||
if (detailRes.dl.dd && (detailRes.dl.dd._t || (Object.prototype.toString.call(detailRes.dl.dd) === '[object Array]' && detailRes.dl.dd.some(i => i._t)))) {
|
||||
this.searchContents.push(detailRes)
|
||||
this.searchContents.sort(function (a, b) {
|
||||
return a.site.id - b.site.id
|
||||
})
|
||||
this.statusText = '暂无数据'
|
||||
})
|
||||
})
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
zy.detail(site.key, res.id).then(detailRes => {
|
||||
detailRes.site = site
|
||||
if (id !== this.searchID) return
|
||||
}
|
||||
}).finally(() => { count++; if (count === res.length) { this.siteSearchCount++; this.statusText = '暂无数据' } })
|
||||
})
|
||||
} else if (type === '[object Object]') {
|
||||
zy.detail(site.key, res.id).then(detailRes => {
|
||||
if (id !== this.searchID || !this.searchRunning) return
|
||||
detailRes.site = site
|
||||
if (detailRes.dl.dd && (detailRes.dl.dd._t || (Object.prototype.toString.call(detailRes.dl.dd) === '[object Array]' && detailRes.dl.dd.some(i => i._t)))) {
|
||||
this.searchContents.push(detailRes)
|
||||
this.searchContents.sort(function (a, b) {
|
||||
return a.site.id - b.site.id
|
||||
})
|
||||
this.statusText = '暂无数据'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}).finally(() => { this.siteSearchCount++; this.statusText = '暂无数据' })
|
||||
} else if (res === undefined) {
|
||||
this.siteSearchCount++
|
||||
this.statusText = '暂无数据'
|
||||
if (this.searchGroup === '站内') this.$message.info('没有查询到数据!')
|
||||
}
|
||||
}).catch(() => { this.siteSearchCount++; if (this.searchGroup === '站内') this.$message.error('本次查询状态异常,未获取到数据!') })
|
||||
})
|
||||
},
|
||||
searchAndRecord () {
|
||||
this.addSearchRecord()
|
||||
this.searchEvent()
|
||||
},
|
||||
searchChangeEvent () {
|
||||
if (this.searchTxt.length >= 1) {
|
||||
this.show.class = false
|
||||
} else {
|
||||
this.show.class = true
|
||||
if (!this.searchTxt.length) {
|
||||
this.searchContents = []
|
||||
this.show.find = false
|
||||
if (this.setting.view === 'picture' && this.$refs.filmWaterfall) {
|
||||
this.$refs.filmWaterfall.refresh()
|
||||
} else {
|
||||
this.getClass().then(res => {
|
||||
if (res) {
|
||||
this.infiniteId += 1
|
||||
}
|
||||
})
|
||||
}
|
||||
this.showFind = false
|
||||
}
|
||||
},
|
||||
getAllSites () {
|
||||
@@ -746,28 +875,20 @@ export default {
|
||||
this.searchGroup = this.setting.searchGroup
|
||||
if (this.searchGroup === undefined) setting.find().then(res => { this.searchGroup = res.searchGroup })
|
||||
})
|
||||
},
|
||||
getSearchViewMode () {
|
||||
setting.find().then(res => {
|
||||
this.searchViewMode = res.searchViewMode === undefined ? 'picture' : res.searchViewMode
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getAllSites()
|
||||
this.getSearchHistory()
|
||||
this.getSearchViewMode()
|
||||
},
|
||||
mounted () {
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.$refs.filmWaterfall && this.view === 'Film') {
|
||||
this.$refs.filmWaterfall.resize()
|
||||
this.$refs.filmWaterfall.refresh()
|
||||
setTimeout(() => {
|
||||
this.$refs.filmWaterfall.refresh()
|
||||
}, 500)
|
||||
}
|
||||
}, false)
|
||||
addEventListener('resize', () => {
|
||||
setTimeout(() => {
|
||||
this.showTableLastColumn = window.outerWidth >= 1200
|
||||
if (this.$refs.filmWaterfall) this.$refs.filmWaterfall.resize()
|
||||
if (this.$refs.filmSearchWaterfall) this.$refs.filmSearchWaterfall.resize()
|
||||
}, 500)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
<template>
|
||||
<div class="listpage" id="history">
|
||||
<div class="listpage-header" id="history-header">
|
||||
<el-switch v-model="viewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
|
||||
<el-button @click.stop="exportHistory" icon="el-icon-upload2">导出</el-button>
|
||||
<el-button @click.stop="importHistory" icon="el-icon-download">导入</el-button>
|
||||
<el-button @click.stop="clearAllHistory" icon="el-icon-delete-solid">清空</el-button>
|
||||
<el-switch v-model="setting.historyViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
|
||||
<el-button @click.stop="exportHistory" icon="el-icon-upload2" title="导出全部,自动添加扩展名">导出</el-button>
|
||||
<el-button @click.stop="importHistory" icon="el-icon-download" title="支持同时导入多个文件">导入</el-button>
|
||||
<el-button @click.stop="removeSelectedItems" icon="el-icon-delete-solid">{{ multipleSelection.length === 0 ? "清空" : "删除所选" }}</el-button>
|
||||
</div>
|
||||
<div class="listpage-body" id="history-body">
|
||||
<div class="show-table" id="history-table" v-show="viewMode === 'table'">
|
||||
<el-table size="mini" fit height="100%" :data="history" row-key="id" @row-click="detailEvent">
|
||||
<div class="show-table" id="history-table" v-if="setting.historyViewMode === 'table'">
|
||||
<el-table size="mini" fit height="100%"
|
||||
:data="history"
|
||||
row-key="id"
|
||||
ref="historyTable"
|
||||
@select="selectionCellClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
@row-click="detailEvent">
|
||||
<el-table-column
|
||||
type="selection">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="片名">
|
||||
@@ -26,8 +35,8 @@
|
||||
width="180"
|
||||
label="观看至">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.detail && scope.row.detail.m3u8List && scope.row.detail.m3u8List.length > 1">
|
||||
第{{ scope.row.index + 1 }}集(共{{scope.row.detail.m3u8List.length}}集)
|
||||
<span v-if="scope.row.detail && scope.row.detail.fullList[0].list && scope.row.detail.fullList[0].list.length > 1">
|
||||
第{{ scope.row.index + 1 }}集(共{{scope.row.detail.fullList[0].list.length}}集)
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -36,6 +45,7 @@
|
||||
label="时间进度">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.time && scope.row.duration">{{fmtMSS(scope.row.time.toFixed(0))}}/{{fmtMSS(scope.row.duration.toFixed(0))}}</span>
|
||||
<span v-if="scope.row.onlinePlay">在线解析</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -52,7 +62,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-picture" id="star-picture" v-show="viewMode === 'picture'">
|
||||
<div class="show-picture" id="star-picture" v-if="setting.historyViewMode === 'picture'">
|
||||
<Waterfall ref="historyWaterfall" :list="history" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
@@ -85,8 +95,9 @@
|
||||
<span v-if="props.data.time && props.data.duration">
|
||||
{{fmtMSS(props.data.time.toFixed(0))}}/{{fmtMSS(props.data.duration.toFixed(0))}}
|
||||
</span>
|
||||
<span v-if="props.data.detail && props.data.detail.m3u8List !== undefined && props.data.detail.m3u8List.length > 1">
|
||||
第{{ props.data.index + 1 }}集(共{{props.data.detail.m3u8List.length}}集)
|
||||
<span v-if="props.data.onlinePlay">在线解析</span>
|
||||
<span v-if="props.data.detail && props.data.detail.fullList[0].list !== undefined && props.data.detail.fullList[0].list.length > 1">
|
||||
第{{ props.data.index + 1 }}集(共{{props.data.detail.fullList[0].list.length}}集)
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,7 +111,6 @@
|
||||
import { mapMutations } from 'vuex'
|
||||
import { history, sites, setting } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Sortable from 'sortablejs'
|
||||
import { remote } from 'electron'
|
||||
import fs from 'fs'
|
||||
import Waterfall from 'vue-waterfall-plugin'
|
||||
@@ -112,7 +122,10 @@ export default {
|
||||
return {
|
||||
history: [],
|
||||
sites: [],
|
||||
viewMode: setting.historyViewMode
|
||||
shiftDown: false,
|
||||
selectionBegin: '',
|
||||
selectionEnd: '',
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -150,22 +163,57 @@ export default {
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
setting: {
|
||||
get () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
this.getAllhistory()
|
||||
this.getAllsites()
|
||||
if (this.$refs.historyWaterfall) {
|
||||
this.$refs.historyWaterfall.refresh()
|
||||
if (this.view === 'History') {
|
||||
this.getAllhistory()
|
||||
this.getAllsites()
|
||||
if (this.setting.historyViewMode === 'table') this.showShiftPrompt()
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
|
||||
fmtMSS (s) {
|
||||
return (s - (s %= 60)) / 60 + (s > 9 ? ':' : ':0') + s
|
||||
},
|
||||
selectionCellClick (selection, row) { // 历史id与顺序刚好相反,大的反而在前面
|
||||
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
|
||||
this.selectionEnd = row.id
|
||||
const start = this.history.findIndex(e => e.id === Math.max(this.selectionBegin, this.selectionEnd))
|
||||
const end = this.history.findIndex(e => e.id === Math.min(this.selectionBegin, this.selectionEnd))
|
||||
const selections = this.history.slice(start, end + 1)
|
||||
this.$nextTick(() => {
|
||||
selections.forEach(e => this.$refs.historyTable.toggleRowSelection(e, true))
|
||||
})
|
||||
this.selectionBegin = this.selectionEnd = ''
|
||||
return
|
||||
}
|
||||
if (selection.includes(row)) {
|
||||
this.selectionBegin = row.id
|
||||
} else {
|
||||
this.selectionBegin = ''
|
||||
}
|
||||
},
|
||||
handleSelectionChange (rows) {
|
||||
this.multipleSelection = rows
|
||||
},
|
||||
removeSelectedItems () {
|
||||
if (!this.multipleSelection.length) this.multipleSelection = this.history
|
||||
this.multipleSelection.forEach(e => history.remove(e.id))
|
||||
this.getAllhistory()
|
||||
this.updateDatabase()
|
||||
},
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
@@ -183,58 +231,21 @@ export default {
|
||||
} else {
|
||||
this.video = { key: e.site, info: { id: e.ids, name: e.name, index: 0 } }
|
||||
}
|
||||
zy.detail(e.site, e.ids).then(detailRes => {
|
||||
this.video.detail = detailRes
|
||||
})
|
||||
this.view = 'Play'
|
||||
},
|
||||
shareEvent (e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.site,
|
||||
info: e
|
||||
info: e.detail
|
||||
}
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.site, e.ids).then(res => {
|
||||
if (res && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
var m3u8List = {}
|
||||
zy.detail(e.site, e.ids).then(res => {
|
||||
const dd = res.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
m3u8List = i._t.split('#')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m3u8List = dd._t.split('#')
|
||||
}
|
||||
const list = [...m3u8List]
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
})
|
||||
}
|
||||
zy.download(e.site, e.ids, e.videoFlag).then(res => {
|
||||
clipboard.writeText(res.downloadUrls)
|
||||
this.$message.success(res.info)
|
||||
}).catch((err) => {
|
||||
this.$message.error(err.info)
|
||||
})
|
||||
},
|
||||
exportHistory () {
|
||||
@@ -248,6 +259,7 @@ export default {
|
||||
}
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
if (!result.filePath.endsWith('.json')) result.filePath += '.json'
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
this.$message.success('已保存成功')
|
||||
}
|
||||
@@ -265,7 +277,7 @@ export default {
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
result.filePaths.forEach(file => {
|
||||
var str = fs.readFileSync(file)
|
||||
const str = fs.readFileSync(file)
|
||||
const json = JSON.parse(str)
|
||||
history.bulkAdd(json).then(res => {
|
||||
this.$message.success('导入成功')
|
||||
@@ -275,11 +287,6 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
clearAllHistory () {
|
||||
history.clear().then(res => {
|
||||
this.history = []
|
||||
})
|
||||
},
|
||||
getAllhistory () {
|
||||
history.all().then(res => {
|
||||
this.history = res.reverse()
|
||||
@@ -291,7 +298,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getSiteName (key) {
|
||||
var site = this.sites.find(e => e.key === key)
|
||||
const site = this.sites.find(e => e.key === key)
|
||||
if (site) {
|
||||
return site.name
|
||||
}
|
||||
@@ -303,54 +310,48 @@ export default {
|
||||
this.$message.warning('删除历史记录失败, 错误信息: ' + err)
|
||||
})
|
||||
},
|
||||
updateDatabase (data) {
|
||||
updateDatabase () {
|
||||
history.clear().then(res => {
|
||||
var id = length
|
||||
data.forEach(ele => {
|
||||
let id = length
|
||||
this.history.forEach(ele => {
|
||||
ele.id = id
|
||||
id -= 1
|
||||
history.add(ele)
|
||||
})
|
||||
})
|
||||
},
|
||||
rowDrop () {
|
||||
const tbody = document.getElementById('history-table').querySelector('.el-table__body-wrapper tbody')
|
||||
const _this = this
|
||||
Sortable.create(tbody, {
|
||||
onEnd ({ newIndex, oldIndex }) {
|
||||
const currRow = _this.history.splice(oldIndex, 1)[0]
|
||||
_this.history.splice(newIndex, 0, currRow)
|
||||
_this.updateDatabase(_this.history)
|
||||
}
|
||||
})
|
||||
},
|
||||
getViewMode () {
|
||||
setting.find().then(res => {
|
||||
this.viewMode = res.historyViewMode
|
||||
})
|
||||
},
|
||||
updateViewMode () {
|
||||
if (this.setting.historyViewMode === 'table') {
|
||||
this.showShiftPrompt()
|
||||
} else {
|
||||
setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.refresh() }, 700)
|
||||
}
|
||||
setting.find().then(res => {
|
||||
res.historyViewMode = this.viewMode
|
||||
res.historyViewMode = this.setting.historyViewMode
|
||||
setting.update(res)
|
||||
})
|
||||
},
|
||||
showShiftPrompt () {
|
||||
if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5
|
||||
if (this.setting.shiftTooltipLimitTimes) {
|
||||
this.$message.info('多选时支持shift快捷键')
|
||||
this.setting.shiftTooltipLimitTimes--
|
||||
setting.find().then(res => {
|
||||
res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.rowDrop()
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.$refs.historyWaterfall && this.view === 'History') {
|
||||
this.$refs.historyWaterfall.resize()
|
||||
this.$refs.historyWaterfall.refresh()
|
||||
setTimeout(() => {
|
||||
this.$refs.historyWaterfall.refresh()
|
||||
}, 500)
|
||||
}
|
||||
}, false)
|
||||
addEventListener('keydown', code => { if (code.keyCode === 16) this.shiftDown = true })
|
||||
addEventListener('keyup', code => { if (code.keyCode === 16) this.shiftDown = false })
|
||||
addEventListener('resize', () => {
|
||||
setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.resize() }, 500)
|
||||
})
|
||||
},
|
||||
created () {
|
||||
this.getAllhistory()
|
||||
this.getViewMode()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
<div class="listpage" id="iptv">
|
||||
<div class="listpage-header" id="iptv-header" v-show="!enableBatchEdit">
|
||||
<el-switch v-model="enableBatchEdit" active-text="批处理及频道调整"></el-switch>
|
||||
<el-button @click.stop="exportChannels" icon="el-icon-upload2" >导出</el-button>
|
||||
<el-button @click.stop="importChannels" icon="el-icon-download">导入</el-button>
|
||||
<el-button @click="checkAllChannels" icon="el-icon-refresh" :loading="checkAllChannelsLoading">检测{{ this.checkAllChannelsLoading ? this.checkProgress + '/' + this.iptvList.length : '' }}</el-button>
|
||||
<el-button @click.stop="exportChannels" icon="el-icon-upload2" title="导出m3u时必须手动添加扩展名,要保存频道配置信息请选择json格式">导出</el-button>
|
||||
<el-button @click.stop="importChannels" icon="el-icon-download" title='支持同时导入多个文件,导入m3u时网址可带参数、含有"#"号时自动分割'>导入</el-button>
|
||||
<el-button @click="checkAllChannels" icon="el-icon-refresh" :loading="checkAllChannelsLoading" title="可在后台运行">检测{{ this.checkAllChannelsLoading ? this.checkProgress + '/' + this.iptvList.length : '' }}</el-button>
|
||||
<el-button @click.stop="resetChannelsEvent" icon="el-icon-refresh-left">重置</el-button>
|
||||
</div>
|
||||
<div class="listpage-header" id="iptv-header" v-show="enableBatchEdit">
|
||||
<el-switch v-model="enableBatchEdit" active-text="批处理及频道调整"></el-switch>
|
||||
<el-input placeholder="新组名/新频道名" v-model="inputContent"></el-input>
|
||||
<el-switch v-model="batchIsActive" active-text="启用"></el-switch>
|
||||
<el-button type="primary" icon="el-icon-edit" @click.stop="saveBatchEdit">保存分组与开关状态</el-button>
|
||||
<el-button type="primary" icon="el-icon-film" @click.stop="mergeChannel">{{ this.multipleSelection.length === 1 ? '频道重命名' : '频道合并' }}</el-button>
|
||||
<el-button type="primary" icon="el-icon-edit" @click.stop="saveBatchEdit" title="输入框组名为空时仅保存开关状态">保存分组与开关状态</el-button>
|
||||
<el-button type="primary" icon="el-icon-film" @click.stop="mergeChannel" title="勾选单个时可重命名频道">{{ this.multipleSelection.length === 1 ? '频道重命名' : '频道合并' }}</el-button>
|
||||
<el-button @click.stop="removeSelectedChannels" icon="el-icon-delete-solid">删除</el-button>
|
||||
</div>
|
||||
<div class="listpage-body" id="iptv-table">
|
||||
@@ -25,7 +25,6 @@
|
||||
:load="(row, treeNode, resolve) => resolve(row.channels)"
|
||||
:tree-props="{hasChildren: 'hasChildren'}"
|
||||
@expand-change="expandChange"
|
||||
@row-click="playEvent"
|
||||
@select="selectionCellClick"
|
||||
@selection-change="handleSelectionChange"
|
||||
@sort-change="handleSortChange">
|
||||
@@ -95,6 +94,7 @@
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.stop="moveToTopEvent(scope.row)" type="text" v-if="scope.row.channels">置顶</el-button>
|
||||
<el-button @click.stop="playEvent(scope.row)" type="text">播放</el-button>
|
||||
<!-- 检测时先强制批量检测一遍,如果不强制直接单个检测时第一次不会显示“检测中”-->
|
||||
<el-button size="mini" v-if="iptvList.every(channel => channel.status)" v-show="!checkAllChannelsLoading" @click.stop="checkChannel(scope.row)" type="text">检测</el-button>
|
||||
<el-button @click.stop="removeEvent(scope.row)" type="text">删除</el-button>
|
||||
@@ -107,7 +107,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { iptv, iptvSearch, channelList } from '../lib/dexie'
|
||||
import { iptv, channelList, setting } from '../lib/dexie'
|
||||
import { iptv as defaultChannels } from '../lib/dexie/initData'
|
||||
import zy from '../lib/site/tools'
|
||||
import { remote } from 'electron'
|
||||
@@ -120,7 +120,6 @@ export default {
|
||||
iptvList: [],
|
||||
channelList: [],
|
||||
searchTxt: '',
|
||||
searchRecordList: [],
|
||||
enableBatchEdit: false,
|
||||
inputContent: '',
|
||||
batchIsActive: true,
|
||||
@@ -132,10 +131,7 @@ export default {
|
||||
checkAllChannelsLoading: false,
|
||||
checkProgress: 0,
|
||||
stopFlag: false,
|
||||
sortableTable: '',
|
||||
show: {
|
||||
search: false
|
||||
}
|
||||
sortableTable: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -147,8 +143,13 @@ export default {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
setting () {
|
||||
return this.$store.getters.getSetting
|
||||
setting: {
|
||||
get () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
},
|
||||
video: {
|
||||
get () {
|
||||
@@ -167,9 +168,9 @@ export default {
|
||||
},
|
||||
getFilters () {
|
||||
const groups = [...new Set(this.channelList.map(iptv => iptv.group))]
|
||||
var filters = []
|
||||
const filters = []
|
||||
groups.forEach(g => {
|
||||
var doc = {
|
||||
const doc = {
|
||||
text: g,
|
||||
value: g
|
||||
}
|
||||
@@ -179,11 +180,6 @@ export default {
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
if (this.view === 'IPTV') {
|
||||
this.getChannelList()
|
||||
}
|
||||
},
|
||||
enableBatchEdit () {
|
||||
if (this.checkAllChannelsLoading) {
|
||||
this.$message.info('正在检测, 请勿操作.')
|
||||
@@ -191,6 +187,15 @@ export default {
|
||||
return
|
||||
}
|
||||
if (this.enableBatchEdit) {
|
||||
if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5
|
||||
if (this.setting.shiftTooltipLimitTimes) {
|
||||
this.$message.info('多选时支持shift快捷键')
|
||||
this.setting.shiftTooltipLimitTimes--
|
||||
setting.find().then(res => {
|
||||
res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.expandedRows.forEach(e => this.$refs.iptvTable.toggleRowExpansion(e, false))
|
||||
})
|
||||
@@ -201,7 +206,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
|
||||
sortByLocaleCompare (a, b) {
|
||||
return a.localeCompare(b, 'zh')
|
||||
},
|
||||
@@ -252,7 +257,7 @@ export default {
|
||||
},
|
||||
mergeChannel () {
|
||||
if (this.inputContent && this.multipleSelection.length) {
|
||||
var channels = []
|
||||
let channels = []
|
||||
const id = this.multipleSelection[0].id
|
||||
this.multipleSelection.forEach(ele => {
|
||||
channels = channels.concat(ele.channels)
|
||||
@@ -293,6 +298,7 @@ export default {
|
||||
ele.channels.splice(ele.channels.findIndex(e => e.id === row.id), 1)
|
||||
channelList.remove(row.channelID)
|
||||
if (ele.channels.length) {
|
||||
if (ele.channels.length === 1) ele.hasChildren = false
|
||||
channelList.add(ele)
|
||||
this.$set(this.$refs.iptvTable.store.states.lazyTreeNodeMap, ele.id, ele.channels)
|
||||
}
|
||||
@@ -314,13 +320,14 @@ export default {
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
if (result.filePath.endsWith('m3u')) {
|
||||
var writer = require('m3u').extendedWriter()
|
||||
const writer = require('m3u').extendedWriter()
|
||||
this.iptvList.forEach(e => {
|
||||
writer.file(e.url, -1, e.name)
|
||||
})
|
||||
fs.writeFileSync(result.filePath, writer.toString())
|
||||
this.$message.success('已保存成功')
|
||||
} else {
|
||||
if (!result.filePath.endsWith('.json')) result.filePath += '.json'
|
||||
const arr = [...this.channelList] // 要保存channelList必须选json
|
||||
const str = JSON.stringify(arr, null, 2)
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
@@ -348,21 +355,26 @@ export default {
|
||||
result.filePaths.forEach(file => {
|
||||
if (file.endsWith('m3u') || file.endsWith('m3u8')) {
|
||||
const docs = []
|
||||
const URL = require('url')
|
||||
let id = this.channelList.length ? this.channelList.slice(-1)[0].id + 1 : 1
|
||||
const parser = require('iptv-playlist-parser')
|
||||
const playlist = fs.readFileSync(file, { encoding: 'utf-8' })
|
||||
const result = parser.parse(playlist)
|
||||
const supportFormats = /\.(m3u8|flv)$/
|
||||
result.items.forEach(ele => {
|
||||
if (ele.name && ele.url && ele.url.endsWith('.m3u8')) {
|
||||
var doc = {
|
||||
id: id,
|
||||
name: ele.name,
|
||||
url: ele.url,
|
||||
isActive: true
|
||||
const urls = ele.url.split('#').filter(e => e.startsWith('http')) // 网址带#时自动分割
|
||||
urls.forEach(url => {
|
||||
if (ele.name && url && (supportFormats.test(url) || supportFormats.test(new URL.URL(url).pathname))) { // 网址可能带参数
|
||||
const doc = {
|
||||
id: id,
|
||||
name: ele.name,
|
||||
url: url,
|
||||
isActive: true
|
||||
}
|
||||
id += 1
|
||||
docs.push(doc)
|
||||
}
|
||||
id += 1
|
||||
docs.push(doc)
|
||||
}
|
||||
})
|
||||
})
|
||||
// 获取url不重复的列表
|
||||
const uniqueList = [...new Map(docs.map(item => [item.url, item])).values()]
|
||||
@@ -393,14 +405,12 @@ export default {
|
||||
})
|
||||
},
|
||||
determineGroup (name) {
|
||||
if (name.toLowerCase().includes('cctv') && (name.includes('蓝光') || name.includes('高清'))) {
|
||||
return '央视高清'
|
||||
} else if (name.toLowerCase().includes('cctv')) {
|
||||
if (name.toLowerCase().includes('cctv') || name.toLowerCase().includes('cgtn')) {
|
||||
return '央视'
|
||||
} else if (name.includes('香港') || name.includes('澳门') || name.includes('台湾') || name.includes('凤凰') || name.includes('翡翠')) {
|
||||
return '港澳台'
|
||||
} else if (name.includes('卫视')) {
|
||||
return '卫视'
|
||||
} else if (name.includes('香港') || name.includes('澳门') || name.includes('台湾') || name.includes('凤凰')) {
|
||||
return '港澳台'
|
||||
} else if (name.includes('高清') || name.includes('蓝光') || name.includes('1080P')) {
|
||||
return '高清'
|
||||
} else {
|
||||
@@ -429,12 +439,12 @@ export default {
|
||||
res = res.filter(o => !this.iptvList.find(e => o.url === e.url))
|
||||
const resClone = JSON.parse(JSON.stringify(res))
|
||||
const uniqueChannelName = {}
|
||||
for (var i = 0; i < resClone.length; i++) {
|
||||
var channelName = resClone[i].name.trim().replace(/[- ]?(1080p|蓝光|超清|高清|标清|hd|cq|4k)(\d{1,2})?$/i, '')
|
||||
for (let i = 0; i < resClone.length; i++) {
|
||||
let channelName = resClone[i].name.trim().replace(/[- ]?(1080p|蓝光|超清|高清|标清|hd|cq|4k)(\d{1,2})?$/i, '')
|
||||
if (channelName.match(/cctv/i)) channelName = channelName.replace('-', '')
|
||||
if (Object.keys(uniqueChannelName).some(name => channelName.match(new RegExp(`${name}(1080p|4k|(?!\\d))`, 'i')))) continue // 避免重复
|
||||
const matchRule = new RegExp(`${channelName}(1080p|4k|(?!\\d))`, 'i')
|
||||
for (var j = i; j < resClone.length; j++) {
|
||||
for (let j = i; j < resClone.length; j++) {
|
||||
if (resClone[j].name.match(/cctv/i)) {
|
||||
resClone[j].name = resClone[j].name.replace('-', '')
|
||||
}
|
||||
@@ -468,8 +478,8 @@ export default {
|
||||
iptv.clear() // iptv默认清空状态
|
||||
})
|
||||
},
|
||||
getChannelList () {
|
||||
channelList.all().then(res => {
|
||||
async getChannelList () {
|
||||
await channelList.all().then(res => {
|
||||
this.channelList = res
|
||||
this.getIptvList()
|
||||
})
|
||||
@@ -477,28 +487,6 @@ export default {
|
||||
getIptvList () {
|
||||
this.iptvList = this.channelList.reduce((result, item) => { item.channels.forEach(e => { e.channelID = item.id }); return result.concat(item.channels) }, [])
|
||||
},
|
||||
getSearchRecordList () {
|
||||
iptvSearch.all().then(res => {
|
||||
this.searchRecordList = res.reverse()
|
||||
})
|
||||
},
|
||||
clearSearch () {
|
||||
iptvSearch.clear().then(res => {
|
||||
this.getSearchRecordList()
|
||||
})
|
||||
},
|
||||
searchEvent (wd) {
|
||||
this.searchTxt = wd
|
||||
this.show.search = false
|
||||
if (wd) {
|
||||
iptvSearch.find({ keywords: wd }).then(res => {
|
||||
if (!res) {
|
||||
iptvSearch.add({ keywords: wd })
|
||||
}
|
||||
this.getSearchRecordList()
|
||||
})
|
||||
}
|
||||
},
|
||||
moveToTopEvent (row) {
|
||||
if (this.checkAllChannelsLoading) {
|
||||
this.$message.info('正在检测, 请勿操作.')
|
||||
@@ -526,7 +514,7 @@ export default {
|
||||
})
|
||||
},
|
||||
resetId (channelList) {
|
||||
var id = 1
|
||||
let id = 1
|
||||
channelList.forEach(ele => {
|
||||
ele.id = id
|
||||
id += 1
|
||||
@@ -537,6 +525,11 @@ export default {
|
||||
ele.channels.forEach((e, index) => { e.id = embedChannelID + index }) // 为避免混杂,给内置iptv重起id
|
||||
if (prefer) ele.prefer = prefer.id
|
||||
})
|
||||
if (ele.channels.length === 1) {
|
||||
ele.hasChildren = false
|
||||
} else {
|
||||
ele.hasChildren = true
|
||||
}
|
||||
})
|
||||
},
|
||||
rowDrop () {
|
||||
@@ -562,25 +555,28 @@ export default {
|
||||
channelList.remove(row.channelID)
|
||||
channelList.add(ele)
|
||||
} else {
|
||||
if (row.channels.length === 1) row.channels[0].isActive = row.isActive
|
||||
channelList.remove(row.id)
|
||||
channelList.add(row)
|
||||
}
|
||||
},
|
||||
async checkAllChannels () {
|
||||
if (this.checkAllChannelsLoading) return
|
||||
this.checkAllChannelsLoading = true
|
||||
this.stopFlag = false
|
||||
this.checkProgress = 0
|
||||
this.channelList.forEach(e => { e.status = ' '; e.hasCheckedNum = 0 })
|
||||
this.channelList.filter(e => e.channels.length).forEach(e => { e.status = ' '; e.hasCheckedNum = 0 })
|
||||
const uncheckedList = this.iptvList.filter(e => e.status === undefined || e.status === ' ') // 未检测过的优先
|
||||
const other = this.iptvList.filter(e => !uncheckedList.includes(e))
|
||||
await this.checkChannelsBySite(uncheckedList)
|
||||
await this.checkChannelsBySite(other).then(res => {
|
||||
this.checkAllChannelsLoading = false
|
||||
this.updateChannelList()
|
||||
this.getChannelList()
|
||||
if (!this.stopFlag) this.$message.success('直播频道批量检测已完成!')
|
||||
})
|
||||
},
|
||||
async checkChannelsBySite (channels) {
|
||||
var siteList = {}
|
||||
const siteList = {}
|
||||
channels.forEach(channel => {
|
||||
const site = channel.url.split('/')[2]
|
||||
if (siteList[site]) {
|
||||
@@ -597,35 +593,49 @@ export default {
|
||||
await this.checkSingleChannel(c)
|
||||
}
|
||||
},
|
||||
async checkSingleChannel (channel) {
|
||||
channel.status = ' '
|
||||
const ele = this.channelList.find(e => e.id === channel.channelID)
|
||||
async checkSingleChannel (channel, force = false) {
|
||||
if (this.stopFlag) {
|
||||
this.checkProgress += 1
|
||||
return channel.status
|
||||
return
|
||||
}
|
||||
const ele = this.channelList.find(e => e.id === channel.channelID)
|
||||
if (!force && this.setting.allowPassWhenIptvCheck && (!channel.isActive || !ele.isActive)) {
|
||||
if (!ele.isActive) {
|
||||
ele.status = '跳过'
|
||||
} else if (!channel.isActive) {
|
||||
channel.status = '跳过'
|
||||
}
|
||||
} else {
|
||||
channel.status = ' '
|
||||
const flag = await zy.checkChannel(channel.url)
|
||||
if (flag) {
|
||||
channel.status = '可用'
|
||||
} else {
|
||||
channel.status = '失效'
|
||||
channel.isActive = false
|
||||
if (this.setting.autocleanWhenIptvCheck) {
|
||||
ele.channels.splice(ele.channels.findIndex(e => e.id === channel.id), 1)
|
||||
ele.hasCheckedNum--
|
||||
}
|
||||
}
|
||||
}
|
||||
const flag = await zy.checkChannel(channel.url)
|
||||
this.checkProgress += 1
|
||||
ele.hasCheckedNum++
|
||||
if (flag) {
|
||||
channel.status = '可用'
|
||||
} else {
|
||||
channel.status = '失效'
|
||||
channel.isActive = false
|
||||
}
|
||||
if (ele.hasCheckedNum === ele.channels.length) {
|
||||
ele.status = ele.channels.some(channel => channel.status === '可用') ? '可用' : '失效'
|
||||
if (ele.status === '失效') ele.isActive = false
|
||||
if (ele.status === ' ') {
|
||||
ele.status = ele.channels.some(channel => channel.status === '可用') ? '可用' : '失效'
|
||||
if (ele.status === '失效') ele.isActive = false
|
||||
}
|
||||
channelList.remove(channel.channelID)
|
||||
channelList.add(ele)
|
||||
if (ele.channels.length === 1) ele.hasChildren = false
|
||||
if (ele.channels.length) channelList.add(ele)
|
||||
}
|
||||
return channel.status
|
||||
},
|
||||
async checkChannel (row) {
|
||||
if (row.channels) {
|
||||
row.status = ' '
|
||||
row.hasCheckedNum = 0
|
||||
row.channels.forEach(e => this.checkSingleChannel(e))
|
||||
row.channels.forEach(e => this.checkSingleChannel(e, true))
|
||||
} else {
|
||||
this.checkSingleChannel(row)
|
||||
}
|
||||
@@ -635,10 +645,9 @@ export default {
|
||||
addEventListener('keydown', code => { if (code.keyCode === 16) this.shiftDown = true })
|
||||
addEventListener('keyup', code => { if (code.keyCode === 16) this.shiftDown = false })
|
||||
},
|
||||
created () {
|
||||
this.getChannelList()
|
||||
async created () {
|
||||
await this.getChannelList()
|
||||
if (!this.channelList.length) this.resetChannelsEvent()
|
||||
this.getSearchRecordList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,360 +1,322 @@
|
||||
<template>
|
||||
<div class="listpage" id="recommendataions">
|
||||
<div class="listpage-header" id="recommendataions-header">
|
||||
<el-switch v-model="viewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
|
||||
<el-button type="text">视频数:{{ recommendations.length }}</el-button>
|
||||
<el-select v-model="selectedAreas" size="small" multiple collapse-tags placeholder="地区" popper-class="popper" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in areas"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="selectedTypes" size="small" multiple collapse-tags placeholder="类型" popper-class="popper" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in types"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in sortKeywords"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button :loading="loading" @click.stop="updateEvent" icon="el-icon-refresh">更新推荐</el-button>
|
||||
</div>
|
||||
<div class="listpage-body" id="recommendataions-body" >
|
||||
<div class="show-table" id="star-table" v-show="viewMode === 'table'">
|
||||
<el-table size="mini" fit height="100%" row-key="id"
|
||||
ref="recommendataionsTable"
|
||||
:data="filteredRecommendations"
|
||||
@row-click="detailEvent">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="片名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="detail.area"
|
||||
label="地区"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="detail.type"
|
||||
label="类型"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="detail.year"
|
||||
label="上映"
|
||||
width="100"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="filteredRecommendations.some(e => e.rate)"
|
||||
prop="rate"
|
||||
align="center"
|
||||
width="100"
|
||||
label="豆瓣评分">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="filteredRecommendations.some(e => e.detail.note)"
|
||||
prop="detail.note"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
header-align="center"
|
||||
align="right"
|
||||
width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.stop="playEvent(scope.row)" type="text">播放</el-button>
|
||||
<el-button @click.stop="shareEvent(scope.row)" type="text">分享</el-button>
|
||||
<el-button @click.stop="downloadEvent(scope.row)" type="text">下载</el-button>
|
||||
<el-button @click.stop="deleteEvent(scope.row)" type="text">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-picture" id="star-picture" v-show="viewMode === 'picture'">
|
||||
<Waterfall ref="recommendataionsWaterfall" :list="filteredRecommendations" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
rowPerView: 4,
|
||||
},
|
||||
800: { //当屏幕宽度小于等于800
|
||||
rowPerView: 3,
|
||||
},
|
||||
500: { //当屏幕宽度小于等于500
|
||||
rowPerView: 2,
|
||||
}
|
||||
}"
|
||||
animationDuration="0.5s"
|
||||
backgroundColor="rgba(0, 0, 0, 0)">
|
||||
<template slot="item" slot-scope="props">
|
||||
<div class="card">
|
||||
<div class="img">
|
||||
<div class="rate" v-if="props.data.rate && props.data.rate !== '暂无评分'">
|
||||
<span>{{props.data.rate}}分</span>
|
||||
</div>
|
||||
<img style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.recommendataionsWaterfall.refresh()" @click="detailEvent(props.data)">
|
||||
<div class="operate">
|
||||
<div class="operate-wrap">
|
||||
<span class="o-play" @click="playEvent(props.data)">播放</span>
|
||||
<span class="o-share" @click="shareEvent(props.data)">分享</span>
|
||||
<span class="o-star" @click="downloadEvent(props.data)">下载</span>
|
||||
<span class="o-star" @click="deleteEvent(props.data)">删除</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
|
||||
<div class="info">
|
||||
<span>{{props.data.detail.area}}</span>
|
||||
<span>{{props.data.detail.year}}</span>
|
||||
<span>{{props.data.detail.note}}</span>
|
||||
<span>{{props.data.detail.type}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Waterfall>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { history, recommendation, setting } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Waterfall from 'vue-waterfall-plugin'
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
name: 'recommendations',
|
||||
data () {
|
||||
return {
|
||||
recommendations: [],
|
||||
sites: [],
|
||||
viewMode: 'picture',
|
||||
loading: false,
|
||||
types: [],
|
||||
selectedTypes: [],
|
||||
areas: [],
|
||||
selectedAreas: [],
|
||||
sortKeyword: '',
|
||||
sortKeywords: ['上映', '评分', '默认']
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Waterfall
|
||||
},
|
||||
computed: {
|
||||
view: {
|
||||
get () {
|
||||
return this.$store.getters.getView
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
video: {
|
||||
get () {
|
||||
return this.$store.getters.getVideo
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIDEO(val)
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
get () {
|
||||
return this.$store.getters.getDetail
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DETAIL(val)
|
||||
}
|
||||
},
|
||||
share: {
|
||||
get () {
|
||||
return this.$store.getters.getShare
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
filteredRecommendations () {
|
||||
var filteredData = this.recommendations.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
|
||||
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
|
||||
return filteredData
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
if (this.view === 'Recommendation') {
|
||||
this.getRecommendations()
|
||||
if (this.$refs.recommendataionsWaterfall) {
|
||||
this.$refs.recommendataionsWaterfall.refresh()
|
||||
}
|
||||
}
|
||||
},
|
||||
sortKeyword () {
|
||||
switch (this.sortKeyword) {
|
||||
case '上映':
|
||||
this.recommendations = this.recommendations.sort(function (a, b) {
|
||||
return b.detail.year - a.detail.year
|
||||
})
|
||||
break
|
||||
case '评分':
|
||||
this.recommendations.sort(function (a, b) {
|
||||
return b.rate - a.rate
|
||||
})
|
||||
break
|
||||
case '默认':
|
||||
this.recommendations.sort(function (a, b) {
|
||||
return b.id - a.id
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
key: e.key,
|
||||
info: {
|
||||
id: e.ids,
|
||||
name: e.name
|
||||
}
|
||||
}
|
||||
},
|
||||
updateEvent () {
|
||||
const url = 'https://raw.githubusercontent.com/cuiocean/ZY-Player-Resources/main/Recommendations/Recommendations.json'
|
||||
this.loading = true
|
||||
const axios = require('axios')
|
||||
axios.get(url).then(res => {
|
||||
if (res.status === 200) {
|
||||
if (res.data.length > 0) {
|
||||
this.recommendations = res.data
|
||||
recommendation.clear().then(recommendation.bulkAdd(this.recommendations))
|
||||
this.getFilterData()
|
||||
this.$message.success('更新推荐成功. 仅根据作者cuiocean个人喜好推荐,不喜请无视.')
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
}).catch(error => {
|
||||
this.loading = false
|
||||
this.$message.error('更新推荐失败. ' + error)
|
||||
this.$message.warning('最新的推荐数据保存在Github上,请考虑使用代理或者等待下一版本内置数据更新.')
|
||||
})
|
||||
},
|
||||
async playEvent (e) {
|
||||
const db = await history.find({ site: e.key, ids: e.ids })
|
||||
if (db) {
|
||||
this.video = { key: e.key, info: { id: db.ids, name: db.name, index: db.index }, detail: db.detail }
|
||||
} else {
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: 0 }, detail: e.detail }
|
||||
}
|
||||
this.view = 'Play'
|
||||
},
|
||||
deleteEvent (e) {
|
||||
recommendation.remove(e.id).then(res => {
|
||||
if (res) {
|
||||
this.$message.warning('删除失败')
|
||||
}
|
||||
this.getRecommendations()
|
||||
})
|
||||
},
|
||||
shareEvent (e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.key,
|
||||
info: e
|
||||
}
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.key, e.ids).then(res => {
|
||||
if (res && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
var m3u8List = {}
|
||||
zy.detail(e.key, e.ids).then(res => {
|
||||
const dd = res.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
m3u8List = i._t.split('#')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m3u8List = dd._t.split('#')
|
||||
}
|
||||
const list = [...m3u8List]
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getRecommendations () {
|
||||
recommendation.all().then(res => {
|
||||
this.recommendations = res.sort(function (a, b) {
|
||||
return b.id - a.id
|
||||
})
|
||||
this.getFilterData()
|
||||
})
|
||||
},
|
||||
getFilterData () {
|
||||
this.types = [...new Set(this.recommendations.map(ele => ele.detail.type))].filter(x => x)
|
||||
this.areas = [...new Set(this.recommendations.map(ele => ele.detail.area))].filter(x => x)
|
||||
},
|
||||
getViewMode () {
|
||||
setting.find().then(res => {
|
||||
this.viewMode = res.recommendationViewMode
|
||||
})
|
||||
},
|
||||
updateViewMode () {
|
||||
setting.find().then(res => {
|
||||
res.recommendationViewMode = this.viewMode
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getRecommendations()
|
||||
this.getViewMode()
|
||||
},
|
||||
mounted () {
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.$refs.recommendataionsWaterfall && this.view === 'Recommendation') {
|
||||
this.$refs.recommendataionsWaterfall.resize()
|
||||
this.$refs.recommendataionsWaterfall.refresh()
|
||||
setTimeout(() => {
|
||||
this.$refs.recommendataionsWaterfall.refresh()
|
||||
}, 500)
|
||||
}
|
||||
}, false)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
<div class="listpage" id="recommendations">
|
||||
<div class="listpage-header" id="recommendations-header">
|
||||
<el-switch v-model="setting.recommendationViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
|
||||
<el-button type="text">视频数:{{ recommendations.length }}</el-button>
|
||||
<el-select v-model="selectedAreas" size="small" multiple placeholder="地区" popper-class="popper" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in areas"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="selectedTypes" size="small" multiple placeholder="类型" popper-class="popper" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in types"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false">
|
||||
<el-option
|
||||
v-for="item in sortKeywords"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<el-button :loading="loading" @click.stop="updateEvent" icon="el-icon-refresh">更新推荐</el-button>
|
||||
</div>
|
||||
<div class="listpage-body" id="recommendations-body" >
|
||||
<div class="show-table" id="star-table" v-if="setting.recommendationViewMode === 'table'">
|
||||
<el-table size="mini" fit height="100%" row-key="id"
|
||||
ref="recommendationsTable"
|
||||
:data="filteredRecommendations"
|
||||
@row-click="detailEvent">
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="片名">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="detail.area"
|
||||
label="地区"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="detail.type"
|
||||
label="类型"
|
||||
width="100">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="detail.year"
|
||||
label="上映"
|
||||
width="100"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="filteredRecommendations.some(e => e.rate)"
|
||||
prop="rate"
|
||||
align="center"
|
||||
width="100"
|
||||
label="豆瓣评分">
|
||||
</el-table-column>
|
||||
<el-table-column v-if="filteredRecommendations.some(e => e.detail.note)"
|
||||
prop="detail.note"
|
||||
label="备注">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
header-align="center"
|
||||
align="right"
|
||||
width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click.stop="playEvent(scope.row)" type="text">播放</el-button>
|
||||
<el-button @click.stop="shareEvent(scope.row)" type="text">分享</el-button>
|
||||
<el-button @click.stop="downloadEvent(scope.row)" type="text">下载</el-button>
|
||||
<el-button @click.stop="deleteEvent(scope.row)" type="text">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-picture" id="star-picture" v-if="setting.recommendationViewMode === 'picture'">
|
||||
<Waterfall ref="recommendationsWaterfall" :list="filteredRecommendations" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
rowPerView: 4,
|
||||
},
|
||||
800: { //当屏幕宽度小于等于800
|
||||
rowPerView: 3,
|
||||
},
|
||||
500: { //当屏幕宽度小于等于500
|
||||
rowPerView: 2,
|
||||
}
|
||||
}"
|
||||
animationDuration="0.5s"
|
||||
backgroundColor="rgba(0, 0, 0, 0)">
|
||||
<template slot="item" slot-scope="props">
|
||||
<div class="card">
|
||||
<div class="img">
|
||||
<div class="rate" v-if="props.data.rate && props.data.rate !== '暂无评分'">
|
||||
<span>{{props.data.rate}}分</span>
|
||||
</div>
|
||||
<img style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.recommendationsWaterfall.refresh()" @click="detailEvent(props.data)">
|
||||
<div class="operate">
|
||||
<div class="operate-wrap">
|
||||
<span class="o-play" @click="playEvent(props.data)">播放</span>
|
||||
<span class="o-share" @click="shareEvent(props.data)">分享</span>
|
||||
<span class="o-star" @click="downloadEvent(props.data)">下载</span>
|
||||
<span class="o-star" @click="deleteEvent(props.data)">删除</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
|
||||
<div class="info">
|
||||
<span>{{props.data.detail.area}}</span>
|
||||
<span>{{props.data.detail.year}}</span>
|
||||
<span>{{props.data.detail.note}}</span>
|
||||
<span>{{props.data.detail.type}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</Waterfall>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { history, recommendation, setting } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import Waterfall from 'vue-waterfall-plugin'
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
name: 'recommendations',
|
||||
data () {
|
||||
return {
|
||||
recommendations: [],
|
||||
sites: [],
|
||||
loading: false,
|
||||
types: [],
|
||||
selectedTypes: [],
|
||||
areas: [],
|
||||
selectedAreas: [],
|
||||
sortKeyword: '',
|
||||
sortKeywords: ['上映', '评分', '默认']
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Waterfall
|
||||
},
|
||||
computed: {
|
||||
view: {
|
||||
get () {
|
||||
return this.$store.getters.getView
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
video: {
|
||||
get () {
|
||||
return this.$store.getters.getVideo
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIDEO(val)
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
get () {
|
||||
return this.$store.getters.getDetail
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DETAIL(val)
|
||||
}
|
||||
},
|
||||
share: {
|
||||
get () {
|
||||
return this.$store.getters.getShare
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
setting: {
|
||||
get () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
},
|
||||
filteredRecommendations () {
|
||||
let filteredData = this.recommendations.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
|
||||
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
|
||||
return filteredData
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
if (this.view === 'Recommendation') {
|
||||
if (this.$refs.recommendationsWaterfall) this.$refs.recommendationsWaterfall.resize()
|
||||
}
|
||||
},
|
||||
sortKeyword () {
|
||||
switch (this.sortKeyword) {
|
||||
case '上映':
|
||||
this.recommendations = this.recommendations.sort(function (a, b) {
|
||||
return b.detail.year - a.detail.year
|
||||
})
|
||||
break
|
||||
case '评分':
|
||||
this.recommendations.sort(function (a, b) {
|
||||
return b.rate - a.rate
|
||||
})
|
||||
break
|
||||
case '默认':
|
||||
this.recommendations.sort(function (a, b) {
|
||||
return b.id - a.id
|
||||
})
|
||||
break
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
key: e.key,
|
||||
info: {
|
||||
id: e.ids,
|
||||
name: e.name
|
||||
}
|
||||
}
|
||||
},
|
||||
updateEvent () {
|
||||
const url = 'https://raw.githubusercontent.com/cuiocean/ZY-Player-Resources/main/Recommendations/Recommendations.json'
|
||||
this.loading = true
|
||||
const axios = require('axios')
|
||||
axios.get(url).then(res => {
|
||||
if (res.status === 200) {
|
||||
if (res.data.length > 0) {
|
||||
this.recommendations = res.data
|
||||
recommendation.clear().then(recommendation.bulkAdd(this.recommendations))
|
||||
this.getFilterData()
|
||||
this.$message.success('更新推荐成功. 仅根据作者cuiocean个人喜好推荐,不喜请无视.')
|
||||
}
|
||||
}
|
||||
this.loading = false
|
||||
}).catch(error => {
|
||||
this.loading = false
|
||||
this.$message.error('更新推荐失败. ' + error)
|
||||
this.$message.warning('最新的推荐数据保存在Github上,请考虑使用代理或者等待下一版本内置数据更新.')
|
||||
})
|
||||
},
|
||||
async playEvent (e) {
|
||||
const db = await history.find({ site: e.key, ids: e.ids })
|
||||
if (db) {
|
||||
this.video = { key: e.key, info: { id: db.ids, name: db.name, index: db.index }, detail: db.detail }
|
||||
} else {
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: 0 }, detail: e.detail }
|
||||
}
|
||||
this.view = 'Play'
|
||||
},
|
||||
deleteEvent (e) {
|
||||
recommendation.remove(e.id).then(res => {
|
||||
if (res) {
|
||||
this.$message.warning('删除失败')
|
||||
}
|
||||
this.getRecommendations()
|
||||
})
|
||||
},
|
||||
shareEvent (e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.key,
|
||||
info: e.detail
|
||||
}
|
||||
},
|
||||
async downloadEvent (e) {
|
||||
const db = await history.find({ site: e.key, ids: e.ids })
|
||||
let videoFlag
|
||||
if (db) videoFlag = db.videoFlag
|
||||
zy.download(e.key, e.ids, videoFlag).then(res => {
|
||||
clipboard.writeText(res.downloadUrls)
|
||||
this.$message.success(res.info)
|
||||
}).catch((err) => {
|
||||
this.$message.error(err.info)
|
||||
})
|
||||
},
|
||||
getRecommendations () {
|
||||
recommendation.all().then(res => {
|
||||
this.recommendations = res.sort(function (a, b) {
|
||||
return b.id - a.id
|
||||
})
|
||||
this.getFilterData()
|
||||
})
|
||||
},
|
||||
getFilterData () {
|
||||
this.types = [...new Set(this.recommendations.map(ele => ele.detail.type))].filter(x => x)
|
||||
this.areas = [...new Set(this.recommendations.map(ele => ele.detail.area))].filter(x => x)
|
||||
},
|
||||
updateViewMode () {
|
||||
setTimeout(() => { if (this.$refs.recommendationsWaterfall) this.$refs.recommendationsWaterfall.refresh() }, 700)
|
||||
setting.find().then(res => {
|
||||
res.recommendationViewMode = this.setting.recommendationViewMode
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getRecommendations()
|
||||
},
|
||||
mounted () {
|
||||
addEventListener('resize', () => {
|
||||
setTimeout(() => { if (this.$refs.recommendationsWaterfall) this.$refs.recommendationsWaterfall.resize() }, 500)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,22 +5,10 @@
|
||||
<div class="info">
|
||||
<a @click="linkOpen('http://zyplayer.fun/')">官网</a>
|
||||
<a @click="linkOpen('https://github.com/Hunlongyu/ZY-Player')">Github</a>
|
||||
<a @click="linkOpen('https://github.com/Hunlongyu/ZY-Player/issues')">当前版本v{{pkg.version}} 反馈</a>
|
||||
<a style="color:#38dd77" @click="quitAndInstall()" v-show="latestVersion !== pkg.version" >最新版本v{{latestVersion}}</a>
|
||||
</div>
|
||||
<div class="view">
|
||||
<div class="title">视图</div>
|
||||
<div class="view-box">
|
||||
<div class="zy-select" @mouseleave="show.view = false">
|
||||
<div class="vs-placeholder" @click="show.view = true">默认视图</div>
|
||||
<div class="vs-options" v-show="show.view">
|
||||
<ul class="zy-scroll">
|
||||
<li :class="d.view === 'picture' ? 'active' : ''" @click="changeView('picture')">海报</li>
|
||||
<li :class="d.view === 'table' ? 'active' : ''" @click="changeView('table')">列表</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a @click="linkOpen('https://github.com/Hunlongyu/ZY-Player/releases/tag/v' + pkg.version)">v{{pkg.version}}更新日志</a>
|
||||
<a @click="linkOpen('https://github.com/Hunlongyu/ZY-Player/issues/80')">常见问题</a>
|
||||
<a @click="linkOpen('https://github.com/Hunlongyu/ZY-Player/issues')">反馈建议</a>
|
||||
<a style="color:#38dd77" @click="openUpdate()" v-show="update.find" >最新版本v{{update.version}}</a>
|
||||
</div>
|
||||
<div class="shortcut">
|
||||
<div class="title">快捷键</div>
|
||||
@@ -40,13 +28,16 @@
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="impShortcut">导入</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="resetShortcut">重置</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="shortcut">
|
||||
<div class="shortcut" title="清理缓存后图片资源需重新下载,不建议清理,软件会根据磁盘空间动态管理缓存大小">
|
||||
<div class="title">缓存</div>
|
||||
<div class="shortcut-box">
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="clearCache">清理视频缓存</div>
|
||||
<div class="vs-placeholder vs-noAfter" @click="clearCache">清理缓存</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -78,6 +69,16 @@
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="view = 'IPTV'">编辑直播源</div>
|
||||
</div>
|
||||
<div class="zy-input">
|
||||
<input type="checkbox" v-model = "d.allowPassWhenIptvCheck" @change="updateSettingEvent"> 检测时自动跳过停用源
|
||||
</div>
|
||||
<div class="zy-input">
|
||||
<input type="checkbox" v-model = "d.autocleanWhenIptvCheck" @change="updateSettingEvent"> 检测时自动清理无效源
|
||||
</div>
|
||||
<div class="zy-input">
|
||||
<input type="checkbox" v-model = "d.autoChangeSourceWhenIptvStalling" @change="updateSettingEvent">
|
||||
卡顿时自动换源换台:<input style="width:50px" type="number" min=0 v-model.number = "d.waitingTimeInSec" @change="updateSettingEvent">秒
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site">
|
||||
@@ -86,6 +87,9 @@
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="editSitesEvent">编辑源</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="show.configDefaultParseUrlDialog = true">设置默认解析接口</div>
|
||||
</div>
|
||||
<div class="zy-input" @click="toggleExcludeRootClasses">
|
||||
<input type="checkbox" v-model = "d.excludeRootClasses" @change="updateSettingEvent"> 屏蔽主分类
|
||||
</div>
|
||||
@@ -151,6 +155,20 @@
|
||||
<span>所有资源来自网上, 该软件不参与任何制作, 上传, 储存等内容, 禁止传播违法资源. 该软件仅供学习参考, 请于安装后24小时内删除.</span>
|
||||
</div>
|
||||
</div>
|
||||
<div> <!-- 设置默认解析接口 -->
|
||||
<el-dialog :visible.sync="show.configDefaultParseUrlDialog" v-if='show.configDefaultParseUrlDialog' title="设置默认解析接口" :append-to-body="true" @close="closeDialog">
|
||||
<el-form label-width="45px" label-position="left">
|
||||
<el-form-item label="URL:" prop='defaultParseURL'>
|
||||
<el-input v-model="setting.defaultParseURL" :autosize="{ minRows: 2, maxRows: 4}" type="textarea" placeholder="请输入解析接口地址,为空时会自动设置,重置时会自动更新默认接口地址"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="closeDialog">取消</el-button>
|
||||
<el-button type="danger" @click="get7kParseURL">重置</el-button>
|
||||
<el-button type="primary" @click="configDefaultParseURL">确定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div> <!-- 输入密码页面 -->
|
||||
<el-dialog :visible.sync="show.checkPasswordDialog" v-if='show.checkPasswordDialog' :append-to-body="true" @close="closeDialog" width="300px">
|
||||
<el-form label-width="75px" label-position="left">
|
||||
@@ -204,13 +222,26 @@
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div class="update" v-if="update.show">
|
||||
<div class="wrapper">
|
||||
<div class="body">
|
||||
<div class="content" v-html="update.html"></div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<el-button size="small" @click="closeUpdate">关闭</el-button>
|
||||
<el-button size="small" v-show="update.showDownload" @click="startUpdate">更新</el-button>
|
||||
<el-button size="small" v-show="!update.showDownload && !update.downloaded">正在更新...</el-button>
|
||||
<el-button size="small" v-show="update.downloaded" @click="installUpdate">安装</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import pkg from '../../package.json'
|
||||
import { setting, sites, shortcut } from '../lib/dexie'
|
||||
import { sites as defaultSites } from '../lib/dexie/initData'
|
||||
import { sites as defaultSites, localKey as defaultShortcuts } from '../lib/dexie/initData'
|
||||
import { shell, clipboard, remote, ipcRenderer } from 'electron'
|
||||
import db from '../lib/dexie/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
@@ -228,7 +259,8 @@ export default {
|
||||
checkPasswordDialog: false,
|
||||
changePasswordDialog: false,
|
||||
proxy: false,
|
||||
proxyDialog: false
|
||||
proxyDialog: false,
|
||||
configDefaultParseUrlDialog: false
|
||||
},
|
||||
d: { },
|
||||
latestVersion: pkg.version,
|
||||
@@ -239,6 +271,14 @@ export default {
|
||||
scheme: '',
|
||||
url: '',
|
||||
port: ''
|
||||
},
|
||||
update: {
|
||||
find: false,
|
||||
version: '',
|
||||
show: false,
|
||||
html: '',
|
||||
downloaded: false,
|
||||
showDownload: true
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -269,6 +309,7 @@ export default {
|
||||
setting.find().then(res => {
|
||||
this.d = res
|
||||
this.setting = this.d
|
||||
if (!this.setting.defaultParseURL) this.configDefaultParseURL()
|
||||
})
|
||||
},
|
||||
getSites () {
|
||||
@@ -284,11 +325,6 @@ export default {
|
||||
this.shortcutList = res
|
||||
})
|
||||
},
|
||||
changeView (e) {
|
||||
this.d.view = e
|
||||
this.updateSettingEvent()
|
||||
this.show.view = false
|
||||
},
|
||||
async clearCache () {
|
||||
const win = remote.getCurrentWindow()
|
||||
const ses = win.webContents.session
|
||||
@@ -310,6 +346,20 @@ export default {
|
||||
this.d.excludeRootClasses = !this.d.excludeRootClasses
|
||||
this.updateSettingEvent()
|
||||
},
|
||||
async get7kParseURL () {
|
||||
this.$message.info('正在获取7K源解析地址...')
|
||||
const parseURL = await zy.get7kParseURL()
|
||||
if (parseURL.startsWith('http')) {
|
||||
this.$message.success('获取成功,更新应用默认解析接口地址...')
|
||||
this.setting.defaultParseURL = parseURL
|
||||
}
|
||||
},
|
||||
async configDefaultParseURL () {
|
||||
if (!this.setting.defaultParseURL) await this.get7kParseURL()
|
||||
this.d.defaultParseURL = this.setting.defaultParseURL.trim()
|
||||
this.show.configDefaultParseUrlDialog = false
|
||||
this.updateSettingEvent()
|
||||
},
|
||||
selectLocalPlayer () {
|
||||
const options = {
|
||||
filters: [
|
||||
@@ -320,7 +370,7 @@ export default {
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
var playerPath = result.filePaths[0].replace(/\\/g, '/')
|
||||
const playerPath = result.filePaths[0].replace(/\\/g, '/')
|
||||
this.$message.success('设定第三方播放器路径为:' + result.filePaths[0])
|
||||
this.d.externalPlayer = playerPath
|
||||
this.updateSettingEvent()
|
||||
@@ -352,6 +402,7 @@ export default {
|
||||
async closeDialog () {
|
||||
this.show.checkPasswordDialog = false
|
||||
this.show.changePasswordDialog = false
|
||||
this.show.configDefaultParseUrlDialog = false
|
||||
if (this.show.proxyDialog) {
|
||||
this.show.proxyDialog = false
|
||||
this.setting.proxy.type = 'none'
|
||||
@@ -410,10 +461,20 @@ export default {
|
||||
this.$message.info('已清空原数据')
|
||||
shortcut.add(json).then(e => {
|
||||
this.$message.success('已添加成功')
|
||||
this.getSites()
|
||||
this.getShortcut()
|
||||
this.d.shortcutModified = true
|
||||
this.updateSettingEvent()
|
||||
})
|
||||
})
|
||||
},
|
||||
resetShortcut () {
|
||||
shortcut.clear().then(shortcut.add(defaultShortcuts)).then(res => {
|
||||
this.getShortcut()
|
||||
this.$message.success('快捷键已重置')
|
||||
this.d.shortcutModified = true
|
||||
this.updateSettingEvent()
|
||||
})
|
||||
},
|
||||
async changeProxyType (e) {
|
||||
this.d.proxy.type = e
|
||||
if (e === 'manual') {
|
||||
@@ -460,20 +521,29 @@ export default {
|
||||
return false
|
||||
}
|
||||
},
|
||||
getLatestVersion () {
|
||||
checkUpdate () {
|
||||
ipcRenderer.send('checkForUpdate')
|
||||
ipcRenderer.on('update-available', (e, info) => {
|
||||
this.latestVersion = info.version
|
||||
})
|
||||
ipcRenderer.on('update-error', () => {
|
||||
this.$message.warning = '更新出错.'
|
||||
})
|
||||
ipcRenderer.on('update-downloaded', () => {
|
||||
this.$message.info = '下载完毕, 退出安装'
|
||||
this.update.find = true
|
||||
this.update.version = info.version
|
||||
this.update.html = info.releaseNotes
|
||||
})
|
||||
},
|
||||
quitAndInstall () {
|
||||
this.$message.success('已开始下载更新,下载完毕后,将自动退出安装。')
|
||||
openUpdate () {
|
||||
this.update.show = true
|
||||
},
|
||||
closeUpdate () {
|
||||
this.update.show = false
|
||||
},
|
||||
startUpdate () {
|
||||
this.update.showDownload = false
|
||||
ipcRenderer.send('downloadUpdate')
|
||||
ipcRenderer.on('update-downloaded', () => {
|
||||
this.update.downloaded = true
|
||||
this.$message.success('更新已下载完成!Mac用户须手动点击“安装”,其它系统会在退出后自动安装')
|
||||
})
|
||||
},
|
||||
installUpdate () {
|
||||
ipcRenderer.send('quitAndInstall')
|
||||
},
|
||||
createContextMenu () {
|
||||
@@ -492,7 +562,7 @@ export default {
|
||||
this.getSites()
|
||||
this.getSetting()
|
||||
this.getShortcut()
|
||||
this.getLatestVersion()
|
||||
this.checkUpdate()
|
||||
this.createContextMenu()
|
||||
}
|
||||
}
|
||||
@@ -530,17 +600,6 @@ export default {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.view{
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
margin-top: 20px;
|
||||
.view-box{
|
||||
margin-top: 10px;
|
||||
.zy-select{
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.site{
|
||||
width: 100%;
|
||||
padding: 20px;
|
||||
@@ -635,5 +694,28 @@ export default {
|
||||
font-size: 12px;
|
||||
color: #ff000066;
|
||||
}
|
||||
.update{
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(7, 17, 27, 0.7);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.wrapper{
|
||||
background-color: #fff;
|
||||
padding: 20px 50px 40px;
|
||||
border-radius: 4px;
|
||||
max-width: 500px;
|
||||
max-height: 90%;
|
||||
overflow: auto;
|
||||
.footer{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<template>
|
||||
<div class="share" id="share" @click="shareClickEvent" v-on-clickaway="shareClickEvent">
|
||||
<div class="share" id="share" @click="shareClickEvent" v-clickoutside="shareClickEvent">
|
||||
<div class="left">
|
||||
<img :src="pic" alt="" @load="picLoadEvent">
|
||||
<img :src="share.info.pic" alt="">
|
||||
</div>
|
||||
<div class="right" id="right">
|
||||
<div class="title">{{ share.info.name }}</div>
|
||||
<qrcode-vue id="qr" :value="link" :size="160" level="L" />
|
||||
<qrcode-vue v-if="link !== ''" id="qr" :value="link" :size="160" level="L" />
|
||||
<div class="tips">
|
||||
<p>长按二维码,识别播放。</p>
|
||||
<p><img src="@/assets/image/logo.png"></p>
|
||||
@@ -22,7 +22,7 @@ import { mapMutations } from 'vuex'
|
||||
import QrcodeVue from 'qrcode.vue'
|
||||
import html2canvas from 'html2canvas'
|
||||
import zy from '../lib/site/tools'
|
||||
import { directive as onClickaway } from 'vue-clickaway'
|
||||
import Clickoutside from 'element-ui/src/utils/clickoutside'
|
||||
const { clipboard, nativeImage } = require('electron')
|
||||
export default {
|
||||
name: 'share',
|
||||
@@ -45,6 +45,14 @@ export default {
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
DetailCache: {
|
||||
get () {
|
||||
return this.$store.getters.getDetailCache
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DetailCache(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -58,47 +66,47 @@ export default {
|
||||
}
|
||||
},
|
||||
directives: {
|
||||
onClickaway: onClickaway
|
||||
Clickoutside
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_SHARE']),
|
||||
...mapMutations(['SET_SHARE', 'SET_DetailCache']),
|
||||
shareClickEvent () {
|
||||
this.share = {
|
||||
show: false,
|
||||
info: {}
|
||||
}
|
||||
},
|
||||
getDetail () {
|
||||
this.loading = true
|
||||
const id = this.share.info.ids || this.share.info.id
|
||||
zy.detail(this.share.key, id).then(res => {
|
||||
if (res) {
|
||||
this.pic = res.pic
|
||||
var m3u8List = {}
|
||||
const dd = res.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
m3u8List = i._t.split('#')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m3u8List = dd._t.split('#')
|
||||
}
|
||||
const url = m3u8List[1]
|
||||
this.link = 'http://zyplayer.fun/player/player.html?url=' + url + '&title=' + this.share.info.name
|
||||
async getUrl (dl, index) {
|
||||
const t = dl.dd._t
|
||||
if (t) {
|
||||
return t.split('#')[index].split('$')[1]
|
||||
} else {
|
||||
const id = this.share.info.ids || this.share.info.id
|
||||
const cacheKey = this.share.key + '@' + id
|
||||
let res = this.DetailCache[cacheKey]
|
||||
if (!this.DetailCache[cacheKey]) {
|
||||
res = await zy.detail(this.share.key, id)
|
||||
this.DetailCache[cacheKey] = res
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
if (res) {
|
||||
return res.fullList[0].list[index]
|
||||
}
|
||||
}
|
||||
},
|
||||
picLoadEvent () {
|
||||
const dom = document.getElementById('share')
|
||||
html2canvas(dom, { useCORS: true, allowTaint: true }).then(res => {
|
||||
const png = res.toDataURL('image/png')
|
||||
const p = nativeImage.createFromDataURL(png)
|
||||
clipboard.writeImage(p)
|
||||
this.$message.success('已复制到剪贴板,快去分享吧~ 严禁传播违法资源!!!')
|
||||
async getDetail () {
|
||||
this.loading = true
|
||||
const index = this.share.index || 0
|
||||
const url = await this.getUrl(this.share.info.dl, index)
|
||||
this.link = 'http://hunlongyu.gitee.io/zy-player-web?url=' + url + '&name=' + this.share.info.name
|
||||
this.loading = false
|
||||
this.$nextTick(() => {
|
||||
const dom = document.getElementById('share')
|
||||
html2canvas(dom, { useCORS: true }).then(res => {
|
||||
const png = res.toDataURL('image/png')
|
||||
const p = nativeImage.createFromDataURL(png)
|
||||
clipboard.writeImage(p)
|
||||
this.$message.success('已复制到剪贴板,快去分享吧~ 严禁传播违法资源!!!')
|
||||
})
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
<template>
|
||||
<div class="listpage" id="star">
|
||||
<div class="listpage-header" id="star-header">
|
||||
<el-switch v-model="viewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
|
||||
<el-button @click.stop="exportFavoritesEvent" icon="el-icon-upload2">导出</el-button>
|
||||
<el-button @click.stop="importFavoritesEvent" icon="el-icon-download">导入</el-button>
|
||||
<el-button @click.stop="clearFavoritesEvent" icon="el-icon-delete-solid">清空</el-button>
|
||||
<el-switch v-model="setting.starViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
|
||||
<el-button @click.stop="exportFavoritesEvent" icon="el-icon-upload2" title="导出全部,自动添加扩展名">导出</el-button>
|
||||
<el-button @click.stop="importFavoritesEvent" icon="el-icon-download" title="支持同时导入多个文件">导入</el-button>
|
||||
<el-button @click.stop="removeSelectedItems" icon="el-icon-delete-solid">{{ multipleSelection.length === 0 ? "清空" : "删除所选" }}</el-button>
|
||||
<el-button @click.stop="updateAllEvent" icon="el-icon-refresh">同步所有收藏</el-button>
|
||||
</div>
|
||||
<div class="listpage-body" id="star-body">
|
||||
<div class="show-table" id="star-table" v-show="viewMode === 'table'">
|
||||
<div class="show-table" id="star-table" v-if="setting.starViewMode === 'table'">
|
||||
<el-table size="mini" fit height="100%" row-key="id"
|
||||
ref="starTable"
|
||||
:data="list"
|
||||
:cell-class-name="checkUpdate"
|
||||
@row-click="detailEvent"
|
||||
@sort-change="handleSortChange">
|
||||
ref="starTable"
|
||||
:data="list"
|
||||
:cell-class-name="checkUpdate"
|
||||
@row-click="detailEvent"
|
||||
@sort-change="handleSortChange"
|
||||
@select="selectionCellClick"
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column
|
||||
type="selection">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
sortable
|
||||
:sort-method="(a , b) => sortByLocaleCompare(a.name, b.name)"
|
||||
@@ -78,7 +83,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="show-picture" id="star-picture" v-show="viewMode === 'picture'">
|
||||
<div class="show-picture" id="star-picture" v-if="setting.starViewMode === 'picture'">
|
||||
<Waterfall ref="starWaterfall" :list="list" :gutter="20" :width="240"
|
||||
:breakpoints="{
|
||||
1200: { //当屏幕宽度小于等于1200
|
||||
@@ -102,7 +107,7 @@
|
||||
<div class="update" v-if="props.data.hasUpdate">
|
||||
<span>有更新</span>
|
||||
</div>
|
||||
<div class="progress" v-if="props.data.index && props.data.detail && props.data.detail.m3u8List !== undefined && props.data.detail.m3u8List.length > 1">
|
||||
<div class="progress" v-if="props.data.index && props.data.detail && props.data.detail.fullList[0].list !== undefined && props.data.detail.fullList[0].list.length > 1">
|
||||
<span>
|
||||
看至第{{ props.data.index + 1 }}集
|
||||
</span>
|
||||
@@ -133,7 +138,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { star, sites, setting } from '../lib/dexie'
|
||||
import { history, star, sites, setting } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import { remote } from 'electron'
|
||||
import fs from 'fs'
|
||||
@@ -146,8 +151,11 @@ export default {
|
||||
return {
|
||||
list: [],
|
||||
sites: [],
|
||||
viewMode: 'picture',
|
||||
numNoUpdate: 0
|
||||
numNoUpdate: 0,
|
||||
shiftDown: false,
|
||||
selectionBegin: '',
|
||||
selectionEnd: '',
|
||||
multipleSelection: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -185,6 +193,22 @@ export default {
|
||||
set (val) {
|
||||
this.SET_SHARE(val)
|
||||
}
|
||||
},
|
||||
setting: {
|
||||
get () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
},
|
||||
DetailCache: {
|
||||
get () {
|
||||
return this.$store.getters.getDetailCache
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DetailCache(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -192,9 +216,7 @@ export default {
|
||||
if (this.view === 'Star') {
|
||||
this.getAllsites()
|
||||
this.getFavorites()
|
||||
if (this.$refs.starWaterfall) {
|
||||
this.$refs.starWaterfall.refresh()
|
||||
}
|
||||
if (this.setting.starViewMode === 'table') this.showShiftPrompt()
|
||||
}
|
||||
},
|
||||
numNoUpdate () {
|
||||
@@ -206,13 +228,40 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
|
||||
handleSortChange (column, prop, order) {
|
||||
this.updateDatabase()
|
||||
},
|
||||
sortByLocaleCompare (a, b) {
|
||||
return a.localeCompare(b, 'zh')
|
||||
},
|
||||
selectionCellClick (selection, row) { // 同history一样,逆序
|
||||
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
|
||||
this.selectionEnd = row.id
|
||||
const start = this.list.findIndex(e => e.id === Math.max(this.selectionBegin, this.selectionEnd))
|
||||
const end = this.list.findIndex(e => e.id === Math.min(this.selectionBegin, this.selectionEnd))
|
||||
const selections = this.list.slice(start, end + 1)
|
||||
this.$nextTick(() => {
|
||||
selections.forEach(e => this.$refs.starTable.toggleRowSelection(e, true))
|
||||
})
|
||||
this.selectionBegin = this.selectionEnd = ''
|
||||
return
|
||||
}
|
||||
if (selection.includes(row)) {
|
||||
this.selectionBegin = row.id
|
||||
} else {
|
||||
this.selectionBegin = ''
|
||||
}
|
||||
},
|
||||
handleSelectionChange (rows) {
|
||||
this.multipleSelection = rows
|
||||
},
|
||||
removeSelectedItems () {
|
||||
if (!this.multipleSelection.length) this.multipleSelection = this.list
|
||||
this.multipleSelection.forEach(e => star.remove(e.id))
|
||||
this.getFavorites()
|
||||
this.updateDatabase()
|
||||
},
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
@@ -228,9 +277,9 @@ export default {
|
||||
},
|
||||
async playEvent (e) {
|
||||
if (e.index) {
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: e.index }, detail: e.detail }
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: e.index } }
|
||||
} else {
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: 0 }, detail: e.detail }
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: 0 } }
|
||||
}
|
||||
if (e.hasUpdate) {
|
||||
this.clearHasUpdateFlag(e)
|
||||
@@ -249,7 +298,7 @@ export default {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.key,
|
||||
info: e
|
||||
info: e.detail
|
||||
}
|
||||
},
|
||||
checkUpdate ({ row, rowIndex }) {
|
||||
@@ -265,21 +314,24 @@ export default {
|
||||
this.getFavorites()
|
||||
}
|
||||
},
|
||||
updateEvent (e) {
|
||||
zy.detail(e.key, e.ids).then(detailRes => {
|
||||
var doc = {
|
||||
async updateEvent (e) {
|
||||
try {
|
||||
if (!this.DetailCache[e.key + '@' + e.ids]) {
|
||||
this.DetailCache[e.key + '@' + e.ids] = await zy.detail(e.key, e.ids)
|
||||
}
|
||||
const doc = {
|
||||
id: e.id,
|
||||
key: e.key,
|
||||
ids: e.ids,
|
||||
site: e.site,
|
||||
name: e.name,
|
||||
detail: detailRes,
|
||||
detail: this.DetailCache[e.key + '@' + e.ids],
|
||||
index: e.index
|
||||
}
|
||||
star.get(e.id).then(resStar => {
|
||||
if (!e.hasUpdate && e.detail.last !== detailRes.last) {
|
||||
if (!e.hasUpdate && e.detail.last !== doc.detail.last) {
|
||||
doc.hasUpdate = true
|
||||
var msg = `同步"${e.name}"成功, 检查到更新。`
|
||||
const msg = `同步"${e.name}"成功, 检查到更新。`
|
||||
this.$message.success(msg)
|
||||
} else {
|
||||
this.numNoUpdate += 1
|
||||
@@ -287,10 +339,10 @@ export default {
|
||||
star.update(e.id, doc)
|
||||
this.getFavorites()
|
||||
})
|
||||
}).catch(err => {
|
||||
var msg = `同步"${e.name}"失败, 请重试。`
|
||||
} catch (err) {
|
||||
const msg = `同步"${e.name}"失败, 请重试。`
|
||||
this.$message.warning(msg, err)
|
||||
})
|
||||
}
|
||||
},
|
||||
updateAllEvent () {
|
||||
this.numNoUpdate = 0
|
||||
@@ -298,53 +350,22 @@ export default {
|
||||
this.updateEvent(e)
|
||||
})
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.key, e.ids).then(res => {
|
||||
if (res && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『MP4』格式的链接已复制, 快去下载吧!')
|
||||
} else {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
var m3u8List = {}
|
||||
zy.detail(e.key, e.ids).then(res => {
|
||||
const dd = res.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
m3u8List = i._t.split('#')
|
||||
}
|
||||
}
|
||||
} else {
|
||||
m3u8List = dd._t.split('#')
|
||||
}
|
||||
const list = [...m3u8List]
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
})
|
||||
}
|
||||
async downloadEvent (e) {
|
||||
const db = await history.find({ site: e.key, ids: e.ids })
|
||||
let videoFlag
|
||||
if (db) videoFlag = db.videoFlag
|
||||
zy.download(e.key, e.ids, videoFlag).then(res => {
|
||||
clipboard.writeText(res.downloadUrls)
|
||||
this.$message.success(res.info)
|
||||
}).catch((err) => {
|
||||
this.$message.error(err.info)
|
||||
})
|
||||
},
|
||||
getSiteName (row) {
|
||||
if (row.site) {
|
||||
return row.site.name
|
||||
} else {
|
||||
var site = this.sites.find(e => e.key === row.key)
|
||||
const site = this.sites.find(e => e.key === row.key)
|
||||
if (site) {
|
||||
return site.name
|
||||
}
|
||||
@@ -374,13 +395,12 @@ export default {
|
||||
const str = JSON.stringify(arr, null, 2)
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
{ name: 'JSON file', extensions: ['json'] }
|
||||
]
|
||||
}
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
if (!result.filePath.endsWith('.json')) result.filePath += '.json'
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
this.$message.success('导出收藏成功')
|
||||
}
|
||||
@@ -391,23 +411,31 @@ export default {
|
||||
importFavoritesEvent () {
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
{ name: 'JSON file', extensions: ['json'] }
|
||||
],
|
||||
properties: ['openFile', 'multiSelections']
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
var starList = Array.from(this.list)
|
||||
var id = this.list.length + 1
|
||||
const starList = Array.from(this.list)
|
||||
let id = this.list.length + 1
|
||||
result.filePaths.forEach(file => {
|
||||
var str = fs.readFileSync(file)
|
||||
const str = fs.readFileSync(file)
|
||||
const json = JSON.parse(str)
|
||||
json.reverse().forEach(ele => {
|
||||
const starExists = starList.some(x => x.key === ele.key && x.ids === ele.ids)
|
||||
if (!starExists) {
|
||||
var doc = {
|
||||
const newDetail = {
|
||||
director: ele.director,
|
||||
actor: ele.actor,
|
||||
type: ele.type,
|
||||
area: ele.area,
|
||||
lang: ele.lang,
|
||||
year: ele.year,
|
||||
last: ele.last,
|
||||
note: ele.note
|
||||
}
|
||||
const doc = {
|
||||
id: id,
|
||||
key: ele.key,
|
||||
ids: ele.ids,
|
||||
@@ -416,16 +444,7 @@ export default {
|
||||
hasUpdate: ele.hasUpdate,
|
||||
index: ele.index,
|
||||
rate: ele.rate,
|
||||
detail: ele.detail === undefined ? {
|
||||
director: ele.director,
|
||||
actor: ele.actor,
|
||||
type: ele.type,
|
||||
area: ele.area,
|
||||
lang: ele.lang,
|
||||
year: ele.year,
|
||||
last: ele.last,
|
||||
note: ele.note
|
||||
} : ele.detail
|
||||
detail: ele.detail === undefined ? newDetail : ele.detail
|
||||
}
|
||||
id += 1
|
||||
starList.push(doc)
|
||||
@@ -441,11 +460,6 @@ export default {
|
||||
this.$message.error(err)
|
||||
})
|
||||
},
|
||||
clearFavoritesEvent () {
|
||||
star.clear().then(e => {
|
||||
this.getFavorites()
|
||||
})
|
||||
},
|
||||
syncTableData () {
|
||||
if (this.$refs.starTable.tableData && this.$refs.starTable.tableData.length === this.list.length) {
|
||||
this.list = this.$refs.starTable.tableData
|
||||
@@ -454,7 +468,7 @@ export default {
|
||||
updateDatabase () {
|
||||
this.syncTableData()
|
||||
star.clear().then(res => {
|
||||
var id = this.list.length
|
||||
let id = this.list.length
|
||||
this.list.forEach(ele => {
|
||||
ele.id = id
|
||||
id -= 1
|
||||
@@ -463,6 +477,7 @@ export default {
|
||||
})
|
||||
},
|
||||
rowDrop () {
|
||||
if (!document.getElementById('star-table')) return
|
||||
const tbody = document.getElementById('star-table').querySelector('.el-table__body-wrapper tbody')
|
||||
const _this = this
|
||||
Sortable.create(tbody, {
|
||||
@@ -473,33 +488,40 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
getViewMode () {
|
||||
setting.find().then(res => {
|
||||
this.viewMode = res.starViewMode
|
||||
})
|
||||
},
|
||||
updateViewMode () {
|
||||
if (this.setting.starViewMode === 'table') {
|
||||
setTimeout(() => { this.rowDrop() }, 100)
|
||||
this.showShiftPrompt()
|
||||
} else {
|
||||
setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.refresh() }, 700)
|
||||
}
|
||||
setting.find().then(res => {
|
||||
res.starViewMode = this.viewMode
|
||||
res.starViewMode = this.setting.starViewMode
|
||||
setting.update(res)
|
||||
})
|
||||
},
|
||||
showShiftPrompt () {
|
||||
if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5
|
||||
if (this.setting.shiftTooltipLimitTimes) {
|
||||
this.$message.info('多选时支持shift快捷键')
|
||||
this.setting.shiftTooltipLimitTimes--
|
||||
setting.find().then(res => {
|
||||
res.shiftTooltipLimitTimes = this.setting.shiftTooltipLimitTimes
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getFavorites()
|
||||
this.getViewMode()
|
||||
},
|
||||
mounted () {
|
||||
this.rowDrop()
|
||||
window.addEventListener('resize', () => {
|
||||
if (this.$refs.starWaterfall && this.view === 'Star') {
|
||||
this.$refs.starWaterfall.resize()
|
||||
this.$refs.starWaterfall.refresh()
|
||||
setTimeout(() => {
|
||||
this.$refs.starWaterfall.refresh()
|
||||
}, 500)
|
||||
}
|
||||
}, false)
|
||||
if (this.setting.starViewMode === 'table') setTimeout(() => { this.rowDrop() }, 100)
|
||||
addEventListener('keydown', code => { if (code.keyCode === 16) this.shiftDown = true })
|
||||
addEventListener('keyup', code => { if (code.keyCode === 16) this.shiftDown = false })
|
||||
addEventListener('resize', () => {
|
||||
setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.resize() }, 500)
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,19 +5,60 @@ const db = new Dexie('zy')
|
||||
|
||||
db.version(4).stores({
|
||||
search: '++id, keywords',
|
||||
iptvSearch: '++id, keywords',
|
||||
setting: 'id, theme, site, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode, searchViewMode, password, proxy',
|
||||
setting: 'id, theme, site, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode, searchViewMode, password, proxy, allowPassWhenIptvCheck, autocleanWhenIptvCheck',
|
||||
shortcut: 'name, key, desc',
|
||||
star: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',
|
||||
recommendation: '++id, [key+ids], site, name, detail, index, rate, hasUpdate',
|
||||
sites: '++id, key, name, api, download, isActive, group',
|
||||
history: '++id, [site+ids], name, type, year, index, time, duration, detail',
|
||||
// mini: 'id, mode, site, ids, name, index, time, url',
|
||||
mini: 'id, bounds',
|
||||
iptv: '++id, name, url, isActive',
|
||||
channelList: '++id, name, prefer, channels, group, isActive'
|
||||
})
|
||||
|
||||
// 开发和稳定版同一版本号会有不同的数据库
|
||||
// 参考https://github.com/dfahlander/Dexie.js/releases/tag/v3.0.0-alpha.3 upgrade可以改变主键和表名了
|
||||
// https://dexie.org/docs/Version/Version.stores()
|
||||
// https://dexie.org/docs/Version/Version.upgrade()
|
||||
// https://ahuigo.github.io/b/ria/js-indexedDB#/ 比较旧,适当参考
|
||||
db.version(5).stores({
|
||||
shortcut: null
|
||||
})
|
||||
|
||||
db.version(6).stores({
|
||||
shortcut: '++id, name, key, desc'
|
||||
}).upgrade(async tx => {
|
||||
await tx.shortcut.bulkAdd(localKey)
|
||||
})
|
||||
|
||||
db.version(7).stores({
|
||||
sites: '++id, key, name, api, download, jiexiUrl, isActive, group',
|
||||
history: '++id, [site+ids], name, type, year, index, time, duration, detail, onlinePlay'
|
||||
}).upgrade(trans => {
|
||||
trans.sites.toCollection().modify(site => {
|
||||
site.jiexiUrl = ''
|
||||
})
|
||||
trans.history.toCollection().modify(record => {
|
||||
record.detail.fullList = [].concat(record.detail.m3u8List)
|
||||
delete record.detail.m3u8List
|
||||
})
|
||||
trans.star.toCollection().modify(favorite => {
|
||||
favorite.detail.fullList = [].concat(favorite.detail.m3u8List)
|
||||
delete favorite.detail.m3u8List
|
||||
})
|
||||
})
|
||||
|
||||
db.version(8).stores({
|
||||
}).upgrade(trans => {
|
||||
trans.sites.toCollection().modify(site => {
|
||||
if (site.api.includes('7kjx.com')) site.jiexiUrl = 'default'
|
||||
})
|
||||
trans.setting.toCollection().modify(setting => {
|
||||
setting.waitingTimeInSec = 15
|
||||
setting.autoChangeSourceWhenIptvStalling = true
|
||||
})
|
||||
})
|
||||
|
||||
db.on('populate', () => {
|
||||
db.setting.bulkAdd(setting)
|
||||
db.sites.bulkAdd(sites)
|
||||
|
||||
@@ -5,7 +5,6 @@ import shortcut from './shortcut'
|
||||
import star from './star'
|
||||
import sites from './sites'
|
||||
import search from './search'
|
||||
import iptvSearch from './iptvSearch'
|
||||
import iptv from './iptv'
|
||||
import channelList from './channelList'
|
||||
import recommendation from './recommendation'
|
||||
@@ -20,6 +19,5 @@ export {
|
||||
iptv,
|
||||
channelList,
|
||||
search,
|
||||
iptvSearch,
|
||||
recommendation
|
||||
}
|
||||
|
||||
@@ -1,5 +1,259 @@
|
||||
[
|
||||
{
|
||||
"key": "1886zy",
|
||||
"ids": 16944,
|
||||
"site": {
|
||||
"id": 2,
|
||||
"key": "1886zy",
|
||||
"name": "1886 资源",
|
||||
"api": "http://cj.1886zy.co/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
"name": "柯明斯基理论",
|
||||
"detail": {
|
||||
"last": "2018-11-23 18:13:07",
|
||||
"id": 16944,
|
||||
"tid": 15,
|
||||
"name": "柯明斯基理论",
|
||||
"type": "欧美剧",
|
||||
"pic": "http://pic.yc370.com/upload/vod/2019-01-19/15479133688.jpg",
|
||||
"lang": "",
|
||||
"area": "美国",
|
||||
"year": 2018,
|
||||
"state": 8,
|
||||
"note": "08",
|
||||
"actor": "迈克尔·道格拉斯,艾伦·阿金,莎拉·贝克,南希·特拉维斯",
|
||||
"director": "安迪·坦纳特,查克·罗瑞,唐纳德·佩特瑞,贝丝·麦卡锡-米勒",
|
||||
"dl": {
|
||||
"dd": [
|
||||
{
|
||||
"_t": "08$https://zuikzy.51moca.com/share/XoIqsGnIP7IED2LS#07$https://zkcdn.yiya520.com/share/kJOL42dTmm6VJkqK#06$https://zkcdn.yiya520.com/share/f8gxIqAchIPyxlAg#05$https://zkcdn.yiya520.com/share/mTG5GkXpB7yro1sQ#04$https://zkcdn.yiya520.com/share/HjQAbC0lzzHAusIw#03$https://zkcdn.yiya520.com/share/qlN7TvZUDDueiefE#02$https://zkcdn.yiya520.com/share/2P9HAA5H1KvkMgm2#01$https://zkcdn.yiya520.com/share/KUD3QMMS4UGnNA3Y",
|
||||
"_flag": "zkyun"
|
||||
},
|
||||
{
|
||||
"_t": "08$https://zuikzy.51moca.com/2018/11/23/XoIqsGnIP7IED2LS/playlist.m3u8#07$https://zkcdn.yiya520.com/2018/11/21/kJOL42dTmm6VJkqK/playlist.m3u8#06$https://zkcdn.yiya520.com/2018/11/21/f8gxIqAchIPyxlAg/playlist.m3u8#05$https://zkcdn.yiya520.com/2018/11/21/mTG5GkXpB7yro1sQ/playlist.m3u8#04$https://zkcdn.yiya520.com/2018/11/19/HjQAbC0lzzHAusIw/playlist.m3u8#03$https://zkcdn.yiya520.com/2018/11/19/qlN7TvZUDDueiefE/playlist.m3u8#02$https://zkcdn.yiya520.com/2018/11/18/2P9HAA5H1KvkMgm2/playlist.m3u8#01$https://zkcdn.yiya520.com/2018/11/18/KUD3QMMS4UGnNA3Y/playlist.m3u8",
|
||||
"_flag": "zkm3u8"
|
||||
}
|
||||
]
|
||||
},
|
||||
"des": "迈克尔·道格拉斯、艾伦·阿金有望加盟Netflix喜剧剧集《柯明斯基理论》(The Kominsky Method,暂译)!该剧由《生活大爆炸》联合编剧查克·罗瑞担任制片。道格拉斯剧中饰演曾经红极一时的明星,现下却只能靠教授表演课程为生,阿金饰演他的老友。道格拉斯上次出演电视剧集还是上世纪70年代的《旧金山风物记》,而阿金上一部荧屏作品则是2001年的犯罪剧集《百厦街》。",
|
||||
"m3u8List": [
|
||||
"08$https://zuikzy.51moca.com/2018/11/23/XoIqsGnIP7IED2LS/playlist.m3u8",
|
||||
"07$https://zkcdn.yiya520.com/2018/11/21/kJOL42dTmm6VJkqK/playlist.m3u8",
|
||||
"06$https://zkcdn.yiya520.com/2018/11/21/f8gxIqAchIPyxlAg/playlist.m3u8",
|
||||
"05$https://zkcdn.yiya520.com/2018/11/21/mTG5GkXpB7yro1sQ/playlist.m3u8",
|
||||
"04$https://zkcdn.yiya520.com/2018/11/19/HjQAbC0lzzHAusIw/playlist.m3u8",
|
||||
"03$https://zkcdn.yiya520.com/2018/11/19/qlN7TvZUDDueiefE/playlist.m3u8",
|
||||
"02$https://zkcdn.yiya520.com/2018/11/18/2P9HAA5H1KvkMgm2/playlist.m3u8",
|
||||
"01$https://zkcdn.yiya520.com/2018/11/18/KUD3QMMS4UGnNA3Y/playlist.m3u8"
|
||||
],
|
||||
"rate": "9.2"
|
||||
},
|
||||
"rate": "9.2",
|
||||
"id": 255
|
||||
},
|
||||
{
|
||||
"key": "mahuazy",
|
||||
"ids": 21869,
|
||||
"site": {
|
||||
"id": 1,
|
||||
"key": "mahuazy",
|
||||
"name": "麻花资源",
|
||||
"api": "http://www.mhapi123.com/inc/ldg_api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
"name": "海上钢琴师",
|
||||
"detail": {
|
||||
"last": "2019-12-26 17:45:44",
|
||||
"id": 21869,
|
||||
"tid": 10,
|
||||
"name": "海上钢琴师",
|
||||
"type": "剧情片",
|
||||
"pic": "https://mahuapic.com/upload/vod/2019-12-26/201912261577353503.png",
|
||||
"lang": "英语",
|
||||
"area": "其它",
|
||||
"year": 2019,
|
||||
"state": 0,
|
||||
"note": "HD",
|
||||
"actor": "蒂姆·罗斯",
|
||||
"director": "朱塞佩·托纳多雷",
|
||||
"dl": {
|
||||
"dd": {
|
||||
"_t": "HD$https://mhkuaibo.com/20191226/4s3AkbXZ/index.m3u8$mahua",
|
||||
"_flag": "mahua"
|
||||
}
|
||||
},
|
||||
"des": "<span style=\"color: rgb(51, 51, 51); font-family: Tahoma, Helvetica, Arial, 微软雅黑, sans-serif; font-size: 14px; line-height: 22px; background-color: rgb(248, 248, 248);\">1900年,Virginian号豪华邮轮上,一个孤儿被遗弃在头等舱,由船上的水手抚养长大,取名1900。1900慢慢长大,显示出了无师自通的非凡钢琴天赋,在船上的乐队表演钢琴,每个听过他演奏的人,都被深深打动。爵士乐鼻祖杰尼听说了1900的高超技艺,专门上船和他比赛,最后自叹弗如,黯然离去。可惜,这一切的事情都发生在海上,1900从来不愿踏上陆地,直到有一天,他爱上了一个女孩,情愫在琴键上流淌。他会不会为了爱情,踏上陆地开始新的生活,用他的琴声惊艳世界?他将怎样谱写自己非凡的人生。</span><br />",
|
||||
"m3u8List": [
|
||||
"HD$https://mhkuaibo.com/20191226/4s3AkbXZ/index.m3u8$mahua"
|
||||
],
|
||||
"rate": "9.3"
|
||||
},
|
||||
"rate": "9.3",
|
||||
"id": 254
|
||||
},
|
||||
{
|
||||
"key": "mahuazy",
|
||||
"ids": 22567,
|
||||
"site": {
|
||||
"id": 1,
|
||||
"key": "mahuazy",
|
||||
"name": "麻花资源",
|
||||
"api": "http://www.mhapi123.com/inc/ldg_api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
"name": "王冠第一季",
|
||||
"detail": {
|
||||
"last": "2019-12-19 11:41:40",
|
||||
"id": 22567,
|
||||
"tid": 15,
|
||||
"name": "王冠第一季",
|
||||
"type": "欧美剧",
|
||||
"pic": "https://mahuapic.com/upload/vod/2019-12-19/15767269760.jpg",
|
||||
"lang": "英语",
|
||||
"area": "美国",
|
||||
"year": 2016,
|
||||
"state": 0,
|
||||
"note": "完结",
|
||||
"actor": "克莱尔·芙伊,马特·史密斯,约翰·利思戈,凡妮莎·柯比",
|
||||
"director": "本·卡隆,史蒂芬·戴德利,菲利普·马丁,朱里安·杰拉德",
|
||||
"dl": {
|
||||
"dd": {
|
||||
"_t": "第01集$https://mhyunbo.com/20191218/5vUSpghQ/index.m3u8$mahua#第02集$https://mhyunbo.com/20191218/jC9O5JXb/index.m3u8$mahua#第03集$https://mhyunbo.com/20191218/yHN6zIDc/index.m3u8$mahua#第04集$https://mhyunbo.com/20191218/q47c0tVo/index.m3u8$mahua#第05集$https://mhyunbo.com/20191218/PBckT1Qt/index.m3u8$mahua#第06集$https://mhyunbo.com/20191218/BSy4h1fR/index.m3u8$mahua#第07集$https://mhyunbo.com/20191218/gn2peH5k/index.m3u8$mahua#第08集$https://mhyunbo.com/20191218/2UNcvDq5/index.m3u8$mahua#第09集$https://mhyunbo.com/20191218/ROV7hhdI/index.m3u8$mahua#第10集$https://mhyunbo.com/20191218/VnSKiBc4/index.m3u8$mahua",
|
||||
"_flag": "mahua"
|
||||
}
|
||||
},
|
||||
"des": "马特·史密斯和约翰·利斯高加盟Netflix剧集《王冠》(The Crown,暂译),二人分别饰演菲利普亲王和丘吉尔。剧集剧本由《女王》编剧彼得·摩根创作,首播集由《时时刻刻》导演史蒂芬·戴德利执导,讲述伊丽莎白二世与丘吉尔在二战后,重塑英伦的故事。之前确定由克莱尔·福伊出演伊丽莎白二世。",
|
||||
"m3u8List": [
|
||||
"第01集$https://mhyunbo.com/20191218/5vUSpghQ/index.m3u8$mahua",
|
||||
"第02集$https://mhyunbo.com/20191218/jC9O5JXb/index.m3u8$mahua",
|
||||
"第03集$https://mhyunbo.com/20191218/yHN6zIDc/index.m3u8$mahua",
|
||||
"第04集$https://mhyunbo.com/20191218/q47c0tVo/index.m3u8$mahua",
|
||||
"第05集$https://mhyunbo.com/20191218/PBckT1Qt/index.m3u8$mahua",
|
||||
"第06集$https://mhyunbo.com/20191218/BSy4h1fR/index.m3u8$mahua",
|
||||
"第07集$https://mhyunbo.com/20191218/gn2peH5k/index.m3u8$mahua",
|
||||
"第08集$https://mhyunbo.com/20191218/2UNcvDq5/index.m3u8$mahua",
|
||||
"第09集$https://mhyunbo.com/20191218/ROV7hhdI/index.m3u8$mahua",
|
||||
"第10集$https://mhyunbo.com/20191218/VnSKiBc4/index.m3u8$mahua"
|
||||
],
|
||||
"rate": "9.2"
|
||||
},
|
||||
"rate": "9.2",
|
||||
"id": 253
|
||||
},
|
||||
{
|
||||
"id": 252,
|
||||
"key": "mahuazy",
|
||||
"ids": 29806,
|
||||
"site": {
|
||||
"id": 1,
|
||||
"key": "mahuazy",
|
||||
"name": "麻花资源",
|
||||
"api": "https://www.mhapi123.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
"name": "最后的棒棒",
|
||||
"rate": "9.6",
|
||||
"detail": {
|
||||
"last": "2020-04-12 15:43:02",
|
||||
"id": 29806,
|
||||
"tid": 20,
|
||||
"name": "最后的棒棒",
|
||||
"type": "记录片",
|
||||
"pic": "https://mahuapic.com/upload/vod/2020-04-12/15866774000.jpg",
|
||||
"lang": "国语",
|
||||
"area": "大陆",
|
||||
"year": 2016,
|
||||
"state": 0,
|
||||
"note": "完结",
|
||||
"actor": "何苦",
|
||||
"director": "何苦",
|
||||
"dl": {
|
||||
"dd": {
|
||||
"_t": "第01集$https://mahua-kb.com/20200412/vpFPIG1f/index.m3u8#第02集$https://mahua-kb.com/20200412/K0b5AvUp/index.m3u8#第03集$https://mahua-kb.com/20200412/tgpvWhFj/index.m3u8#第04集$https://mahua-kb.com/20200412/9mc4bPsO/index.m3u8#第05集$https://mahua-kb.com/20200412/gs0qmble/index.m3u8#第06集$https://mahua-kb.com/20200412/l2eDtPPY/index.m3u8#第07集$https://mahua-kb.com/20200412/7LrOTyqT/index.m3u8#第08集$https://mahua-kb.com/20200412/rnLFz9kO/index.m3u8#第09集$https://mahua-kb.com/20200412/nOTSjrba/index.m3u8#第10集$https://mahua-kb.com/20200412/qrfl8OzL/index.m3u8#第11集$https://mahua-kb.com/20200412/Y4sTsCWm/index.m3u8#第12集$https://mahua-kb.com/20200412/w5L2lXpy/index.m3u8#第13集$https://mahua-kb.com/20200412/Up2AGSWE/index.m3u8",
|
||||
"_flag": "mahua"
|
||||
}
|
||||
},
|
||||
"des": "改革开放之初,山城重庆特殊的地理环境孕育了一个特殊的行业——山城棒棒军。爬坡上坎,负重前行的三十多年,数十万棒棒大军不仅挑走了汗水浸泡的年华,也挑走了属于自己的年代。癸巳岁末,几个佝偻背影即将道别正在消逝的行业,一名退役中校扛起一根棒棒开始了自己的追寻——辉煌与尴尬,艰韧和无奈,他们的人生无须评说,他们的故事值得铭记。",
|
||||
"m3u8List": [
|
||||
"第01集$https://mahua-kb.com/20200412/vpFPIG1f/index.m3u8",
|
||||
"第02集$https://mahua-kb.com/20200412/K0b5AvUp/index.m3u8",
|
||||
"第03集$https://mahua-kb.com/20200412/tgpvWhFj/index.m3u8",
|
||||
"第04集$https://mahua-kb.com/20200412/9mc4bPsO/index.m3u8",
|
||||
"第05集$https://mahua-kb.com/20200412/gs0qmble/index.m3u8",
|
||||
"第06集$https://mahua-kb.com/20200412/l2eDtPPY/index.m3u8",
|
||||
"第07集$https://mahua-kb.com/20200412/7LrOTyqT/index.m3u8",
|
||||
"第08集$https://mahua-kb.com/20200412/rnLFz9kO/index.m3u8",
|
||||
"第09集$https://mahua-kb.com/20200412/nOTSjrba/index.m3u8",
|
||||
"第10集$https://mahua-kb.com/20200412/qrfl8OzL/index.m3u8",
|
||||
"第11集$https://mahua-kb.com/20200412/Y4sTsCWm/index.m3u8",
|
||||
"第12集$https://mahua-kb.com/20200412/w5L2lXpy/index.m3u8",
|
||||
"第13集$https://mahua-kb.com/20200412/Up2AGSWE/index.m3u8"
|
||||
],
|
||||
"rate": "9.6"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 251,
|
||||
"key": "mahuazy",
|
||||
"ids": 50694,
|
||||
"site": {
|
||||
"id": 1,
|
||||
"key": "mahuazy",
|
||||
"name": "麻花资源",
|
||||
"api": "https://www.mhapi123.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
"name": "以你的心诠释我的爱",
|
||||
"index": 2,
|
||||
"rate": "9.5",
|
||||
"detail": {
|
||||
"last": "2020-11-13 09:34:47",
|
||||
"id": 50694,
|
||||
"tid": 17,
|
||||
"name": "以你的心诠释我的爱",
|
||||
"type": "泰剧",
|
||||
"pic": "https://mahuapic.com/upload/vod/2020-10-23/16034119330.jpg",
|
||||
"lang": "泰语",
|
||||
"area": "泰国",
|
||||
"year": 2020,
|
||||
"state": 0,
|
||||
"note": "更新至04集",
|
||||
"actor": "克里特·安努艾德奇康,普提蓬·阿萨拉塔纳功",
|
||||
"director": "纳卢拜·库诺",
|
||||
"dl": {
|
||||
"dd": {
|
||||
"_t": "第01集$https://b.mhqiyi.com/20201022/K4gdEqpu/index.m3u8#第02集$https://b.mhqiyi.com/20201029/h3maf38g/index.m3u8#第03集$https://e.mahua-kb.com/20201105/HVK7wMlM/index.m3u8#第04集$https://b.mhqiyi.com/20201112/pOl6JaA7/index.m3u8",
|
||||
"_flag": "mahua"
|
||||
}
|
||||
},
|
||||
"des": "这部电视剧是BKPP project的一部分",
|
||||
"m3u8List": [
|
||||
"第01集$https://b.mhqiyi.com/20201022/K4gdEqpu/index.m3u8",
|
||||
"第02集$https://b.mhqiyi.com/20201029/h3maf38g/index.m3u8",
|
||||
"第03集$https://e.mahua-kb.com/20201105/HVK7wMlM/index.m3u8",
|
||||
"第04集$https://b.mhqiyi.com/20201112/pOl6JaA7/index.m3u8"
|
||||
],
|
||||
"rate": "9.5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 250,
|
||||
"key": "niuniucj",
|
||||
"ids": 20044,
|
||||
"site": {
|
||||
@@ -12,6 +266,7 @@
|
||||
"isActive": 1
|
||||
},
|
||||
"name": "此画怎讲",
|
||||
"rate": "8.1",
|
||||
"detail": {
|
||||
"last": "2020-09-23 23:23:36",
|
||||
"id": 20044,
|
||||
@@ -72,11 +327,10 @@
|
||||
"第30集$https://s6.niuniu-baidu.com/2020/09/23/37H4vtEiTXcjSzoa/index.m3u8"
|
||||
],
|
||||
"rate": "8.1"
|
||||
},
|
||||
"rate": "8.1",
|
||||
"id": 250
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 249,
|
||||
"key": "niuniucj",
|
||||
"ids": 4255,
|
||||
"site": {
|
||||
@@ -89,6 +343,7 @@
|
||||
"isActive": 1
|
||||
},
|
||||
"name": "紧急呼救第一季",
|
||||
"rate": "8.6",
|
||||
"detail": {
|
||||
"last": "2019-10-10 19:19:15",
|
||||
"id": 4255,
|
||||
@@ -129,11 +384,10 @@
|
||||
"第10集$https://s1.niuniu-baidu.com/20191010/XZjWRMxLgh8nyFlT/index.m3u8"
|
||||
],
|
||||
"rate": "8.6"
|
||||
},
|
||||
"rate": "8.6",
|
||||
"id": 249
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 248,
|
||||
"key": "niuniucj",
|
||||
"ids": 20632,
|
||||
"site": {
|
||||
@@ -146,6 +400,7 @@
|
||||
"isActive": 1
|
||||
},
|
||||
"name": "小小世界",
|
||||
"rate": "9.4",
|
||||
"detail": {
|
||||
"last": "2020-10-03 12:00:49",
|
||||
"id": 20632,
|
||||
@@ -182,9 +437,7 @@
|
||||
"第06集$https://s6.niuniu-baidu.com/2020/10/03/U0JFALI1lHOjWCfw/index.m3u8"
|
||||
],
|
||||
"rate": "9.4"
|
||||
},
|
||||
"rate": "9.4",
|
||||
"id": 248
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 247,
|
||||
@@ -9238,6 +9491,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"key": "mahuazy",
|
||||
"ids": 20868,
|
||||
"site": {
|
||||
@@ -9250,6 +9504,7 @@
|
||||
"group": "默认"
|
||||
},
|
||||
"name": "铁血战士(1987)",
|
||||
"rate": "7.7",
|
||||
"detail": {
|
||||
"last": "2019-11-23 10:59:36",
|
||||
"id": 20868,
|
||||
@@ -9275,9 +9530,7 @@
|
||||
"HD$https://mhbobo.com/20191121/vyWmCGRH/index.m3u8"
|
||||
],
|
||||
"rate": "7.7"
|
||||
},
|
||||
"rate": "7.7",
|
||||
"id": 22
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
|
||||
@@ -3,270 +3,180 @@
|
||||
"id": 1,
|
||||
"key": "mahuazy",
|
||||
"name": "麻花资源",
|
||||
"api": "https://www.mhapi123.com/inc/api.php",
|
||||
"api": "http://www.mhapi123.com/inc/ldg_api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"key": "niuniucj",
|
||||
"name": "牛牛资源",
|
||||
"api": "http://v.niuniucj.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"key": "88zyw",
|
||||
"name": "88 影视资源站",
|
||||
"api": "http://www.88zyw.net/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 4,
|
||||
"key": "apibdzy",
|
||||
"name": "百度云资源",
|
||||
"api": "https://api.apibdzy.com/api.php/provide/vod/at/xml",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"key": "mbo",
|
||||
"name": "秒播资源",
|
||||
"api": "http://caiji.mb77.vip/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"key": "zuidazy",
|
||||
"name": "最大资源网",
|
||||
"api": "http://www.zdziyuan.com/inc/api.php",
|
||||
"download": "http://www.zdziyuan.com/inc/apidown.php",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"key": "123ku",
|
||||
"name": "123 资源",
|
||||
"api": "http://cj.123ku2.com:12315/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 8,
|
||||
"key": "okzy",
|
||||
"name": "OK 资源网",
|
||||
"api": "http://cj.okzy.tv/inc/api.php",
|
||||
"download": "http://cj.okzy.tv/inc/apidown.php",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 9,
|
||||
"key": "kuyunzy",
|
||||
"name": "酷云资源",
|
||||
"api": "http://caiji.kuyun98.com/inc/ldg_api.php",
|
||||
"download": "http://caiji.kuyun98.com/inc/apidown.php",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"key": "kubozy",
|
||||
"name": "酷播资源",
|
||||
"api": "http://api.kbzyapi.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"key": "yongjiuzy",
|
||||
"name": "永久资源",
|
||||
"api": "http://cj.yongjiuzyw.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"key": "rrzy",
|
||||
"name": "人人资源",
|
||||
"api": "https://www.rrzyw.cc/api.php/provide/vod/from/rrm3u8/at/xml/",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"key": "bbkdj",
|
||||
"name": "步步高顶尖资源网",
|
||||
"api": "http://api.bbkdj.com/api",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"key": "solezy",
|
||||
"name": "搜乐资源网",
|
||||
"api": "https://www.caijizy.vip/api.php/provide/vod/at/xml/",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"key": "zuixinzy",
|
||||
"name": "最新资源",
|
||||
"api": "http://api.zuixinapi.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"key": "605zy",
|
||||
"name": "605资源",
|
||||
"api": "http://www.605zy.net/inc/seacmsapi.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"key": "subo988",
|
||||
"name": "速播资源站",
|
||||
"api": "https://www.subo988.com/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"key": "1886zy",
|
||||
"name": "1886 资源",
|
||||
"api": "http://cj.1886zy.co/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
"key": "doubanzy",
|
||||
"name": "豆瓣电影资源",
|
||||
"api": "http://v.1988cj.com/inc/api.php",
|
||||
"download": "http://v.1988cj.com/inc/apidown.php",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 20,
|
||||
"key": "135zy",
|
||||
"name": "135 资源网",
|
||||
"api": "http://cj.zycjw1.com/inc/api.php",
|
||||
"download": "http://cj.zycjw1.com/inc/apidown.php",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 21,
|
||||
"key": "mgtvzy",
|
||||
"name": "芒果 TV 资源网",
|
||||
"api": "https://api.shijiapi.com/api.php/provide/vod/at/xml/",
|
||||
"id": 3,
|
||||
"key": "123ku",
|
||||
"name": "123 资源",
|
||||
"api": "http://cj.123ku2.com:12315/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 22,
|
||||
"key": "7K资源",
|
||||
"id": 4,
|
||||
"name": "7K资源",
|
||||
"api": "https://zy.7kjx.com/cjapi.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "default",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"key": "1717云资源网",
|
||||
"id": 5,
|
||||
"name": "1717云资源网",
|
||||
"api": "http://zy.itono.cn/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "https://www.1717yun.com/jiexi/?url=",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"key": "subo988",
|
||||
"name": "速播资源站",
|
||||
"api": "https://www.subo988.com/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 7,
|
||||
"key": "88zyw",
|
||||
"name": "88 影视资源站",
|
||||
"api": "http://www.88zyw.net/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"key": "zuidazy",
|
||||
"id": 8,
|
||||
"name": "最大资源网",
|
||||
"api": "http://www.zdziyuan.com/inc/ldg_sea.php",
|
||||
"download": "http://www.zdziyuan.com/inc/apidown.php",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"key": "mbo",
|
||||
"id": 9,
|
||||
"name": "秒播资源",
|
||||
"api": "http://caiji.mb77.vip/inc/seacmsapi.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"key": "apibdzy",
|
||||
"name": "百度云资源",
|
||||
"api": "https://api.apibdzy.com/api.php/provide/vod/at/xml",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"key": "okzy",
|
||||
"name": "OK 资源网",
|
||||
"api": "http://cj.okzy.tv/inc/api.php",
|
||||
"download": "http://cj.okzy.tv/inc/apidown.php",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
"key": "kuyunzy",
|
||||
"name": "酷云资源",
|
||||
"api": "http://caiji.kuyun98.com/inc/ldg_api.php",
|
||||
"download": "http://caiji.kuyun98.com/inc/apidown.php",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 13,
|
||||
"key": "kubozy",
|
||||
"name": "酷播资源",
|
||||
"api": "http://api.kbzyapi.com/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"key": "yongjiuzy",
|
||||
"name": "永久资源",
|
||||
"api": "http://cj.yongjiuzyw.com/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"key": "rrzy",
|
||||
"name": "人人资源",
|
||||
"api": "https://www.rrzyw.cc/api.php/provide/vod/from/rrm3u8/at/xml/",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"key": "bbkdj",
|
||||
"name": "步步高顶尖资源网",
|
||||
"api": "http://api.bbkdj.com/api",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"key": "zuixinzy",
|
||||
"name": "最新资源",
|
||||
"api": "http://api.zuixinapi.com/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"key": "209zy",
|
||||
"name": "209 资源",
|
||||
"api": "http://cj.1156zy.com/inc/api.php",
|
||||
"download": "",
|
||||
"jiexiUrl": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
"key": "kkzy",
|
||||
"name": "快快资源",
|
||||
"api": "https://api.kkzy.tv/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 24,
|
||||
"key": "wolongzy",
|
||||
"name": "卧龙资源",
|
||||
"api": "http://cj.wlzy.tv/inc/api_mac.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"key": "mokazy",
|
||||
"name": "魔卡资源网",
|
||||
"api": "https://cj.heiyap.com/api.php/provide/vod/at/xml/",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 26,
|
||||
"key": "158zy",
|
||||
"name": "壹伍捌资源网",
|
||||
"api": "http://cj.158zyz.net:158/inc/api.php",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
},
|
||||
{
|
||||
"id": 27,
|
||||
"key": "kyzy",
|
||||
"name": "快影资源站",
|
||||
"api": "https://www.kyzy.tv/api.php/kyyun/vod/at/xml/",
|
||||
"download": "",
|
||||
"group": "默认",
|
||||
"isActive": true,
|
||||
"status": "可用"
|
||||
"isActive": true
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -9,6 +9,7 @@ const setting = [
|
||||
excludeRootClasses: true,
|
||||
excludeR18Films: true,
|
||||
forwardTimeInSec: 5,
|
||||
waitingTimeInSec: 15,
|
||||
starViewMode: 'picture',
|
||||
recommendationViewMode: 'picture',
|
||||
historyViewMode: 'picture',
|
||||
@@ -19,7 +20,10 @@ const setting = [
|
||||
scheme: '',
|
||||
url: '',
|
||||
port: ''
|
||||
}
|
||||
},
|
||||
allowPassWhenIptvCheck: true,
|
||||
autocleanWhenIptvCheck: false,
|
||||
autoChangeSourceWhenIptvStalling: true
|
||||
}
|
||||
]
|
||||
|
||||
@@ -66,7 +70,7 @@ const localKey = [
|
||||
},
|
||||
{
|
||||
name: 'escape',
|
||||
desc: '退出全屏',
|
||||
desc: '退出全屏/精简模式',
|
||||
key: 'esc'
|
||||
},
|
||||
{
|
||||
@@ -89,6 +93,21 @@ const localKey = [
|
||||
desc: '跳到视频结束位置',
|
||||
key: 'end'
|
||||
},
|
||||
{
|
||||
name: 'startPosition',
|
||||
desc: '标记片头',
|
||||
key: 'ctrl+home'
|
||||
},
|
||||
{
|
||||
name: 'endPosition',
|
||||
desc: '标记片尾',
|
||||
key: 'ctrl+end'
|
||||
},
|
||||
{
|
||||
name: 'clearPosition',
|
||||
desc: '清除标记',
|
||||
key: 'ctrl+del'
|
||||
},
|
||||
{
|
||||
name: 'opacityUp',
|
||||
desc: '透明度调高',
|
||||
@@ -113,6 +132,11 @@ const localKey = [
|
||||
name: 'mini',
|
||||
desc: '进入或退出mini模式',
|
||||
key: 'alt+m'
|
||||
},
|
||||
{
|
||||
name: 'resetMini',
|
||||
desc: '重置mini窗口',
|
||||
key: 'ctrl+0'
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import db from './dexie'
|
||||
const { iptvSearch } = db
|
||||
export default {
|
||||
async add (doc) {
|
||||
return await iptvSearch.add(doc)
|
||||
},
|
||||
async find (doc) {
|
||||
return await iptvSearch.get(doc)
|
||||
},
|
||||
async update (id, docs) {
|
||||
return await iptvSearch.update(id, docs)
|
||||
},
|
||||
async all () {
|
||||
return await iptvSearch.toArray()
|
||||
},
|
||||
async remove (id) {
|
||||
return await iptvSearch.delete(id)
|
||||
},
|
||||
async clear () {
|
||||
return await iptvSearch.clear()
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col, Tree } from 'element-ui'
|
||||
import { Message, Button, Table, TableColumn, Tag, Input, InputNumber, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col, Tree, Divider, Progress } from 'element-ui'
|
||||
import Plugin from 'v-fit-columns'
|
||||
Vue.use(Button)
|
||||
Vue.use(Col)
|
||||
@@ -7,6 +7,7 @@ Vue.use(Table)
|
||||
Vue.use(TableColumn)
|
||||
Vue.use(Tag)
|
||||
Vue.use(Input)
|
||||
Vue.use(InputNumber)
|
||||
Vue.use(Dialog)
|
||||
Vue.use(Form)
|
||||
Vue.use(FormItem)
|
||||
@@ -17,4 +18,6 @@ Vue.use(Option)
|
||||
Vue.use(Checkbox)
|
||||
Vue.use(Autocomplete)
|
||||
Vue.use(Tree)
|
||||
Vue.use(Divider)
|
||||
Vue.use(Progress)
|
||||
Vue.prototype.$message = Message
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
import express from 'express'
|
||||
import cors from 'cors'
|
||||
const Axios = require('axios')
|
||||
|
||||
const app = express()
|
||||
app.use(cors())
|
||||
app.use(express.json())
|
||||
app.use(express.urlencoded({ extended: true }))
|
||||
|
||||
app.post('/api', async (req, res) => {
|
||||
const result = await Axios.get(req.body.url)
|
||||
res.json({
|
||||
code: 1,
|
||||
info: result.data
|
||||
})
|
||||
})
|
||||
|
||||
app.listen(44444)
|
||||
@@ -3,36 +3,55 @@ import axios from 'axios'
|
||||
import parser from 'fast-xml-parser'
|
||||
import cheerio from 'cheerio'
|
||||
import { Parser as M3u8Parser } from 'm3u8-parser'
|
||||
// import FLVDemuxer from 'xgplayer-flv.js/src/flv/demux/flv-demuxer.js'
|
||||
import SocksProxyAgent from 'socks-proxy-agent'
|
||||
|
||||
// axios使用系统代理 https://evandontje.com/2020/04/02/automatic-system-proxy-configuration-for-electron-applications/
|
||||
// xgplayer使用chromium代理设置,浏览器又默认使用系统代理 https://www.chromium.org/developers/design-documents/network-settings
|
||||
// 要在设置中添加代理设置,可参考https://stackoverflow.com/questions/37393248/how-connect-to-proxy-in-electron-webview
|
||||
var http = require('http')
|
||||
var https = require('http')
|
||||
const http = require('http')
|
||||
const https = require('http')
|
||||
const { remote } = require('electron')
|
||||
var win = remote.getCurrentWindow()
|
||||
var session = win.webContents.session
|
||||
var ElectronProxyAgent = require('electron-proxy-agent')
|
||||
const win = remote.getCurrentWindow()
|
||||
const session = win.webContents.session
|
||||
const ElectronProxyAgent = require('electron-proxy-agent')
|
||||
const URL = require('url')
|
||||
const request = require('request')
|
||||
let proxyURL
|
||||
|
||||
// 取消axios请求 浅析cancelToken https://juejin.cn/post/6844904168277147661 https://masteringjs.io/tutorials/axios/cancel
|
||||
// const source = axios.CancelToken.source()
|
||||
// const cancelToken = source.token
|
||||
|
||||
// 请求超时时限
|
||||
axios.defaults.timeout = 10000 // 可能使用代理,增长超时
|
||||
// axios.defaults.timeout = 10000 // 可能使用代理,增长超时
|
||||
const TIMEOUT = 20000
|
||||
|
||||
// 重试次数,共请求3次
|
||||
axios.defaults.retry = 2
|
||||
// 重试次数,共请求2次
|
||||
axios.defaults.retry = 1
|
||||
|
||||
// 请求的间隙
|
||||
axios.defaults.retryDelay = 1000
|
||||
|
||||
// 使用请求拦截器动态调整超时
|
||||
axios.interceptors.request.use(function (config) {
|
||||
if (config.__retryCount === undefined) {
|
||||
config.timeout = TIMEOUT
|
||||
} else {
|
||||
config.timeout = TIMEOUT * (config.__retryCount + 1)
|
||||
}
|
||||
return config
|
||||
}, function (err) {
|
||||
return Promise.reject(err)
|
||||
})
|
||||
|
||||
// 添加响应拦截器
|
||||
axios.interceptors.response.use(function (response) {
|
||||
// 对响应数据做些事
|
||||
if (response.status && response.status === 200 && response.request.responseURL.includes('api.php') && !response.data.startsWith('<?xml')) {
|
||||
}
|
||||
return response
|
||||
}, function (err) { // 请求错误时做些事
|
||||
// 请求超时的之后,抛出 err.code = ECONNABORTED的错误..错误信息是 timeout of xxx ms exceeded
|
||||
if (err.code === 'ECONNABORTED' && err.message.indexOf('timeout') !== -1) {
|
||||
var config = err.config
|
||||
const config = err.config
|
||||
config.__retryCount = config.__retryCount || 0
|
||||
|
||||
if (config.__retryCount >= config.retry) {
|
||||
@@ -42,7 +61,7 @@ axios.interceptors.response.use(function (response) {
|
||||
|
||||
config.__retryCount += 1
|
||||
|
||||
var backoff = new Promise(function (resolve) {
|
||||
const backoff = new Promise(function (resolve) {
|
||||
setTimeout(function () {
|
||||
resolve()
|
||||
}, config.retryDelay || 1)
|
||||
@@ -92,9 +111,10 @@ const zy = {
|
||||
axios.post(url).then(res => {
|
||||
const data = res.data
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const jsondata = json.rss === undefined ? json : json.rss
|
||||
const arr = []
|
||||
if (json.rss.class) {
|
||||
for (const i of json.rss.class.ty) {
|
||||
if (jsondata.class) {
|
||||
for (const i of jsondata.class.ty) {
|
||||
const j = {
|
||||
tid: i._id,
|
||||
name: i._t
|
||||
@@ -104,10 +124,10 @@ const zy = {
|
||||
}
|
||||
const doc = {
|
||||
class: arr,
|
||||
page: json.rss.list._page,
|
||||
pagecount: json.rss.list._pagecount,
|
||||
pagesize: json.rss.list._pagesize,
|
||||
recordcount: json.rss.list._recordcount
|
||||
page: jsondata.list._page,
|
||||
pagecount: jsondata.list._pagecount,
|
||||
pagesize: jsondata.list._pagesize,
|
||||
recordcount: jsondata.list._recordcount
|
||||
}
|
||||
resolve(doc)
|
||||
}).catch(err => {
|
||||
@@ -136,8 +156,13 @@ const zy = {
|
||||
axios.post(url).then(async res => {
|
||||
const data = res.data
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const videoList = json.rss.list.video
|
||||
resolve(videoList)
|
||||
const jsondata = json.rss === undefined ? json : json.rss
|
||||
const videoList = jsondata.list.video
|
||||
if (videoList && videoList.length) {
|
||||
resolve(videoList)
|
||||
} else {
|
||||
resolve([])
|
||||
}
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
@@ -161,13 +186,14 @@ const zy = {
|
||||
url = `${site.api}?ac=videolist`
|
||||
}
|
||||
axios.post(url).then(async res => {
|
||||
const data = res.data
|
||||
const data = res.data.match(/<list [^>]*>/)[0] + '</list>' // 某些源站不含页码时获取到的数据parser无法解析
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const jsondata = json.rss === undefined ? json : json.rss
|
||||
const pg = {
|
||||
page: json.rss.list._page,
|
||||
pagecount: json.rss.list._pagecount,
|
||||
pagesize: json.rss.list._pagesize,
|
||||
recordcount: json.rss.list._recordcount
|
||||
page: jsondata.list._page,
|
||||
pagecount: jsondata.list._pagecount,
|
||||
pagesize: jsondata.list._pagesize,
|
||||
recordcount: jsondata.list._recordcount
|
||||
}
|
||||
resolve(pg)
|
||||
}).catch(err => {
|
||||
@@ -187,12 +213,13 @@ const zy = {
|
||||
this.getSite(key).then(res => {
|
||||
const site = res
|
||||
wd = encodeURI(wd)
|
||||
var url = `${site.api}?wd=${wd}`
|
||||
const url = `${site.api}?wd=${wd}`
|
||||
axios.post(url, { timeout: 3000 }).then(res => {
|
||||
const data = res.data
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
if (json && json.rss && json.rss.list) {
|
||||
const videoList = json.rss.list.video
|
||||
const jsondata = json.rss === undefined ? json : json.rss
|
||||
if (json && jsondata && jsondata.list) {
|
||||
const videoList = jsondata.list.video
|
||||
resolve(videoList)
|
||||
}
|
||||
}).catch(err => {
|
||||
@@ -216,21 +243,52 @@ const zy = {
|
||||
axios.post(url).then(res => {
|
||||
const data = res.data
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const videoList = json.rss.list.video
|
||||
// Parse m3u8List
|
||||
var m3u8List = []
|
||||
const jsondata = json.rss === undefined ? json : json.rss
|
||||
const videoList = jsondata.list.video
|
||||
// Parse video lists
|
||||
let fullList = []
|
||||
let index = 0
|
||||
const supportedFormats = ['m3u8', 'mp4']
|
||||
const dd = videoList.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
m3u8List = i._t.split('#')
|
||||
i._t = i._t.replace(/\$+/g, '$')
|
||||
const ext = Array.from(new Set(...i._t.split('#').map(e => e.includes('$') ? e.split('$')[1].match(/\.\w+?$/) : e.match(/\.\w+?$/)))).map(e => e.slice(1))
|
||||
if (ext.length && ext.length <= supportedFormats.length && ext.every(e => supportedFormats.includes(e))) {
|
||||
if (ext.length === 1) {
|
||||
i._flag = ext[0]
|
||||
} else {
|
||||
i._flag = index ? 'ZY支持-' + index : 'ZY支持'
|
||||
index++
|
||||
}
|
||||
}
|
||||
fullList.push(
|
||||
{
|
||||
flag: i._flag,
|
||||
list: i._t.split('#').filter(e => e && (e.startsWith('http') || (e.split('$')[1] && e.split('$')[1].startsWith('http'))))
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
m3u8List = dd._t.split('#')
|
||||
fullList.push(
|
||||
{
|
||||
flag: dd._flag,
|
||||
list: dd._t.replace(/\$+/g, '$').split('#').filter(e => e && (e.startsWith('http') || (e.split('$')[1] && e.split('$')[1].startsWith('http'))))
|
||||
}
|
||||
)
|
||||
}
|
||||
videoList.m3u8List = m3u8List
|
||||
fullList.forEach(item => {
|
||||
if (item.list.every(e => e.includes('$') && /^\s*\d+\s*$/.test(e.split('$')[0]))) item.list.sort((a, b) => { return a.split('$')[0] - b.split('$')[0] })
|
||||
})
|
||||
if (fullList.length > 1) { // 将ZY支持的播放列表前置
|
||||
index = fullList.findIndex(e => supportedFormats.includes(e.flag) || e.flag.startsWith('ZY支持'))
|
||||
if (index !== -1) {
|
||||
const first = fullList.splice(index, 1)
|
||||
fullList = first.concat(fullList)
|
||||
}
|
||||
}
|
||||
videoList.fullList = fullList
|
||||
resolve(videoList)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
@@ -246,8 +304,10 @@ const zy = {
|
||||
* @param {*} id 资源唯一标识符 id
|
||||
* @returns
|
||||
*/
|
||||
download (key, id) {
|
||||
download (key, id, videoFlag) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let info = ''
|
||||
let downloadUrls = ''
|
||||
this.getSite(key).then(res => {
|
||||
const site = res
|
||||
if (site.download) {
|
||||
@@ -255,13 +315,44 @@ const zy = {
|
||||
axios.post(url).then(res => {
|
||||
const data = res.data
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const videoList = json.rss.list.video
|
||||
resolve(videoList)
|
||||
}).catch(err => {
|
||||
const jsondata = json.rss === undefined ? json : json.rss
|
||||
const videoList = jsondata.list.video
|
||||
const dd = videoList.dl.dd
|
||||
const type = Object.prototype.toString.call(dd)
|
||||
if (type === '[object Array]') {
|
||||
for (const i of dd) {
|
||||
downloadUrls = i._t.replace(/\$+/g, '$').split('#').map(e => encodeURI(e.includes('$') ? e.split('$')[1] : e)).join('\n')
|
||||
}
|
||||
} else {
|
||||
downloadUrls = dd._t.replace(/\$+/g, '$').split('#').map(e => encodeURI(e.includes('$') ? e.split('$')[1] : e)).join('\n')
|
||||
}
|
||||
if (downloadUrls) {
|
||||
info = '调用下载接口获取到的链接已复制, 快去下载吧!'
|
||||
resolve({ downloadUrls: downloadUrls, info: info })
|
||||
} else {
|
||||
throw new Error()
|
||||
}
|
||||
}).catch((err) => {
|
||||
err.info = '无法获取到下载链接,请通过播放页面点击“调试”按钮获取'
|
||||
reject(err)
|
||||
})
|
||||
} else {
|
||||
resolve([])
|
||||
zy.detail(key, id).then(res => {
|
||||
const dl = res.fullList.find(e => e.flag === videoFlag) || res.fullList[0]
|
||||
for (const i of dl.list) {
|
||||
const url = encodeURI(i.includes('$') ? i.split('$')[1] : i)
|
||||
downloadUrls += (url + '\n')
|
||||
}
|
||||
if (downloadUrls) {
|
||||
info = '视频源链接已复制, 快去下载吧!'
|
||||
resolve({ downloadUrls: downloadUrls, info: info })
|
||||
} else {
|
||||
throw new Error()
|
||||
}
|
||||
}).catch((err) => {
|
||||
err.info = '无法获取到下载链接,请通过播放页面点击“调试”按钮获取'
|
||||
reject(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -288,49 +379,72 @@ const zy = {
|
||||
* @param {*} channel 直播频道 url
|
||||
* @returns boolean
|
||||
*/
|
||||
async checkChannel (channel) {
|
||||
checkChannel (url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.get(channel).then(res => {
|
||||
const manifest = res.data
|
||||
var parser = new M3u8Parser()
|
||||
parser.push(manifest)
|
||||
parser.end()
|
||||
var parsedManifest = parser.manifest
|
||||
if (parsedManifest.segments.length) {
|
||||
resolve(true)
|
||||
} else {
|
||||
resolve(false)
|
||||
const supportFormats = /\.(m3u8|flv)$/
|
||||
const extRE = url.match(supportFormats) || new URL.URL(url).pathname.match(supportFormats)
|
||||
if (extRE[1] === 'flv') {
|
||||
const MAX_CONTENT_LENGTH = 2000 // axios配置maxContentLength不生效,先用request凑合
|
||||
let receivedLength = 0
|
||||
let options = { uri: url, gzip: true, timeout: 10000 }
|
||||
if (proxyURL) {
|
||||
if (proxyURL.startsWith('http')) options = Object.assign({ proxy: proxyURL }, options)
|
||||
if (proxyURL.startsWith('socks5')) options = Object.assign({ agent: new SocksProxyAgent(proxyURL) }, options)
|
||||
}
|
||||
}).catch(e => {
|
||||
resolve(false)
|
||||
})
|
||||
const req = request.get(options)
|
||||
.on('data', (str) => {
|
||||
receivedLength += str.length
|
||||
if (receivedLength > MAX_CONTENT_LENGTH) {
|
||||
resolve(true) // 应该用FLVDemuxer.probe来检测,先凑合
|
||||
req.abort()
|
||||
}
|
||||
})
|
||||
.on('error', function (err) {
|
||||
resolve(false)
|
||||
console.log(err)
|
||||
})
|
||||
.on('end', () => { resolve(false) })
|
||||
} else if (extRE[1] === 'm3u8') {
|
||||
axios.get(url).then(res => {
|
||||
const manifest = res.data
|
||||
const parser = new M3u8Parser()
|
||||
parser.push(manifest)
|
||||
parser.end()
|
||||
const parsedManifest = parser.manifest
|
||||
if (parsedManifest.segments.length) {
|
||||
resolve(true)
|
||||
} else {
|
||||
resolve(false)
|
||||
}
|
||||
}).catch(e => {
|
||||
resolve(false)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取豆瓣页面链接
|
||||
* @param {*} name 视频名称
|
||||
* @param {*} year 视频年份
|
||||
* @returns 豆瓣页面链接,如果没有搜到该视频,返回搜索页面链接
|
||||
*/
|
||||
doubanLink (name) {
|
||||
doubanLink (name, year) {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 豆瓣搜索链接
|
||||
var nameToSearch = name.replace(/\s/g, '')
|
||||
var doubanSearchLink = 'https://www.douban.com/search?q=' + nameToSearch
|
||||
const nameToSearch = name.replace(/\s/g, '')
|
||||
const doubanSearchLink = 'https://www.douban.com/search?q=' + nameToSearch
|
||||
axios.get(doubanSearchLink).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
// 比较第一和第二给豆瓣搜索结果, 看名字是否相符
|
||||
var link = ''
|
||||
var linkInDouban = $($('div.result')[0]).find('div>div>h3>a').first()
|
||||
var nameInDouban = linkInDouban.text().replace(/\s/g, '')
|
||||
if (nameToSearch === nameInDouban) {
|
||||
link = linkInDouban.attr('href')
|
||||
} else {
|
||||
linkInDouban = $($('div.result')[1]).find('div>div>h3>a').first()
|
||||
nameInDouban = linkInDouban.text().replace(/\s/g, '')
|
||||
if (nameToSearch === nameInDouban) {
|
||||
// 查询所有搜索结果, 看名字和年代是否相符
|
||||
let link = ''
|
||||
$('div.result').each(function () {
|
||||
const linkInDouban = $(this).find('div>div>h3>a').first()
|
||||
const nameInDouban = linkInDouban.text().replace(/\s/g, '')
|
||||
const subjectCast = $(this).find('span.subject-cast').text()
|
||||
if (nameToSearch === nameInDouban && subjectCast && subjectCast.includes(year)) {
|
||||
link = linkInDouban.attr('href')
|
||||
}
|
||||
}
|
||||
})
|
||||
if (link) {
|
||||
resolve(link)
|
||||
} else {
|
||||
@@ -345,18 +459,19 @@ const zy = {
|
||||
/**
|
||||
* 获取豆瓣评分
|
||||
* @param {*} name 视频名称
|
||||
* @param {*} year 视频年份
|
||||
* @returns 豆瓣评分
|
||||
*/
|
||||
doubanRate (name) {
|
||||
doubanRate (name, year) {
|
||||
return new Promise((resolve, reject) => {
|
||||
var nameToSearch = name.replace(/\s/g, '')
|
||||
this.doubanLink(nameToSearch).then(link => {
|
||||
const nameToSearch = name.replace(/\s/g, '')
|
||||
this.doubanLink(nameToSearch, year).then(link => {
|
||||
if (link.includes('https://www.douban.com/search')) {
|
||||
resolve('暂无评分')
|
||||
} else {
|
||||
axios.get(link).then(response => {
|
||||
const parsedHtml = cheerio.load(response.data)
|
||||
var rating = parsedHtml('body').find('#interest_sectl').first().find('strong').first()
|
||||
const rating = parsedHtml('body').find('#interest_sectl').first().find('strong').first()
|
||||
if (rating.text()) {
|
||||
resolve(rating.text().replace(/\s/g, ''))
|
||||
} else {
|
||||
@@ -371,20 +486,28 @@ const zy = {
|
||||
})
|
||||
})
|
||||
},
|
||||
async proxy () {
|
||||
get7kParseURL () {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.get('https://zy.7kjx.com/').then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
const parseURL = $('body > div.container > div > div.stui-pannel > div.col-pd > p:contains("解析接口:")').first().find('a').text()
|
||||
resolve(parseURL)
|
||||
}).catch(err => { reject(err) })
|
||||
})
|
||||
},
|
||||
proxy () {
|
||||
return new Promise((resolve, reject) => {
|
||||
setting.find().then(db => {
|
||||
if (db.proxy) {
|
||||
if (db.proxy.type === 'none') {
|
||||
session.setProxy({ proxyRules: 'direct://' })
|
||||
if (db && db.proxy && db.proxy.type === 'manual') {
|
||||
if (db.proxy.scheme && db.proxy.url && db.proxy.port) {
|
||||
proxyURL = db.proxy.scheme + '://' + db.proxy.url.trim() + ':' + db.proxy.port.trim()
|
||||
session.setProxy({ proxyRules: proxyURL })
|
||||
http.globalAgent = https.globalAgent = new ElectronProxyAgent(session)
|
||||
} else if (db.proxy.type === 'manual') {
|
||||
if (db.proxy.scheme && db.proxy.url && db.proxy.port) {
|
||||
const proxyURL = db.proxy.scheme + '://' + db.proxy.url.trim() + ':' + db.proxy.port.trim()
|
||||
session.setProxy({ proxyRules: proxyURL })
|
||||
http.globalAgent = https.globalAgent = new ElectronProxyAgent(session)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
proxyURL = ''
|
||||
session.setProxy({ proxyRules: 'direct://' })
|
||||
http.globalAgent = https.globalAgent = new ElectronProxyAgent(session)
|
||||
}
|
||||
// 不要删了,留着测试用
|
||||
// axios.get('https://api.my-ip.io/ip').then(res => console.log(res))
|
||||
|
||||
@@ -1,18 +1,24 @@
|
||||
import { BrowserWindow, ipcMain } from 'electron'
|
||||
import { autoUpdater } from 'electron-updater'
|
||||
const { autoUpdater } = require('electron-updater')
|
||||
|
||||
// electron-updater 增量更新时似乎无法显示进度
|
||||
export function initUpdater (win = BrowserWindow) {
|
||||
autoUpdater.autoDownload = false
|
||||
autoUpdater.autoInstallOnAppQuit = false
|
||||
autoUpdater.autoInstallOnAppQuit = true
|
||||
|
||||
// 主进程监听检查更新事件
|
||||
ipcMain.on('checkForUpdate', () => {
|
||||
autoUpdater.checkForUpdates()
|
||||
})
|
||||
|
||||
// 主进程监听开始下载事件
|
||||
ipcMain.on('downloadUpdate', () => {
|
||||
autoUpdater.downloadUpdate()
|
||||
})
|
||||
|
||||
// 主进程监听退出并安装事件
|
||||
ipcMain.on('quitAndInstall', () => {
|
||||
autoUpdater.downloadUpdate()
|
||||
autoUpdater.quitAndInstall()
|
||||
})
|
||||
|
||||
// 开始检测是否有更新
|
||||
@@ -40,9 +46,8 @@ export function initUpdater (win = BrowserWindow) {
|
||||
win.webContents.send('download-progress', progressObj)
|
||||
})
|
||||
|
||||
// 下载完成并退出安装
|
||||
// 下载完成
|
||||
autoUpdater.on('update-downloaded', () => {
|
||||
win.webContents.send('update-downloaded')
|
||||
autoUpdater.quitAndInstall()
|
||||
})
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ export default new Vuex.Store({
|
||||
},
|
||||
appState: {
|
||||
windowIsOnTop: false
|
||||
}
|
||||
},
|
||||
DetailCache: {}
|
||||
},
|
||||
getters: {
|
||||
getView: state => {
|
||||
@@ -48,6 +49,9 @@ export default new Vuex.Store({
|
||||
},
|
||||
getAppState: state => {
|
||||
return state.appState
|
||||
},
|
||||
getDetailCache: state => {
|
||||
return state.DetailCache
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
@@ -68,6 +72,9 @@ export default new Vuex.Store({
|
||||
},
|
||||
SET_APPSTATE: (state, payload) => {
|
||||
state.appState = payload
|
||||
},
|
||||
set_DetailCache: (state, payload) => {
|
||||
state.DetailCache = payload
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
module.exports = {
|
||||
pages: {
|
||||
index: 'src/main.js',
|
||||
index: 'src/main.js'
|
||||
},
|
||||
pluginOptions: {
|
||||
electronBuilder: {
|
||||
|
||||