新增xhamster视频下载,新增视频在线预览(xgPlayer)(同步更新)

This commit is contained in:
chuzhongzai 2023-02-23 13:09:02 +08:00
parent b1bd4d8a34
commit 0c2c77bc0d
2 changed files with 32 additions and 3 deletions

View File

@ -239,8 +239,13 @@ function validateLink(rawLink){
else if(rawLink.includes("pornhub.com")){
return rawLink.includes("view_video.php")
}
else if(rawLink.includes("xhamster") && rawLink.includes(".com")){
return true
}
}
function coverLink(rawLink){
if(rawLink.includes("xhamster"))
rawLink = "https://zh.xhamster" + rawLink.substring(rawLink.indexOf(".com"))
let url = new URL(rawLink)
maskDomain.value.forEach((mask) => {
if(url.host === mask['raw'])

View File

@ -21,7 +21,7 @@
<el-button @click="deleteGallery(props.row.gid)" :disabled="props.row.download === undefined">删除</el-button>
<el-button @click="editTag(props.row.gid, props.row.tag)">编辑标签</el-button>
<el-button @click="updateGallery(props.row.link)" :disabled="props.row.download === undefined">更新</el-button>
<el-button @click="shareGallery({gid:props.row.gid, shortName:props.row.shortName + '.zip'})" v-if="isLion">分享</el-button>
<el-button @click="shareGallery({gid:props.row.gid, shortName:props.row.shortName + '.zip'})" v-show="isLion">分享</el-button>
</template>
</el-table-column>
@ -73,6 +73,7 @@
<span>
<el-button @click="downloadTask(scoped.row.download)" :disabled="scoped.row.download === undefined">下载</el-button>
<el-button @click="deleteVideo(scoped.row.id)" :disabled="scoped.row.download === undefined">删除</el-button>
<el-button @click="openVideoPanel(scoped.row.download)" :disabled="scoped.row.download === undefined">在线播放</el-button>
</span>
</template>
</el-table-column>
@ -142,6 +143,9 @@
<span v-show="!loadComplete" class="side">请输入授权码后再查看</span>
</div>
<el-dialog v-model="isPlaying" @opened="initPlayer()" @closed="destroyPlayer()" width="635px" title="在线预览">
<div id="player"></div>
</el-dialog>
</template>
<script setup>
@ -149,6 +153,7 @@ import store from "../store";
import {computed, ref} from "vue";
import axios from "axios";
import {ElMessage} from "element-plus";
import Player from "xgplayer";
//
let inputNode = ref(null)
@ -156,6 +161,11 @@ let inputNode = ref(null)
let isEditingPage = ref(false)
//
let isEditingTag = ref(false)
//
let isPlaying = ref(false)
let current_video_link = ref("")
let player = ref()
//
let tempTag = ref("")
@ -326,6 +336,22 @@ function shareGallery(data){
ElMessage(res.data.data)
})
}
function openVideoPanel(link){
current_video_link.value = link
isPlaying.value = true
}
function initPlayer(){
player.value = new Player({
id: "player",
url: current_video_link.value,
videoInit: true,
lang: 'zh-cn'
})
}
function destroyPlayer(){
player.value.destroy()
}
//
function showThumbnail(gallery){
@ -346,8 +372,6 @@ function showThumbnail(gallery){
display: block;
}
.pageChanger{
/*position: absolute;*/
/*top: 85vh;*/
margin-top: 5vh;
}
.el-select{