Compare commits

...

66 Commits

Author SHA1 Message Date
haiyangcui
6f296a1170 v2.8.4 2021-04-23 17:04:32 +02:00
haiyangcui
f8228a71f3 添加"热门美剧""热门英剧""热门国产剧"推荐列表 2021-04-22 11:47:09 +02:00
haiyangcui
9886f04b48 推荐页面添加"按评分"排序 2021-04-22 11:31:47 +02:00
haiyangcui
37c4aad4b0 Update lock files 2021-04-22 11:31:29 +02:00
haiyangcui
77d7b28e26 Update lock files 2021-04-21 21:10:51 +02:00
haiyangcui
3505b22344 简化调用解析网址的逻辑 2021-04-21 21:00:04 +02:00
haiyangcui
80cec08982 v2.8.3 2021-04-21 18:59:53 +02:00
haiyangcui
f92094daec 支持"豆瓣热门动画电影" 2021-04-21 18:57:54 +02:00
haiyangcui
2c06ef1da6 支持"豆瓣热门综艺" 2021-04-21 18:52:42 +02:00
haiyangcui
06403ece3f 因不明原因,全屏时上一集按钮被遮盖而无法点取.简单粗暴的解决方法:把所有按钮向右移动一下. 2021-04-21 18:42:26 +02:00
haiyangcui
39a6491403 添加"豆瓣热门纪录片" 2021-04-21 16:37:17 +02:00
haiyangcui
edb82eb3be 支持更新豆瓣推荐 2021-04-20 22:57:23 +02:00
haiyangcui
c7ca3df50d 修复设置默认解析网址 2021-04-20 22:13:16 +02:00
haiyangcui
0b198381b1 升级依赖 2021-04-20 22:11:53 +02:00
hunlongyu
2dcda83741 升级依赖 2021-04-16 09:09:33 +08:00
haiyangcui
5b3c3f0ff2 推荐页面,移除"删除" 2021-04-13 23:00:02 +02:00
haiyangcui
23454f7c7f v2.8.2 2021-04-13 17:49:02 +02:00
haiyangcui
0fdfe29343 增加"豆瓣高分电影" 2021-04-13 17:44:43 +02:00
haiyangcui
fa7a799e2b 支持缓存电影数据 2021-04-13 17:34:46 +02:00
haiyangcui
9c1a707279 初始的数据都移到iniData文件夹下 2021-04-13 17:07:18 +02:00
haiyangcui
7b69bb05d4 支持设置是否最小化时暂停播放 2021-04-13 17:06:33 +02:00
haiyangcui
3b6b6ea11b 记录窗口大小及位置 2021-04-12 17:57:56 +02:00
haiyangcui
9ec65ab027 Introduce searchFirstDetail 2021-04-12 16:48:58 +02:00
haiyangcui
da5531a947 主分类过滤, 检测关键词是否包含分类名. 福利过滤,检测分类名是否包含关键词 2021-04-12 14:55:06 +02:00
haiyangcui
4744f91f6b 过滤开启改为开关 2021-04-12 14:41:37 +02:00
haiyangcui
36b80c1d7e Import axios in Recommendation.vue 2021-04-12 12:56:26 +02:00
haiyangcui
15f4ab7248 修复"动漫"子分类消失的问题 2021-04-12 12:30:56 +02:00
haiyangcui
0e25c25480 推荐页面,加入"豆瓣热门电影"和"豆瓣热门剧集" 2021-04-12 12:26:29 +02:00
haiyangcui
7ff48a407d 删除log 2021-04-11 21:42:10 +02:00
haiyangcui
bbc371b1c5 添加初始化的设置文件 2021-04-11 20:31:00 +02:00
haiyangcui
d141d60e77 v2.8.1 2021-04-11 17:53:44 +02:00
haiyangcui
80af701e5c 删除经常跳出来的一个无用信息 2021-04-11 17:52:53 +02:00
haiyangcui
f0e70e03cb 在refreshClass内部调用classClick 2021-04-11 17:48:46 +02:00
haiyangcui
aba3472f2e 避免rootClassFilter r18ClassFilter数据为空时出错 2021-04-11 17:48:10 +02:00
haiyangcui
8772076d76 检测site变化,以及时刷新数据 2021-04-11 17:36:26 +02:00
haiyangcui
4abe03347a 修正数据库版本号 2021-04-11 17:31:31 +02:00
haiyangcui
b3e6e817dd 过滤开关关联局部变量,否则点击取消的话, 设置也会记录在setting里 2021-04-11 16:27:10 +02:00
haiyangcui
e48445c224 过滤设置更新后,刷新分类列表 2021-04-11 16:19:52 +02:00
haiyangcui
159f19d5ec 支持分开设置分类过滤和福利分类过滤 2021-04-11 16:11:20 +02:00
haiyangcui
c2953a530c 替换函数containsR18Keywords 2021-04-10 14:35:13 +02:00
haiyangcui
9166f129d8 移除过滤关键词列表中的空格 2021-04-10 13:52:59 +02:00
haiyangcui
72ac3eafdd 调高过滤词输入窗口 2021-04-10 13:52:40 +02:00
haiyangcui
8610b41fad 支持定义分类过滤关键词 2021-04-10 13:44:51 +02:00
haiyangcui
06e4c0e83e 只有当视频的核心信息变化时,才刷新播放页面 2021-04-09 14:10:03 +02:00
haiyangcui
5db3fd9f9b 历史页面初始化filteredList,否则视图切换有问题 2021-04-09 12:14:55 +02:00
haiyangcui
978afb2b38 删除无用代码 2021-04-08 15:38:07 +02:00
haiyangcui
b00b69a582 更新调用API的逻辑,如果某些重要数据没有API返回结果中,很可能是该源站已经失效,直接返回空数据 2021-04-06 16:49:00 +02:00
haiyangcui
9a33b0cfb3 搜索分三类,站内,组内,全站 2021-04-06 16:25:18 +02:00
haiyangcui
f4bf42bf07 将"有更新"切换按钮从工具栏移到顶层按钮区 2021-04-04 22:40:41 +02:00
haiyangcui
671a6e32d0 v2.8.0 2021-03-31 21:24:54 +02:00
haiyangcui
d05534fb17 恢复推荐视频的收藏,分享和详情功能 2021-03-31 20:47:02 +02:00
haiyangcui
b655c8c8bc 调整样式 2021-03-31 20:47:02 +02:00
haiyangcui
8fbea8ab57 添加"喜欢这部电影的人也喜欢" 2021-03-31 20:47:01 +02:00
haiyangcui
2ddfc66104 解决某些网址返回分类里含有{}字符串的问题 2021-03-30 09:54:00 +02:00
haiyangcui
26d62cdef4 历史页面增加按完成度排序 2021-03-29 22:41:08 +02:00
haiyangcui
7f6be795b5 v2.7.9 2021-03-29 17:49:11 +02:00
haiyangcui
d7fc97b3d7 有更新项目,进入详情页面,也清除有更新标记 2021-03-29 15:49:03 +02:00
haiyangcui
4a2aa9ee4b 历史页面添加只显示有更新过滤开关 2021-03-29 15:33:10 +02:00
haiyangcui
f4aeec0937 收藏页面添加有更新过滤开关 2021-03-29 15:31:08 +02:00
haiyangcui
ea06a52921 历史页面添加检查更新按钮 2021-03-29 15:12:11 +02:00
haiyangcui
26dc24d216 v2.7.8 2021-03-28 17:31:13 +02:00
haiyangcui
1c57c37997 降级xgplayer回2.17.3, 否则精简模式不工作 2021-03-28 17:28:49 +02:00
haiyangcui
15a6370785 增加推荐页面工具栏 2021-03-28 17:17:45 +02:00
haiyangcui
c8580ff6e6 增加历史页面工具栏 2021-03-28 16:48:33 +02:00
haiyangcui
a104e7cfa8 收藏页面工具栏 2021-03-28 16:31:48 +02:00
haiyangcui
c649d97021 升级依赖 2021-03-28 13:39:24 +02:00
27 changed files with 46158 additions and 9138 deletions

35964
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "zy",
"version": "2.7.7",
"version": "2.8.4",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
@@ -18,22 +18,23 @@
"main": "background.js",
"dependencies": {
"axios": "^0.21.1",
"cheerio": "^1.0.0-rc.5",
"core-js": "^3.9.0",
"bootstrap-vue": "^2.21.2",
"cheerio": "^1.0.0-rc.6",
"core-js": "^3.10.2",
"dexie": "^3.0.3",
"electron-localshortcut": "^3.2.1",
"electron-proxy-agent": "^1.2.0",
"electron-updater": "^4.3.5",
"element-ui": "^2.15.0",
"fast-xml-parser": "^3.18.0",
"electron-updater": "^4.3.8",
"element-ui": "^2.15.1",
"fast-xml-parser": "^3.19.0",
"html2canvas": "^1.0.0-rc.7",
"iptv-playlist-parser": "^0.6.0",
"m3u": "0.0.2",
"m3u8-parser": "^4.5.2",
"m3u8-parser": "^4.6.0",
"memcached": "^2.2.2",
"modern-normalize": "^1.0.0",
"mousetrap": "^1.6.5",
"pinyin-match": "^1.2.0",
"pinyin-match": "^1.2.1",
"qrcode.vue": "^1.7.0",
"randomstring": "^1.1.5",
"session": "^0.1.0",
@@ -44,9 +45,9 @@
"vue-waterfall-plugin": "^1.1.0",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"xgplayer": "2.17.13",
"xgplayer-flv.js": "^2.2.0",
"xgplayer-hls.js": "^2.4.1"
"xgplayer": "2.19.1",
"xgplayer-flv.js": "^2.3.0",
"xgplayer-hls.js": "^2.4.2"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.11",

View File

@@ -22,11 +22,62 @@
</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.restoreWindowPositionAndSize) {
var win = remote.getCurrentWindow()
win.setBounds({
x: res.windowPositionAndSize.x,
y: res.windowPositionAndSize.y,
width: res.windowPositionAndSize.width,
height: res.windowPositionAndSize.height
})
this.winSizePosition = {
x: win.getPosition()[0],
y: win.getPosition()[1],
width: win.getSize()[0],
height: win.getSize()[1]
}
}
})
},
updated () {
// 本来想hook up到beforedestroy 但不工作
// 每当窗口更新时检查窗口大小及位置记录到setting数据库中
if (this.setting.restoreWindowPositionAndSize) {
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.windowPositionAndSize = newWinSizePosition
setting.update(res)
})
}
}
},
computed: {

View File

@@ -441,3 +441,134 @@
}
}
}
// detail
.detail{
.detail-content{
.detail-body{
.m3u8{
.show-picture{
height: 100%;
width: 100%;
padding: 10px;
.card{
border-radius: 6px;
overflow: hidden;
position: relative;
cursor: pointer;
transition: 0.2s;
&:hover {
width: 102%;
height: 102%
}
.img{
position: relative;
min-height: 40px;
img{
width: 100%;
height: auto;
cursor: pointer;
}
.rate{
position: absolute;
top: 3%;
right: -40%;
width: 100%;
background-color: #111111aa;
color:#2f90b9;
height: 30px;
line-height: 30px;
font-size: 14px;
font-weight: bolder;
text-align: center;
transform: rotate(45deg);
}
.site{
position: absolute;
top: 0%;
left: 0%;
width: 100%;
background-color: #111111aa;
color:#2f90b9;
height: 30px;
line-height: 30px;
font-size: 14px;
font-weight: bolder;
text-align: center;
}
.progress{
position: absolute;
bottom: 10%;
left: 0%;
width: 40%;
background-color: #111111aa;
color: #f8df70;
height: 30px;
line-height: 30px;
font-size: 14px;
font-weight: bolder;
text-align: left;
}
.update{
position: absolute;
top: 5%;
left: -40%;
width: 100%;
background-color: #68b88e;
color: #cdcdcd;
height: 30px;
line-height: 30px;
font-size: 14px;
text-align: center;
transform: rotate(-45deg);
}
.operate{
display: none;
position: absolute;
left: 0;
bottom: 0;
background-color: #111111aa;
width: 100%;
font-size: 13px;
.operate-wrap{
display: flex;
justify-content: space-between;
.o-play, .o-star, .o-share{
cursor: pointer;
display: inline-block;
width: 80px;
height: 36px;
text-align: center;
line-height: 36px;
color: #cdcdcd;
&:hover{
background-color: #111;
}
}
}
}
}
.name{
font-size: 16px;
padding: 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.info{
display: flex;
justify-content: space-between;
font-size: 12px;
padding: 10px;
}
&:hover{
.operate{
display: block;
}
}
}
}
}
}
}
}

View File

@@ -138,6 +138,17 @@
}
}
}
.show-picture{
color: var(--d-fc-1);
.card{
background-color: var(--d-bgc-3);
box-shadow: var(--d-bsc);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
&:hover{
box-shadow: var(--d-bsc-hover);
}
}
}
}
}
}

View File

@@ -138,6 +138,17 @@
}
}
}
.show-picture{
color: var(--g-fc-1);
.card{
background-color: var(--g-bgc-3);
box-shadow: var(--g-bsc);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
&:hover{
box-shadow: var(--g-bsc-hover);
}
}
}
}
}
}

View File

@@ -1,5 +1,6 @@
.theme-light{
background-color: var(--l-bgc-1);
// background-color: var(--l-bgc-1);
background: rgba(0, 0, 0, 0);
.zy-select{
color: var(--l-fc-1);
background-color: var(--l-bgc-1);
@@ -138,6 +139,17 @@
}
}
}
.show-picture{
color: var(--l-fc-1);
.card{
background-color: var(--l-bgc-3);
box-shadow: var(--l-bsc);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
&:hover{
box-shadow: var(--l-bsc-hover);
}
}
}
}
}
}

View File

@@ -138,6 +138,17 @@
}
}
}
.show-picture{
color: var(--p-fc-1);
.card{
background-color: var(--p-bgc-3);
box-shadow: var(--p-bsc);
transition: all 0.3s cubic-bezier(.25,.8,.25,1);
&:hover{
box-shadow: var(--p-bsc-hover);
}
}
}
}
}
}

View File

@@ -17,7 +17,7 @@
</svg>
</span>
</div>
<div class="detail-body zy-scroll" v-show="!loading">
<div class="detail-body zy-scroll listpage" v-show="!loading">
<div class="info">
<div class="info-left">
<img :src="info.pic" alt="">
@@ -37,9 +37,9 @@
</div>
<div class="operate">
<span @click="playEvent(selectedEpisode)">播放</span>
<span @click="starEvent">收藏</span>
<span @click="starEvent(info)">收藏</span>
<span @click="downloadEvent">下载</span>
<span @click="shareEvent">分享</span>
<span @click="shareEvent(info,selectedEpisode)">分享</span>
<span @click="doubanLinkEvent">豆瓣</span>
<span @click="togglePlayOnlineEvent">
<input type="checkbox" v-model="playOnline"> 播放在线高清视频
@@ -64,6 +64,47 @@
<span v-bind:class="{ selected: j === selectedEpisode }" v-for="(i, j) in videoList" :key="j" @click="playEvent(j)" @mouseenter="() => { selectedEpisode = j }">{{ i | ftName(j) }}</span>
</div>
</div>
<div class="m3u8">
<div class="show-picture" v-show="info.recommendations && info.recommendations.length > 0">
<span>喜欢这部电影的人也喜欢 · · · · · ·</span>
<Waterfall :list="info.recommendations" :gutter="20" :width="240"
:breakpoints="{
1200: { //当屏幕宽度小于等于1200
rowPerView: 4,
},
800: { //当屏幕宽度小于等于800
rowPerView: 3,
},
500: { //当屏幕宽度小于等于500
rowPerView: 2,
}
}"
animationEffect="fadeIn"
backgroundColor="rgba(0, 0, 0, 0)">
<template slot="item" slot-scope="props">
<div class="card">
<div class="img">
<img style="width: 100%" :src="props.data.pic" alt="" @click="detailEvent(props.data)">
<div class="operate">
<div class="operate-wrap">
<span class="o-play" @click="playRecommendationEvent(props.data)">播放</span>
<span class="o-star" @click="starEvent(props.data)">收藏</span>
<span class="o-share" @click="shareEvent(props.data, 0)">分享</span>
</div>
</div>
</div>
<div class="name">{{props.data.name}}</div>
<div class="info">
<span>{{props.data.area}}</span>
<span>{{props.data.year}}</span>
<span>{{props.data.note}}</span>
<span>{{props.data.type}}</span>
</div>
</div>
</template>
</Waterfall>
</div>
</div>
</div>
<div class="detail-mask zy-loading" v-show="loading">
<div class="loader"></div>
@@ -73,6 +114,7 @@
</template>
<script>
import { mapMutations } from 'vuex'
import Waterfall from 'vue-waterfall-plugin'
import zy from '../lib/site/tools'
import onlineVideo from '../lib/site/onlineVideo'
import { star, history } from '../lib/dexie'
@@ -85,6 +127,8 @@ export default {
videoFlag: '',
videoList: [],
videoFullList: [],
key: '',
site: {},
info: {},
playOnline: false,
selectedEpisode: 0, // 选定集数
@@ -144,8 +188,22 @@ export default {
}
}
},
components: {
Waterfall
},
methods: {
...mapMutations(['SET_VIEW', 'SET_VIDEO', 'SET_DETAIL', 'SET_SHARE', 'SET_DetailCache']),
async playRecommendationEvent (e) {
const db = await history.find({ site: this.detail.key, ids: e.id })
if (db) {
this.video = { key: db.site, info: { id: db.ids, name: db.name, index: db.index, site: this.detail.site } }
} else {
this.video = { key: this.detail.key, info: { id: e.id, name: e.name, index: 0, site: this.detail.site } }
}
this.video.detail = e
this.view = 'Play'
this.detail.show = false
},
addClass (flag) {
if (flag === this.videoFlag) {
return 'selectedBox'
@@ -200,15 +258,15 @@ export default {
onlineVideo.playVideoOnline(this.selectedOnlineSite, this.detail.info.name, n)
}
},
async starEvent () {
const db = await star.find({ key: this.detail.key, ids: this.info.id })
async starEvent (info) {
const db = await star.find({ key: this.detail.key, ids: info.id })
const doc = {
key: this.detail.key,
ids: this.info.id,
ids: info.id,
site: this.detail.site,
name: this.info.name,
detail: this.info,
rate: this.info.rate
name: info.name,
detail: info,
rate: info.rate
}
if (db) {
star.update(db.id, doc)
@@ -219,6 +277,10 @@ export default {
})
}
},
detailEvent (info) {
this.detail.info = info
this.getDetailInfo()
},
togglePlayOnlineEvent () {
this.playOnline = !this.playOnline
},
@@ -257,12 +319,12 @@ export default {
this.$message.error(err.info)
})
},
shareEvent () {
shareEvent (info, selectedEpisode) {
this.share = {
show: true,
key: this.detail.key,
info: this.info,
index: this.selectedEpisode
info: info,
index: selectedEpisode
}
},
doubanLinkEvent () {
@@ -277,6 +339,17 @@ export default {
const name = this.info.name.trim()
const year = this.info.year
this.info.rate = await zy.doubanRate(name, year)
const recommendations = await zy.doubanRecommendations(name, year)
if (recommendations) {
this.info.recommendations = []
recommendations.forEach(element => {
zy.searchFirstDetail(this.detail.key, element).then(detailRes => {
if (detailRes) {
this.info.recommendations.push(detailRes)
}
})
})
}
},
async getDetailInfo () {
const id = this.detail.info.ids || this.detail.info.id
@@ -293,13 +366,14 @@ export default {
if (res) {
this.info = res
this.$set(this.info, 'rate', this.DetailCache[cacheKey].rate || '')
this.$set(this.info, 'recommendations', this.DetailCache[cacheKey].recommendations || [])
this.videoFlag = this.videoFlag || res.fullList[0].flag
this.videoList = res.fullList[0].list
this.videoFullList = res.fullList
this.loading = false
if (!this.info.rate) {
await this.getDoubanRate()
this.DetailCache[cacheKey].rate = this.info.rate
this.DetailCache[cacheKey] = this.info
}
}
}

View File

@@ -2,7 +2,7 @@
<div class="listpage" id="sites">
<div class="listpage-header" v-show="!enableBatchEdit">
<el-switch v-model="enableBatchEdit" active-text="批处理分组">></el-switch>
<el-checkbox v-model="setting.excludeR18Films" @change="excludeR18FilmsChangeEvent">屏蔽福利片</el-checkbox>
<el-button @click="openFilterKeywordsDiag" icon="el-icon-key">关键词过滤</el-button>
<el-button @click="addSite" icon="el-icon-document-add">新增</el-button>
<el-button @click="exportSites" icon="el-icon-upload2" title="导出全部,自动添加扩展名">导出</el-button>
<el-button @click="importSites" icon="el-icon-download" title="支持同时导入多个文件">导入</el-button>
@@ -83,7 +83,7 @@
</div>
<!-- 编辑页面 -->
<div>
<el-dialog :visible.sync="dialogVisible" v-if='dialogVisible' :title="dialogType==='edit'?'编辑源':'新增源'" :append-to-body="true" @close="closeDialog">
<el-dialog :visible.sync="editSiteDialogVisible" v-if='editSiteDialogVisible' :title="dialogType==='edit'?'编辑源':'新增源'" :append-to-body="true" @close="closeDialog">
<el-form :model="siteInfo" ref='siteInfo' label-width="75px" label-position="left" :rules="rules">
<el-form-item label="源站名" prop='name'>
<el-input v-model="siteInfo.name" placeholder="请输入源站名" />
@@ -112,6 +112,27 @@
</span>
</el-dialog>
</div>
<!-- 设置过滤关键词页面 -->
<div>
<el-dialog :visible.sync="filterKeywordsDialogVisible" v-if='filterKeywordsDialogVisible' :title="'分类过滤'" :append-to-body="true" @close="closeDialog">
<el-form>
<el-switch v-model="excludeRootClasses" active-text="开启主分类过滤">></el-switch>
<el-form-item>
<el-input v-model="rootClassFilterKeywords" :autosize="{ minRows: 3, maxRows: 6}" type="textarea" placeholder="请输入过滤关键词" />
</el-form-item>
</el-form>
<el-form>
<el-switch v-model="excludeR18Films" active-text="开启福利分类过滤">></el-switch>
<el-form-item>
<el-input v-model="r18ClassFilterKeywords" :autosize="{ minRows: 3, maxRows: 6}" type="textarea" placeholder="请输入过滤关键词" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button type="primary" @click="saveFilterKeywords">保存</el-button>
</span>
</el-dialog>
</div>
</div>
</template>
<script>
@@ -129,7 +150,8 @@ export default {
show: false,
sites: [],
dialogType: 'new',
dialogVisible: false,
editSiteDialogVisible: false,
filterKeywordsDialogVisible: false,
siteInfo: {
key: '',
name: '',
@@ -139,6 +161,10 @@ export default {
group: '',
isActive: true
},
excludeRootClasses: true,
excludeR18Films: true,
rootClassFilterKeywords: [],
r18ClassFilterKeywords: [],
siteGroup: [],
rules: {
name: [
@@ -204,12 +230,6 @@ export default {
},
methods: {
...mapMutations(['SET_SETTING']),
excludeR18FilmsChangeEvent () {
setting.find().then(res => {
res.excludeR18Films = this.setting.excludeR18Films
setting.update(res)
})
},
selectionCellClick (selection, row) {
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
this.selectionEnd = row.id
@@ -261,6 +281,29 @@ export default {
}
this.siteGroup = arr
},
openFilterKeywordsDiag () {
this.excludeRootClasses = this.setting.excludeRootClasses
this.excludeR18Films = this.setting.excludeR18Films
this.rootClassFilterKeywords = this.setting.rootClassFilter?.join()
this.r18ClassFilterKeywords = this.setting.r18ClassFilter?.join()
this.filterKeywordsDialogVisible = true
},
saveFilterKeywords () {
// 移除空格,然后按逗号分开
this.setting.rootClassFilter = this.rootClassFilterKeywords?.replace(/\s/g, '').split(',')
this.setting.r18ClassFilter = this.r18ClassFilterKeywords?.replace(/\s/g, '').split(',')
this.setting.classFilter = []
this.setting.excludeRootClasses = this.excludeRootClasses
if (this.excludeRootClasses) {
this.setting.classFilter = this.setting.classFilter.concat(this.setting.rootClassFilter)
}
this.setting.excludeR18Films = this.excludeR18Films
if (this.excludeR18Films) {
this.setting.classFilter = this.setting.classFilter.concat(this.setting.r18ClassFilter)
}
setting.update(this.setting)
this.filterKeywordsDialogVisible = false
},
addSite () {
if (this.checkAllSitesLoading) {
this.$message.info('正在检测, 请勿操作.')
@@ -268,7 +311,7 @@ export default {
}
this.getSitesGroup()
this.dialogType = 'new'
this.dialogVisible = true
this.editSiteDialogVisible = true
this.siteInfo = {
key: '',
name: '',
@@ -286,12 +329,13 @@ export default {
}
this.getSitesGroup()
this.dialogType = 'edit'
this.dialogVisible = true
this.editSiteDialogVisible = true
this.siteInfo = siteInfo
this.editOldkey = siteInfo.key
},
closeDialog () {
this.dialogVisible = false
this.editSiteDialogVisible = false
this.filterKeywordsDialogVisible = false
this.getSites()
},
removeEvent (e) {
@@ -348,7 +392,7 @@ export default {
group: ''
}
this.dialogType === 'edit' ? this.$message.success('修改成功!') : this.$message.success('新增源成功!')
this.dialogVisible = false
this.editSiteDialogVisible = false
this.getSites()
})
this.editOldkey = ''

View File

@@ -281,7 +281,7 @@
animationEffect="fadeIn"
backgroundColor="rgba(0, 0, 0, 0)">
<template slot="item" slot-scope="props">
<div class="card" v-show="!setting.excludeR18Films || !containsR18Keywords(props.data.type)">
<div class="card" v-show="!setting.excludeR18Films || !containsClassFilterKeyword(props.data.type)">
<div class="img">
<div class="site">
<span>{{props.data.site.name}}</span>
@@ -322,7 +322,6 @@ export default {
data () {
return {
showFind: false,
showToolbar: false,
showTableLastColumn: false,
sites: [],
site: {},
@@ -345,18 +344,19 @@ export default {
filteredSearchContents: [],
currentColumn: '',
searchGroup: '',
searchGroups: [],
// 福利片关键词
r18KeyWords: ['伦理', '论理', '倫理', '福利', '激情', '理论', '写真', '情色', '美女', '街拍', '赤足', '性感', '里番', 'VIP'],
searchGroups: ['站内', '组内', '全站'],
classFilterKeywords: [],
filteredList: [],
areas: [],
searchRunning: false,
siteSearchCount: 0,
infiniteHandlerCount: 0,
// Toolbar
showToolbar: false,
selectedAreas: [],
sortKeyword: '',
sortKeywords: ['按片名', '按上映年份', '按更新时间'],
selectedYears: { start: 0, end: new Date().getFullYear() },
searchRunning: false,
siteSearchCount: 0,
infiniteHandlerCount: 0
selectedYears: { start: 0, end: new Date().getFullYear() }
}
},
components: {
@@ -413,12 +413,13 @@ export default {
}
},
filterSettings () {
return this.$store.getters.getSetting.excludeR18Films // 需要监听的数据
return this.$store.getters.getSetting.classFilter // 需要监听的数据
},
searchSites () {
if (this.searchGroup === '站内') return [this.site]
if (this.searchGroup === '组内') return this.sites.filter(site => site.group === this.site.group)
if (this.searchGroup === '全站') return this.sites
return this.sites.filter(site => site.group === this.searchGroup)
return this.sites.filter(site => site.isActive)
}
},
filters: {
@@ -443,7 +444,7 @@ export default {
}
},
filterSettings () {
this.siteClick(this.site.name)
this.refreshClass()
},
list: {
handler (list) {
@@ -455,9 +456,12 @@ export default {
siteSearchCount () {
if (this.siteSearchCount === this.searchSites.length) this.searchRunning = false
},
site () {
this.siteClick(this.site.name)
},
searchContents: {
handler (list) {
list = list.filter(res => !this.setting.excludeR18Films || !this.containsR18Keywords(res.type))
list = list.filter(res => !this.setting.excludeR18Films || !this.containsClassFilterKeyword(res.type))
this.areas = [...new Set(list.map(ele => ele.area))].filter(x => x)
this.searchClassList = [...new Set(list.map(ele => ele.type))].filter(x => x)
this.refreshFilteredList()
@@ -499,7 +503,7 @@ export default {
let filteredData = this.showFind ? this.searchContents : this.list
if (this.showFind) filteredData = filteredData.filter(x => (this.selectedSearchClassNames.length === 0) || this.selectedSearchClassNames.includes(x.type))
filteredData = filteredData.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.area))
filteredData = filteredData.filter(res => !this.setting.excludeR18Films || !this.containsR18Keywords(res.type))
filteredData = filteredData.filter(res => !this.setting.excludeR18Films || !this.containsClassFilterKeyword(res.type))
filteredData = filteredData.filter(res => res.year >= this.selectedYears.start)
filteredData = filteredData.filter(res => res.year <= this.selectedYears.end)
if (!this.showFind) this.selectedClassName = this.type.name + ' ' + filteredData.length + '/' + this.recordcount
@@ -591,6 +595,16 @@ export default {
})
}
},
refreshClass () {
this.getClass().then(res => {
this.classList = res
// cache classList data
FILM_DATA_CACHE[this.site.key] = {
classList: this.classList
}
this.classClick(this.site.name)
})
},
classClick (className) {
this.list = []
this.type = this.classList.find(x => x.name === className)
@@ -618,20 +632,11 @@ export default {
getClass () {
return new Promise((resolve, reject) => {
const key = this.site.key
// 屏蔽主分类
const classToHide = ['电影', '电影片', '电视剧', '连续剧', '综艺', '动漫']
zy.class(key).then(res => {
const allClass = [{ name: '最新', tid: 0 }]
res.class.forEach(element => {
if (!this.setting.excludeRootClasses || !classToHide.includes(element.name)) {
if (this.setting.excludeR18Films) {
const containKeyWord = this.containsR18Keywords(element.name)
if (!containKeyWord) {
allClass.push(element)
}
} else {
allClass.push(element)
}
if (!this.containsClassFilterKeyword(element.name)) {
allClass.push(element)
}
})
resolve(allClass)
@@ -640,12 +645,17 @@ export default {
})
})
},
containsR18Keywords (name) {
const containKeyWord = false
if (!name) {
return containKeyWord
containsClassFilterKeyword (name) {
let ret = false
// 主分类过滤, 检测关键词是否包含分类名
if (this.setting.excludeRootClasses) {
ret = this.setting.rootClassFilter?.some(v => v.includes(name))
}
return this.r18KeyWords.some(v => name.includes(v))
// 福利过滤,检测分类名是否包含关键词
if (this.setting.excludeR18Films && !ret) {
ret = this.setting.r18ClassFilter?.some(v => name?.includes(v))
}
return ret
},
toFlipPagecount () {
// 似乎需要解析的网站的视频排序和其他m3u8采集站的顺序正好相反
@@ -873,10 +883,6 @@ export default {
this.selectedSiteName = this.sites[0].name
}
}
this.searchGroups = [...new Set(this.sites.map(site => site.group))]
if (this.searchGroups.length === 1) this.searchGroups = []
this.searchGroups.unshift('站内')
this.searchGroups.push('全站')
this.searchGroup = this.setting.searchGroup
if (this.searchGroup === undefined) setting.find().then(res => { this.searchGroup = res.searchGroup })
})

View File

@@ -1,15 +1,55 @@
<template>
<div class="listpage" id="history">
<div class="listpage-header" id="history-header">
<el-switch v-model="setting.historyViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
<el-button @click.stop="exportHistory" icon="el-icon-upload2" title="导出全部,自动添加扩展名">导出</el-button>
<el-button @click.stop="importHistory" icon="el-icon-download" title="支持同时导入多个文件">导入</el-button>
<el-button @click.stop="removeSelectedItems" icon="el-icon-delete-solid">{{ multipleSelection.length === 0 ? "清空" : "删除所选" }}</el-button>
<b-button-group>
<el-switch v-model="onlyShowItemsHasUpdate" active-text="有更新" inactive-text="全部" @change="refreshFilteredList"></el-switch>
<el-button @click.stop="updateAllEvent" icon="el-icon-refresh">检查更新</el-button>
</b-button-group>
</div>
<div class="toolbar" v-show="showToolbar">
<el-select v-model="selectedAreas" size="small" multiple placeholder="地区" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
<el-option
v-for="item in areas"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="selectedTypes" size="small" multiple placeholder="类型" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
<el-option
v-for="item in types"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false" @change="refreshFilteredList">
<el-option
v-for="item in sortKeywords"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<span>
上映区间
<el-input-number size="small" v-model="selectedYears.start" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
<el-input-number size="small" v-model="selectedYears.end" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
</span>
</div>
<el-divider class="listpage-header-divider" content-position="right">
<el-button type="text" size="mini" @click="toggleViewMode">视图切换</el-button>
<el-button type="text" size="mini" @click='() => { showToolbar = !showToolbar; if (!showToolbar) this.refreshFilteredList() }' title="收起工具栏会重置筛选排序">{{ showToolbar ? '隐藏工具栏' : '显示工具栏' }}</el-button>
<el-button type="text" size="mini" @click="backTop">回到顶部</el-button>
</el-divider>
<div class="listpage-body" id="history-body">
<div class="show-table" id="history-table" v-if="setting.historyViewMode === 'table'">
<el-table size="mini" fit height="100%"
:data="history"
:data="filteredList"
row-key="id"
ref="historyTable"
@select="selectionCellClick"
@@ -40,11 +80,11 @@
</span>
</template>
</el-table-column>
<el-table-column v-if="history.some(e => e.time)"
width="150"
<el-table-column v-if="list.some(e => e.time)"
width="200"
label="时间进度">
<template slot-scope="scope">
<span v-if="scope.row.time && scope.row.duration">{{fmtMSS(scope.row.time.toFixed(0))}}/{{fmtMSS(scope.row.duration.toFixed(0))}}</span>
<span v-if="scope.row.time && scope.row.duration">{{fmtMSS(scope.row.time.toFixed(0))}}/{{fmtMSS(scope.row.duration.toFixed(0))}} ({{progress(scope.row)}}%)</span>
<span v-if="scope.row.onlinePlay">在线解析</span>
</template>
</el-table-column>
@@ -63,7 +103,7 @@
</el-table>
</div>
<div class="show-picture" id="star-picture" v-if="setting.historyViewMode === 'picture'">
<Waterfall ref="historyWaterfall" :list="history" :gutter="20" :width="240"
<Waterfall ref="historyWaterfall" :list="filteredList" :gutter="20" :width="240"
:breakpoints="{
1200: { //当屏幕宽度小于等于1200
rowPerView: 4,
@@ -80,6 +120,9 @@
<template slot="item" slot-scope="props">
<div class="card">
<div class="img">
<div class="update" v-if="props.data.hasUpdate">
<span>有更新</span>
</div>
<img v-if="props.data.detail && props.data.detail.pic" style="width: 100%" :src="props.data.detail.pic" alt="" @load="$refs.historyWaterfall.refresh()" @click="detailEvent(props.data)">
<div class="operate">
<div class="operate-wrap">
@@ -93,7 +136,7 @@
<div class="name" @click="detailEvent(props.data)">{{props.data.name}}</div>
<div class="info">
<span v-if="props.data.time && props.data.duration">
{{fmtMSS(props.data.time.toFixed(0))}}/{{fmtMSS(props.data.duration.toFixed(0))}}
{{fmtMSS(props.data.time.toFixed(0))}}/{{fmtMSS(props.data.duration.toFixed(0))}} ({{progress(props.data)}}%)
</span>
<span v-if="props.data.onlinePlay">在线解析</span>
<span v-if="props.data.detail && props.data.detail.fullList[0].list !== undefined && props.data.detail.fullList[0].list.length > 1">
@@ -120,12 +163,25 @@ export default {
name: 'history',
data () {
return {
history: [],
list: [],
sites: [],
shiftDown: false,
selectionBegin: '',
selectionEnd: '',
multipleSelection: []
multipleSelection: [],
areas: [],
types: [],
filteredList: [],
// Update
numNoUpdate: 0,
// Toolbar
showToolbar: false,
selectedAreas: [],
selectedTypes: [],
sortKeyword: '',
sortKeywords: ['按片名', '按上映年份', '按更新时间', '按完成度'],
selectedYears: { start: 0, end: new Date().getFullYear() },
onlyShowItemsHasUpdate: false
}
},
components: {
@@ -171,6 +227,14 @@ export default {
set (val) {
this.SET_SETTING(val)
}
},
DetailCache: {
get () {
return this.$store.getters.getDetailCache
},
set (val) {
this.SET_DetailCache(val)
}
}
},
watch: {
@@ -180,19 +244,134 @@ export default {
this.getAllsites()
if (this.setting.historyViewMode === 'table') this.showShiftPrompt()
}
},
list: {
handler (list) {
this.areas = [...new Set(list.map(ele => ele.detail.area))].filter(x => x)
this.types = [...new Set(list.map(ele => ele.detail.type))].filter(x => x)
this.refreshFilteredList()
},
deep: true
},
numNoUpdate () {
// 如果所有历史都没有更新的话
if (this.numNoUpdate === this.list.length) {
this.numNoUpdate = 0
this.$message.warning('未查询到任何更新')
}
}
},
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
updateAllEvent () {
this.numNoUpdate = 0
this.list.forEach(e => {
this.updateEvent(e)
})
},
async updateEvent (e) {
try {
if (!this.DetailCache[e.site + '@' + e.ids]) {
this.DetailCache[e.site + '@' + e.ids] = await zy.detail(e.site, e.ids)
}
const newDetail = this.DetailCache[e.site + '@' + e.ids]
history.get(e.id).then(res => {
if (!e.hasUpdate && e.detail.last !== newDetail.last) {
res.hasUpdate = true
res.detail = newDetail
const msg = `检查到"${e.name}"有更新。`
this.$message.success(msg)
} else {
this.numNoUpdate += 1
}
history.update(e.id, res)
this.getAllhistory()
})
} catch (err) {
const msg = `更新"${e.name}"失败, 请重试。`
this.$message.warning(msg, err)
}
},
toggleViewMode () {
this.setting.historyViewMode = this.setting.historyViewMode === 'picture' ? 'table' : 'picture'
if (this.setting.historyViewMode === 'table') {
this.showShiftPrompt()
} else {
setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.refresh() }, 700)
}
setting.find().then(res => {
res.historyViewMode = this.setting.historyViewMode
setting.update(res)
})
},
backTop () {
if (this.setting.starViewMode === 'picture') {
document.getElementById('history-body').scrollTop = 0
} else {
this.$refs.historyTable.bodyWrapper.scrollTop = 0
}
},
refreshFilteredList () {
if (!this.showToolbar) {
this.sortKeyword = ''
this.selectedAreas = []
this.selectedSearchClassNames = []
this.selectedYears.start = 0
this.selectedYears.end = new Date().getFullYear()
this.filteredList = this.list
} else {
let filteredData = this.list
filteredData = filteredData.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
filteredData = filteredData.filter(res => res.detail.year >= this.selectedYears.start)
filteredData = filteredData.filter(res => res.detail.year <= this.selectedYears.end)
switch (this.sortKeyword) {
case '按上映年份':
filteredData.sort(function (a, b) {
return a.detail.year - b.detail.year
})
break
case '按片名':
filteredData.sort(function (a, b) {
return a.detail.name.localeCompare(b.detail.name, 'zh')
})
break
case '按更新时间':
filteredData.sort(function (a, b) {
return new Date(b.detail.last) - new Date(a.detail.last)
})
break
case '按完成度':
filteredData.sort(this.sortByProgress)
break
default:
break
}
this.filteredList = filteredData
}
if (this.onlyShowItemsHasUpdate) {
this.filteredList = this.filteredList.filter(x => x.hasUpdate)
}
},
progress (e) {
return e.duration > 0 ? ((e.time / e.duration) * 100).toFixed(0) : 0
},
sortByProgress (a, b) {
if (this.progress(a) < this.progress(b)) {
return -1
} else {
return 1
}
},
fmtMSS (s) {
return (s - (s %= 60)) / 60 + (s > 9 ? ':' : ':0') + s
},
selectionCellClick (selection, row) { // 历史id与顺序刚好相反大的反而在前面
if (this.shiftDown && this.selectionBegin !== '' && selection.includes(row)) {
this.selectionEnd = row.id
const start = this.history.findIndex(e => e.id === Math.max(this.selectionBegin, this.selectionEnd))
const end = this.history.findIndex(e => e.id === Math.min(this.selectionBegin, this.selectionEnd))
const selections = this.history.slice(start, end + 1)
const start = this.list.findIndex(e => e.id === Math.max(this.selectionBegin, this.selectionEnd))
const end = this.list.findIndex(e => e.id === Math.min(this.selectionBegin, this.selectionEnd))
const selections = this.list.slice(start, end + 1)
this.$nextTick(() => {
selections.forEach(e => this.$refs.historyTable.toggleRowSelection(e, true))
})
@@ -209,7 +388,7 @@ export default {
this.multipleSelection = rows
},
removeSelectedItems () {
if (!this.multipleSelection.length) this.multipleSelection = this.history
if (!this.multipleSelection.length) this.multipleSelection = this.list
this.multipleSelection.forEach(e => history.remove(e.id))
this.multipleSelection = []
this.getAllhistory()
@@ -224,6 +403,9 @@ export default {
name: e.name
}
}
if (e.hasUpdate) {
this.clearHasUpdateFlag(e)
}
},
async playEvent (e) {
const db = await history.find({ site: e.site, ids: e.ids })
@@ -232,8 +414,19 @@ export default {
} else {
this.video = { key: e.site, info: { id: e.ids, name: e.name, index: 0 } }
}
if (e.hasUpdate) {
this.clearHasUpdateFlag(e)
}
this.view = 'Play'
},
async clearHasUpdateFlag (e) {
const db = await history.find({ id: e.id })
if (db) {
db.hasUpdate = false
history.update(e.id, db)
this.getAllhistory()
}
},
shareEvent (e) {
this.share = {
show: true,
@@ -251,7 +444,7 @@ export default {
},
exportHistory () {
this.getAllhistory()
const arr = [...this.history]
const arr = [...this.list]
const str = JSON.stringify(arr, null, 2)
const options = {
filters: [
@@ -296,7 +489,7 @@ export default {
},
getAllhistory () {
history.all().then(res => {
this.history = res.reverse()
this.list = res.reverse()
})
},
getAllsites () {
@@ -320,24 +513,13 @@ export default {
updateDatabase () {
history.clear().then(res => {
let id = length
this.history.forEach(ele => {
this.list.forEach(ele => {
ele.id = id
id -= 1
history.add(ele)
})
})
},
updateViewMode () {
if (this.setting.historyViewMode === 'table') {
this.showShiftPrompt()
} else {
setTimeout(() => { if (this.$refs.historyWaterfall) this.$refs.historyWaterfall.refresh() }, 700)
}
setting.find().then(res => {
res.historyViewMode = this.setting.historyViewMode
setting.update(res)
})
},
showShiftPrompt () {
if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5
if (this.setting.shiftTooltipLimitTimes) {

View File

@@ -342,7 +342,7 @@ export default {
videoTitle: true,
airplay: true,
closeVideoTouch: true,
ignores: ['cssFullscreen', 'replay', 'error'], // 为了切换播放器类型时避免显示错误刷新,暂时忽略错误
ignores: ['replay', 'error'], // 为了切换播放器类型时避免显示错误刷新,暂时忽略错误
preloadTime: 300
},
state: {
@@ -445,6 +445,9 @@ export default {
set (val) {
this.SET_DetailCache(val)
}
},
VideoEssentialInfo () {
return this.video.key + '@' + this.video.info.id + '@' + this.video.info.index
}
},
watch: {
@@ -458,12 +461,11 @@ export default {
}
}
},
video: {
VideoEssentialInfo: {
handler () {
if (this.changingIPTV) return
this.getUrls()
},
deep: true
}
},
setting: {
handler () {
@@ -655,9 +657,9 @@ export default {
const currentSite = await sites.find({ key: this.video.key })
this.$message.info('即将调用解析接口播放,请等待...')
if (currentSite.jiexiUrl) {
this.onlineUrl = /^\s*(default|默认)\s*$/i.test(currentSite.jiexiUrl) ? this.setting.defaultParseURL + url : currentSite.jiexiUrl + url
this.onlineUrl = currentSite.jiexiUrl + url
} else {
this.onlineUrl = url
this.onlineUrl = this.setting.defaultParseURL + url
}
this.videoPlaying('online')
return
@@ -1568,7 +1570,7 @@ export default {
},
minMaxEvent () {
win.on('minimize', () => {
if (this.xg && this.xg.hasStart) {
if (this.xg && this.xg.hasStart && this.setting.pauseWhenMinimize) {
this.xg.pause()
}
})
@@ -1664,6 +1666,9 @@ export default {
cursor: pointer;
margin-left: 3px;
}
.xgplayer-skin-default .xg-btn-playPrev {
margin-left: 50px;
}
.xgplayer-skin-default .xg-btn-quitMiniMode {
display: none;
}

View File

@@ -1,39 +1,63 @@
<template>
<div class="listpage" id="recommendations">
<div class="listpage-header" id="recommendations-header">
<el-switch v-model="setting.recommendationViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
<el-select v-model="selectedRecommendationType" size="small" slot="prepend"
:popper-append-to-body="false"
popper-class="popper"
default-first-option placeholder="请选择"
@change="changeRecommendationTypeEvent">
<el-option
v-for="item in recommendationTypes"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-button type="text">视频数{{ recommendations.length }}</el-button>
<el-select v-model="selectedAreas" size="small" multiple placeholder="地区" popper-class="popper" :popper-append-to-body="false">
<el-option
v-for="item in areas"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="selectedTypes" size="small" multiple placeholder="类型" popper-class="popper" :popper-append-to-body="false">
<el-option
v-for="item in types"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false">
<el-option
v-for="item in sortKeywords"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-button :loading="loading" @click.stop="updateEvent" icon="el-icon-refresh">更新推荐</el-button>
</div>
<div class="toolbar" v-show="showToolbar">
<el-select v-model="selectedAreas" size="small" multiple placeholder="地区" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
<el-option
v-for="item in areas"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="selectedTypes" size="small" multiple placeholder="类型" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
<el-option
v-for="item in types"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false" @change="refreshFilteredList">
<el-option
v-for="item in sortKeywords"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<span>
上映区间
<el-input-number size="small" v-model="selectedYears.start" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
<el-input-number size="small" v-model="selectedYears.end" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
</span>
</div>
<el-divider class="listpage-header-divider" content-position="right">
<el-button type="text" size="mini" @click="toggleViewMode">视图切换</el-button>
<el-button type="text" size="mini" @click='() => { showToolbar = !showToolbar; if (!showToolbar) this.refreshFilteredList() }' title="收起工具栏会重置筛选排序">{{ showToolbar ? '隐藏工具栏' : '显示工具栏' }}</el-button>
<el-button type="text" size="mini" @click="backTop">回到顶部</el-button>
</el-divider>
<div class="listpage-body" id="recommendations-body" >
<div class="show-table" id="star-table" v-if="setting.recommendationViewMode === 'table'">
<el-table size="mini" fit height="100%" row-key="id"
ref="recommendationsTable"
:data="filteredRecommendations"
:data="filteredList"
@row-click="detailEvent">
<el-table-column
prop="name"
@@ -55,13 +79,13 @@
width="100"
align="center">
</el-table-column>
<el-table-column v-if="filteredRecommendations.some(e => e.rate)"
<el-table-column v-if="filteredList.some(e => e.rate)"
prop="rate"
align="center"
width="100"
label="豆瓣评分">
</el-table-column>
<el-table-column v-if="filteredRecommendations.some(e => e.detail.note)"
<el-table-column v-if="filteredList.some(e => e.detail.note)"
prop="detail.note"
label="备注">
</el-table-column>
@@ -74,13 +98,12 @@
<el-button @click.stop="playEvent(scope.row)" type="text">播放</el-button>
<el-button @click.stop="shareEvent(scope.row)" type="text">分享</el-button>
<el-button @click.stop="downloadEvent(scope.row)" type="text">下载</el-button>
<el-button @click.stop="deleteEvent(scope.row)" type="text">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="show-picture" id="star-picture" v-if="setting.recommendationViewMode === 'picture'">
<Waterfall ref="recommendationsWaterfall" :list="filteredRecommendations" :gutter="20" :width="240"
<Waterfall ref="recommendationsWaterfall" :list="filteredList" :gutter="20" :width="240"
:breakpoints="{
1200: { //当屏幕宽度小于等于1200
rowPerView: 4,
@@ -106,7 +129,6 @@
<span class="o-play" @click="playEvent(props.data)">播放</span>
<span class="o-share" @click="shareEvent(props.data)">分享</span>
<span class="o-star" @click="downloadEvent(props.data)">下载</span>
<span class="o-star" @click="deleteEvent(props.data)">删除</span>
</div>
</div>
</div>
@@ -126,10 +148,12 @@
</template>
<script>
import { mapMutations } from 'vuex'
import { history, recommendation, setting } from '../lib/dexie'
import { history, recommendation, setting, sites, cachedMovies } from '../lib/dexie'
import zy from '../lib/site/tools'
import Waterfall from 'vue-waterfall-plugin'
import axios from 'axios'
const { clipboard } = require('electron')
export default {
name: 'recommendations',
data () {
@@ -138,11 +162,45 @@ export default {
sites: [],
loading: false,
types: [],
selectedTypes: [],
areas: [],
filteredList: [],
// 不同推荐
recommendationsDefault: [],
recommendationTypes: ['作者推荐', '豆瓣热门电影', '豆瓣高分电影', '豆瓣热门剧集', '豆瓣热门美剧', '豆瓣热门英剧', '豆瓣热门国产剧', '豆瓣热门综艺', '豆瓣热门动漫', '豆瓣热门纪录片', '豆瓣热门动画电影'],
selectedRecommendationType: '作者推荐',
// Toolbar
showToolbar: false,
selectedAreas: [],
selectedTypes: [],
sortKeyword: '',
sortKeywords: ['上映', '评分', '默认']
sortKeywords: ['按片名', '按上映年份', '按更新时间', '按评分'],
selectedYears: { start: 0, end: new Date().getFullYear() },
// 缓存数据
localCachedMovies: [],
// 豆瓣
douban: {
page_limit: 50,
hotMoviePageStart: 0,
hotmovie: [],
hotTVPageStart: 0,
hotTV: [],
highRateMoviePageStart: 0,
highRateMovie: [],
hotAnimePageStart: 0,
hotAnime: [],
hotDocumentaryPageStart: 0,
hotDocumentary: [],
hotTVShowPageStart: 0,
hotTVShow: [],
hotCartonMoviePageStart: 0,
hotCartonMovie: [],
hotAmericanTVSeriesPageStart: 0,
hotAmericanTVSeries: [],
hotBritishTVSeriesPageStart: 0,
hotBritishTVSeries: [],
hotChineseTVSeriesPageStart: 0,
hotChineseTVSeries: []
}
}
},
components: {
@@ -188,11 +246,6 @@ export default {
set (val) {
this.SET_SETTING(val)
}
},
filteredRecommendations () {
let filteredData = this.recommendations.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
return filteredData
}
},
watch: {
@@ -201,44 +254,130 @@ export default {
if (this.$refs.recommendationsWaterfall) this.$refs.recommendationsWaterfall.resize()
}
},
sortKeyword () {
switch (this.sortKeyword) {
case '上映':
this.recommendations = this.recommendations.sort(function (a, b) {
return b.detail.year - a.detail.year
})
break
case '评分':
this.recommendations.sort(function (a, b) {
return b.rate - a.rate
})
break
case '默认':
this.recommendations.sort(function (a, b) {
return b.id - a.id
})
break
default:
break
}
recommendations: {
handler (recommendations) {
this.areas = [...new Set(recommendations.map(ele => ele.detail.area))].filter(x => x)
this.types = [...new Set(recommendations.map(ele => ele.detail.type))].filter(x => x)
this.refreshFilteredList()
},
deep: true
}
},
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
detailEvent (e) {
this.detail = {
show: true,
key: e.key,
info: {
id: e.ids,
name: e.name
changeRecommendationTypeEvent () {
if (this.selectedRecommendationType === '作者推荐') {
this.recommendations = this.recommendationsDefault
} else {
if (this.selectedRecommendationType === '豆瓣热门电影') {
this.recommendations = [...this.douban.hotmovie]
}
if (this.selectedRecommendationType === '豆瓣高分电影') {
this.recommendations = [...this.douban.highRateMovie]
}
if (this.selectedRecommendationType === '豆瓣热门剧集') {
this.recommendations = [...this.douban.hotTV]
}
if (this.selectedRecommendationType === '豆瓣热门美剧') {
this.recommendations = [...this.douban.hotAmericanTVSeries]
}
if (this.selectedRecommendationType === '豆瓣热门英剧') {
this.recommendations = [...this.douban.hotBritishTVSeries]
}
if (this.selectedRecommendationType === '豆瓣热门国产剧') {
this.recommendations = [...this.douban.hotChineseTVSeries]
}
if (this.selectedRecommendationType === '豆瓣热门动漫') {
this.recommendations = [...this.douban.hotAnime]
}
if (this.selectedRecommendationType === '豆瓣热门纪录片') {
this.recommendations = [...this.douban.hotDocumentary]
}
if (this.selectedRecommendationType === '豆瓣热门综艺') {
this.recommendations = [...this.douban.hotTVShow]
}
if (this.selectedRecommendationType === '豆瓣热门动画电影') {
this.recommendations = [...this.douban.hotCartonMovie]
}
if (this.recommendations.length === 0) {
this.updateDoubanRecommendationsEvent()
}
}
},
getRecommendationsDoubanMovieOrTV (doubanUrl) {
axios.get(doubanUrl).then(res => {
if (res.data) {
res.data.subjects.forEach(element => {
const localCachedMovie = this.localCachedMovies.find(e => e.key === this.sites[0].key && e.name === element.title)
if (localCachedMovie) {
this.updateDoubanRecommendataions(localCachedMovie)
} else {
this.searchAndCacheMovie(element)
}
})
}
})
},
updateDoubanRecommendataions (movie) {
this.recommendations.push(movie)
if (this.selectedRecommendationType === '豆瓣热门电影') {
this.douban.hotmovie.push(movie)
}
if (this.selectedRecommendationType === '豆瓣高分电影') {
this.douban.highRateMovie.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门剧集') {
this.douban.hotTV.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门美剧') {
this.douban.hotAmericanTVSeries.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门英剧') {
this.douban.hotBritishTVSeries.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门国产剧') {
this.douban.hotChineseTVSeries.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门动漫') {
this.douban.hotAnime.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门纪录片') {
this.douban.hotDocumentary.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门综艺') {
this.douban.hotTVShow.push(movie)
}
if (this.selectedRecommendationType === '豆瓣热门动画电影') {
this.douban.hotCartonMovie.push(movie)
}
},
searchAndCacheMovie (element) {
zy.searchFirstDetail(this.sites[0].key, element.title).then(detailRes => {
if (detailRes) {
const doc = {
key: this.sites[0].key,
ids: detailRes.id,
site: this.sites[0],
name: detailRes.name,
detail: detailRes,
rate: element.rate
}
this.updateDoubanRecommendataions(doc)
this.localCachedMovies.push(doc)
cachedMovies.add(doc)
}
})
},
updateEvent () {
if (this.selectedRecommendationType === '作者推荐') {
this.updateAuthorRecommendataions()
} else {
this.updateDoubanRecommendationsEvent()
}
},
updateAuthorRecommendataions () {
const url = 'https://raw.githubusercontent.com/cuiocean/ZY-Player-Resources/main/Recommendations/Recommendations.json'
this.loading = true
const axios = require('axios')
axios.get(url).then(res => {
if (res.status === 200) {
if (res.data.length > 0) {
@@ -255,6 +394,120 @@ export default {
this.$message.warning('最新的推荐数据保存在Github上,请考虑使用代理或者等待下一版本内置数据更新.')
})
},
updateDoubanRecommendationsEvent () {
let doubanUrl = ''
if (this.selectedRecommendationType === '豆瓣热门电影') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=movie&tag=热门&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotMoviePageStart}`
this.douban.hotMoviePageStart = this.douban.hotMoviePageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门剧集') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=热门&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotTVPageStart}`
this.douban.hotTVPageStart = this.douban.hotTVPageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门美剧') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=美剧&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotCartonMoviePageStart}`
this.douban.hotCartonMoviePageStart = this.douban.hotCartonMoviePageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门英剧') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=英剧&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotBritishTVSeriesPageStart}`
this.douban.hotBritishTVSeriesPageStart = this.douban.hotBritishTVSeriesPageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门国产剧') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=国产剧&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotChineseTVSeriesPageStart}`
this.douban.hotChineseTVSeriesPageStart = this.douban.hotChineseTVSeriesPageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣高分电影') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=movie&tag=豆瓣高分&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.highRateMoviePageStart}`
this.douban.highRateMoviePageStart = this.douban.highRateMoviePageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门动漫') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=日本动画&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotAnimePageStart}`
this.douban.hotAnimePageStart = this.douban.hotAnimePageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门纪录片') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=纪录片&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotDocumentaryPageStart}`
this.douban.hotDocumentaryPageStart = this.douban.hotDocumentaryPageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门综艺') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=tv&tag=综艺&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotTVShowPageStart}`
this.douban.hotTVShowPageStart = this.douban.hotTVShowPageStart + this.douban.page_limit
}
if (this.selectedRecommendationType === '豆瓣热门动画电影') {
doubanUrl = `https://movie.douban.com/j/search_subjects?type=movie&tag=动画&sort=recommend&page_limit=${this.douban.page_limit}&page_start=${this.douban.hotCartonMoviePageStart}`
this.douban.hotCartonMoviePageStart = this.douban.hotCartonMoviePageStart + this.douban.page_limit
}
this.getRecommendationsDoubanMovieOrTV(doubanUrl)
},
toggleViewMode () {
this.setting.recommendationViewMode = this.setting.recommendationViewMode === 'picture' ? 'table' : 'picture'
if (this.setting.recommendationViewMode === 'table') {
setTimeout(() => { this.rowDrop() }, 100)
} else {
setTimeout(() => { if (this.$refs.recommendationsWaterfall) this.$refs.recommendationsWaterfall.refresh() }, 700)
}
setting.find().then(res => {
res.recommendationViewMode = this.setting.recommendationViewMode
setting.update(res)
})
},
backTop () {
if (this.setting.recommendationViewMode === 'picture') {
document.getElementById('recommendations-body').scrollTop = 0
} else {
this.$refs.recommendationsTable.bodyWrapper.scrollTop = 0
}
},
refreshFilteredList () {
if (!this.showToolbar) {
this.sortKeyword = ''
this.selectedAreas = []
this.selectedSearchClassNames = []
this.selectedYears.start = 0
this.selectedYears.end = new Date().getFullYear()
this.filteredList = this.recommendations
} else {
let filteredData = this.recommendations
filteredData = filteredData.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
filteredData = filteredData.filter(res => res.detail.year >= this.selectedYears.start)
filteredData = filteredData.filter(res => res.detail.year <= this.selectedYears.end)
switch (this.sortKeyword) {
case '按上映年份':
filteredData.sort(function (a, b) {
return a.detail.year - b.detail.year
})
break
case '按片名':
filteredData.sort(function (a, b) {
return a.detail.name.localeCompare(b.detail.name, 'zh')
})
break
case '按更新时间':
filteredData.sort(function (a, b) {
return new Date(b.detail.last) - new Date(a.detail.last)
})
break
case '按评分':
filteredData.sort(function (a, b) {
return b.rate - a.rate
})
break
default:
break
}
this.filteredList = filteredData
}
},
detailEvent (e) {
this.detail = {
show: true,
key: e.key,
info: {
id: e.ids,
name: e.name
}
}
},
async playEvent (e) {
const db = await history.find({ site: e.key, ids: e.ids })
if (db) {
@@ -264,14 +517,6 @@ export default {
}
this.view = 'Play'
},
deleteEvent (e) {
recommendation.remove(e.id).then(res => {
if (res) {
this.$message.warning('删除失败')
}
this.getRecommendations()
})
},
shareEvent (e) {
this.share = {
show: true,
@@ -295,6 +540,7 @@ export default {
this.recommendations = res.sort(function (a, b) {
return b.id - a.id
})
this.recommendationsDefault = this.recommendations
this.getFilterData()
})
},
@@ -308,10 +554,24 @@ export default {
res.recommendationViewMode = this.setting.recommendationViewMode
setting.update(res)
})
},
getAllSites () {
sites.all().then(res => {
if (res.length > 0) {
this.sites = res.filter(item => item.isActive)
}
})
},
getCachedMovies () {
cachedMovies.all().then(res => {
this.localCachedMovies = res
})
}
},
created () {
this.getAllSites()
this.getRecommendations()
this.getCachedMovies()
},
mounted () {
addEventListener('resize', () => {

View File

@@ -93,9 +93,6 @@
<div class="zy-select">
<div class="vs-placeholder vs-noAfter" @click="show.configSitesDataUrlDialog = true">设置源站接口文件</div>
</div>
<div class="zy-input" @click="toggleExcludeRootClasses">
<input type="checkbox" v-model = "d.excludeRootClasses" @change="updateSettingEvent"> 屏蔽主分类
</div>
</div>
</div>
<div class="site">
@@ -113,6 +110,15 @@
</div>
</div>
</div>
<div class="site">
<div class="title">窗口及播放</div>
<div class="site-box">
<div class="zy-input">
<input type="checkbox" v-model = "d.restoreWindowPositionAndSize" @change="updateSettingEvent"> 记录并恢复窗口位置和大小
<input type="checkbox" v-model = "d.pauseWhenMinimize" @change="updateSettingEvent"> 最小化时暂停播放
</div>
</div>
</div>
<div class="theme">
<div class="title">主题</div>
<div class="theme-box">
@@ -167,7 +173,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button type="danger" @click="get7kParseURL">重置</el-button>
<el-button type="danger" @click="resetDefaultParseURL">重置</el-button>
<el-button type="primary" @click="configDefaultParseURL">确定</el-button>
</span>
</el-dialog>
@@ -181,7 +187,7 @@
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialog">取消</el-button>
<el-button type="danger" @click="getDefaultdeSitesDataURL">重置</el-button>
<el-button type="danger" @click="resetDefaultSitesDataURL">重置</el-button>
<el-button type="primary" @click="configSitesDataURL">确定</el-button>
</span>
</el-dialog>
@@ -328,7 +334,7 @@ export default {
this.d = res
this.setting = this.d
if (!this.setting.defaultParseURL) this.configDefaultParseURL()
if (!this.setting.sitesDataURL) this.getDefaultdeSitesDataURL()
if (!this.setting.sitesDataURL) this.resetDefaultSitesDataURL()
})
},
getDefaultSites () {
@@ -374,25 +380,20 @@ export default {
this.d.excludeRootClasses = !this.d.excludeRootClasses
this.updateSettingEvent()
},
async get7kParseURL () {
this.$message.info('正在获取7K源解析地址...')
const parseURL = await zy.get7kParseURL()
if (parseURL.startsWith('http')) {
this.$message.success('获取成功,更新应用默认解析接口地址...')
this.setting.defaultParseURL = parseURL
}
async resetDefaultParseURL () {
this.setting.defaultParseURL = 'https://jx.bpba.cc/?v='
},
async configDefaultParseURL () {
if (!this.setting.defaultParseURL) await this.get7kParseURL()
this.d.defaultParseURL = this.setting.defaultParseURL.trim()
if (!this.setting.defaultParseURL) await this.resetDefaultParseURL()
this.d.defaultParseURL = this.setting.defaultParseURL?.trim()
this.show.configDefaultParseUrlDialog = false
this.updateSettingEvent()
},
getDefaultdeSitesDataURL () {
resetDefaultSitesDataURL () {
this.setting.sitesDataURL = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
},
configSitesDataURL () {
if (!this.setting.sitesDataURL) this.getDefaultdeSitesDataURL()
if (!this.setting.sitesDataURL) this.resetDefaultSitesDataURL()
this.d.sitesDataURL = this.setting.sitesDataURL
this.show.configSitesDataUrlDialog = false
this.updateSettingEvent()

View File

@@ -1,17 +1,56 @@
<template>
<div class="listpage" id="star">
<div class="listpage-header" id="star-header">
<el-switch v-model="setting.starViewMode" active-text="海报" active-value="picture" inactive-text="列表" inactive-value="table" @change="updateViewMode"></el-switch>
<el-button @click.stop="exportFavoritesEvent" icon="el-icon-upload2" title="导出全部,自动添加扩展名">导出</el-button>
<el-button @click.stop="importFavoritesEvent" icon="el-icon-download" title="支持同时导入多个文件">导入</el-button>
<el-button @click.stop="removeSelectedItems" icon="el-icon-delete-solid">{{ multipleSelection.length === 0 ? "清空" : "删除所选" }}</el-button>
<el-button @click.stop="updateAllEvent" icon="el-icon-refresh">同步所有收藏</el-button>
<b-button-group>
<el-switch v-model="onlyShowItemsHasUpdate" active-text="有更新" inactive-text="全部" @change="refreshFilteredList"></el-switch>
<el-button @click.stop="updateAllEvent" icon="el-icon-refresh">检查更新</el-button>
</b-button-group>
</div>
<div class="toolbar" v-show="showToolbar">
<el-select v-model="selectedAreas" size="small" multiple placeholder="地区" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
<el-option
v-for="item in areas"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="selectedTypes" size="small" multiple placeholder="类型" popper-class="popper" :popper-append-to-body="false" @remove-tag="refreshFilteredList" @change="refreshFilteredList">
<el-option
v-for="item in types"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<el-select v-model="sortKeyword" size="small" placeholder="排序" popper-class="popper" :popper-append-to-body="false" @change="refreshFilteredList">
<el-option
v-for="item in sortKeywords"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
<span>
上映区间
<el-input-number size="small" v-model="selectedYears.start" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
<el-input-number size="small" v-model="selectedYears.end" :min=0 :max="new Date().getFullYear()" controls-position="right" step-strictly @change="refreshFilteredList"></el-input-number>
</span>
</div>
<el-divider class="listpage-header-divider" content-position="right">
<el-button type="text" size="mini" @click="toggleViewMode">视图切换</el-button>
<el-button type="text" size="mini" @click='() => { showToolbar = !showToolbar; if (!showToolbar) this.refreshFilteredList() }' title="收起工具栏会重置筛选排序">{{ showToolbar ? '隐藏工具栏' : '显示工具栏' }}</el-button>
<el-button type="text" size="mini" @click="backTop">回到顶部</el-button>
</el-divider>
<div class="listpage-body" id="star-body">
<div class="show-table" id="star-table" v-if="setting.starViewMode === 'table'">
<el-table size="mini" fit height="100%" row-key="id"
ref="starTable"
:data="list"
:data="filteredList"
:cell-class-name="checkUpdate"
@row-click="detailEvent"
@sort-change="handleSortChange"
@@ -84,7 +123,7 @@
</el-table>
</div>
<div class="show-picture" id="star-picture" v-if="setting.starViewMode === 'picture'">
<Waterfall ref="starWaterfall" :list="list" :gutter="20" :width="240"
<Waterfall ref="starWaterfall" :list="filteredList" :gutter="20" :width="240"
:breakpoints="{
1200: { //当屏幕宽度小于等于1200
rowPerView: 4,
@@ -155,7 +194,18 @@ export default {
shiftDown: false,
selectionBegin: '',
selectionEnd: '',
multipleSelection: []
multipleSelection: [],
filteredList: [],
areas: [],
types: [],
// Toolbar
showToolbar: false,
selectedAreas: [],
selectedTypes: [],
sortKeyword: '',
sortKeywords: ['按片名', '按上映年份', '按更新时间'],
selectedYears: { start: 0, end: new Date().getFullYear() },
onlyShowItemsHasUpdate: false
}
},
components: {
@@ -225,10 +275,77 @@ export default {
this.numNoUpdate = 0
this.$message.warning('未查询到任何更新')
}
},
list: {
handler (list) {
this.areas = [...new Set(list.map(ele => ele.detail.area))].filter(x => x)
this.types = [...new Set(list.map(ele => ele.detail.type))].filter(x => x)
this.refreshFilteredList()
},
deep: true
}
},
methods: {
...mapMutations(['SET_VIEW', 'SET_DETAIL', 'SET_VIDEO', 'SET_SHARE', 'SET_SETTING']),
toggleViewMode () {
this.setting.starViewMode = this.setting.starViewMode === 'picture' ? 'table' : 'picture'
if (this.setting.starViewMode === 'table') {
setTimeout(() => { this.rowDrop() }, 100)
this.showShiftPrompt()
} else {
setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.refresh() }, 700)
}
setting.find().then(res => {
res.starViewMode = this.setting.starViewMode
setting.update(res)
})
},
backTop () {
if (this.setting.starViewMode === 'picture') {
document.getElementById('star-body').scrollTop = 0
} else {
this.$refs.starTable.bodyWrapper.scrollTop = 0
}
},
refreshFilteredList () {
if (!this.showToolbar) {
this.sortKeyword = ''
this.selectedAreas = []
this.selectedSearchClassNames = []
this.selectedYears.start = 0
this.selectedYears.end = new Date().getFullYear()
this.filteredList = this.list
} else {
let filteredData = this.list
filteredData = filteredData.filter(x => (this.selectedAreas.length === 0) || this.selectedAreas.includes(x.detail.area))
filteredData = filteredData.filter(x => (this.selectedTypes.length === 0) || this.selectedTypes.includes(x.detail.type))
filteredData = filteredData.filter(res => res.detail.year >= this.selectedYears.start)
filteredData = filteredData.filter(res => res.detail.year <= this.selectedYears.end)
switch (this.sortKeyword) {
case '按上映年份':
filteredData.sort(function (a, b) {
return a.detail.year - b.detail.year
})
break
case '按片名':
filteredData.sort(function (a, b) {
return a.detail.name.localeCompare(b.detail.name, 'zh')
})
break
case '按更新时间':
filteredData.sort(function (a, b) {
return new Date(b.detail.last) - new Date(a.detail.last)
})
break
default:
break
}
this.filteredList = filteredData
}
if (this.onlyShowItemsHasUpdate) {
this.filteredList = this.filteredList.filter(x => x.hasUpdate)
}
},
handleSortChange (column, prop, order) {
this.updateDatabase()
},
@@ -331,7 +448,7 @@ export default {
star.get(e.id).then(resStar => {
if (!e.hasUpdate && e.detail.last !== doc.detail.last) {
doc.hasUpdate = true
const msg = `同步"${e.name}"成功, 检查到更新。`
const msg = `检查到"${e.name}"更新。`
this.$message.success(msg)
} else {
this.numNoUpdate += 1
@@ -340,7 +457,7 @@ export default {
this.getFavorites()
})
} catch (err) {
const msg = `同步"${e.name}"失败, 请重试`
const msg = `更新"${e.name}"失败, 请重试`
this.$message.warning(msg, err)
}
},
@@ -488,18 +605,6 @@ export default {
}
})
},
updateViewMode () {
if (this.setting.starViewMode === 'table') {
setTimeout(() => { this.rowDrop() }, 100)
this.showShiftPrompt()
} else {
setTimeout(() => { if (this.$refs.starWaterfall) this.$refs.starWaterfall.refresh() }, 700)
}
setting.find().then(res => {
res.starViewMode = this.setting.starViewMode
setting.update(res)
})
},
showShiftPrompt () {
if (this.setting.shiftTooltipLimitTimes === undefined) this.setting.shiftTooltipLimitTimes = 5
if (this.setting.shiftTooltipLimitTimes) {

View File

@@ -0,0 +1,28 @@
import db from './dexie'
const { cachedMovies } = db
export default {
async add (doc) {
return await cachedMovies.add(doc)
},
async bulkAdd (doc) {
return await cachedMovies.bulkAdd(doc)
},
async find (doc) {
return await cachedMovies.where(doc).first()
},
async update (id, docs) {
return await cachedMovies.update(id, docs)
},
async all () {
return await cachedMovies.toArray()
},
async remove (id) {
return await cachedMovies.delete(id)
},
async get (id) {
return await cachedMovies.get(id)
},
async clear () {
return await cachedMovies.clear()
}
}

View File

@@ -1,8 +1,7 @@
import Dexie from 'dexie'
import { setting, sites, localKey, iptv, recommendations } from './initData'
import { sites, localKey, iptv, recommendations, iniSetting } from './initData'
const db = new Dexie('zy')
db.version(4).stores({
search: '++id, keywords',
setting: 'id, theme, site, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode, searchViewMode, password, proxy, allowPassWhenIptvCheck, autocleanWhenIptvCheck',
@@ -59,8 +58,51 @@ db.version(8).stores({
})
})
db.version(9).stores({
history: '++id, [site+ids], name, type, year, index, time, duration, detail, onlinePlay, hasUpdate'
})
db.version(10).stores({
setting: 'id, theme, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode, searchViewMode, password, proxy, allowPassWhenIptvCheck, autocleanWhenIptvCheck, rootClassFilter, r18ClassFilter, classFilter'
}).upgrade(trans => {
trans.setting.toCollection().modify(setting => {
delete setting.site
setting.rootClassFilter = ['电影', '电影片', '电视剧', '连续剧', '综艺', '动漫']
setting.r18ClassFilter = ['伦理', '论理', '倫理', '福利', '激情', '理论', '写真', '情色', '美女', '街拍', '赤足', '性感', '里番', 'VIP']
setting.classFilter = ['电影', '电影片', '电视剧', '连续剧', '综艺', '动漫', '伦理', '论理', '倫理', '福利', '激情', '理论', '写真', '情色', '美女', '街拍', '赤足', '性感', '里番', 'VIP']
})
})
db.version(11).stores({
setting: 'id, theme, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode,' +
'searchViewMode, password, proxy, allowPassWhenIptvCheck, autocleanWhenIptvCheck, rootClassFilter, r18ClassFilter, classFilter, restoreWindowPositionAndSize, windowPositionAndSize, pauseWhenMinimize',
cachedMovies: '++id, [key+ids], site, name, detail, index, rate, hasUpdate'
}).upgrade(trans => {
trans.setting.toCollection().modify(setting => {
setting.restoreWindowPositionAndSize = false
setting.windowPositionAndSize = {
x: 0,
y: 0,
width: 1080,
height: 720
}
setting.pauseWhenMinimize = false
})
})
db.version(11).stores({
setting: 'id, theme, shortcut, view, volume, externalPlayer, searchGroup, excludeRootClasses, excludeR18Films, forwardTimeInSec, starViewMode, recommandationViewMode,' +
'searchViewMode, password, proxy, allowPassWhenIptvCheck, autocleanWhenIptvCheck, rootClassFilter, r18ClassFilter, classFilter, restoreWindowPositionAndSize,' +
'windowPositionAndSize, pauseWhenMinimize, sitesDataURL, defaultParseURL'
}).upgrade(trans => {
trans.setting.toCollection().modify(setting => {
setting.sitesDataURL = 'https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json'
setting.defaultParseURL = 'https://jx.bpba.cc/?v='
})
})
db.on('populate', () => {
db.setting.bulkAdd(setting)
db.setting.bulkAdd(iniSetting)
db.sites.bulkAdd(sites)
db.shortcut.bulkAdd(localKey)
db.iptv.bulkAdd(iptv)

View File

@@ -19,6 +19,9 @@ export default {
async remove (id) {
return await history.delete(id)
},
async get (id) {
return await history.get(id)
},
async clear () {
return await history.clear()
}

View File

@@ -8,6 +8,7 @@ import search from './search'
import iptv from './iptv'
import channelList from './channelList'
import recommendation from './recommendation'
import cachedMovies from './cachedMovies'
export {
history,
@@ -19,5 +20,6 @@ export {
iptv,
channelList,
search,
recommendation
recommendation,
cachedMovies
}

View File

@@ -0,0 +1,82 @@
[{
"id": 0,
"theme": "light",
"shortcut": true,
"view": "picture",
"externalPlayer": "",
"searchGroup": "全站",
"excludeRootClasses": true,
"excludeR18Films": true,
"forwardTimeInSec": 5,
"waitingTimeInSec": 15,
"starViewMode": "picture",
"recommendationViewMode": "picture",
"historyViewMode": "picture",
"searchViewMode": "picture",
"password": "",
"proxy": {
"type": "none",
"scheme": "",
"url": "",
"port": ""
},
"allowPassWhenIptvCheck": true,
"autocleanWhenIptvCheck": false,
"autoChangeSourceWhenIptvStalling": true,
"shortcutModified": false,
"sitesDataURL": "https://gitee.com/cuiocean/ZY-Player-Resources/raw/main/Sites/Sites.json",
"rootClassFilter": [
"电影",
"电影片",
"电视剧",
"连续剧",
"综艺",
"动漫"
],
"r18ClassFilter": [
"伦理",
"论理",
"倫理",
"福利",
"激情",
"理论",
"写真",
"情色",
"美女",
"街拍",
"赤足",
"性感",
"里番",
"VIP"
],
"classFilter": [
"电影",
"电影片",
"电视剧",
"连续剧",
"综艺",
"动漫",
"伦理",
"论理",
"倫理",
"福利",
"激情",
"理论",
"写真",
"情色",
"美女",
"街拍",
"赤足",
"性感",
"里番",
"VIP"
],
"restoreWindowPositionAndSize": false,
"windowPositionAndSize": {
"x": 0,
"y": 0,
"width": 1080,
"height": 720
},
"pauseWhenMinimize": false
}]

View File

@@ -0,0 +1,112 @@
[
{
"name": "playAndPause",
"desc": "播放或暂停",
"key": "space"
},
{
"name": "forward",
"desc": "快进",
"key": "right"
},
{
"name": "back",
"desc": "快退",
"key": "left"
},
{
"name": "volumeUp",
"desc": "音量调高",
"key": "up"
},
{
"name": "volumeDown",
"desc": "音量调低",
"key": "down"
},
{
"name": "mute",
"desc": "静音",
"key": "m"
},
{
"name": "top",
"desc": "置顶或退出置顶",
"key": "t"
},
{
"name": "fullscreen",
"desc": "进入或退出全屏",
"key": "f"
},
{
"name": "escape",
"desc": "退出全屏/精简模式",
"key": "esc"
},
{
"name": "next",
"desc": "下一集",
"key": "alt+right"
},
{
"name": "prev",
"desc": "上一集",
"key": "alt+left"
},
{
"name": "home",
"desc": "跳到视频开始位置",
"key": "home"
},
{
"name": "end",
"desc": "跳到视频结束位置",
"key": "end"
},
{
"name": "startPosition",
"desc": "标记片头",
"key": "ctrl+home"
},
{
"name": "endPosition",
"desc": "标记片尾",
"key": "ctrl+end"
},
{
"name": "clearPosition",
"desc": "清除标记",
"key": "ctrl+del"
},
{
"name": "opacityUp",
"desc": "透明度调高",
"key": "alt+up"
},
{
"name": "opacityDown",
"desc": "透明度调低",
"key": "alt+down"
},
{
"name": "playbackRateUp",
"desc": "播放倍速加快",
"key": "pageup"
},
{
"name": "playbackRateDown",
"desc": "播放倍速减慢",
"key": "pagedown"
},
{
"name": "mini",
"desc": "进入或退出mini模式",
"key": "alt+m"
},
{
"name": "resetMini",
"desc": "重置mini窗口",
"key": "ctrl+0"
}
]

View File

@@ -1,145 +1,3 @@
const setting = [
{
id: 0,
theme: 'light',
shortcut: true,
view: 'picture',
externalPlayer: '',
searchGroup: '全站',
excludeRootClasses: true,
excludeR18Films: true,
forwardTimeInSec: 5,
waitingTimeInSec: 15,
starViewMode: 'picture',
recommendationViewMode: 'picture',
historyViewMode: 'picture',
searchViewMode: 'picture',
password: '',
proxy: {
type: 'none',
scheme: '',
url: '',
port: ''
},
allowPassWhenIptvCheck: true,
autocleanWhenIptvCheck: false,
autoChangeSourceWhenIptvStalling: true
}
]
const localKey = [
{
name: 'playAndPause',
desc: '播放或暂停',
key: 'space'
},
{
name: 'forward',
desc: '快进',
key: 'right'
},
{
name: 'back',
desc: '快退',
key: 'left'
},
{
name: 'volumeUp',
desc: '音量调高',
key: 'up'
},
{
name: 'volumeDown',
desc: '音量调低',
key: 'down'
},
{
name: 'mute',
desc: '静音',
key: 'm'
},
{
name: 'top',
desc: '置顶或退出置顶',
key: 't'
},
{
name: 'fullscreen',
desc: '进入或退出全屏',
key: 'f'
},
{
name: 'escape',
desc: '退出全屏/精简模式',
key: 'esc'
},
{
name: 'next',
desc: '下一集',
key: 'alt+right'
},
{
name: 'prev',
desc: '上一集',
key: 'alt+left'
},
{
name: 'home',
desc: '跳到视频开始位置',
key: 'home'
},
{
name: 'end',
desc: '跳到视频结束位置',
key: 'end'
},
{
name: 'startPosition',
desc: '标记片头',
key: 'ctrl+home'
},
{
name: 'endPosition',
desc: '标记片尾',
key: 'ctrl+end'
},
{
name: 'clearPosition',
desc: '清除标记',
key: 'ctrl+del'
},
{
name: 'opacityUp',
desc: '透明度调高',
key: 'alt+up'
},
{
name: 'opacityDown',
desc: '透明度调低',
key: 'alt+down'
},
{
name: 'playbackRateUp',
desc: '播放倍速加快',
key: 'pageup'
},
{
name: 'playbackRateDown',
desc: '播放倍速减慢',
key: 'pagedown'
},
{
name: 'mini',
desc: '进入或退出mini模式',
key: 'alt+m'
},
{
name: 'resetMini',
desc: '重置mini窗口',
key: 'ctrl+0'
}
]
const getSite = (key) => {
for (const i of sites) {
if (key === i.key) {
@@ -151,11 +9,13 @@ const getSite = (key) => {
const sites = require('./iniData/Sites.json')
const iptv = require('./iniData/Iptv.json')
const recommendations = require('./iniData/Recommendations.json')
const iniSetting = require('./iniData/iniSetting.json')
const localKey = require('./iniData/localKey.json')
export {
setting,
sites,
iptv,
recommendations,
iniSetting,
localKey,
getSite
}

View File

@@ -5,6 +5,12 @@ export default {
async find () {
return await setting.get({ id: 0 })
},
async bulkAdd (doc) {
return await setting.bulkAdd(doc)
},
async add (doc) {
return await setting.add(doc)
},
async update (docs) {
return await setting.update(0, docs)
}

View File

@@ -1,6 +1,8 @@
import Vue from 'vue'
import { Message, Button, Table, TableColumn, Tag, Input, InputNumber, Dialog, Form, FormItem, Switch, Select, Option, Checkbox, Autocomplete, Col, Tree, Divider, Progress, MessageBox } from 'element-ui'
import Plugin from 'v-fit-columns'
import { ButtonGroupPlugin } from 'bootstrap-vue'
Vue.use(ButtonGroupPlugin)
Vue.use(Button)
Vue.use(Col)
Vue.use(Table)

View File

@@ -111,13 +111,16 @@ const zy = {
axios.get(url).then(res => {
const data = res.data
const json = parser.parse(data, this.xmlConfig)
const jsondata = json.rss === undefined ? json : json.rss
const jsondata = json?.rss === undefined ? json : json.rss
if (!jsondata?.class || !jsondata?.list) resolve()
const arr = []
if (jsondata.class) {
// 有些网站返回的分类名里会含有一串包含在{}内的字符串,移除掉
const regex = /\{.*\}/i
for (const i of jsondata.class.ty) {
const j = {
tid: i._id,
name: i._t
name: i._t.replace(regex, '')
}
arr.push(j)
}
@@ -216,16 +219,55 @@ const zy = {
axios.get(url, { timeout: 3000 }).then(res => {
const data = res.data
const json = parser.parse(data, this.xmlConfig)
const jsondata = json.rss === undefined ? json : json.rss
const jsondata = json?.rss === undefined ? json : json.rss
if (json && jsondata && jsondata.list) {
let videoList = jsondata.list.video
if (Object.prototype.toString.call(videoList) === '[object Object]') videoList = [].concat(videoList)
videoList = videoList.filter(e => e.name.toLowerCase().includes(wd.toLowerCase()))
if (videoList.length) {
videoList = videoList?.filter(e => e.name.toLowerCase().includes(wd.toLowerCase()))
if (videoList?.length) {
resolve(videoList)
} else {
resolve()
}
} else {
resolve()
}
}).catch(err => {
reject(err)
})
}).catch(err => {
reject(err)
})
})
},
/**
* 搜索资源详情
* @param {*} key 资源网 key
* @param {*} wd 搜索关键字
* @returns
*/
searchFirstDetail (key, wd) {
return new Promise((resolve, reject) => {
this.getSite(key).then(res => {
const site = res
const url = `${site.api}?wd=${encodeURI(wd)}`
axios.get(url, { timeout: 3000 }).then(res => {
const data = res.data
const json = parser.parse(data, this.xmlConfig)
const jsondata = json?.rss === undefined ? json : json.rss
if (json && jsondata && jsondata.list) {
let videoList = jsondata.list.video
if (Object.prototype.toString.call(videoList) === '[object Object]') videoList = [].concat(videoList)
videoList = videoList?.filter(e => e.name.toLowerCase().includes(wd.toLowerCase()))
if (videoList?.length) {
this.detail(key, videoList[0].id).then(detailRes => {
resolve(detailRes)
})
} else {
resolve()
}
} else {
resolve()
}
}).catch(err => {
reject(err)
@@ -248,8 +290,9 @@ const zy = {
axios.get(url).then(res => {
const data = res.data
const json = parser.parse(data, this.xmlConfig)
const jsondata = json.rss === undefined ? json : json.rss
const videoList = jsondata.list.video
const jsondata = json?.rss === undefined ? json : json.rss
const videoList = jsondata?.list?.video
if (!videoList) resolve()
// Parse video lists
let fullList = []
let index = 0
@@ -491,13 +534,33 @@ const zy = {
})
})
},
get7kParseURL () {
/**
* 获取豆瓣相关视频推荐列表
* @param {*} name 视频名称
* @param {*} year 视频年份
* @returns 豆瓣相关视频推荐列表
*/
doubanRecommendations (name, year) {
return new Promise((resolve, reject) => {
axios.get('https://zy.7kjx.com/').then(res => {
const $ = cheerio.load(res.data)
const parseURL = $('body > div.container > div > div.stui-pannel > div.col-pd > p:contains("解析接口:")').first().find('a').text()
resolve(parseURL)
}).catch(err => { reject(err) })
const nameToSearch = name.replace(/\s/g, '')
const recommendations = []
this.doubanLink(nameToSearch, year).then(link => {
if (link.includes('https://www.douban.com/search')) {
resolve(recommendations)
} else {
axios.get(link).then(response => {
const $ = cheerio.load(response.data)
$('div.recommendations-bd').find('div>dl>dd>a').each(function (index, element) {
recommendations.push($(element).text())
})
resolve(recommendations)
}).catch(err => {
reject(err)
})
}
}).catch(err => {
reject(err)
})
})
},
getDefaultSites () {

17471
yarn.lock

File diff suppressed because it is too large Load Diff