mirror of
https://github.com/cuiocean/ZY-Player.git
synced 2026-02-15 00:16:26 +08:00
Compare commits
116 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d647d2ecec | ||
|
|
7f9f847d73 | ||
|
|
36e0b140cd | ||
|
|
99948770ff | ||
|
|
5300d777ce | ||
|
|
64da42524d | ||
|
|
1ebdfee7bc | ||
|
|
17ba319157 | ||
|
|
27bdc3559d | ||
|
|
ca53a22598 | ||
|
|
6632318cf6 | ||
|
|
cb7a4af7ae | ||
|
|
25340b79aa | ||
|
|
381b0a8735 | ||
|
|
c7b99244bb | ||
|
|
5b5826e9a6 | ||
|
|
03e2f2673b | ||
|
|
503a90d8da | ||
|
|
afb92d59ff | ||
|
|
d26f1cbdf7 | ||
|
|
7f821b05ad | ||
|
|
746c93c9d2 | ||
|
|
9fb51ed8fc | ||
|
|
6a1c045e0b | ||
|
|
756b8ecc33 | ||
|
|
b4946a6c99 | ||
|
|
cbde4180ab | ||
|
|
00dab782e8 | ||
|
|
89d6183841 | ||
|
|
efd2095261 | ||
|
|
cbedb859c3 | ||
|
|
65aedc84cf | ||
|
|
95c58095ee | ||
|
|
b5da3c7f81 | ||
|
|
5b0211b2ed | ||
|
|
0bb6409687 | ||
|
|
7078e05668 | ||
|
|
0172a204b1 | ||
|
|
c6b0781a02 | ||
|
|
b3e67bcc7d | ||
|
|
cbca6db97e | ||
|
|
814ecaf25b | ||
|
|
4a07520336 | ||
|
|
2e121a901c | ||
|
|
3a2a16a168 | ||
|
|
881ab6cfa5 | ||
|
|
3151b33a23 | ||
|
|
f154f44772 | ||
|
|
a1458cf8bf | ||
|
|
595136c799 | ||
|
|
b7e497e2d9 | ||
|
|
dce8ad2ef2 | ||
|
|
79ba45b63a | ||
|
|
b6fcbcb934 | ||
|
|
54c4409311 | ||
|
|
5e9c273048 | ||
|
|
197df4e830 | ||
|
|
5271dfa490 | ||
|
|
7efde45aed | ||
|
|
4c92918dc3 | ||
|
|
6c0bd5125b | ||
|
|
785f9b20e7 | ||
|
|
8d052d2904 | ||
|
|
69a397e24e | ||
|
|
c216352268 | ||
|
|
89448d390f | ||
|
|
a853b02aa0 | ||
|
|
0443ce248f | ||
|
|
8009c3197e | ||
|
|
978d4e7181 | ||
|
|
138b70263a | ||
|
|
7f48c91f97 | ||
|
|
7a494a54c0 | ||
|
|
97812af0fd | ||
|
|
490d7c963e | ||
|
|
ed1afa2026 | ||
|
|
7ef114d0e3 | ||
|
|
7f9b7fc2c8 | ||
|
|
511820f873 | ||
|
|
af6dcb11bf | ||
|
|
7ecad1ad8e | ||
|
|
4d169f9d51 | ||
|
|
f3862e8385 | ||
|
|
490d4839b7 | ||
|
|
033bcb3df7 | ||
|
|
df22efa980 | ||
|
|
5428891297 | ||
|
|
bb3502774b | ||
|
|
fa67ad03d2 | ||
|
|
8a196ae52a | ||
|
|
ebfb681205 | ||
|
|
ba9f3246d2 | ||
|
|
51cb181acd | ||
|
|
33537638b0 | ||
|
|
fa9f85a177 | ||
|
|
3e1ecaac74 | ||
|
|
5cc9849e8a | ||
|
|
e353b629c5 | ||
|
|
4d20d5bc68 | ||
|
|
a921ce7adf | ||
|
|
1dd8d0dd24 | ||
|
|
b90c359670 | ||
|
|
27eb8c06ff | ||
|
|
add2bedb61 | ||
|
|
3dc970e198 | ||
|
|
3f2def4455 | ||
|
|
5b8d883af4 | ||
|
|
7113567475 | ||
|
|
e30da35e72 | ||
|
|
55b7396a2e | ||
|
|
83568fa499 | ||
|
|
838d3a64cd | ||
|
|
506be03e3e | ||
|
|
cfdb561473 | ||
|
|
ab2f45189f | ||
|
|
f4b9a73b18 |
196
README.md
196
README.md
@@ -21,160 +21,72 @@
|
||||
<img src="https://img.shields.io/github/workflow/status/Hunlongyu/ZY-Player/release-build?style=for-the-badge">
|
||||
<p>
|
||||
|
||||
# ZY Player 资源播放器
|
||||
|
||||
# 目录
|
||||
- [特性](#特性)
|
||||
- [重要](#重要)
|
||||
- [快捷键](#快捷键)
|
||||
- [下载](#下载)
|
||||
- [赞助](#赞助)
|
||||
- [截图](#截图)
|
||||
- [开发向导](#开发向导)
|
||||
- [准备环境](#准备环境)
|
||||
- [nodejs安装](#nodejs安装)
|
||||
- [yarn新一代包管理器安利](#yarn新一代包管理器安利)
|
||||
- [npm配置](#npm配置)
|
||||
- [翻墙代理设置](#翻墙代理设置)
|
||||
- [镜像源设置](#镜像源设置)
|
||||
- [代码IDE](#代码IDE)
|
||||
- [安装依赖](#安装依赖)
|
||||
- [调试开发](#调试开发)
|
||||
- [打包发布](#打包发布)
|
||||
<h1 align="center">ZY Player 资源播放器</h1>
|
||||
|
||||
## 特性
|
||||
|
||||
1. 全平台支持. Windows, Mac, Linux
|
||||
2. 支持更多视频源,支持自定义视频源
|
||||
3. 支持海报模式和列表模式
|
||||
4. 支持瀑布流 无限加载
|
||||
5. 支持历史播放记录,自动跳转播放进度
|
||||
6. 支持快捷键,使用更便捷,支持自定义快捷键
|
||||
7. 支持搜索历史记录
|
||||
8. 支持分享功能
|
||||
9. 支持精简模式,划水新高度
|
||||
10. 支持导出资源下载链接
|
||||
11. 收藏夹同步功能,追剧更方便
|
||||
12. 自动更新
|
||||
|
||||
觉得软件不错的, 点击右上角 star 收藏关注一波呀~
|
||||
### ✨特性
|
||||
|
||||
## 重要
|
||||
从 V1.x 版本升级到 V2.x 版本, 需要重置软件, 由于数据库改动较大, 重置后收藏的资源会丢失. 重置功能在设置界面里.
|
||||
- 🍕 全平台支持. Windows, Mac, Linux
|
||||
- 🍔 视频源支持自定义, 支持导入, 导出
|
||||
- 🍟 支持海报模式和列表模式浏览资源
|
||||
- 🌭 播放历史, 自动跳转历史进度
|
||||
- 🍿 收藏夹支持导入,导出, 支持同步追剧
|
||||
- 🥙 支持精简模式, 摸鱼划水
|
||||
- 🥪 一键搜索所有资源, 支持历史搜索记录
|
||||
- 🌮 导出资源下载链接
|
||||
- 🍣 支持第三方播放器播放
|
||||
- 🍤 显示豆瓣评分
|
||||
|
||||
#### 快捷键
|
||||
### 🌴 下载
|
||||
|
||||
- 🍓 [Github -- 官方下载](https://github.com/Hunlongyu/ZY-Player/releases)
|
||||
- 🍉 [蓝奏云 -- 快速下载](https://www.lanzoux.com/b04s6a3re) 密码:95px
|
||||
- 🍒 适用于32位操作系统的x86软件,在蓝奏云网盘里, 后缀名: ZY Player * 32位.exe
|
||||
|
||||
### 🚀 快捷键
|
||||
|
||||
播放窗口 和 Mini窗口
|
||||
|
||||
| 快捷键 | 说明 | 快捷键 | 说明 |
|
||||
| :----------------------: | ---------- | :----------------------: | ---------- |
|
||||
| `Alt + Space` | 聚焦或取消聚焦(全局快捷键)| | |
|
||||
| `→` | 快进 5 秒 | `←` | 快退 5 秒 |
|
||||
| `↑` | 音量调高 | `↓` | 音量调低 |
|
||||
| `m` | 静音 | `t` | 置顶或退出置顶 |
|
||||
| `f` | 进入或退出全屏 | `esc` | 退出全屏 |
|
||||
| `Alt + →` | 下一集 | `Alt + ←` | 上一集 |
|
||||
| `Alt + ↑` | 透明度调高 | `Alt + ↓` | 透明度调低 |
|
||||
| `home` | 跳到视频开始位置 | `end` | 跳到视频结束位置 |
|
||||
| `pgUp` | 播放倍速加快 0.25 | `pgDown` | 播放倍速减慢 0.25 |
|
||||
| `Alt + m` | 进入或退出 Mini 模式 | `space` | 播放或暂停 |
|
||||
| 快捷键 | 说明 | 快捷键 | 说明 |
|
||||
| :-----------: | ---------------------------- | :-------: | ----------------- |
|
||||
| `Alt + Space` | 聚焦或取消聚焦(全局快捷键) | | |
|
||||
| `→` | 快进 5 秒 | `←` | 快退 5 秒 |
|
||||
| `↑` | 音量调高 | `↓` | 音量调低 |
|
||||
| `m` | 静音 | `t` | 置顶或退出置顶 |
|
||||
| `f` | 进入或退出全屏 | `esc` | 退出全屏 |
|
||||
| `Alt + →` | 下一集 | `Alt + ←` | 上一集 |
|
||||
| `Alt + ↑` | 透明度调高 | `Alt + ↓` | 透明度调低 |
|
||||
| `home` | 跳到视频开始位置 | `end` | 跳到视频结束位置 |
|
||||
| `pgUp` | 播放倍速加快 0.25 | `pgDown` | 播放倍速减慢 0.25 |
|
||||
| `Alt + m` | 进入或退出 Mini 模式 | `space` | 播放或暂停 |
|
||||
|
||||
#### 下载:
|
||||
### 🎨 截图
|
||||
|
||||
1. [Github -- 官方下载](https://github.com/Hunlongyu/ZY-Player/releases)
|
||||
| 🥼 浏览 (海报模式) | 🧥 浏览 (列表模式) |
|
||||
| :----------------------------------------------------------: | :----------------------------------------------------------: |
|
||||
|  |  |
|
||||
| 👔 搜索 | 👕 详情 |
|
||||
|  |  |
|
||||
| 👖 播放 (普通模式) | 🩳 播放 (精简模式) |
|
||||
|  |  |
|
||||
| 🧣 历史记录 | 🧤 收藏夹 |
|
||||
|  |  |
|
||||
| 👗 白色主题 | 🥻 黑色主题 |
|
||||
|  |  |
|
||||
| 👘 绿色主题 | 👚 粉色主题 |
|
||||
|  |  |
|
||||
|
||||
2. [蓝奏云 -- 快速下载](https://www.lanzous.com/b04s6a3re) 密码:95px
|
||||
### 🍭 开发者
|
||||
|
||||
3. 适用于32位操作系统的x86软件,在蓝奏云网盘里, 后缀名: ZY Player * 32位.exe
|
||||
| [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" /> |
|
||||
| 💻 🎨 🐛 | 💻 🐛 |
|
||||
|
||||
|
||||
|
||||
### 🧧 赞助
|
||||
|
||||
#### 赞助
|
||||
[](https://latopay.com/@Hunlongyu)
|
||||
|
||||
#### 截图:
|
||||
|
||||
1. 浏览 ⇣ ↓
|
||||

|
||||

|
||||
2. 搜索 ⇣ ↓
|
||||

|
||||
3. 详情 ⇣ ↓
|
||||

|
||||
4. 播放 ⇣ ↓
|
||||

|
||||

|
||||
5. 收藏 ⇣ ↓
|
||||

|
||||
6. 白色主题皮肤 ⇣ ↓
|
||||

|
||||
7. 绿色主题皮肤 ⇣ ↓
|
||||

|
||||
8. 粉色色主题皮肤 ⇣ ↓
|
||||

|
||||
|
||||
### 重要:
|
||||
所有资源来自网上, 该软件不参与任何制作, 上传, 储存, 下载等内容. 该软件仅供学习参考, 请于安装后24小时内删除.
|
||||
|
||||
## 开发指导
|
||||
软件基于nodejs, vue, electron, 如果想成为一个有追求的码农,你先考虑一下自己是否具备上述几个关键词的知识储备,如果没有,建议先百度了解下。这里的开发环境基于linux发行版mint, 其他大同小异,自行发挥。
|
||||
|
||||
### 准备环境
|
||||
|
||||
#### nodejs安装
|
||||
* [LINK1](https://nodejs.org/zh-cn/)
|
||||
* [LINK2](https://www.jianshu.com/p/13f45e24b1de/)
|
||||
|
||||
#### yarn新一代包管理器安利
|
||||
最近管理员用[yarn](https://yarn.bootcss.com/)替换了npm,本人测试后表示非常好用。。连翻墙都不想要了,强烈推荐, 安装好使用yarn代理npm命令即可, [官网安装向导](https://yarn.bootcss.com/docs/install/)
|
||||
|
||||
#### npm配置
|
||||
天朝的网络环境都有耳闻,想顺利开发,要么翻墙,要么镜像源,以下按照自己的水平二选一
|
||||
|
||||
#### 翻墙代理设置
|
||||
自备http代理,sock5代理转换,参考privoxy
|
||||
```bash
|
||||
设置代理
|
||||
npm config set proxy=http://127.0.0.1:8087
|
||||
npm config set registry=http://registry.npmjs.org
|
||||
|
||||
|
||||
关于https
|
||||
经过上面设置使用了http开头的源,因此不需要设https_proxy了,否则还要增加一句:
|
||||
|
||||
npm config set https-proxy http://server:port
|
||||
|
||||
代理用户名和密码
|
||||
npm config set proxy http://username:password@server:port
|
||||
npm confit set https-proxy http://username:password@server:port
|
||||
|
||||
取消代理
|
||||
npm config delete proxy
|
||||
npm config delete https-proxy
|
||||
```
|
||||
|
||||
#### 镜像源设置
|
||||
这里使用阿里的npm镜像
|
||||
```bash
|
||||
npm install -g cnpm --registry=https://registry.npm.taobao.org
|
||||
```
|
||||
搞定后使用cnpm代替所有的npm命令即可,切记使用一致,切记切记
|
||||
|
||||
* [参考网页链接](https://developer.aliyun.com/mirror/NPM?from=tnpm)
|
||||
|
||||
### 代码IDE
|
||||
随心所欲吧,这里安利vscode
|
||||
|
||||
### 安装依赖
|
||||
```bash
|
||||
npm install
|
||||
or
|
||||
cnpm install
|
||||
```
|
||||
### 调试开发
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
### 打包发布
|
||||
```
|
||||
npm run electron:build
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "zy",
|
||||
"version": "2.4.0",
|
||||
"version": "2.5.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
@@ -18,6 +18,8 @@
|
||||
"main": "background.js",
|
||||
"dependencies": {
|
||||
"axios": "^0.19.2",
|
||||
"cheerio": "^1.0.0-rc.3",
|
||||
"child_process": "^1.0.2",
|
||||
"core-js": "^3.6.5",
|
||||
"cors": "^2.8.5",
|
||||
"dexie": "^3.0.1",
|
||||
@@ -26,12 +28,15 @@
|
||||
"express": "^4.17.1",
|
||||
"fast-xml-parser": "^3.17.4",
|
||||
"html2canvas": "^1.0.0-rc.5",
|
||||
"m3u8": "0.0.10",
|
||||
"modern-normalize": "^0.6.0",
|
||||
"mousetrap": "^1.6.5",
|
||||
"qrcode.vue": "^1.7.0",
|
||||
"randomstring": "^1.1.5",
|
||||
"vue": "^2.6.11",
|
||||
"vue-infinite-loading": "^2.4.5",
|
||||
"vue-waterfall-plugin": "^1.0.7",
|
||||
"vuedraggable": "^2.24.1",
|
||||
"vuex": "^3.4.0",
|
||||
"xgplayer": "^2.9.10",
|
||||
"xgplayer-hls.js": "^2.2.3"
|
||||
|
||||
59
src/App.vue
59
src/App.vue
@@ -5,6 +5,7 @@
|
||||
<Frame />
|
||||
<Film v-show="view === 'Film'" />
|
||||
<Play v-show="view === 'Play'" />
|
||||
<IPTV v-show="view === 'IPTV'" />
|
||||
<Star v-show="view === 'Star'" />
|
||||
<History v-show="view === 'History'" />
|
||||
<Setting v-show="view === 'Setting'" />
|
||||
@@ -15,15 +16,68 @@
|
||||
<transition name="slide">
|
||||
<Share v-if="share.show"/>
|
||||
</transition>
|
||||
<transition name="slide">
|
||||
<EditSites v-if="editSites.show"/>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { setting } from './lib/dexie'
|
||||
const { remote } = require('electron')
|
||||
export default {
|
||||
name: 'App',
|
||||
data () {
|
||||
return {
|
||||
appTheme: 'theme-light'
|
||||
appTheme: 'theme-light',
|
||||
winSizePosition: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 0,
|
||||
height: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
// 窗口创建口,检查是否有窗口大小位置的记录,如果有的话,更新窗口位置及大小
|
||||
setting.find().then(res => {
|
||||
if (res.windowSizePosition) {
|
||||
var win = remote.getCurrentWindow()
|
||||
win.setBounds({
|
||||
x: res.windowSizePosition.x,
|
||||
y: res.windowSizePosition.y,
|
||||
width: res.windowSizePosition.width,
|
||||
height: res.windowSizePosition.height
|
||||
})
|
||||
}
|
||||
})
|
||||
var win = remote.getCurrentWindow()
|
||||
this.winSizePosition = {
|
||||
x: win.getPosition()[0],
|
||||
y: win.getPosition()[1],
|
||||
width: win.getSize()[0],
|
||||
height: win.getSize()[1]
|
||||
}
|
||||
},
|
||||
updated () {
|
||||
// 本来想hook up到beforedestroy, 但不工作
|
||||
// 每当窗口更新时,检查窗口大小及位置,记录到setting数据库中
|
||||
const win = remote.getCurrentWindow()
|
||||
var newWinSizePosition = {
|
||||
x: win.getPosition()[0],
|
||||
y: win.getPosition()[1],
|
||||
width: win.getSize()[0],
|
||||
height: win.getSize()[1]
|
||||
}
|
||||
if (newWinSizePosition.x !== this.winSizePosition.x ||
|
||||
newWinSizePosition.y !== this.winSizePosition.y ||
|
||||
newWinSizePosition.width !== this.winSizePosition.width ||
|
||||
newWinSizePosition.height !== this.winSizePosition.height) {
|
||||
this.winSizePosition = newWinSizePosition
|
||||
setting.find().then(res => {
|
||||
res.windowSizePosition = newWinSizePosition
|
||||
setting.update(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -38,6 +92,9 @@ export default {
|
||||
},
|
||||
setting () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
editSites () {
|
||||
return this.$store.getters.getEditSites
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
BIN
src/assets/image/wepay_cuiocean.jpg
Normal file
BIN
src/assets/image/wepay_cuiocean.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 85 KiB |
@@ -78,15 +78,21 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
.zy-input{
|
||||
position: relative;
|
||||
display: flex;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
width: 200px;
|
||||
height: 30px;
|
||||
vertical-align: middle;
|
||||
align-items: center;
|
||||
.search-all-check-input{
|
||||
cursor: pointer;
|
||||
cursor: pointer;
|
||||
input{
|
||||
vertical-align: bottom;
|
||||
position: relative;
|
||||
border: none;
|
||||
width: 20px;
|
||||
height: 15px;
|
||||
background-color: #ffffff00;
|
||||
text-indent: 10px;
|
||||
}
|
||||
}
|
||||
.zy-highlighted{
|
||||
@@ -101,13 +107,14 @@
|
||||
.tHeader{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
height: 50px;
|
||||
min-height: 50px;
|
||||
width: 100%;
|
||||
border-bottom: 1px solid;
|
||||
.btn{
|
||||
user-select: none;
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
}
|
||||
}
|
||||
.vs-input{
|
||||
color: var(--d-fc-1);
|
||||
background-color: var(--d-bgc-1);
|
||||
input{
|
||||
color: var(--d-fc-1);
|
||||
&::-webkit-input-placeholder{
|
||||
@@ -32,6 +34,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-input{
|
||||
color: var(--d-fc-1);
|
||||
background-color: var(--d-bgc-1);
|
||||
input{
|
||||
color: var(--d-fc-1);
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--d-fc-1);
|
||||
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
|
||||
|
||||
@@ -32,6 +32,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-input{
|
||||
color: var(--g-fc-1);
|
||||
background-color: var(--g-bgc-1);
|
||||
input{
|
||||
color: var(--g-fc-1);
|
||||
background-color: var(--g-bgc-1);
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--g-fc-1);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-input{
|
||||
color: var(--l-fc-1);
|
||||
background-color: var(--l-bgc-1);
|
||||
input{
|
||||
color: var(--l-fc-1);
|
||||
background-color: var(--l-bgc-1);
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--l-fc-1);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.zy-input{
|
||||
color: var(--p-fc-1);
|
||||
background-color: var(--p-bgc-1);
|
||||
input{
|
||||
color: var(--p-fc-1);
|
||||
}
|
||||
}
|
||||
.zy-checkbox{
|
||||
color: var(--p-fc-1);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div class="aside">
|
||||
<span :class="[view === 'Film' ? 'active ': ''] + 'zy-svg'" @click="changeView('Film')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="apertureIconTitle">
|
||||
<title id="apertureIconTitle">view</title>
|
||||
<title id="apertureIconTitle">电影</title>
|
||||
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z"></path>
|
||||
<g stroke-linecap="round">
|
||||
<path d="M3 16H14.3164"></path>
|
||||
@@ -16,7 +16,7 @@
|
||||
</span>
|
||||
<span :class="[view === 'Play' ? 'active ': ''] + 'zy-svg'" @click="changeView('Play')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="playIconTitle">
|
||||
<title id="playIconTitle">play</title>
|
||||
<title id="playIconTitle">播放</title>
|
||||
<path d="M20 12L5 21V3z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
@@ -26,6 +26,13 @@
|
||||
<path d="M12,21 L10.55,19.7051771 C5.4,15.1242507 2,12.1029973 2,8.39509537 C2,5.37384196 4.42,3 7.5,3 C9.24,3 10.91,3.79455041 12,5.05013624 C13.09,3.79455041 14.76,3 16.5,3 C19.58,3 22,5.37384196 22,8.39509537 C22,12.1029973 18.6,15.1242507 13.45,19.7149864 L12,21 Z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
<span :class="[view === 'IPTV' ? 'active ': ''] + 'zy-svg'" @click="changeView('IPTV')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="tvIconTitle">
|
||||
<title id="tvIconTitle">IPTV</title>
|
||||
<polygon points="20 8 20 20 4 20 4 8"></polygon>
|
||||
<polyline stroke-linejoin="round" points="8 4 12 7.917 16 4"></polyline>
|
||||
</svg>
|
||||
</span>
|
||||
<span :class="[view === 'History' ? 'active ': ''] + 'zy-svg'" @click="changeView('History')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="timeIconTitle">
|
||||
<title id="timeIconTitle">历史记录</title>
|
||||
@@ -35,7 +42,7 @@
|
||||
</span>
|
||||
<span :class="[view === 'Setting' ? 'active ': ''] + 'zy-svg'" @click="changeView('Setting')">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="settingsIconTitle">
|
||||
<title id="settingsIconTitle">setting</title>
|
||||
<title id="settingsIconTitle">设置</title>
|
||||
<path d="M5.03506429,12.7050339 C5.01187484,12.4731696 5,12.2379716 5,12 C5,11.7620284 5.01187484,11.5268304 5.03506429,11.2949661 L3.20577137,9.23205081 L5.20577137,5.76794919 L7.9069713,6.32070904 C8.28729123,6.0461342 8.69629298,5.80882212 9.12862533,5.61412402 L10,3 L14,3 L14.8713747,5.61412402 C15.303707,5.80882212 15.7127088,6.0461342 16.0930287,6.32070904 L18.7942286,5.76794919 L20.7942286,9.23205081 L18.9649357,11.2949661 C18.9881252,11.5268304 19,11.7620284 19,12 C19,12.2379716 18.9881252,12.4731696 18.9649357,12.7050339 L20.7942286,14.7679492 L18.7942286,18.2320508 L16.0930287,17.679291 C15.7127088,17.9538658 15.303707,18.1911779 14.8713747,18.385876 L14,21 L10,21 L9.12862533,18.385876 C8.69629298,18.1911779 8.28729123,17.9538658 7.9069713,17.679291 L5.20577137,18.2320508 L3.20577137,14.7679492 L5.03506429,12.7050339 Z"></path>
|
||||
<circle cx="12" cy="12" r="1"></circle>
|
||||
</svg>
|
||||
@@ -54,12 +61,37 @@ export default {
|
||||
set (val) {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
detail: {
|
||||
get () {
|
||||
return this.$store.getters.getDetail
|
||||
},
|
||||
set (val) {
|
||||
this.SET_DETAIL(val)
|
||||
}
|
||||
},
|
||||
editSites: {
|
||||
get () {
|
||||
return this.$store.getters.getEditSites
|
||||
},
|
||||
set (val) {
|
||||
this.SET_EDITSITES(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW']),
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_EDITSITES']),
|
||||
changeView (e) {
|
||||
this.view = e
|
||||
// ChangeView 的时候关闭Detail和EditSites页面
|
||||
this.detail = {
|
||||
show: false
|
||||
}
|
||||
if (this.editSites.show === true) {
|
||||
this.editSites = {
|
||||
show: false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<div class="year" v-show="info.year">上映: {{info.year}}</div>
|
||||
<div class="last" v-show="info.last">更新: {{info.last}}</div>
|
||||
<div class="note" v-show="info.note">备注: {{info.note}}</div>
|
||||
<div class="rate" v-show="info.rate">豆瓣评分: {{info.rate}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="operate">
|
||||
@@ -32,6 +33,16 @@
|
||||
<span @click="starEvent">收藏</span>
|
||||
<span @click="downloadEvent">下载</span>
|
||||
<span @click="shareEvent">分享</span>
|
||||
<span @click="doubanLinkEvent">豆瓣</span>
|
||||
<span @click="togglePlayOnlineEvent">
|
||||
<input type="checkbox" v-model="playOnline"> 播放在线高清视频
|
||||
</span>
|
||||
<span>
|
||||
<select v-model="selectedOnlineSite" class="vs-options">
|
||||
<option disabled value="">Please select one</option>
|
||||
<option v-for="(i, j) in onlineSites" :key="j">{{i}}</option>
|
||||
</select>
|
||||
</span>
|
||||
</div>
|
||||
<div class="desc" v-show="info.des">{{info.des}}</div>
|
||||
<div class="m3u8">
|
||||
@@ -49,6 +60,7 @@
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import zy from '../lib/site/tools'
|
||||
import onlineVideo from '../lib/site/onlineVideo'
|
||||
import { star, history } from '../lib/dexie'
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
@@ -57,7 +69,10 @@ export default {
|
||||
return {
|
||||
loading: true,
|
||||
m3u8List: [],
|
||||
info: {}
|
||||
info: {},
|
||||
playOnline: false,
|
||||
selectedOnlineSite: '哔嘀',
|
||||
onlineSites: ['哔嘀', '素白白', '简影', '1080影视']
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
@@ -119,25 +134,44 @@ export default {
|
||||
}
|
||||
},
|
||||
playEvent (n) {
|
||||
history.find({ site: this.detail.key, ids: this.detail.info.id }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: n, site: this.detail.site } }
|
||||
} 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.view = 'Play'
|
||||
this.detail.show = false
|
||||
if (!this.playOnline) {
|
||||
history.find({ site: this.detail.key, ids: this.detail.info.id }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: n, site: this.detail.site } }
|
||||
} 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.view = 'Play'
|
||||
this.detail.show = false
|
||||
} else {
|
||||
history.find({ site: this.detail.key, ids: this.detail.info.id }).then(res => {
|
||||
if (res) {
|
||||
res.index = n
|
||||
history.update(res.id, res)
|
||||
} else {
|
||||
const doc = {
|
||||
site: this.detail.key,
|
||||
ids: this.detail.info.id,
|
||||
name: this.detail.info.name,
|
||||
type: this.detail.info.type,
|
||||
year: this.detail.info.year,
|
||||
index: n,
|
||||
time: ''
|
||||
}
|
||||
history.add(doc)
|
||||
}
|
||||
})
|
||||
this.playVideoOnline(this.detail.info.name, n)
|
||||
}
|
||||
},
|
||||
starEvent () {
|
||||
star.find({ key: this.detail.key, ids: this.info.id }).then(res => {
|
||||
if (res) {
|
||||
this.$message.info('已存在')
|
||||
this.$message.info('该影片已被收藏')
|
||||
} else {
|
||||
const docs = {
|
||||
key: this.detail.site.key,
|
||||
site: this.detail.site,
|
||||
key: this.detail.key,
|
||||
ids: this.info.id,
|
||||
name: this.info.name,
|
||||
type: this.info.type,
|
||||
@@ -153,9 +187,36 @@ export default {
|
||||
this.$message.warning('收藏失败')
|
||||
})
|
||||
},
|
||||
togglePlayOnlineEvent () {
|
||||
this.playOnline = !this.playOnline
|
||||
},
|
||||
playVideoOnline (videoName, videoIndex) {
|
||||
switch (this.selectedOnlineSite) {
|
||||
case '哔嘀':
|
||||
onlineVideo.playVideoOnBde4(videoName, videoIndex)
|
||||
break
|
||||
case '1080影视':
|
||||
onlineVideo.playVideoOnK1080(videoName, videoIndex)
|
||||
break
|
||||
case '素白白':
|
||||
onlineVideo.playVideoOnSubaibai(videoName, videoIndex)
|
||||
break
|
||||
case '哆咪动漫':
|
||||
onlineVideo.playVideoOndmdm2020(videoName, videoIndex)
|
||||
break
|
||||
case '樱花动漫':
|
||||
onlineVideo.playVideoOnYhdm(videoName, videoIndex)
|
||||
break
|
||||
case '简影':
|
||||
onlineVideo.playVideoOnSyrme(videoName, videoIndex)
|
||||
break
|
||||
default:
|
||||
this.$message.console.error(`不支持该网站:${this.selectedOnlineSite}`)
|
||||
}
|
||||
},
|
||||
downloadEvent () {
|
||||
zy.download(this.detail.key, this.info.id).then(res => {
|
||||
if (res) {
|
||||
if (res && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
@@ -188,12 +249,72 @@ export default {
|
||||
info: this.detail.info
|
||||
}
|
||||
},
|
||||
doubanLinkEvent () {
|
||||
const open = require('open')
|
||||
const axios = require('axios')
|
||||
const cheerio = require('cheerio')
|
||||
const name = this.detail.info.name.trim()
|
||||
// 豆瓣搜索链接
|
||||
var doubanSearchLink = 'https://www.douban.com/search?q=' + name
|
||||
var link = doubanSearchLink
|
||||
axios.get(doubanSearchLink).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
// 比较第一和第二豆瓣搜索结果, 如果名字相符, 就打开该链接,否则打开搜索页面
|
||||
var nameInDouban = $($('div.result')[0]).find('div>div>h3>a').first()
|
||||
if (name.replace(/\s/g, '') === nameInDouban.text().replace(/\s/g, '')) {
|
||||
link = nameInDouban.attr('href')
|
||||
} else {
|
||||
nameInDouban = $($('div.result')[1]).find('div>div>h3>a').first()
|
||||
if (name.replace(/\s/g, '') === nameInDouban.text().replace(/\s/g, '')) {
|
||||
link = nameInDouban.attr('href')
|
||||
}
|
||||
}
|
||||
open(link)
|
||||
})
|
||||
},
|
||||
getDoubanRate () {
|
||||
const axios = require('axios')
|
||||
const cheerio = require('cheerio')
|
||||
const name = this.detail.info.name.trim()
|
||||
// 豆瓣搜索链接
|
||||
var doubanSearchLink = 'https://www.douban.com/search?q=' + name
|
||||
axios.get(doubanSearchLink).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
// 比较第一和第二给豆瓣搜索结果, 看名字是否相符
|
||||
var link = ''
|
||||
var nameInDouban = $($('div.result')[0]).find('div>div>h3>a').first()
|
||||
if (name.replace(/\s/g, '') === nameInDouban.text().replace(/\s/g, '')) {
|
||||
link = nameInDouban.attr('href')
|
||||
} else {
|
||||
nameInDouban = $($('div.result')[1]).find('div>div>h3>a').first()
|
||||
if (name.replace(/\s/g, '') === nameInDouban.text().replace(/\s/g, '')) {
|
||||
link = nameInDouban.attr('href')
|
||||
}
|
||||
}
|
||||
// 如果找到链接,就打开该链接获取评分
|
||||
if (link) {
|
||||
axios.get(link).then(response => {
|
||||
const parsedHtml = cheerio.load(response.data)
|
||||
var rating = parsedHtml('body').find('#interest_sectl').first().find('strong').first()
|
||||
if (rating.text()) {
|
||||
this.info.rate = rating.text()
|
||||
} else {
|
||||
this.info.rate = '暂无评分'
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.info.rate = '暂无评分'
|
||||
}
|
||||
})
|
||||
},
|
||||
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.m3u8Parse(res)
|
||||
this.getDoubanRate()
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
@@ -207,9 +328,10 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.detail{
|
||||
position: absolute;
|
||||
left: 0;
|
||||
left: 80px;
|
||||
right: 20px;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
width: calc(100% - 100px);
|
||||
height: calc(100% - 40px);
|
||||
z-index: 888;
|
||||
.detail-content{
|
||||
@@ -264,6 +386,11 @@ export default {
|
||||
font-size: 14px;
|
||||
line-height: 26px;
|
||||
}
|
||||
.rate{
|
||||
font-size: 16px;
|
||||
line-height: 26px;
|
||||
font-weight: bolder;
|
||||
}
|
||||
}
|
||||
}
|
||||
.operate{
|
||||
|
||||
200
src/components/EditSites.vue
Normal file
200
src/components/EditSites.vue
Normal file
@@ -0,0 +1,200 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<div class="detail-content">
|
||||
<div class="detail-header">
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="openAddSite">添加新源</div>
|
||||
</div>
|
||||
<span class="detail-close zy-svg" @click="close">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-labelledby="closeIconTitle">
|
||||
<title id="closeIconTitle">关闭</title>
|
||||
<path d="M6.34314575 6.34314575L17.6568542 17.6568542M6.34314575 17.6568542L17.6568542 6.34314575"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</div>
|
||||
<div class="detail-body zy-scroll">
|
||||
<div class="zy-table">
|
||||
<div class="tBody zy-scroll">
|
||||
<div class="addSites-box zy-scroll" v-show="showAddSite">
|
||||
<ul>
|
||||
<li >
|
||||
<span class="name">源名称</span>
|
||||
<span class="name">API接口</span>
|
||||
<span class="name">DOWNLOAD接口</span>
|
||||
<span class="operate">
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="name" style="display:inline-block;vertical-align:middle">
|
||||
<input style="height: 30px" v-model="newSite.name">
|
||||
</span>
|
||||
<span class="name" style="display:inline-block;vertical-align:middle">
|
||||
<input style="height: 30px" v-model="newSite.api">
|
||||
</span>
|
||||
<span class="name" style="display:inline-block;vertical-align:middle">
|
||||
<input style="height: 30px" v-model="newSite.download" placeholder="可以为空">
|
||||
</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click="addNewSite">添加</span>
|
||||
<span class="btn" @click="closeAddSite">关闭</span>
|
||||
</span>
|
||||
</li>
|
||||
<li ></li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul>
|
||||
<draggable v-model="sites" @change="listUpdatedEvent">
|
||||
<transition-group>
|
||||
<li v-for="(i, j) in sites" :key="j">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="removeEvent(i)">删除</span>
|
||||
</span>
|
||||
</li>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { sites } from '../lib/dexie'
|
||||
import draggable from 'vuedraggable'
|
||||
export default {
|
||||
name: 'editSites',
|
||||
data () {
|
||||
return {
|
||||
show: false,
|
||||
sites: [],
|
||||
showAddSite: false,
|
||||
newSite: {
|
||||
name: '',
|
||||
api: '',
|
||||
download: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
draggable
|
||||
},
|
||||
computed: {
|
||||
setting: {
|
||||
get () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
},
|
||||
editSites: {
|
||||
get () {
|
||||
return this.$store.getters.getEditSites
|
||||
},
|
||||
set (val) {
|
||||
this.SET_EDITSITES(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_SETTING', 'SET_EDITSITES']),
|
||||
close () {
|
||||
this.editSites.show = false
|
||||
},
|
||||
getSites () {
|
||||
sites.all().then(res => {
|
||||
this.sites = res
|
||||
})
|
||||
},
|
||||
removeEvent (e) {
|
||||
sites.remove(e.id).then(res => {
|
||||
this.getSites()
|
||||
}).catch(err => {
|
||||
this.$message.warning('删除源失败, 错误信息: ' + err)
|
||||
})
|
||||
},
|
||||
listUpdatedEvent () {
|
||||
sites.clear().then(res1 => {
|
||||
// 重新排序
|
||||
var id = 1
|
||||
this.sites.forEach(element => {
|
||||
element.id = id
|
||||
sites.add(element)
|
||||
id += 1
|
||||
})
|
||||
})
|
||||
},
|
||||
openAddSite () {
|
||||
this.showAddSite = true
|
||||
},
|
||||
closeAddSite () {
|
||||
this.showAddSite = false
|
||||
},
|
||||
addNewSite () {
|
||||
if (!this.newSite.name || !this.newSite.api) {
|
||||
this.$message.error('名称和API接口不能为空。')
|
||||
return
|
||||
}
|
||||
var randomstring = require('randomstring')
|
||||
var doc = {
|
||||
key: randomstring.generate(6),
|
||||
id: this.sites[this.sites.length - 1].id + 1,
|
||||
name: this.newSite.name,
|
||||
api: this.newSite.api,
|
||||
download: this.newSite.download
|
||||
}
|
||||
sites.add(doc).then(res => {
|
||||
this.newSite = {
|
||||
name: '',
|
||||
api: '',
|
||||
download: ''
|
||||
}
|
||||
this.$message.success('添加新源成功!')
|
||||
this.getSites()
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getSites()
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.detail{
|
||||
position: absolute;
|
||||
left: 80px;
|
||||
right: 20px;
|
||||
bottom: 0;
|
||||
width: calc(100% - 100px);
|
||||
height: calc(100% - 40px);
|
||||
z-index: 888;
|
||||
.detail-content{
|
||||
height: calc(100% - 10px);
|
||||
padding: 0 60px;
|
||||
position: relative;
|
||||
.detail-header{
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.detail-title{
|
||||
font-size: 16px;
|
||||
}
|
||||
.detail-close{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.detail-body{
|
||||
height: calc(100% - 50px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -35,7 +35,7 @@
|
||||
animationEffect="fadeInUp"
|
||||
backgroundColor="rgba(0, 0, 0, 0)">
|
||||
<template slot="item" slot-scope="props">
|
||||
<div class="card">
|
||||
<div class="card" v-show="!setting.excludeR18Films || !containsR18Keywords(props.data.type)">
|
||||
<div class="img">
|
||||
<img style="width: 100%" :src="props.data.pic" alt="" @load="$refs.waterfall.refresh()" @click="detailEvent(site, props.data)">
|
||||
<div class="operate">
|
||||
@@ -49,6 +49,7 @@
|
||||
<div class="name" @click="detailEvent(site, props.data)">{{props.data.name}}</div>
|
||||
<div class="info">
|
||||
<span>{{props.data.year}}</span>
|
||||
<span>{{props.data.note}}</span>
|
||||
<span>{{props.data.type}}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -60,10 +61,11 @@
|
||||
<div class="zy-table">
|
||||
<div class="tBody">
|
||||
<ul>
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(site, i)">
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(site, i)" v-show="!setting.excludeR18Films || !containsR18Keywords(i.type)">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="type">{{i.type}}</span>
|
||||
<span class="time">{{i.year}}</span>
|
||||
<span class="time">{{i.note}}</span>
|
||||
<span class="last">{{i.last}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(site, i)">播放</span>
|
||||
@@ -134,7 +136,9 @@ export default {
|
||||
infiniteId: +new Date(),
|
||||
searchList: [],
|
||||
searchTxt: '',
|
||||
searchContents: []
|
||||
searchContents: [],
|
||||
// 福利片关键词
|
||||
r18KeyWords: ['伦理', '倫理', '福利', '激情', '理论', '写真', '情色', '美女', '街拍', '赤足', '性感', '里番']
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -185,11 +189,14 @@ export default {
|
||||
searchTxt () {
|
||||
this.searchChangeEvent()
|
||||
},
|
||||
'setting.site': {
|
||||
'setting.sitesList': {
|
||||
handler (nv) {
|
||||
this.getAllsites(nv)
|
||||
this.getAllsites()
|
||||
},
|
||||
deep: true
|
||||
},
|
||||
'$store.state.editSites.sites': function () {
|
||||
this.getAllsites()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -225,17 +232,39 @@ export default {
|
||||
getClass () {
|
||||
return new Promise((resolve, reject) => {
|
||||
const key = this.site.key
|
||||
// 屏蔽主分类
|
||||
const classToHide = ['电影', '电影片', '电视剧', '连续剧', '综艺', '动漫']
|
||||
zy.class(key).then(res => {
|
||||
this.classList = res.class
|
||||
var allClass = [{ name: '最新', tid: 0 }]
|
||||
res.class.forEach(element => {
|
||||
if (!classToHide.includes(element.name)) {
|
||||
if (this.setting.excludeR18Films) {
|
||||
const containKeyWord = this.containsR18Keywords(element.name)
|
||||
if (!containKeyWord) {
|
||||
allClass.push(element)
|
||||
}
|
||||
} else {
|
||||
allClass.push(element)
|
||||
}
|
||||
}
|
||||
})
|
||||
this.classList = allClass
|
||||
this.show.class = true
|
||||
this.pagecount = res.pagecount
|
||||
this.type = { name: '最新', tid: 0 }
|
||||
this.type = this.classList[0]
|
||||
resolve(true)
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
containsR18Keywords (name) {
|
||||
var 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
|
||||
@@ -265,7 +294,8 @@ export default {
|
||||
$state.complete()
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
this.list.push(...res)
|
||||
// zy.list 返回的是按时间从旧到新排列, 我门需要翻转为从新到旧
|
||||
this.list.push(...res.reverse())
|
||||
}
|
||||
if (type === '[object Object]') {
|
||||
this.list.push(res)
|
||||
@@ -301,7 +331,6 @@ export default {
|
||||
} else {
|
||||
const docs = {
|
||||
key: site.key,
|
||||
site: site,
|
||||
ids: e.id,
|
||||
name: e.name,
|
||||
type: e.type,
|
||||
@@ -326,7 +355,7 @@ export default {
|
||||
},
|
||||
downloadEvent (site, e) {
|
||||
zy.download(site.key, e.id).then(res => {
|
||||
if (res.length > 0) {
|
||||
if (res && res.length > 0 && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
@@ -393,12 +422,9 @@ export default {
|
||||
}
|
||||
this.getAllSearch()
|
||||
})
|
||||
sites.forEach(site =>
|
||||
sites.forEach(site => {
|
||||
zy.search(site.key, wd).then(res => {
|
||||
const type = Object.prototype.toString.call(res)
|
||||
if (type === '[object Undefined]') {
|
||||
this.$message.info(site.name + ' 无搜索结果')
|
||||
}
|
||||
if (type === '[object Array]') {
|
||||
res.forEach(element => {
|
||||
element.site = site
|
||||
@@ -410,7 +436,7 @@ export default {
|
||||
this.searchContents.push(res)
|
||||
}
|
||||
})
|
||||
)
|
||||
})
|
||||
} else {
|
||||
this.show.find = false
|
||||
this.getClass().then(res => {
|
||||
|
||||
@@ -3,17 +3,30 @@
|
||||
<div class="body zy-scroll">
|
||||
<div class="zy-table">
|
||||
<div class="tHeader">
|
||||
<span class="btn"></span>
|
||||
<span class="btn" @click="clearAllHistory">清空</span>
|
||||
</div>
|
||||
<div class="tBody zy-scroll">
|
||||
<ul>
|
||||
<li v-show="this.history.length === 0">无数据</li>
|
||||
<li v-show="this.history.length > 0">
|
||||
<span class="name">名字</span>
|
||||
<span class="site">片源</span>
|
||||
<span class="note">观看至</span>
|
||||
<span class="operate">
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
</span>
|
||||
</li>
|
||||
<li v-for="(i, j) in history" :key="j" @click="historyItemEvent(i)">
|
||||
<span class="name" @click.stop="playEvent(i)">{{i.name}}</span>
|
||||
<span class="name" @click.stop="detailEvent(i)">{{i.name}}</span>
|
||||
<span class="site">{{getSiteName(i.site)}}</span>
|
||||
<span class="note">第{{i.index+1}}集</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
<span class="btn" @click.stop="removeHistoryItem(i)">删除</span>
|
||||
</span>
|
||||
@@ -99,9 +112,16 @@ export default {
|
||||
})
|
||||
this.view = 'Play'
|
||||
},
|
||||
shareEvent (e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.site,
|
||||
info: e
|
||||
}
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.site, e.ids).then(res => {
|
||||
if (res) {
|
||||
if (res && res.dl && res.dl.dd) {
|
||||
const text = res.dl.dd._t
|
||||
if (text) {
|
||||
const list = text.split('#')
|
||||
@@ -116,14 +136,28 @@ export default {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
const list = [...this.m3u8List]
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
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』格式的链接已复制, 快去下载吧!')
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
279
src/components/IPTV.vue
Normal file
279
src/components/IPTV.vue
Normal file
@@ -0,0 +1,279 @@
|
||||
<template>
|
||||
<div class="detail">
|
||||
<div class="detail-content">
|
||||
<div class="detail-header">
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="openAddSite">添加新频道</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="exportSites">导出</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="importSites">导入</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="resetSites">重置</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-body zy-scroll">
|
||||
<div class="zy-table">
|
||||
<div class="tBody zy-scroll">
|
||||
<div class="iptv-box zy-scroll" v-show="showAddSite">
|
||||
<ul>
|
||||
<li >
|
||||
<span class="name">频道名</span>
|
||||
<span class="name">Url</span>
|
||||
<span class="operate">
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span class="name" style="display:inline-block;vertical-align:middle">
|
||||
<input style="height: 30px" v-model="newSite.name">
|
||||
</span>
|
||||
<span class="name" style="display:inline-block;vertical-align:middle">
|
||||
<input style="height: 30px" v-model="newSite.url">
|
||||
</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click="addNewSite">添加</span>
|
||||
<span class="btn" @click="closeAddSite">关闭</span>
|
||||
</span>
|
||||
</li>
|
||||
<li ></li>
|
||||
</ul>
|
||||
</div>
|
||||
<ul>
|
||||
<draggable v-model="iptvList" @change="listUpdatedEvent">
|
||||
<transition-group>
|
||||
<li v-for="(i, j) in iptvList" :key="j" @click.stop="playEvent(i)">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="removeEvent(i)">删除</span>
|
||||
</span>
|
||||
</li>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { iptv } from '../lib/dexie'
|
||||
import draggable from 'vuedraggable'
|
||||
import { iptv as defaultSites } from '../lib/dexie/initData'
|
||||
import { remote } from 'electron'
|
||||
import fs from 'fs'
|
||||
export default {
|
||||
name: 'iptv',
|
||||
data () {
|
||||
return {
|
||||
iptvList: [],
|
||||
showAddSite: false,
|
||||
newSite:
|
||||
{
|
||||
name: '',
|
||||
site: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
draggable
|
||||
},
|
||||
computed: {
|
||||
view: {
|
||||
get () {
|
||||
return this.$store.getters.getView
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIEW(val)
|
||||
}
|
||||
},
|
||||
setting () {
|
||||
return this.$store.getters.getSetting
|
||||
},
|
||||
video: {
|
||||
get () {
|
||||
return this.$store.getters.getVideo
|
||||
},
|
||||
set (val) {
|
||||
this.SET_VIDEO(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
this.getAllSites()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE']),
|
||||
playEvent (e) {
|
||||
this.video = { info: { url: e.url } }
|
||||
this.view = 'Play'
|
||||
},
|
||||
removeEvent (e) {
|
||||
iptv.remove(e.id).then(res => {
|
||||
this.getAllSites()
|
||||
}).catch(err => {
|
||||
this.$message.warning('删除频道失败, 错误信息: ' + err)
|
||||
})
|
||||
},
|
||||
closeAddSite () {
|
||||
this.showAddSite = false
|
||||
},
|
||||
openAddSite () {
|
||||
this.showAddSite = true
|
||||
},
|
||||
addNewSite () {
|
||||
if (!this.newSite.name || !this.newSite.url) {
|
||||
this.$message.error('名称和API接口不能为空。')
|
||||
return
|
||||
}
|
||||
var doc = {
|
||||
name: this.newSite.name,
|
||||
url: this.newSite.url
|
||||
}
|
||||
iptv.add(doc).then(res => {
|
||||
this.newSite = {
|
||||
name: '',
|
||||
url: ''
|
||||
}
|
||||
this.$message.success('添加新源成功!')
|
||||
this.getAllSites()
|
||||
})
|
||||
},
|
||||
listUpdatedEvent () {
|
||||
iptv.clear().then(res1 => {
|
||||
// 重新排序
|
||||
var id = 1
|
||||
this.iptvList.forEach(element => {
|
||||
element.id = id
|
||||
iptv.add(element)
|
||||
id += 1
|
||||
})
|
||||
})
|
||||
},
|
||||
exportSites () {
|
||||
this.getAllSites()
|
||||
const arr = [...this.iptvList]
|
||||
const str = JSON.stringify(arr, null, 4)
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
]
|
||||
}
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
this.$message.success('已保存成功')
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
},
|
||||
importSites () {
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'm3u file', extensions: ['m3u'] },
|
||||
{ name: 'JSON file', extensions: ['json'] }
|
||||
],
|
||||
properties: ['openFile']
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
result.filePaths.forEach(file => {
|
||||
if (file.endsWith('json')) {
|
||||
var str = fs.readFileSync(file)
|
||||
const json = JSON.parse(str)
|
||||
iptv.clear().then(res => {
|
||||
iptv.bulkAdd(json).then(e => {
|
||||
this.getAllSites()
|
||||
this.$message.success('导入成功')
|
||||
})
|
||||
})
|
||||
} else if (file.endsWith('m3u')) {
|
||||
var m3u8 = require('m3u8')
|
||||
var parser = m3u8.createStream()
|
||||
var m3ufile = fs.createReadStream(file, { encoding: 'utf-8' })
|
||||
m3ufile.pipe(parser)
|
||||
var docs = []
|
||||
parser.on('item', function (item) {
|
||||
var prop = item.properties
|
||||
if (prop.title && prop.uri && prop.uri.endsWith('m3u8')) {
|
||||
var doc = {
|
||||
name: prop.title,
|
||||
url: prop.uri
|
||||
}
|
||||
docs.push(doc)
|
||||
}
|
||||
})
|
||||
iptv.clear().then(res => {
|
||||
iptv.bulkAdd(docs).then(e => {
|
||||
this.getAllSites()
|
||||
this.$message.success('导入成功')
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
resetSites () {
|
||||
iptv.clear()
|
||||
iptv.bulkAdd(defaultSites).then(e => {
|
||||
this.getAllSites()
|
||||
this.$message.success('重置成功')
|
||||
})
|
||||
},
|
||||
getAllSites () {
|
||||
iptv.all().then(res => {
|
||||
this.iptvList = res
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getAllSites()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.detail{
|
||||
position: absolute;
|
||||
left: 80px;
|
||||
right: 20px;
|
||||
bottom: 0;
|
||||
width: calc(100% - 100px);
|
||||
height: calc(100% - 40px);
|
||||
z-index: 888;
|
||||
.detail-content{
|
||||
height: calc(100% - 10px);
|
||||
padding: 0 60px;
|
||||
position: relative;
|
||||
.detail-header{
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
.detail-title{
|
||||
font-size: 16px;
|
||||
}
|
||||
.detail-close{
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
.detail-body{
|
||||
height: calc(100% - 50px);
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,6 +3,12 @@
|
||||
<div class="box">
|
||||
<div class="title">
|
||||
<span v-if="this.right.list.length > 1">『第 {{(video.info.index + 1)}} 集』</span>{{name}}
|
||||
<span v-if="video.key" class="right" @click="playWithExternalPalyerEvent" title="使用第三方播放器">
|
||||
<svg role="img" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
|
||||
<polygon points="20 8 20 20 4 20 4 8"></polygon>
|
||||
<polyline stroke-linejoin="round" points="8 4 12 7.917 16 4"></polyline>
|
||||
</svg>
|
||||
</span>
|
||||
<span v-if="video.key" class="right" @click="issueEvent" title="复制调试信息">
|
||||
<svg t="1596338860607" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3127" width="24" height="24">
|
||||
<path d="M503.803829 63.578014c-247.050676 0-447.328072 200.277396-447.328072 447.327048 0 247.054769 200.277396 447.333188 447.328072 447.333188 247.054769 0 447.332165-200.278419 447.332165-447.333188C951.13497 263.85541 750.858598 63.578014 503.803829 63.578014L503.803829 63.578014zM503.803829 894.313336c-211.749682 0-383.408273-171.659615-383.408273-383.408273 0-211.749682 171.659615-383.40725 383.408273-383.40725 211.753775 0 383.412366 171.658591 383.412366 383.40725C887.216195 722.653721 715.557604 894.313336 503.803829 894.313336L503.803829 894.313336zM447.745069 255.897158l127.914298 0L575.659367 383.576095 447.745069 383.576095 447.745069 255.897158 447.745069 255.897158zM447.745069 425.470251l127.914298 0 0 342.058516L447.745069 767.528767 447.745069 425.470251 447.745069 425.470251zM447.745069 425.470251" p-id="3128"></path>
|
||||
@@ -291,17 +297,25 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
const index = this.video.info.index | 0
|
||||
let time = 0
|
||||
|
||||
history.find({ site: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
if (res) {
|
||||
if (res.index === index) {
|
||||
time = res.time
|
||||
if (this.video.info.url) {
|
||||
// 如果info里含有有url,是直播源,直接播放
|
||||
this.playUrl(this.video.info.url)
|
||||
} else {
|
||||
const index = this.video.info.index | 0
|
||||
let time = 0
|
||||
history.find({ site: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
if (res) {
|
||||
if (res.index === index) {
|
||||
time = res.time
|
||||
}
|
||||
}
|
||||
}
|
||||
this.playVideo(index, time)
|
||||
})
|
||||
this.playVideo(index, time)
|
||||
})
|
||||
}
|
||||
},
|
||||
playUrl (url) {
|
||||
this.xg.src = url
|
||||
this.xg.play()
|
||||
},
|
||||
playVideo (index = 0, time = 0) {
|
||||
this.fetchM3u8List().then(m3u8Arr => {
|
||||
@@ -378,7 +392,6 @@ export default {
|
||||
history.find({ site: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
if (res) {
|
||||
const doc = {
|
||||
id: res.id,
|
||||
site: res.site,
|
||||
ids: res.ids,
|
||||
name: res.name,
|
||||
@@ -387,7 +400,8 @@ export default {
|
||||
index: this.video.info.index,
|
||||
time: res.time
|
||||
}
|
||||
history.update(res.id, doc)
|
||||
history.remove(res.id)
|
||||
history.add(doc)
|
||||
} else {
|
||||
const doc = {
|
||||
site: this.video.key,
|
||||
@@ -401,6 +415,7 @@ export default {
|
||||
history.add(doc)
|
||||
}
|
||||
})
|
||||
this.updateStar()
|
||||
this.timerEvent()
|
||||
},
|
||||
changeVideo () {
|
||||
@@ -459,23 +474,34 @@ export default {
|
||||
this.right.history = res.reverse()
|
||||
})
|
||||
},
|
||||
starEvent () {
|
||||
updateStar () {
|
||||
const info = this.video.info
|
||||
star.find({ key: this.video.key, ids: info.id }).then(res => {
|
||||
if (res) {
|
||||
this.$message.info('已存在')
|
||||
res.index = info.index
|
||||
star.update(res.id, res)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.warning('检查收藏失败')
|
||||
})
|
||||
},
|
||||
starEvent () {
|
||||
const info = this.video.info
|
||||
star.find({ key: this.video.key, ids: info.id }).then(res => {
|
||||
const doc = {
|
||||
key: this.video.key,
|
||||
ids: info.id,
|
||||
name: info.name,
|
||||
type: info.type,
|
||||
year: info.year,
|
||||
last: info.last,
|
||||
note: info.note,
|
||||
index: info.index
|
||||
}
|
||||
if (res) {
|
||||
star.update(res.id, doc)
|
||||
} else {
|
||||
const docs = {
|
||||
key: this.video.key,
|
||||
site: this.video.site,
|
||||
ids: info.id,
|
||||
name: info.name,
|
||||
type: info.type,
|
||||
year: info.year,
|
||||
last: info.last,
|
||||
note: info.note
|
||||
}
|
||||
star.add(docs).then(res => {
|
||||
star.add(doc).then(starRes => {
|
||||
this.$message.success('收藏成功')
|
||||
this.isStar = true
|
||||
})
|
||||
@@ -535,8 +561,47 @@ export default {
|
||||
clipboard.writeText(JSON.stringify(info, null, 4))
|
||||
this.$message.success('视频信息复制成功')
|
||||
},
|
||||
playWithExternalPalyerEvent () {
|
||||
this.fetchM3u8List().then(m3u8Arr => {
|
||||
const fs = require('fs')
|
||||
var externalPlayer = this.setting.externalPlayer
|
||||
if (!externalPlayer) {
|
||||
this.$message.error('请设置第三方播放器路径')
|
||||
// 在线播放该视频
|
||||
var link = 'https://www.m3u8play.com/?play=' + m3u8Arr[this.video.info.index]
|
||||
const open = require('open')
|
||||
open(link)
|
||||
} else {
|
||||
var m3uFile = this.generateM3uFile(this.video.info.name, m3u8Arr, this.video.info.index)
|
||||
if (fs.existsSync(externalPlayer)) {
|
||||
var execFile = require('child_process').execFile
|
||||
execFile(externalPlayer, [m3uFile])
|
||||
} else {
|
||||
var exec = require('child_process').exec
|
||||
exec(externalPlayer, [m3uFile])
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
generateM3uFile (fileName, m3u8Arr, startIndex) {
|
||||
const path = require('path')
|
||||
const os = require('os')
|
||||
const fs = require('fs')
|
||||
var filePath = path.join(os.tmpdir(), fileName + '.m3u')
|
||||
if (fs.existsSync(filePath)) {
|
||||
fs.unlinkSync(filePath)
|
||||
}
|
||||
var str = '#EXTM3U' + os.EOL
|
||||
for (let ind = startIndex; ind < m3u8Arr.length; ind++) {
|
||||
str += `#EXTINF: -1, 第${ind + 1}集` + os.EOL
|
||||
str += m3u8Arr[ind] + os.EOL
|
||||
}
|
||||
str += '#EXT-X-ENDLIST' + os.EOL
|
||||
fs.writeFileSync(filePath, str)
|
||||
return filePath
|
||||
},
|
||||
checkStar () {
|
||||
star.find({ site: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
star.find({ key: this.video.key, ids: this.video.info.id }).then(res => {
|
||||
if (res) {
|
||||
this.isStar = true
|
||||
} else {
|
||||
@@ -656,13 +721,13 @@ export default {
|
||||
}
|
||||
if (e === 'forward') {
|
||||
if (this.xg && !this.xg.paused) {
|
||||
this.xg.currentTime += 5
|
||||
this.xg.currentTime += parseInt(this.setting.forwardTimeInSec)
|
||||
}
|
||||
return false
|
||||
}
|
||||
if (e === 'back') {
|
||||
if (this.xg && !this.xg.paused) {
|
||||
this.xg.currentTime -= 5
|
||||
this.xg.currentTime -= parseInt(this.setting.forwardTimeInSec)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
<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 @click="linkOpen('https://github.com/Hunlongyu/ZY-Player/issues')">当前版本v{{pkg.version}} 反馈</a>
|
||||
<a style="color:#38dd77" @click="linkOpen('https://github.com/Hunlongyu/ZY-Player/releases/tag/v' + latestVersion)" v-show="latestVersion !== pkg.version" >最新版本v{{latestVersion}}</a>
|
||||
</div>
|
||||
<div class="view">
|
||||
<div class="title">视图</div>
|
||||
@@ -39,37 +40,54 @@
|
||||
<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="openDoc('shortcut')">说明文档</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site">
|
||||
<div class="title">定位时间设置</div>
|
||||
<div class="zy-input">
|
||||
左/右方向键:<input style="width:50px" type="number" v-model = "d.forwardTimeInSec" @change="updateSettingEvent($event)">秒
|
||||
</div>
|
||||
</div>
|
||||
<div class='search'>
|
||||
<div class="title">搜索</div>
|
||||
<div class="zy-checkbox">
|
||||
<input type="checkbox" v-model="setting.searchAllSites" @change="updateSearchOption($event)"> 搜索所有资源
|
||||
<div class="zy-input" @click="toggleSearchAllSites">
|
||||
<input type="checkbox" v-model="d.searchAllSites" @change="updateSettingEvent($event)"> 搜索所有资源
|
||||
</div>
|
||||
</div>
|
||||
<div class='site'>
|
||||
<div class="title">第三方播放</div>
|
||||
<div class="site-box">
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="selectLocalPlayer">选择本地播放器</div>
|
||||
</div>
|
||||
<div class="zy-select" @click = "editPlayerPath = true">
|
||||
<div class="vs-placeholder vs-noAfter" v-show = "editPlayerPath == false">
|
||||
<label>编辑</label>
|
||||
</div>
|
||||
<input class="zy-input" v-show = "editPlayerPath == true" v-model = "d.externalPlayer"
|
||||
@blur= "updateSettingEvent"
|
||||
@keyup.enter = "updateSettingEvent">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="site">
|
||||
<div class="title">源管理</div>
|
||||
<div class="site-box">
|
||||
<div class="zy-select" @mouseleave="show.site = false">
|
||||
<div class="vs-placeholder" @click="show.site = true">默认源</div>
|
||||
<div class="vs-options" v-show="show.site">
|
||||
<ul class="zy-scroll" style="height: 300px">
|
||||
<li :class="d.site === i.key ? 'active' : ''" v-for="(i, j) in sitesList" :key="j" @click="siteClick(i.key)">{{ i.name }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="exportSites">导出</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="expSites">导出</div>
|
||||
<div class="vs-placeholder vs-noAfter" @click="importSites">导入</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="impSites">导入</div>
|
||||
<div class="vs-placeholder vs-noAfter" @click="editSitesEvent">编辑源</div>
|
||||
</div>
|
||||
<div class="zy-select">
|
||||
<div class="vs-placeholder vs-noAfter" @click="openDoc('sites')">说明文档</div>
|
||||
<div class="vs-placeholder vs-noAfter" @click="resetSites">重置源</div>
|
||||
</div>
|
||||
<div class="zy-input" @click="toggleExcludeR18Films">
|
||||
<input type="checkbox" v-model="d.excludeR18Films" @change="updateSettingEvent($event)"> 屏蔽福利片
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="theme">
|
||||
@@ -106,6 +124,7 @@
|
||||
<div class="qrcode-box">
|
||||
<img class="qrcode-item" src="../assets/image/alipay.png">
|
||||
<img class="qrcode-item" src="../assets/image/wepay.jpg">
|
||||
<img class="qrcode-item" src="../assets/image/wepay_cuiocean.jpg">
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearDB">
|
||||
@@ -121,9 +140,11 @@
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import pkg from '../../package.json'
|
||||
import { setting, sites, shortcut } from '../lib/dexie'
|
||||
import { setting, sites, shortcut, star } from '../lib/dexie'
|
||||
import { shell, clipboard, remote } from 'electron'
|
||||
import db from '../lib/dexie/dexie'
|
||||
import { sites as defaultSites } from '../lib/dexie/initData'
|
||||
import fs from 'fs'
|
||||
export default {
|
||||
name: 'setting',
|
||||
data () {
|
||||
@@ -131,18 +152,28 @@ export default {
|
||||
pkg: pkg,
|
||||
sitesList: [],
|
||||
shortcutList: [],
|
||||
favoritesList: [],
|
||||
show: {
|
||||
site: false,
|
||||
shortcut: false,
|
||||
view: false
|
||||
},
|
||||
externalPlayer: '',
|
||||
editPlayerPath: false,
|
||||
excludeR18Films: false,
|
||||
latestVersion: pkg.version,
|
||||
forwardTimeInSec: 5,
|
||||
d: {
|
||||
id: 0,
|
||||
site: '',
|
||||
theme: '',
|
||||
shortcut: true,
|
||||
searchAllSites: true,
|
||||
view: 'picture'
|
||||
view: 'picture',
|
||||
externalPlayer: '',
|
||||
editPlayerPath: false,
|
||||
excludeR18Films: true,
|
||||
forwardTimeInSec: 5
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -154,10 +185,18 @@ export default {
|
||||
set (val) {
|
||||
this.SET_SETTING(val)
|
||||
}
|
||||
},
|
||||
editSites: {
|
||||
get () {
|
||||
return this.$store.getters.getEditSites
|
||||
},
|
||||
set (val) {
|
||||
this.SET_EDITSITES(val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_SETTING']),
|
||||
...mapMutations(['SET_SETTING', 'SET_EDITSITES']),
|
||||
linkOpen (e) {
|
||||
shell.openExternal(e)
|
||||
},
|
||||
@@ -169,7 +208,11 @@ export default {
|
||||
theme: res.theme,
|
||||
shortcut: res.shortcut,
|
||||
view: res.view,
|
||||
searchAllSites: res.searchAllSites
|
||||
searchAllSites: res.searchAllSites ? res.searchAllSites : true,
|
||||
externalPlayer: res.externalPlayer,
|
||||
editPlayerPath: false,
|
||||
excludeR18Films: res.excludeR18Films ? res.excludeR18Films : true,
|
||||
forwardTimeInSec: res.forwardTimeInSec ? res.forwardTimeInSec : 5
|
||||
}
|
||||
this.setting = this.d
|
||||
})
|
||||
@@ -184,6 +227,11 @@ export default {
|
||||
this.shortcutList = res
|
||||
})
|
||||
},
|
||||
getFavorites () {
|
||||
star.all().then(res => {
|
||||
this.favoritesList = res
|
||||
})
|
||||
},
|
||||
changeView (e) {
|
||||
this.d.view = e
|
||||
setting.update(this.d).then(res => {
|
||||
@@ -200,30 +248,116 @@ export default {
|
||||
this.show.site = false
|
||||
})
|
||||
},
|
||||
updateSearchOption (e) {
|
||||
this.d.searchAllSites = this.setting.searchAllSites
|
||||
updateSettingEvent (e) {
|
||||
this.editPlayerPath = false
|
||||
setting.update(this.d)
|
||||
},
|
||||
toggleSearchAllSites () {
|
||||
this.d.searchAllSites = !this.d.searchAllSites
|
||||
setting.update(this.d)
|
||||
},
|
||||
toggleExcludeR18Films () {
|
||||
this.d.excludeR18Films = !this.d.excludeR18Films
|
||||
setting.update(this.d)
|
||||
},
|
||||
selectLocalPlayer () {
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'Executable file', extensions: ['exe'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
],
|
||||
properties: ['openFile']
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
var playerPath = result.filePaths[0].replace(/\\/g, '/')
|
||||
this.$message.success('设定第三方播放器路径为:' + result.filePaths[0])
|
||||
this.d.externalPlayer = playerPath
|
||||
setting.update(this.d).then(res => {
|
||||
this.setting = this.d
|
||||
})
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
},
|
||||
resetLocalPlayer () {
|
||||
this.d.externalPlayer = ''
|
||||
setting.update(this.d).then(res => {
|
||||
this.setting = this.d
|
||||
this.$message.success('重置第三方播放器成功')
|
||||
})
|
||||
},
|
||||
updatePlayerPath () {
|
||||
this.$message.success('设定第三方播放器路径为:' + this.d.externalPlayer)
|
||||
this.editPlayerPath = false
|
||||
setting.update(this.d).then(res => {
|
||||
this.setting = this.d
|
||||
})
|
||||
},
|
||||
expSites () {
|
||||
exportSites () {
|
||||
this.getSites()
|
||||
const arr = [...this.sitesList]
|
||||
const str = JSON.stringify(arr)
|
||||
clipboard.writeText(str)
|
||||
this.$message.success('已复制到剪贴板')
|
||||
const str = JSON.stringify(arr, null, 4)
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
]
|
||||
}
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
this.$message.success('已保存成功')
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
},
|
||||
impSites () {
|
||||
const str = clipboard.readText()
|
||||
const json = JSON.parse(str)
|
||||
sites.clear().then(res => {
|
||||
this.$message.info('已清空原数据')
|
||||
sites.add(json).then(e => {
|
||||
this.$message.success('已添加成功')
|
||||
this.getSites()
|
||||
this.d.site = json[0].key
|
||||
setting.update(this.d).then(res => {
|
||||
this.setting = this.d
|
||||
importSites () {
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
],
|
||||
properties: ['openFile']
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
sites.clear()
|
||||
result.filePaths.forEach(file => {
|
||||
var str = fs.readFileSync(file)
|
||||
const json = JSON.parse(str)
|
||||
sites.bulkAdd(json).then(e => {
|
||||
this.getSites()
|
||||
this.d.site = json[0].key
|
||||
setting.update(this.d).then(res => {
|
||||
this.setting = this.d
|
||||
})
|
||||
})
|
||||
this.$message.success('导入成功')
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
editSitesEvent () {
|
||||
this.editSites = {
|
||||
show: true,
|
||||
sites: this.sitesList
|
||||
}
|
||||
},
|
||||
resetSites () {
|
||||
sites.clear()
|
||||
sites.bulkAdd(defaultSites).then(e => {
|
||||
this.getSites()
|
||||
this.d.site = defaultSites[0].key
|
||||
setting.update(this.d).then(res => {
|
||||
this.setting = this.d
|
||||
this.$message.success('重置源成功')
|
||||
})
|
||||
})
|
||||
},
|
||||
@@ -243,7 +377,7 @@ export default {
|
||||
},
|
||||
expShortcut () {
|
||||
const arr = [...this.shortcutList]
|
||||
const str = JSON.stringify(arr)
|
||||
const str = JSON.stringify(arr, null, 4)
|
||||
clipboard.writeText(str)
|
||||
this.$message.success('已复制到剪贴板')
|
||||
},
|
||||
@@ -274,12 +408,25 @@ export default {
|
||||
this.linkOpen('http://zyplayer.fun/doc/shortcut/')
|
||||
return false
|
||||
}
|
||||
},
|
||||
getLatestVersion () {
|
||||
const cheerio = require('cheerio')
|
||||
const axios = require('axios')
|
||||
var url = 'https://github.com/Hunlongyu/ZY-Player/releases'
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('div.release-header')[0]
|
||||
var firstResult = $(e).find('div>div>a')
|
||||
this.latestVersion = firstResult.text()
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getSetting()
|
||||
this.getSites()
|
||||
this.getShortcut()
|
||||
this.getFavorites()
|
||||
this.getLatestVersion()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -70,16 +70,22 @@ export default {
|
||||
zy.detail(this.share.key, id).then(res => {
|
||||
if (res) {
|
||||
this.pic = res.pic
|
||||
const text = res.dl.dd
|
||||
for (const i of text) {
|
||||
if (i._flag.indexOf('m3u8') >= 0) {
|
||||
const arr = i._t.split('#')
|
||||
const url = arr[0].split('$')[1]
|
||||
this.link = 'http://zyplayer.fun/player/player.html?url=' + url + '&title=' + this.share.info.name
|
||||
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('#')
|
||||
}
|
||||
this.loading = false
|
||||
const url = m3u8List[1]
|
||||
this.link = 'http://zyplayer.fun/player/player.html?url=' + url + '&title=' + this.share.info.name
|
||||
}
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
picLoadEvent () {
|
||||
|
||||
@@ -3,24 +3,48 @@
|
||||
<div class="body">
|
||||
<div class="zy-table">
|
||||
<div class="tHeader">
|
||||
<span class="btn" @click="updateAllEvent(list)">同步所有收藏</span>
|
||||
<span class="btn" @click="exportFavoritesEvent()">导出</span>
|
||||
<span class="btn" @click="importFavoritesEvent()">导入</span>
|
||||
<span class="btn" @click="clearFavoritesEvent()">清空</span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn" @click="updateAllEvent()">同步所有收藏</span>
|
||||
</div>
|
||||
<div class="tBody zy-scroll">
|
||||
<ul>
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(i)" :class="[i.hasUpdate ? 'zy-highlighted': '']">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="type">{{i.type}}</span>
|
||||
<span class="time">{{i.year}}</span>
|
||||
<span class="site">{{i.site.name}}</span>
|
||||
<span class="note">{{i.note}}</span>
|
||||
<li v-show="this.list.length > 0">
|
||||
<span class="name">名字</span>
|
||||
<span class="type">类型</span>
|
||||
<span class="time">上映</span>
|
||||
<span class="site">片源</span>
|
||||
<span class="note">备注</span>
|
||||
<span class="note">观看至</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="deleteEvent(i)">删除</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="updateEvent(i)">同步</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
<span class="btn"></span>
|
||||
</span>
|
||||
</li>
|
||||
<draggable v-model="list" @change="listUpdatedEvent">
|
||||
<transition-group>
|
||||
<li v-for="(i, j) in list" :key="j" @click="detailEvent(i)" :class="[i.hasUpdate ? 'zy-highlighted': '']">
|
||||
<span class="name">{{i.name}}</span>
|
||||
<span class="type">{{i.type}}</span>
|
||||
<span class="time">{{i.year}}</span>
|
||||
<span class="site">{{getSiteName(i.key)}}</span>
|
||||
<span class="note">{{i.note}}</span>
|
||||
<span class="note">{{getHistoryNote(i.index)}}</span>
|
||||
<span class="operate">
|
||||
<span class="btn" @click.stop="playEvent(i)">播放</span>
|
||||
<span class="btn" @click.stop="shareEvent(i)">分享</span>
|
||||
<span class="btn" @click.stop="updateEvent(i)">同步</span>
|
||||
<span class="btn" @click.stop="downloadEvent(i)">下载</span>
|
||||
<span class="btn" @click.stop="deleteEvent(i)">删除</span>
|
||||
</span>
|
||||
</li>
|
||||
</transition-group>
|
||||
</draggable>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -29,16 +53,24 @@
|
||||
</template>
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { star, history } from '../lib/dexie'
|
||||
import { star, history, sites } from '../lib/dexie'
|
||||
import zy from '../lib/site/tools'
|
||||
import draggable from 'vuedraggable'
|
||||
import { remote } from 'electron'
|
||||
import fs from 'fs'
|
||||
|
||||
const { clipboard } = require('electron')
|
||||
export default {
|
||||
name: 'star',
|
||||
data () {
|
||||
return {
|
||||
list: []
|
||||
list: [],
|
||||
sites: []
|
||||
}
|
||||
},
|
||||
components: {
|
||||
draggable
|
||||
},
|
||||
computed: {
|
||||
view: {
|
||||
get () {
|
||||
@@ -75,7 +107,8 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
view () {
|
||||
this.getStarList()
|
||||
this.getFavorites()
|
||||
this.getAllsites()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -83,23 +116,27 @@ export default {
|
||||
detailEvent (e) {
|
||||
this.detail = {
|
||||
show: true,
|
||||
key: e.site.key,
|
||||
key: e.key,
|
||||
info: {
|
||||
id: e.ids,
|
||||
name: e.name
|
||||
}
|
||||
}
|
||||
this.clearHasUpdateFlag(e)
|
||||
if (e.hasUpdate) {
|
||||
this.clearHasUpdateFlag(e)
|
||||
}
|
||||
},
|
||||
playEvent (e) {
|
||||
history.find({ site: e.site.key, ids: e.ids }).then(res => {
|
||||
history.find({ site: e.key, ids: e.ids }).then(res => {
|
||||
if (res) {
|
||||
this.video = { key: res.site, info: { id: res.ids, name: res.name, index: res.index, site: e.site } }
|
||||
this.video = { key: e.key, info: { id: res.ids, name: res.name, index: res.index } }
|
||||
} else {
|
||||
this.video = { key: e.site.key, info: { id: e.ids, name: e.name, index: 0, site: e.site } }
|
||||
this.video = { key: e.key, info: { id: e.ids, name: e.name, index: 0 } }
|
||||
}
|
||||
})
|
||||
this.clearHasUpdateFlag(e)
|
||||
if (e.hasUpdate) {
|
||||
this.clearHasUpdateFlag(e)
|
||||
}
|
||||
this.view = 'Play'
|
||||
},
|
||||
deleteEvent (e) {
|
||||
@@ -109,13 +146,13 @@ export default {
|
||||
} else {
|
||||
this.$message.success('删除成功')
|
||||
}
|
||||
this.getStarList()
|
||||
this.getFavorites()
|
||||
})
|
||||
},
|
||||
shareEvent (e) {
|
||||
this.share = {
|
||||
show: true,
|
||||
key: e.site.key,
|
||||
key: e.key,
|
||||
info: e
|
||||
}
|
||||
},
|
||||
@@ -123,45 +160,59 @@ export default {
|
||||
star.find({ id: e.id }).then(res => {
|
||||
res.hasUpdate = false
|
||||
star.update(e.id, res)
|
||||
this.getStarList()
|
||||
this.getFavorites()
|
||||
})
|
||||
},
|
||||
listUpdatedEvent () {
|
||||
star.clear().then(res1 => {
|
||||
// 重新排序
|
||||
var id = this.list.length
|
||||
this.list.forEach(element => {
|
||||
element.id = id
|
||||
star.add(element)
|
||||
id -= 1
|
||||
})
|
||||
})
|
||||
},
|
||||
updateEvent (e) {
|
||||
zy.detail(e.site.key, e.ids).then(res => {
|
||||
if (e.last === res.last) {
|
||||
var msg = `同步"${e.name}"成功, 未查询到更新。`
|
||||
this.$message.info(msg)
|
||||
} else {
|
||||
const doc = {
|
||||
id: e.id,
|
||||
ids: res.id,
|
||||
last: res.last,
|
||||
name: res.name,
|
||||
site: e.site,
|
||||
type: res.type,
|
||||
year: res.year,
|
||||
note: res.note,
|
||||
hasUpdate: true
|
||||
}
|
||||
star.update(e.id, doc).then(res => {
|
||||
var msg = `同步"${e.name}"成功, 检查到更新。`
|
||||
this.$message.success(msg)
|
||||
})
|
||||
this.getStarList()
|
||||
zy.detail(e.key, e.ids).then(res => {
|
||||
var doc = {
|
||||
key: e.key,
|
||||
id: e.id,
|
||||
ids: res.id,
|
||||
last: res.last,
|
||||
name: res.name,
|
||||
type: res.type,
|
||||
year: res.year,
|
||||
note: res.note
|
||||
}
|
||||
star.get(e.id).then(resStar => {
|
||||
doc.hasUpdate = resStar.hasUpdate
|
||||
var msg = ''
|
||||
if (e.last === res.last) {
|
||||
msg = `同步"${e.name}"成功, 未查询到更新。`
|
||||
this.$message.info(msg)
|
||||
} else {
|
||||
doc.hasUpdate = true
|
||||
msg = `同步"${e.name}"成功, 检查到更新。`
|
||||
this.$message.success(msg)
|
||||
}
|
||||
star.update(e.id, doc)
|
||||
this.getFavorites()
|
||||
})
|
||||
}).catch(err => {
|
||||
var msg = `同步"${e.name}"失败, 请重试。`
|
||||
this.$message.warning(msg, err)
|
||||
})
|
||||
},
|
||||
updateAllEvent (list) {
|
||||
list.forEach(e => {
|
||||
updateAllEvent () {
|
||||
this.list.forEach(e => {
|
||||
this.updateEvent(e)
|
||||
})
|
||||
},
|
||||
downloadEvent (e) {
|
||||
zy.download(e.site.key, e.ids).then(res => {
|
||||
if (res) {
|
||||
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('#')
|
||||
@@ -176,25 +227,129 @@ export default {
|
||||
this.$message.warning('没有查询到下载链接.')
|
||||
}
|
||||
} else {
|
||||
const list = [...this.m3u8List]
|
||||
let downloadUrl = ''
|
||||
for (const i of list) {
|
||||
const url = encodeURI(i.split('$')[1])
|
||||
downloadUrl += (url + '\n')
|
||||
}
|
||||
clipboard.writeText(downloadUrl)
|
||||
this.$message.success('『M3U8』格式的链接已复制, 快去下载吧!')
|
||||
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』格式的链接已复制, 快去下载吧!')
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getStarList () {
|
||||
getSiteName (key) {
|
||||
var site = this.sites.find(e => e.key === key)
|
||||
if (site) {
|
||||
return site.name
|
||||
}
|
||||
},
|
||||
getHistoryNote (index) {
|
||||
if (index !== null && index !== undefined) {
|
||||
return `第${index + 1}集`
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
getFavorites () {
|
||||
star.all().then(res => {
|
||||
this.list = res.reverse()
|
||||
})
|
||||
},
|
||||
getAllsites () {
|
||||
sites.all().then(res => {
|
||||
this.sites = res
|
||||
})
|
||||
},
|
||||
exportFavoritesEvent () {
|
||||
const arr = [...this.list]
|
||||
const str = JSON.stringify(arr, null, 4)
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
]
|
||||
}
|
||||
remote.dialog.showSaveDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
fs.writeFileSync(result.filePath, str)
|
||||
this.$message.success('已保存成功')
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
},
|
||||
importFavoritesEvent () {
|
||||
const options = {
|
||||
filters: [
|
||||
{ name: 'JSON file', extensions: ['json'] },
|
||||
{ name: 'Normal text file', extensions: ['txt'] },
|
||||
{ name: 'All types', extensions: ['*'] }
|
||||
],
|
||||
properties: ['openFile', 'multiSelections']
|
||||
}
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
if (!result.canceled) {
|
||||
result.filePaths.forEach(file => {
|
||||
var str = fs.readFileSync(file)
|
||||
const json = JSON.parse(str)
|
||||
star.bulkAdd(json).then(e => {
|
||||
this.getFavorites()
|
||||
})
|
||||
this.upgradeFavorites()
|
||||
})
|
||||
this.$message.success('导入收藏成功')
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(err)
|
||||
})
|
||||
},
|
||||
upgradeFavorites () {
|
||||
star.all().then(res => {
|
||||
res.forEach(element => {
|
||||
const docs = {
|
||||
key: element.key,
|
||||
ids: element.ids,
|
||||
name: element.name,
|
||||
type: element.type,
|
||||
year: element.year,
|
||||
last: element.last,
|
||||
note: element.note
|
||||
}
|
||||
star.find({ key: element.key, ids: element.ids }).then(res => {
|
||||
if (!res) {
|
||||
star.add(docs)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.getFavorites()
|
||||
})
|
||||
},
|
||||
clearFavoritesEvent () {
|
||||
star.clear().then(e => {
|
||||
this.getFavorites()
|
||||
this.$message.success('清空所有收藏成功')
|
||||
})
|
||||
}
|
||||
},
|
||||
created () {
|
||||
this.getStarList()
|
||||
this.getFavorites()
|
||||
window.Sortable = require('sortablejs').Sortable
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -8,6 +8,8 @@ import Setting from './Setting'
|
||||
import Detail from './Detail'
|
||||
import Share from './Share'
|
||||
import History from './History'
|
||||
import EditSites from './EditSites'
|
||||
import IPTV from './IPTV'
|
||||
|
||||
export default {
|
||||
registerComponents () {
|
||||
@@ -20,5 +22,7 @@ export default {
|
||||
Vue.component('Detail', Detail)
|
||||
Vue.component('Share', Share)
|
||||
Vue.component('History', History)
|
||||
Vue.component('EditSites', EditSites)
|
||||
Vue.component('IPTV', IPTV)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Dexie from 'dexie'
|
||||
import { setting, sites, localKey } from './initData'
|
||||
import { setting, sites, localKey, iptv } from './initData'
|
||||
|
||||
const db = new Dexie('zy')
|
||||
|
||||
@@ -10,13 +10,15 @@ db.version(3).stores({
|
||||
star: '++id, site, ids, name, type, year, index',
|
||||
sites: '++id, key, name, json, xml, down, level',
|
||||
history: '++id, site, ids, name, type, year, index, time',
|
||||
mini: 'id, site, ids, name, index, time'
|
||||
mini: 'id, site, ids, name, index, time',
|
||||
iptv: '++id, name, url'
|
||||
})
|
||||
|
||||
db.on('populate', () => {
|
||||
db.setting.bulkAdd(setting)
|
||||
db.sites.bulkAdd(sites)
|
||||
db.shortcut.bulkAdd(localKey)
|
||||
db.iptv.bulkAdd(iptv)
|
||||
})
|
||||
|
||||
db.open()
|
||||
|
||||
@@ -5,6 +5,7 @@ import shortcut from './shortcut'
|
||||
import star from './star'
|
||||
import sites from './sites'
|
||||
import search from './search'
|
||||
import iptv from './iptv'
|
||||
|
||||
export {
|
||||
history,
|
||||
@@ -13,5 +14,6 @@ export {
|
||||
shortcut,
|
||||
star,
|
||||
sites,
|
||||
iptv,
|
||||
search
|
||||
}
|
||||
|
||||
@@ -280,9 +280,483 @@ const getSite = (key) => {
|
||||
}
|
||||
}
|
||||
|
||||
const iptv = [
|
||||
{
|
||||
name: 'CCTV1-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv1hd/4000000/mnf.m3u8',
|
||||
id: 5910
|
||||
},
|
||||
{
|
||||
name: '北京卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/bjwshd/4000000/mnf.m3u8',
|
||||
id: 5911
|
||||
},
|
||||
{
|
||||
name: '江苏卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jswshd/4000000/mnf.m3u8',
|
||||
id: 5912
|
||||
},
|
||||
{
|
||||
name: '浙江卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/zjwshd/4000000/mnf.m3u8',
|
||||
id: 5913
|
||||
},
|
||||
{
|
||||
name: '深圳卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/szwshd/4000000/mnf.m3u8',
|
||||
id: 5914
|
||||
},
|
||||
{
|
||||
name: '山东卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/sdwshd/4000000/mnf.m3u8',
|
||||
id: 5915
|
||||
},
|
||||
{
|
||||
name: '湖北卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hbwshd/4000000/mnf.m3u8',
|
||||
id: 5916
|
||||
},
|
||||
{
|
||||
name: '广东卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/gdwshd/4000000/mnf.m3u8',
|
||||
id: 5917
|
||||
},
|
||||
{
|
||||
name: '东方卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hddfws/4000000/mnf.m3u8',
|
||||
id: 5918
|
||||
},
|
||||
{
|
||||
name: '黑龙江卫视1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hljwshd/4000000/mnf.m3u8',
|
||||
id: 5919
|
||||
},
|
||||
{
|
||||
name: '五星体育1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ssty/4000000/mnf.m3u8',
|
||||
id: 5920
|
||||
},
|
||||
{
|
||||
name: '上海Knews24 1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba8/4000000/mnf.m3u8',
|
||||
id: 5921
|
||||
},
|
||||
{
|
||||
name: 'CCTV-1HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv1hd/2300000/mnf.m3u8',
|
||||
id: 5922
|
||||
},
|
||||
{
|
||||
name: 'CCTV-2',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv2/1300000/mnf.m3u8',
|
||||
id: 5923
|
||||
},
|
||||
{
|
||||
name: 'CCTV-3',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv3/1300000/mnf.m3u8',
|
||||
id: 5924
|
||||
},
|
||||
{
|
||||
name: 'CCTV-4',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv4/1300000/mnf.m3u8',
|
||||
id: 5925
|
||||
},
|
||||
{
|
||||
name: 'CCTV-5',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv5/1300000/mnf.m3u8',
|
||||
id: 5926
|
||||
},
|
||||
{
|
||||
name: 'CCTV-6',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv6/1300000/mnf.m3u8',
|
||||
id: 5927
|
||||
},
|
||||
{
|
||||
name: 'CCTV-7',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv7/1300000/mnf.m3u8',
|
||||
id: 5928
|
||||
},
|
||||
{
|
||||
name: 'CCTV-8',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv8/1300000/mnf.m3u8',
|
||||
id: 5929
|
||||
},
|
||||
{
|
||||
name: 'CCTV-10',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv10/1300000/mnf.m3u8',
|
||||
id: 5930
|
||||
},
|
||||
{
|
||||
name: 'CCTV-11',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv11/1300000/mnf.m3u8',
|
||||
id: 5931
|
||||
},
|
||||
{
|
||||
name: 'CCTV-12',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctv12/1300000/mnf.m3u8',
|
||||
id: 5932
|
||||
},
|
||||
{
|
||||
name: 'CCTV-13',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctvxw/1300000/mnf.m3u8',
|
||||
id: 5933
|
||||
},
|
||||
{
|
||||
name: 'CCTV-14',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctvse//1300000/mnf.m3u8',
|
||||
id: 5934
|
||||
},
|
||||
{
|
||||
name: 'CCTV-15',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cctvyy/1300000/mnf.m3u8',
|
||||
id: 5935
|
||||
},
|
||||
{
|
||||
name: '北京卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/bjwshd/1300000/mnf.m3u8',
|
||||
id: 5936
|
||||
},
|
||||
{
|
||||
name: '东方卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hddfws/1300000/mnf.m3u8',
|
||||
id: 5937
|
||||
},
|
||||
{
|
||||
name: '浙江卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/zjwshd/1300000/mnf.m3u8',
|
||||
id: 5938
|
||||
},
|
||||
{
|
||||
name: '湖北卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hbwshd/1300000/mnf.m3u8',
|
||||
id: 5939
|
||||
},
|
||||
{
|
||||
name: '湖南卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hnwshd/1300000/mnf.m3u8',
|
||||
id: 5940
|
||||
},
|
||||
{
|
||||
name: '山东卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/sdwshd/1300000/mnf.m3u8',
|
||||
id: 5941
|
||||
},
|
||||
{
|
||||
name: '江苏卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jswshd/1300000/mnf.m3u8',
|
||||
id: 5942
|
||||
},
|
||||
{
|
||||
name: '深圳卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/szwshd/1300000/mnf.m3u8',
|
||||
id: 5943
|
||||
},
|
||||
{
|
||||
name: '广东卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/gdwshd/1300000/mnf.m3u8',
|
||||
id: 5944
|
||||
},
|
||||
{
|
||||
name: '黑龙江卫视高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hljwshd/1300000/mnf.m3u8',
|
||||
id: 5945
|
||||
},
|
||||
{
|
||||
name: '五星体育高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ssty/1300000/mnf.m3u8',
|
||||
id: 5946
|
||||
},
|
||||
{
|
||||
name: '新闻24高清',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba8/1300000/mnf.m3u8',
|
||||
id: 5947
|
||||
},
|
||||
{
|
||||
name: '湖南卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hnwshd/2300000/mnf.m3u8',
|
||||
id: 5948
|
||||
},
|
||||
{
|
||||
name: '北京卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/bjwshd/2300000/mnf.m3u8',
|
||||
id: 5949
|
||||
},
|
||||
{
|
||||
name: '江苏卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jswshd/2300000/mnf.m3u8',
|
||||
id: 5950
|
||||
},
|
||||
{
|
||||
name: '浙江卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/zjwshd/2300000/mnf.m3u8',
|
||||
id: 5951
|
||||
},
|
||||
{
|
||||
name: '深圳卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/szwshd/2300000/mnf.m3u8',
|
||||
id: 5952
|
||||
},
|
||||
{
|
||||
name: '山东卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/sdwshd/2300000/mnf.m3u8',
|
||||
id: 5953
|
||||
},
|
||||
{
|
||||
name: '湖北卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hbwshd/2300000/mnf.m3u8',
|
||||
id: 5954
|
||||
},
|
||||
{
|
||||
name: '广东卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/gdwshd/2300000/mnf.m3u8',
|
||||
id: 5955
|
||||
},
|
||||
{
|
||||
name: '黑龙江卫视HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hljwshd/2300000/mnf.m3u8',
|
||||
id: 5956
|
||||
},
|
||||
{
|
||||
name: '五星体育HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ssty/2300000/mnf.m3u8',
|
||||
id: 5957
|
||||
},
|
||||
{
|
||||
name: '法治天地HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/fztd/1300000/mnf.m3u8',
|
||||
id: 5958
|
||||
},
|
||||
{
|
||||
name: '欢笑剧场HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hxjc/1300000/mnf.m3u8',
|
||||
id: 5959
|
||||
},
|
||||
{
|
||||
name: '都市剧场HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/dsjc/1300000/mnf.m3u8',
|
||||
id: 5960
|
||||
},
|
||||
{
|
||||
name: '七彩戏剧HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/qcxj/1300000/mnf.m3u8',
|
||||
id: 5961
|
||||
},
|
||||
{
|
||||
name: '动漫秀场HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/dmxc/1300000/mnf.m3u8',
|
||||
id: 5962
|
||||
},
|
||||
{
|
||||
name: '劲爆体育HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jbty/1300000/mnf.m3u8',
|
||||
id: 5963
|
||||
},
|
||||
{
|
||||
name: '极速汽车',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jsqc/1300000/mnf.m3u8',
|
||||
id: 5964
|
||||
},
|
||||
{
|
||||
name: '游戏风云',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/yxfy/1300000/mnf.m3u8',
|
||||
id: 5965
|
||||
},
|
||||
{
|
||||
name: '金鹰卡通',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jykt/1300000/mnf.m3u8',
|
||||
id: 5966
|
||||
},
|
||||
{
|
||||
name: '炫动卡通',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/xdkt/1300000/mnf.m3u8',
|
||||
id: 5967
|
||||
},
|
||||
{
|
||||
name: '嘉佳卡通',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jjkt/1300000/mnf.m3u8',
|
||||
id: 5968
|
||||
},
|
||||
{
|
||||
name: '星尚',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/shss/1300000/mnf.m3u8',
|
||||
id: 5969
|
||||
},
|
||||
{
|
||||
name: '上海纪实',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jspd/1300000/mnf.m3u8',
|
||||
id: 5970
|
||||
},
|
||||
{
|
||||
name: '上海新闻',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/xwzh/1300000/mnf.m3u8',
|
||||
id: 5971
|
||||
},
|
||||
{
|
||||
name: '上海娱乐',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ylpd/1300000/mnf.m3u8',
|
||||
id: 5972
|
||||
},
|
||||
{
|
||||
name: '上海电视剧',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/dsjpd/1300000/mnf.m3u8',
|
||||
id: 5973
|
||||
},
|
||||
{
|
||||
name: '上海ICS外语频道',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/wypd/1300000/mnf.m3u8',
|
||||
id: 5974
|
||||
},
|
||||
{
|
||||
name: '上海艺术人文',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ysrw/1300000/mnf.m3u8',
|
||||
id: 5975
|
||||
},
|
||||
{
|
||||
name: '东方财经浦东',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/dfcj/1300000/mnf.m3u8',
|
||||
id: 5976
|
||||
},
|
||||
{
|
||||
name: '第一财经',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/dycj/1300000/mnf.m3u8',
|
||||
id: 5977
|
||||
},
|
||||
{
|
||||
name: '安徽卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ahws/1300000/mnf.m3u8',
|
||||
id: 5978
|
||||
},
|
||||
{
|
||||
name: '兵团卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/btws/1300000/mnf.m3u8',
|
||||
id: 5979
|
||||
},
|
||||
{
|
||||
name: '甘肃卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/gsws/1300000/mnf.m3u8',
|
||||
id: 5980
|
||||
},
|
||||
{
|
||||
name: '陕西卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/sxws/1300000/mnf.m3u8',
|
||||
id: 5981
|
||||
},
|
||||
{
|
||||
name: '山西卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/shanxiws/1300000/mnf.m3u8',
|
||||
id: 5982
|
||||
},
|
||||
{
|
||||
name: '吉林卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jlws/1300000/mnf.m3u8',
|
||||
id: 5983
|
||||
},
|
||||
{
|
||||
name: '河北卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hbws/1300000/mnf.m3u8',
|
||||
id: 5984
|
||||
},
|
||||
{
|
||||
name: '四川卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/scws/1300000/mnf.m3u8',
|
||||
id: 5985
|
||||
},
|
||||
{
|
||||
name: '贵州卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/gzws/1300000/mnf.m3u8',
|
||||
id: 5986
|
||||
},
|
||||
{
|
||||
name: '云南卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ynws/1300000/mnf.m3u8',
|
||||
id: 5987
|
||||
},
|
||||
{
|
||||
name: '辽宁卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/lnws/1300000/mnf.m3u8',
|
||||
id: 5988
|
||||
},
|
||||
{
|
||||
name: '旅游卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/lyws/1300000/mnf.m3u8',
|
||||
id: 5989
|
||||
},
|
||||
{
|
||||
name: '东南卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/dnws/1300000/mnf.m3u8',
|
||||
id: 5990
|
||||
},
|
||||
{
|
||||
name: '重庆卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/cqws/1300000/mnf.m3u8',
|
||||
id: 5991
|
||||
},
|
||||
{
|
||||
name: '广西卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/gxws/1300000/mnf.m3u8',
|
||||
id: 5992
|
||||
},
|
||||
{
|
||||
name: '青海卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/qhws/1300000/mnf.m3u8',
|
||||
id: 5993
|
||||
},
|
||||
{
|
||||
name: '江西卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/jxws/1300000/mnf.m3u8',
|
||||
id: 5994
|
||||
},
|
||||
{
|
||||
name: '内蒙古卫视',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/nmgws/1300000/mnf.m3u8',
|
||||
id: 5995
|
||||
},
|
||||
{
|
||||
name: '五星体育HD',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/ssty/1300000/mnf.m3u8',
|
||||
id: 5996
|
||||
},
|
||||
{
|
||||
name: '直播1-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba1/4000000/mnf.m3u8',
|
||||
id: 5997
|
||||
},
|
||||
{
|
||||
name: '直播2-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba2/4000000/mnf.m3u8',
|
||||
id: 5998
|
||||
},
|
||||
{
|
||||
name: '直播3-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba3/4000000/mnf.m3u8',
|
||||
id: 5999
|
||||
},
|
||||
{
|
||||
name: '直播4-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba4/4000000/mnf.m3u8',
|
||||
id: 6000
|
||||
},
|
||||
{
|
||||
name: '直播5-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba5/4000000/mnf.m3u8',
|
||||
id: 6001
|
||||
},
|
||||
{
|
||||
name: '直播6-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba6/4000000/mnf.m3u8',
|
||||
id: 6002
|
||||
},
|
||||
{
|
||||
name: '直播7-1080P',
|
||||
url: 'http://keonline.shanghai.liveplay.qq.com/live/program/live/hdnba7/4000000/mnf.m3u8',
|
||||
id: 6003
|
||||
}
|
||||
]
|
||||
|
||||
export {
|
||||
setting,
|
||||
sites,
|
||||
iptv,
|
||||
localKey,
|
||||
getSite
|
||||
}
|
||||
|
||||
25
src/lib/dexie/iptv.js
Normal file
25
src/lib/dexie/iptv.js
Normal file
@@ -0,0 +1,25 @@
|
||||
import db from './dexie'
|
||||
const { iptv } = db
|
||||
export default {
|
||||
async all () {
|
||||
return await iptv.toArray()
|
||||
},
|
||||
async clear () {
|
||||
return await iptv.clear()
|
||||
},
|
||||
async add (doc) {
|
||||
return await iptv.add(doc)
|
||||
},
|
||||
async bulkAdd (doc) {
|
||||
return await iptv.bulkAdd(doc)
|
||||
},
|
||||
async find (doc) {
|
||||
return await iptv.get(doc)
|
||||
},
|
||||
async update (id, docs) {
|
||||
return await iptv.update(id, docs)
|
||||
},
|
||||
async remove (id) {
|
||||
return await iptv.delete(id)
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,16 @@ export default {
|
||||
async clear () {
|
||||
return await sites.clear()
|
||||
},
|
||||
async add (doc) {
|
||||
async bulkAdd (doc) {
|
||||
return await sites.bulkAdd(doc)
|
||||
},
|
||||
async find (doc) {
|
||||
return await sites.get(doc)
|
||||
},
|
||||
async add (doc) {
|
||||
return await sites.add(doc)
|
||||
},
|
||||
async remove (id) {
|
||||
return await sites.delete(id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ export default {
|
||||
async add (doc) {
|
||||
return await star.add(doc)
|
||||
},
|
||||
async bulkAdd (doc) {
|
||||
return await star.bulkAdd(doc)
|
||||
},
|
||||
async find (doc) {
|
||||
return await star.get(doc)
|
||||
},
|
||||
@@ -15,5 +18,11 @@ export default {
|
||||
},
|
||||
async remove (id) {
|
||||
return await star.delete(id)
|
||||
},
|
||||
async get (id) {
|
||||
return await star.get(id)
|
||||
},
|
||||
async clear () {
|
||||
return await star.clear()
|
||||
}
|
||||
}
|
||||
|
||||
219
src/lib/site/onlineVideo.js
Normal file
219
src/lib/site/onlineVideo.js
Normal file
@@ -0,0 +1,219 @@
|
||||
import open from 'open'
|
||||
import axios from 'axios'
|
||||
import cheerio from 'cheerio'
|
||||
|
||||
const onlineVideo = {
|
||||
playVideoOnBde4 (videoName, videoIndex) {
|
||||
videoName = videoName.replace(/\s/g, '')
|
||||
var url = `https://bde4.com/search/${videoName}`
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('div.search-list')
|
||||
var searchResult = $(e).find('div>div>div>div>a').toArray()
|
||||
// 获取第一个搜索结果的视频链接
|
||||
var detailPageLink = $(searchResult[0]).attr('href')
|
||||
// 获取第一个搜索结果的title
|
||||
var title = $(searchResult[0]).attr('title')
|
||||
if (title === null || title === undefined || !title.replace(/\s/g, '').includes(videoName)) {
|
||||
// 如果第一个搜索结果不符合,打开搜索页面
|
||||
open(url)
|
||||
} else {
|
||||
var detailPageFullLink = 'https://bde4.com/' + detailPageLink
|
||||
// 解析详情页面
|
||||
axios.get(detailPageFullLink).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('div.info1')
|
||||
var videoList = $(e).find('a').toArray()
|
||||
var videoFullLink = detailPageFullLink
|
||||
// 获取index视频链接
|
||||
if (videoIndex < videoList.length) {
|
||||
var indexVideoLink = $(videoList[videoIndex]).attr('href')
|
||||
if (indexVideoLink.includes('.htm')) {
|
||||
videoFullLink = 'https://bde4.com' + indexVideoLink
|
||||
}
|
||||
}
|
||||
open(videoFullLink)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
playVideoOnK1080 (videoName, videoIndex) {
|
||||
videoName = videoName.replace(/\s/g, '')
|
||||
var url = `https://k1080.net/vodsearch123/-------------.html?wd=${videoName}&submit=`
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('#searchList')
|
||||
var searchResult = $(e).find('li>div>a').toArray()
|
||||
// 获取第一个搜索结果的视频链接
|
||||
var detailPageLink = $(searchResult[0]).attr('href')
|
||||
// 获取第一个搜索结果的title
|
||||
var title = $(searchResult[0]).attr('title')
|
||||
if (title === null || title === undefined || !title.replace(/\s/g, '').includes(videoName)) {
|
||||
// 如果第一个搜索结果不符合,打开搜索页面
|
||||
open(url)
|
||||
} else {
|
||||
// 解析详情页面
|
||||
var detailPageFullLink = 'https://k1080.net' + detailPageLink
|
||||
axios.get(detailPageFullLink).then(res2 => {
|
||||
const $ = cheerio.load(res2.data)
|
||||
// 获取playlist1
|
||||
var e = $('#playlist1')
|
||||
// 获取所有视频链接
|
||||
var videoList = $(e).find('div>ul>li>a').toArray()
|
||||
var videoFullLink = detailPageFullLink
|
||||
// 获取index视频链接
|
||||
if (videoIndex < videoList.length) {
|
||||
var indexVideoLink = $(videoList[videoIndex]).attr('href')
|
||||
if (indexVideoLink.includes('.htm')) {
|
||||
videoFullLink = 'https://k1080.net' + indexVideoLink
|
||||
}
|
||||
}
|
||||
open(videoFullLink)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
playVideoOnSubaibai (videoName, videoIndex) {
|
||||
videoName = videoName.replace(/\s/g, '')
|
||||
var url = `https://www.subaibai.com/xssearch?q=${videoName}`
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('div.search_list')
|
||||
var searchResult = $(e).find('div>ul>li>h3>a').toArray()
|
||||
// 获取第一个搜索结果的视频链接
|
||||
var detailPageLink = $(searchResult[0]).attr('href')
|
||||
// 获取第一个搜索结果的title
|
||||
var title = $(searchResult[0]).text()
|
||||
if (title === null || title === undefined || !title.replace(/\s/g, '').includes(videoName)) {
|
||||
// 如果第一个搜索结果不符合,打开搜索页面
|
||||
open(url)
|
||||
} else {
|
||||
// 解析详情页面
|
||||
var detailPageFullLink = detailPageLink
|
||||
axios.get(detailPageFullLink).then(res2 => {
|
||||
const $ = cheerio.load(res2.data)
|
||||
// 获取playlist1
|
||||
var e = $('div.paly_list_btn')
|
||||
// 获取所有视频链接
|
||||
var videoList = $(e).find('a').toArray()
|
||||
// 获取index视频链接
|
||||
var videoFullLink = detailPageFullLink
|
||||
if (videoIndex < videoList.length) {
|
||||
var indexVideoLink = $(videoList[videoIndex]).attr('href')
|
||||
if (indexVideoLink.includes('.htm')) {
|
||||
videoFullLink = indexVideoLink
|
||||
}
|
||||
}
|
||||
open(videoFullLink)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
playVideoOnYhdm (videoName, videoIndex) {
|
||||
videoName = videoName.replace(/\s/g, '')
|
||||
var url = `http://www.yhdm.tv/search/${videoName}`
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('div.lpic')
|
||||
var searchResult = $(e).find('div>ul>li>h2>a').toArray()
|
||||
// 获取第一个搜索结果的视频链接
|
||||
var detailPageLink = $(searchResult[0]).attr('href')
|
||||
// 获取第一个搜索结果的title
|
||||
var title = $(searchResult[0]).attr('title')
|
||||
if (title === null || title === undefined || !title.replace(/\s/g, '').includes(videoName)) {
|
||||
// 如果第一个搜索结果不符合,打开搜索页面
|
||||
open(url)
|
||||
} else {
|
||||
// 解析详情页面
|
||||
var detailPageFullLink = 'http://www.yhdm.tv/' + detailPageLink
|
||||
axios.get(detailPageFullLink).then(res2 => {
|
||||
const $ = cheerio.load(res2.data)
|
||||
// 获取playlist1
|
||||
var e = $('div.movurl')
|
||||
// 获取所有视频链接
|
||||
var videoList = $(e).find('div>ul>li>a').toArray()
|
||||
// 获取index视频链接
|
||||
var videoFullLink = detailPageFullLink
|
||||
if (videoIndex < videoList.length) {
|
||||
var indexVideoLink = $(videoList[videoIndex]).attr('href')
|
||||
if (indexVideoLink.includes('.htm')) {
|
||||
videoFullLink = 'http://www.yhdm.tv/' + indexVideoLink
|
||||
}
|
||||
}
|
||||
open(videoFullLink)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
playVideoOndmdm2020 (videoName, videoIndex) {
|
||||
videoName = videoName.replace(/\s/g, '')
|
||||
var url = `http://www.dmdm2020.com/dongmansearch.html?wd=${videoName}&submit=`
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('#searchList')
|
||||
var searchResult = $(e).find('ul>li>div>h4>a').toArray()
|
||||
// 获取第一个搜索结果的视频链接
|
||||
var detailPageLink = $(searchResult[0]).attr('href')
|
||||
// 获取第一个搜索结果的title
|
||||
var title = $(searchResult[0]).text()
|
||||
if (title === null || title === undefined || !title.replace(/\s/g, '').includes(videoName)) {
|
||||
// 如果第一个搜索结果不符合,打开搜索页面
|
||||
open(url)
|
||||
} else {
|
||||
// 解析详情页面
|
||||
var detailPageFullLink = 'http://www.dmdm2020.com' + detailPageLink
|
||||
axios.get(detailPageFullLink).then(res2 => {
|
||||
const $ = cheerio.load(res2.data)
|
||||
// 获取playlist1
|
||||
var e = $('#playlist1')
|
||||
// 获取所有视频链接
|
||||
var videoList = $(e).find('div>ul>li>a').toArray()
|
||||
// 获取index视频链接
|
||||
var videoFullLink = detailPageFullLink
|
||||
if (videoIndex < videoList.length) {
|
||||
var indexVideoLink = $(videoList[videoIndex]).attr('href')
|
||||
if (indexVideoLink.includes('.htm')) {
|
||||
videoFullLink = 'http://www.dmdm2020.com' + indexVideoLink
|
||||
}
|
||||
}
|
||||
open(videoFullLink)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
playVideoOnSyrme (videoName, videoIndex) {
|
||||
videoName = videoName.replace(/\s/g, '')
|
||||
var url = `https://syrme.top/searchs?q=${videoName}`
|
||||
axios.get(url).then(res => {
|
||||
const $ = cheerio.load(res.data)
|
||||
var e = $('ul.MovieList')
|
||||
var searchResult = $(e).find('ul>li>article>a').toArray()
|
||||
// 获取第一个搜索结果的视频链接
|
||||
var detailPageLink = $(searchResult[0]).attr('href')
|
||||
// 获取第一个搜索结果的title
|
||||
var title = $(searchResult[0]).find('a>h2').text()
|
||||
if (title === null || title === undefined || !title.replace(/\s/g, '').includes(videoName)) {
|
||||
// 如果第一个搜索结果不符合,打开搜索页面
|
||||
open(url)
|
||||
} else {
|
||||
// 解析详情页面
|
||||
var detailPageFullLink = 'https://syrme.top' + detailPageLink
|
||||
axios.get(detailPageFullLink).then(res2 => {
|
||||
const $ = cheerio.load(res2.data)
|
||||
// 获取playlist1
|
||||
var e = $('#categories-2')
|
||||
// 获取所有视频链接
|
||||
var videoList = $(e).find('div>ul>li>a').toArray()
|
||||
// 获取index视频链接
|
||||
var videoFullLink = detailPageFullLink
|
||||
if (videoIndex < videoList.length) {
|
||||
var indexVideoLink = $(videoList[videoIndex]).attr('href')
|
||||
videoFullLink = 'https://syrme.top' + indexVideoLink
|
||||
}
|
||||
open(videoFullLink)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
export default onlineVideo
|
||||
@@ -130,14 +130,18 @@ const zy = {
|
||||
this.getSite(key).then(res => {
|
||||
const site = res
|
||||
wd = encodeURI(wd)
|
||||
axios.post(`http://localhost:${this.ports}/api`, { url: site.api + '?wd=' + wd }).then(res => {
|
||||
axios.post(`http://localhost:${this.ports}/api`, { url: site.api + '?wd=' + wd }, { timeout: 2000 }).then(res => {
|
||||
const data = res.data.info
|
||||
const json = parser.parse(data, this.xmlConfig)
|
||||
const videoList = json.rss.list.video
|
||||
resolve(videoList)
|
||||
if (json && json.rss && json.rss.list) {
|
||||
const videoList = json.rss.list.video
|
||||
resolve(videoList)
|
||||
}
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
}).catch(err => {
|
||||
reject(err)
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -23,13 +23,16 @@
|
||||
</div>
|
||||
<div class="right">
|
||||
<span class="top" @click="frameClickEvent('top')" title="置顶">
|
||||
<svg t="1595919317571" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1188" style="width:12px;height:16px"><path d="M43.072 974.72l380.864-301.952 151.936 161.6c0 0 63.424 17.28 67.328-30.72l-3.904-163.584 225.088-259.648 98.048-5.696c0 0 76.928-15.488 21.184-82.752l-275.072-276.928c0 0-74.944-9.6-69.248 59.584l0 75.008L383.552 367.104 225.856 376.64c0 0-57.728 19.2-36.608 69.248l148.16 146.176L43.072 974.72 43.072 974.72z" p-id="1189" :fill="isAlwaysOnTop ? '#555555' : '#ffffff'"></path></svg>
|
||||
<svg t="1595919317571" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1188" style="width:10px;height:14px"><path d="M43.072 974.72l380.864-301.952 151.936 161.6c0 0 63.424 17.28 67.328-30.72l-3.904-163.584 225.088-259.648 98.048-5.696c0 0 76.928-15.488 21.184-82.752l-275.072-276.928c0 0-74.944-9.6-69.248 59.584l0 75.008L383.552 367.104 225.856 376.64c0 0-57.728 19.2-36.608 69.248l148.16 146.176L43.072 974.72 43.072 974.72z" p-id="1189" :fill="isAlwaysOnTop ? '#555555' : '#ffffff'"></path></svg>
|
||||
</span>
|
||||
<span class="min" @click="frameClickEvent('min')" title="最小化">
|
||||
<svg t="1595917239849" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" style="width:10px;height:16px"><path d="M0 479.936C0 444.64 28.448 416 64.064 416L959.936 416C995.328 416 1024 444.736 1024 479.936L1024 544.064C1024 579.392 995.552 608 959.936 608L64.064 608C28.672 608 0 579.264 0 544.064L0 479.936Z" p-id="1156" fill="#ffffff"></path></svg>
|
||||
<svg t="1595917239849" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" style="width:8px;height:14px"><path d="M0 479.936C0 444.64 28.448 416 64.064 416L959.936 416C995.328 416 1024 444.736 1024 479.936L1024 544.064C1024 579.392 995.552 608 959.936 608L64.064 608C28.672 608 0 579.264 0 544.064L0 479.936Z" p-id="1156" fill="#ffffff"></path></svg>
|
||||
</span>
|
||||
<span class="max" @click="frameClickEvent('max')" title="最大化">
|
||||
<svg t="1595917343956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1540" style="width:8px;height:14px"><path d="M416 416 64.064 416C28.448 416 0 444.64 0 479.936L0 544.064C0 579.264 28.672 608 64.064 608L416 608 416 959.936C416 995.552 444.64 1024 479.936 1024L544.064 1024C579.264 1024 608 995.328 608 959.936L608 608 959.936 608C995.552 608 1024 579.36 1024 544.064L1024 479.936C1024 444.736 995.328 416 959.936 416L608 416 608 64.064C608 28.448 579.36 0 544.064 0L479.936 0C444.736 0 416 28.672 416 64.064L416 416Z" p-id="1541" fill="#ffffff"></path></svg>
|
||||
</span>
|
||||
<span class="close" @click="frameClickEvent('close')" title="关闭">
|
||||
<svg t="1595917372551" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1685" style="width:10px;height:16px"><path d="M511.968 376.224 796.096 92.096C833.536 54.624 894.4 54.624 931.84 92.096 969.312 129.568 969.312 190.4 931.84 227.872L647.744 512 931.84 796.096C969.312 833.568 969.312 894.4 931.84 931.872 894.4 969.344 833.536 969.344 796.096 931.872L511.968 647.744 227.84 931.872C190.4 969.344 129.536 969.344 92.096 931.872 54.624 894.4 54.624 833.568 92.096 796.096L376.224 512 92.096 227.872C54.624 190.4 54.624 129.568 92.096 92.096 129.536 54.624 190.4 54.624 227.84 92.096L511.968 376.224Z" p-id="1686" fill="#ffffff"></path></svg>
|
||||
<svg t="1595917372551" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1685" style="width:8px;height:14px"><path d="M511.968 376.224 796.096 92.096C833.536 54.624 894.4 54.624 931.84 92.096 969.312 129.568 969.312 190.4 931.84 227.872L647.744 512 931.84 796.096C969.312 833.568 969.312 894.4 931.84 931.872 894.4 969.344 833.536 969.344 796.096 931.872L511.968 647.744 227.84 931.872C190.4 969.344 129.536 969.344 92.096 931.872 54.624 894.4 54.624 833.568 92.096 796.096L376.224 512 92.096 227.872C54.624 190.4 54.624 129.568 92.096 92.096 129.536 54.624 190.4 54.624 227.84 92.096L511.968 376.224Z" p-id="1686" fill="#ffffff"></path></svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,10 +83,12 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
frameClickEvent (e) {
|
||||
const win = remote.getCurrentWindow()
|
||||
if (e === 'min') {
|
||||
const win = remote.getCurrentWindow()
|
||||
win.minimize()
|
||||
return false
|
||||
}
|
||||
if (e === 'max') {
|
||||
win.isMaximized() ? win.unmaximize() : win.maximize()
|
||||
}
|
||||
if (e === 'close') {
|
||||
ipcRenderer.send('win')
|
||||
@@ -91,7 +96,6 @@ export default {
|
||||
}
|
||||
if (e === 'top') {
|
||||
this.isAlwaysOnTop = !this.isAlwaysOnTop
|
||||
const win = remote.getCurrentWindow()
|
||||
win.setAlwaysOnTop(this.isAlwaysOnTop)
|
||||
}
|
||||
},
|
||||
@@ -125,54 +129,6 @@ export default {
|
||||
}
|
||||
})
|
||||
})
|
||||
// zy.detail(res.site, res.ids).then(e => {
|
||||
// this.name = e.name
|
||||
// this.detail = e
|
||||
// const dd = e.dl.dd
|
||||
// const type = Object.prototype.toString.call(dd)
|
||||
// let m3u8Txt = []
|
||||
// if (type === '[object Array]') {
|
||||
// for (const i of dd) {
|
||||
// if (i._t.indexOf('m3u8') >= 0) {
|
||||
// m3u8Txt = i._t.split('#')
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// m3u8Txt = dd._t.split('#')
|
||||
// }
|
||||
// const m3u8Arr = []
|
||||
// for (const i of m3u8Txt) {
|
||||
// const j = i.split('$')
|
||||
// if (j.length > 1) {
|
||||
// for (let m = 0; m < j.length; m++) {
|
||||
// if (j[m].indexOf('m3u8') >= 0) {
|
||||
// m3u8Arr.push(j[m])
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// m3u8Arr.push(j[0])
|
||||
// }
|
||||
// }
|
||||
// this.m3u8Arr = m3u8Arr
|
||||
// this.xg.src = m3u8Arr[res.index]
|
||||
// if (res.time !== 0 || res.time !== '') {
|
||||
// this.xg.play()
|
||||
// this.xg.once('playing', () => {
|
||||
// this.xg.currentTime = res.time
|
||||
// })
|
||||
// } else {
|
||||
// this.xg.play()
|
||||
// }
|
||||
// this.videoPlaying()
|
||||
// this.xg.once('ended', () => {
|
||||
// if (m3u8Arr.length > 1 && (m3u8Arr.length - 1 > res.index)) {
|
||||
// this.video.time = 0
|
||||
// this.video.index++
|
||||
// this.xg.src = m3u8Arr[this.video.index]
|
||||
// this.xg.play()
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
})
|
||||
},
|
||||
fetchM3u8List (info) {
|
||||
@@ -507,15 +463,18 @@ html,body{
|
||||
span{
|
||||
-webkit-app-region: no-drag;
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
text-align: center;
|
||||
line-height: 16px;
|
||||
line-height: 14px;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
cursor: pointer;
|
||||
opacity: 0.4;
|
||||
&.min{
|
||||
background-color: #32dc36;
|
||||
}
|
||||
&.max{
|
||||
background-color: #ffbe2a;
|
||||
}
|
||||
&.close{
|
||||
|
||||
@@ -25,6 +25,10 @@ export default new Vuex.Store({
|
||||
video: {
|
||||
key: '',
|
||||
info: {}
|
||||
},
|
||||
editSites: {
|
||||
show: false,
|
||||
sites: []
|
||||
}
|
||||
},
|
||||
getters: {
|
||||
@@ -42,6 +46,9 @@ export default new Vuex.Store({
|
||||
},
|
||||
getVideo: state => {
|
||||
return state.video
|
||||
},
|
||||
getEditSites: state => {
|
||||
return state.editSites
|
||||
}
|
||||
},
|
||||
mutations: {
|
||||
@@ -59,6 +66,9 @@ export default new Vuex.Store({
|
||||
},
|
||||
SET_VIDEO: (state, payload) => {
|
||||
state.video = payload
|
||||
},
|
||||
SET_EDITSITES: (state, payload) => {
|
||||
state.editSites = payload
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user