From dd63832221e4f2651b52e8912722ca37b182a5f1 Mon Sep 17 00:00:00 2001 From: tloook Date: Fri, 9 Feb 2024 22:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/JustLive.js | 63 ++++++++++++++++++++++++++++++++++++-------------- js/version.txt | 2 +- 2 files changed, 47 insertions(+), 18 deletions(-) diff --git a/js/JustLive.js b/js/JustLive.js index 86fc0a4d..a60ffd0d 100644 --- a/js/JustLive.js +++ b/js/JustLive.js @@ -114,24 +114,53 @@ var rule = { type_name: jo.platForm.replace("huya", "虎牙").replace("douyu", "斗鱼").replace("cc", "网易CC").replace("bilibili", "哔哩哔哩").replace("douyin", "抖音") + "." + jo.categoryName, vod_content: "🏷分区:" + jo.platForm.replace("huya", "虎牙").replace("douyu", "斗鱼").replace("cc", "网易CC").replace("bilibili", "哔哩哔哩").replace("douyin", "抖音") + "·" + jo.categoryName + " 🏷UP主:" + jo.ownerName + " 🏷人气:" + jo.online + (jo.isLive === 1 ? " 🏷状态:正在直播" : "状态:未开播") }; - // var playurl = JSON.parse(request("http://live.yj1211.work/api/live/getRealUrl?platform=" + jo.platForm + "&roomId=" + jo.roomId)).data; //单线路 let episodes = JSON.parse(request("http://live.yj1211.work/api/live/getRealUrlMultiSource?platform=" + jo.platForm + "&roomId=" + jo.roomId)).data; //多线路 - let playFrom = []; - let playList = []; - let kplayList = []; - Object.keys(episodes).forEach(function(key) { - playFrom.append(key); - kplayList = episodes[key].map(function(it) { - let title = it.qualityName; - let playUrl = it.playUrl - return title + "$" + play_url + urlencode(playUrl) - }).join("#") - playList.append(kplayList); - }); - let vod_play_from = playFrom.join("$$$"); - let vod_play_url = playList.join("$$$"); - VOD["vod_play_from"] = vod_play_from; - VOD["vod_play_url"] = vod_play_url; + if (Object.keys(episodes).length !== 0) { + let playFrom = []; + let playList = []; + let kplayList = []; + Object.keys(episodes).forEach(function(key) { + playFrom.append(key); + kplayList = episodes[key].map(function(it) { + let title = it.qualityName; + let playUrl = it.playUrl + return title + "$" + play_url + urlencode(playUrl) + }).join("#") + playList.append(kplayList); + }); + let vod_play_from = playFrom.join("$$$"); + let vod_play_url = playList.join("$$$"); + VOD["vod_play_from"] = vod_play_from; + VOD["vod_play_url"] = vod_play_url; + } else { + var d = []; + episodes = JSON.parse(request("http://live.yj1211.work/api/live/getRealUrl?platform=" + jo.platForm + "&roomId=" + jo.roomId)).data; //单线路 + var name = { + "OD": "原画", + "FD": "流畅", + "LD": "标清", + "SD": "高清", + "HD": "超清", + "2K": "2K", + "4K": "4K", + "FHD": "全高清", + "XLD": "极速", + "SQ": "普通音质", + "HQ": "高音质" + }; + Object.keys(episodes).forEach(function(key) { + if (!/ayyuid|to/.test(key)) { + d.push({ + title: name[key], + url: episodes[key] + }) + } + }); + VOD["vod_play_from"] = "选择画质"; + VOD["vod_play_url"] = d.map(function(it) { + return it.title + "$" + play_url + urlencode(it.url + "|" + jo.platForm + "|" + jo.roomId) + }).join("#"); + } } catch (e) { log("获取二级详情页发生错误:" + e.message); } diff --git a/js/version.txt b/js/version.txt index e91909d5..3ec7e00a 100644 --- a/js/version.txt +++ b/js/version.txt @@ -1 +1 @@ -3.9.49beta32 \ No newline at end of file +3.9.49beta33 \ No newline at end of file