新增xhamster视频下载,新增视频在线预览(xgPlayer)(同步更新)
This commit is contained in:
parent
57ff0a3686
commit
f27bcff9eb
@ -243,8 +243,13 @@ function validateLink(rawLink){
|
|||||||
else if(rawLink.includes("pornhub.com")){
|
else if(rawLink.includes("pornhub.com")){
|
||||||
return rawLink.includes("view_video.php")
|
return rawLink.includes("view_video.php")
|
||||||
}
|
}
|
||||||
|
else if(rawLink.includes("xhamster") && rawLink.includes(".com")){
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
function coverLink(rawLink){
|
function coverLink(rawLink){
|
||||||
|
if(rawLink.includes("xhamster"))
|
||||||
|
rawLink = "https://zh.xhamster" + rawLink.substring(rawLink.indexOf(".com"))
|
||||||
let url = new URL(rawLink)
|
let url = new URL(rawLink)
|
||||||
maskDomain.value.forEach((mask) => {
|
maskDomain.value.forEach((mask) => {
|
||||||
if(url.host === mask['raw'])
|
if(url.host === mask['raw'])
|
||||||
|
|||||||
@ -56,6 +56,7 @@
|
|||||||
任务创建时间:{{props.row.createTimeDisplay}}<br>
|
任务创建时间:{{props.row.createTimeDisplay}}<br>
|
||||||
<el-button @click="downloadTask(props.row.download)" :disabled="props.row.download === undefined">下载</el-button>
|
<el-button @click="downloadTask(props.row.download)" :disabled="props.row.download === undefined">下载</el-button>
|
||||||
<el-button @click="deleteVideo(props.row.id)" :disabled="props.row.download === undefined">删除</el-button>
|
<el-button @click="deleteVideo(props.row.id)" :disabled="props.row.download === undefined">删除</el-button>
|
||||||
|
<el-button @click="openVideoPanel(props.row.download)" :disabled="props.row.download === undefined">在线播放</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -135,6 +136,9 @@
|
|||||||
:preview-src-list="currentLinks" :initial-index="index" loading="lazy"/>
|
:preview-src-list="currentLinks" :initial-index="index" loading="lazy"/>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<el-dialog v-model="isPlaying" @opened="initPlayer()" @closed="destroyPlayer()" width="95%" title="在线预览">
|
||||||
|
<div id="player"></div>
|
||||||
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -142,6 +146,7 @@ import store from "../store";
|
|||||||
import {computed, ref} from "vue";
|
import {computed, ref} from "vue";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {ElMessage} from "element-plus";
|
import {ElMessage} from "element-plus";
|
||||||
|
import Player from "xgplayer";
|
||||||
|
|
||||||
//输入
|
//输入
|
||||||
let inputNode = ref(null)
|
let inputNode = ref(null)
|
||||||
@ -149,6 +154,12 @@ let inputNode = ref(null)
|
|||||||
let isEditingPage = ref(false)
|
let isEditingPage = ref(false)
|
||||||
//是否正在编辑标签
|
//是否正在编辑标签
|
||||||
let isEditingTag = ref(false)
|
let isEditingTag = ref(false)
|
||||||
|
//是否打开播放面板
|
||||||
|
let isPlaying = ref(false)
|
||||||
|
|
||||||
|
//当前视频链接
|
||||||
|
let current_video_link = ref("")
|
||||||
|
let player = ref()
|
||||||
|
|
||||||
//临时变量
|
//临时变量
|
||||||
let tempTag = ref("")
|
let tempTag = ref("")
|
||||||
@ -314,6 +325,23 @@ function shareGallery(data){
|
|||||||
ElMessage(res.data.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',
|
||||||
|
width: '100%',
|
||||||
|
height: '56%'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
function destroyPlayer(){
|
||||||
|
player.value.destroy()
|
||||||
|
}
|
||||||
|
|
||||||
//显示缩略图
|
//显示缩略图
|
||||||
function showThumbnail(gallery){
|
function showThumbnail(gallery){
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user