1 Star 0 Fork 0

LuckyPuppy514 / Play-With-MPV

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
index.html 21.85 KB
一键复制 编辑 原始数据 按行查看 历史
LuckyPuppy514 提交于 2023-03-19 23:40 . v3.3.8 修复标题BUG
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Play-With-MPV</title>
<meta name="description" content="使用 MPV 播放网页上的视频">
<style>
html,
body {
width: 100%;
height: 100%;
}
* {
padding: 0px;
margin: 0px;
}
body {
background: linear-gradient(90deg, rgba(225, 221, 223, .32) 1px, transparent 0), linear-gradient(rgba(225, 221, 223, .32) 1px, transparent 0);
background-size: 20px 20px;
background-color: rgb(239, 239, 239);
}
#container-div {
display: flex;
flex-flow: column;
height: 100%;
min-width: 800px;
min-height: 700px;
padding-left: 100px;
padding-right: 100px;
}
#header-div,
#category-div {
background-color: rgba(255, 255, 255, 1);
height: 108px;
border-radius: 5px;
margin-top: 15px;
padding: 15px 15px 15px 20px;
}
#category-div {
height: 64px !important;
}
#header-div h3,
#category-div h3 {
color: rgb(251, 108, 40);
}
#header-div p,
#header-div a {
color: #303133;
font-family: "微软雅黑";
font-weight: normal;
font-size: 15px;
margin-top: 8px;
text-decoration: none;
margin-left: 30px;
}
#category-div button {
color: #fb6c28;
background-color: rgba(0, 0, 0, 0);
margin: 20px 10px 0px 10px;
font-size: 15px;
border-radius: 2px;
border: 1px solid rgb(251, 107, 40);
cursor: pointer;
border: none;
}
#category-div button:hover,
#category-div .category-selected {
color: rgb(82, 168, 71);
font-weight: bold;
}
#content-div {
flex: 1;
background-color: rgba(255, 255, 255, 1);
border-radius: 5px;
margin-top: 15px;
margin-bottom: 10px;
padding: 15px;
text-align: center;
}
#footer-div {
height: 50px;
text-align: center;
padding-bottom: 10px;
}
#footer-div a {
color: #909399;
font-family: "微软雅黑";
font-weight: normal;
text-decoration: none;
font-size: 15px;
}
#footer-div .site_police a::before {
display: inline-block;
margin-right: 4px;
margin-bottom: 2px;
vertical-align: text-bottom;
content: "";
width: 15px;
height: 15px;
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAAABGdBTUEAALGPC/xhBQAAAwBQTFRFtJR+///krYt6n2hV0a52/b9Ummlc2aht27qH//eX26xi8Na74bNo+M562rB75MGP5LaA5LaC47xp68l57N2y/vrs369n/++G1qx+/tiP6sN6+//e//nQ79l/+NqC6MZ87NmN+PPJ3qdc3alT25xR46xT57xs69KY57Vcw38+2a+C05NwyoRb6che5LxZ5MJt7d6A4bBn0Ktx+/TQ3KdZ8d/H9N+L7+ij8+mS9/O48deu///i7NOF+fG28+eq/vzgAAAAgVg6o31ShGlK7HEtxGsznl8wp41Z+sREcoWUHD6XlIx1xa58tYA/6Zc09oI24kYeo5mEBAVtbmJiNhpNtJlYAAiR96Q53bZp2U4qFzCJa3OEeWRg14pGxb2H/+Jj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NWPN2yc/d2WaCg4su3rw/veb7t8bp/W/8dfP3iox3IR8a6J48e+XDgzbv9h94fO6VvC/amqeH37ye+Hv/05fPbb6evmtiBBc1+vPr///ObT+ffX/r27sMPC7CgvY3e5SsXzp098/XjxS8G5pbQQNbW0VRWUdVQUlPXMgLxASGRxIfJhdfLAAAAAElFTkSuQmCC) no-repeat center;
background-size: 100% 100%;
}
.item-div {
width: 330px;
height: 190px;
border-radius: 5px;
backdrop-filter: blur(30px);
background-color: rgb(3, 150, 255, .6);
position: relative;
overflow: visible;
display: inline-block;
margin: 10px;
box-shadow: rgb(0 0 0 / 5%) -1px -1px 5px 0, rgb(0 0 0 / 15%) 0px 20px 25px -5px, rgb(0 0 0 / 1%) 0px 10px 10px -5px;
}
.item-div:hover {
background-color: rgba(251, 107, 40, .8);
transform: translate3d(0, -3px, 0);
cursor: pointer;
}
.item-div a {
text-decoration: none;
}
.item-div a:hover:after {
position: absolute;
font-size: 12px;
left: 208px;
top: 10px;
padding: 5px 5px 5px 5px !important;
background-color: rgba(0, 0, 0, 0.6);
color: rgba(255, 255, 255, 1);
content: attr(data-tip);
text-align: center;
z-index: 999999;
width: auto !important;
height: auto !important;
white-space: nowrap;
}
.item-button-div a:hover:after {
background-color: rgba(0, 0, 0, 0) !important;
}
.item-logo-div {
width: 330px;
height: 120px;
text-align: center;
}
.item-logo-div img {
max-width: 210px;
height: 60px;
margin-top: 30px;
}
.item-title-div {
width: 330px;
height: 40px;
text-align: center;
color: rgba(255, 255, 255, 1);
font-weight: bold;
font-size: 17px;
}
.item-button-div {
width: 330px;
height: 30px;
text-align: center;
}
.item-button-div button,
.item-button-div a {
margin-right: 10px;
float: right;
width: 65px;
height: 20px;
border-radius: 2px;
color: rgba(255, 255, 255, 1);
border: none;
background-color: rgb(3, 150, 255, 1);
font-size: 13px;
text-decoration: none;
}
.item-button-div button:hover,
.item-button-div a:hover {
opacity: .9;
transform: translate3d(0, -2px, 0);
cursor: pointer;
}
#loading-div {
display: none;
position: fixed;
bottom: 50%;
left: 50%;
z-index: 999999;
transform: translate(-50%, -50%);
background-color: rgba(255, 255, 255, 0);
}
.spinner {
width: 40px;
height: 40px;
background-color: rgb(251, 107, 40);
-webkit-animation: sk-rotateplane 1.2s infinite ease-in-out;
animation: sk-rotateplane 1.2s infinite ease-in-out;
}
@-webkit-keyframes sk-rotateplane {
0% {
-webkit-transform: perspective(120px)
}
50% {
-webkit-transform: perspective(120px) rotateY(180deg)
}
100% {
-webkit-transform: perspective(120px) rotateY(180deg) rotateX(180deg)
}
}
@keyframes sk-rotateplane {
0% {
transform: perspective(120px) rotateX(0deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(0deg) rotateY(0deg)
}
50% {
transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg);
-webkit-transform: perspective(120px) rotateX(-180.1deg) rotateY(0deg)
}
100% {
transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
-webkit-transform: perspective(120px) rotateX(-180deg) rotateY(-179.9deg);
}
}
#toast-div {
display: none;
position: fixed;
bottom: 80%;
left: 50%;
max-width: 60%;
min-width: 150px;
padding: 0 14px;
height: 40px;
color: rgb(255, 255, 255);
line-height: 40px;
text-align: center;
border-radius: 4px;
transform: translate(-50%, -50%);
z-index: 999999;
background: rgba(0, 255, 0, .9);
font-size: 14px;
font-weight: blod;
}
.ribbon {
width: 106px;
height: 108px;
overflow: hidden;
position: absolute;
top: -6px;
left: -6px;
}
.ribbon1 {
line-height: 8px;
text-align: center;
transform: rotate(-45deg);
position: relative;
padding: 8px 0;
left: -26px;
top: 26px;
width: 130px;
background: #0396ff;
color: white;
box-shadow: 0 5px 5px rgb(0 0 0 / 10%);
letter-spacing: 1px;
}
.ribbon1:before,
.ribbon1:after {
content: "";
border-top: 4px solid #4e7c7d;
border-left: 4px solid transparent;
border-right: 4px solid transparent;
position: absolute;
bottom: -4px;
}
.ribbon1:before {
left: 0;
}
.ribbon1:after {
right: 0;
}
</style>
</head>
<body>
<div id="container-div">
<div id="loading-div">
<div class="spinner"></div>
</div>
<div id="toast-div"></div>
<div id="header-div">
<h3>🧭 简介</h3>
<p>本站是 Play-With-MPV 支持网站导航,建议配合下列项目食用 ♨️</p>
<p><a href="https://greasyfork.org/zh-CN/scripts/444056-play-with-mpv" target="_blank"
style="color: #fb6c28;"> - Play-With-MPV 👆</a>&nbsp;一个支持一键调用 mpv / potplayer / iina
等播放下列网页上的视频的油猴脚本
</p>
<p><a href="https://kutt.lckp.top/uVaT3U" target="_blank" style="color: #fb6c28;"> -
mpv.net_CM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 👆</a>&nbsp;一款使用方便,功能强大,并且已经集成了多种着色器,滤镜和脚本的的播放器</p>
</div>
<div id="category-div">
<h3>🏳️‍🌈 分类</h3>
<button id="anime" onclick="choose(this.id);">动漫</button>
<button id="serial" onclick="choose(this.id);">电视剧</button>
<button id="movie" onclick="choose(this.id);">电影</button>
<button id="show" onclick="choose(this.id);">综艺</button>
<button id="user" onclick="choose(this.id);">用户投稿</button>
<button id="iptv" onclick="choose(this.id);">电视直播</button>
</div>
<div id="content-div"></div>
<div id="footer-div">
<p><a href="https://github.com/LuckyPuppy514/Play-With-MPV" target="_blank">© 2023 LuckyPuppy514
- <a class="icp" href="https://beian.miit.gov.cn" target="_blank"
rel="noopener noreferrer nofollow">粤ICP备2022080328号-1</a></a></p>
<p class="site_police">
<a class="site_police"
href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=44030702004874" target="_blank"
rel="noopener noreferrer nofollow">粤公网安备44030702004874号</a>
</p>
</div>
</div>
</body>
<script>
function choose(category) {
if (localStorage.category) {
document.getElementById(localStorage.category).classList.remove("category-selected");
}
localStorage.category = category;
document.getElementById(category).classList.add("category-selected");
let list = new Array();
for (let website of websiteList) {
if (website.category.indexOf(category) != -1) {
list.push(website);
}
}
appendWebsiteItem(list);
}
function loadLastChoose() {
let category = localStorage.category;
category = category ? category : "iptv";
choose(category);
}
function loadIPTV(website) {
var xhr = new XMLHttpRequest();
xhr.open('GET', website.url[0], true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
let m3us = xhr.responseText.replaceAll("\r\n", "\n").matchAll(/#EXTINF:[^\n]+\nhttp[^\n]+/g);
for (let m3u of m3us) {
m3u = m3u.toString();
let url = m3u.match(/\n(http[^\n]+)/);
if (url) {
url = url[1];
let title = m3u.match(/,([^\n^,]+)\n/);
title = title ? title[1] : "";
let logo = m3u.match(/tvg-logo="([^"]+)"/);
logo = logo ? logo[1] : "";
if (m3u.match(/(4K|4k|8K|8k|UHD|uhd|2160p|4320p|超清|超高清)/)) {
resolution = "超高清";
} else {
resolution = "高清";
}
websiteList.push({
"title": title,
"logo": logo,
"url": [
url
],
"category": website.category,
"resolution": resolution
});
}
}
if (!localStorage.category || localStorage.category == "iptv") {
choose("iptv");
}
}
}
xhr.send();
}
async function loadWebsiteList() {
var xhr = new XMLHttpRequest();
xhr.open('GET', WEBSITE_LIST_URL, false);
xhr.onreadystatechange = async function () {
if (xhr.readyState == 4 && xhr.status == 200) {
let wsJson = JSON.parse(xhr.responseText);
for (let website of wsJson) {
if (website.category == "iptv") {
localStorage.iptvUrl = website.url[0];
await loadIPTV(website);
} else {
websiteList.push(website);
}
}
}
}
await xhr.send();
}
function loading(visiable) {
let loadingDiv = document.getElementById("loading-div");
if (visiable) {
loadingDiv.style.display = "flex";
setTimeout(() => {
if (loadingDiv.style.display == "flex") {
document.getElementById("loading-div").style.display = "none";
toast("超时辣 ...... 😓", "error");
}
}, 6000);
} else {
loadingDiv.style.display = "none";
}
}
function toast(message, type, duration) {
type = type ? type : "info";
duration = isNaN(duration) ? 3000 : duration;
let toastDiv = document.getElementById("toast-div");
toastDiv.innerHTML = message;
toastDiv.style.display = "block";
if (type == "info") {
toastDiv.style.backgroundColor = "rgba(75, 180 ,54, 1)";
} else if (type == "warn") {
toastDiv.style.backgroundColor = "rgba(190, 190, 70, 1)";
} else if (type == "error") {
toastDiv.style.backgroundColor = "rgba(210, 51, 35, 1)";
}
setTimeout(() => {
toastDiv.style.display = "none";
}, duration);
}
function appendWebsiteItem(list) {
let html = "";
if (list.length > 0) {
if (list[0].category == "iptv") {
let index = 0;
for (const website of list) {
let title = website.title;
if (title.length > 20) {
title = title.substring(0, 20) + " ...";
}
let link = "";
let player = undefined;
if (localStorage.player) {
player = JSON.parse(localStorage.player);
}
if (player && player.name != "mpv") {
let param = player.params.videoUrl;
let videoUrl = encodeURIComponent(website.url);
param = param.replace('${videoUrl}', videoUrl);
param = param.replace('${EvideoUrl}', videoUrl);
param = param.replace('${DvideoUrl}', website.url);
link = param;
param = player.params.title;
if (param) {
let title = encodeURIComponent(website.title);
param = param.replace('${title}', title);
param = param.replace('${Etitle}', title);
param = param.replace('${Dtitle}', website.title);
link = link + " " + param;
}
link = link.replaceAll('"', "%22") + "%20";
} else {
link = `mpv://%22${encodeURIComponent(website.url)}%22 --force-media-title=%22${encodeURIComponent(website.title)}%22%20`;
}
let potplayer = `potplayer://${website.url} /current /title=%22${encodeURIComponent(website.title)}%22%20`;
html = html + `
<div class="item-div">
<div class='ribbon'>
<div class='ribbon1'>${website.resolution}</div>
</div>
<a href="${link}" target="_blank" data-tip="调用外部播放器打开">
<div class="item-logo-div">
<img src="${website.logo}" onerror="this.src='${ERROR_IMG_URL}'" referrerpolicy="no-referrer">
</div>
<div class="item-title-div">${title}</div>
</a>
<div class="item-button-div">
<input type="text" value="${website.url[0]}" id="website-url-${index}" style="display: none">
<span>
<button onclick="copyUrl(this.value)" value="website-url-${index}">复制链接</button>
<a href="${potplayer}" target="_blank">potplayer</a>
</span>
</div>
</div>`;
index++;
}
} else {
for (const website of list) {
html = html + `
<div class="item-div">
<div class='ribbon'>
<div class='ribbon1'>${website.resolution}</div>
</div>
<a href="${website.url[0]}" target="_blank" data-tip="点击打开主站首页">
<div class="item-logo-div">
<img src="${website.logo}" onerror="this.src='${ERROR_IMG_URL}'" referrerpolicy="no-referrer">
</div>
<div class="item-title-div">${website.title}</div>
</a>
<div class="item-button-div">
<span>`;
for (let index = website.url.length - 1; index > 0; index--) {
html = html + `<a href="${website.url[index]}" target="_blank" style="width: 42px;">备用</a>`;
}
html = html + `<a href="${website.url[0]}" target="_blank" style="width: 50px;">主站</a>
</span>
</div>
</div>`;
}
}
} else {
html = `<div style="position: relative; top: 49%; left: 49%; transform:translate(-50%,-50%);">空空如也~~</div>`;
}
document.getElementById("content-div").innerHTML = html;
}
function copyUrl(id) {
let input = document.getElementById(id);
input.style.display = "block";
input.select();
document.execCommand("copy");
input.style.display = "none";
toast("复制成功");
}
const WEBSITE_LIST_URL = "./website/list.json";
const ERROR_IMG_URL = "./website/logo/404.png";
var websiteList = new Array;
loading(true);
window.onload = async function () {
await loadWebsiteList();
loadLastChoose();
loading(false);
}
</script>
</html>
JavaScript
1
https://gitee.com/LuckyPuppy514/Play-With-MPV.git
git@gitee.com:LuckyPuppy514/Play-With-MPV.git
LuckyPuppy514
Play-With-MPV
Play-With-MPV
main

搜索帮助