Compare commits

..

4 Commits

Author SHA1 Message Date
35d1c61cb4
revert: some changes 2026-07-17 20:41:49 +08:00
a183e153ef
Merge branch 'pr/214' 2026-07-17 20:11:37 +08:00
2fa78c3826
fix: 修复评论接口 2026-07-17 20:11:20 +08:00
Zxwy
5ae1eab14c feat: 新增云小编接口 2026-07-17 19:02:16 +08:00
22 changed files with 973 additions and 12 deletions

View File

@ -7,8 +7,7 @@ module.exports = async (query, request) => {
type_ids: query.type_ids || '["400002_0"]', type_ids: query.type_ids || '["400002_0"]',
} }
const option = createOption(query, 'xeapi') const option = createOption(query, 'xeapi', 'v3')
option.checkToken = true
const res = await request(`/api/ad/get`, data, option) const res = await request(`/api/ad/get`, data, option)
const raw = res.body const raw = res.body

View File

@ -75,7 +75,7 @@ module.exports = async (query, request) => {
const res = await request( const res = await request(
`/api/ad/listening/rights/gain`, `/api/ad/listening/rights/gain`,
data, data,
createOption(query, 'xeapi', true), createOption(query, 'xeapi', 'v3'),
) )
return { return {

View File

@ -25,6 +25,6 @@ module.exports = (query, request) => {
return request( return request(
`/api/resource/comments/${query.t}`, `/api/resource/comments/${query.t}`,
data, data,
createOption(query, 'weapi'), createOption(query, 'eapi', 'v2'),
) )
} }

View File

@ -9,6 +9,6 @@ module.exports = (query, request) => {
? { checkToken: query.checkToken || APP_CONF.checkToken } ? { checkToken: query.checkToken || APP_CONF.checkToken }
: {}), : {}),
} }
query.checkToken = true // 强制开启checkToken query.checkToken = 'v2' // 强制开启checkToken
return request(`/api/playlist/${path}`, data, createOption(query, 'eapi')) return request(`/api/playlist/${path}`, data, createOption(query, 'eapi'))
} }

View File

@ -0,0 +1,38 @@
// 易盾反作弊 Token 注册端点
// 调用后获取实时 token 并存入共享存储,供后续带 checkToken 的请求使用
//
// GET /register/checktoken → 返回当前 token尚无则自动获取
// POST /register/checktoken → 强制刷新 token
// GET /register/checktoken?refresh=1 → 强制刷新
//
const { default: axios } = require('axios')
const { APP_CONF } = require('../util/config.json')
const URL = APP_CONF.dunDomainV2 + '/v2/config/js?pn=YD00000558929251'
let _token = ''
async function fetch() {
const res = await axios.get(URL, { timeout: 10000 })
const data = res.data
if (data && data.code === 200 && data.result && data.result.conf) {
return data.result.conf
}
throw new Error('易盾返回异常: ' + JSON.stringify(data).substring(0, 200))
}
// 端点处理
module.exports = async (query) => {
const refresh = query.refresh === '1' || query.refresh === 'true'
let token = refresh ? null : _token
if (!token) {
token = await fetch()
_token = token
}
return {
status: 200,
body: { code: 200, token, registered: !!token },
}
}
// 给 request.js 读取用
module.exports.getToken = () => _token

View File

@ -8,7 +8,7 @@
const { default: axios } = require('axios') const { default: axios } = require('axios')
const { APP_CONF } = require('../util/config.json') const { APP_CONF } = require('../util/config.json')
const URL = APP_CONF.dunDomain + '/v3/b?pn=YD00000558929251' const URL = APP_CONF.dunDomainV3 + '/v3/b?pn=YD00000558929251'
let _token = '' let _token = ''
async function fetch() { async function fetch() {

View File

@ -0,0 +1,17 @@
// 云小编领取任务积分
//
// activityId:
// 调用 rep/ugc/activity/get 获取
const createOption = require('../util/option.js')
module.exports = (query, request) => {
const data = {
activityId: query.activityId || '5001',
}
return request(
`/api/rep/ugc/activity/collect`,
data,
createOption(query, 'eapi'),
)
}

View File

@ -0,0 +1,7 @@
// 云小编活动信息
const createOption = require('../util/option.js')
module.exports = (query, request) => {
return request(`/api/rep/ugc/activity/get`, {}, createOption(query, 'eapi'))
}

View File

@ -0,0 +1,16 @@
// 云小编领取一日会员
//
// 注:前提条件见 rep/ugc/user/vip
const createOption = require('../util/option.js')
module.exports = (query, request) => {
const data = {
activityId: query.activityId || '5001',
}
return request(
`/api/rep/ugc/user/collect-vip`,
data,
createOption(query, 'eapi'),
)
}

View File

@ -0,0 +1,7 @@
// 云小编获取用户详情
const createOption = require('../util/option.js')
module.exports = (query, request) => {
return request(`/api/rep/ugc/user/get`, {}, createOption(query, 'eapi'))
}

View File

@ -0,0 +1,7 @@
// 云小编每日签到
const createOption = require('../util/option.js')
module.exports = (query, request) => {
return request(`/api/rep/ugc/user/sign`, {}, createOption(query, 'eapi'))
}

View File

@ -0,0 +1,12 @@
// 云小编查询会员任务状态
//
// 状态 (data.status)
// 10: 用户积分达50可免费领取1日黑胶会员
// 20: 用户积分已达50可免费领取1日黑胶会员
// 30: 已领取1日黑胶会员明天再来吧~
const createOption = require('../util/option.js')
module.exports = (query, request) => {
return request(`/api/rep/ugc/user/vip`, {}, createOption(query, 'eapi'))
}

View File

@ -0,0 +1,20 @@
// 云小编获取任务
//
// type:
// 1: 歌曲曲风审核 musicalStyleEnter
// 2: 歌曲语种审核 languageEnter
// 3: 歌曲原唱审核 oriSingerEnter
// 4: 情绪标签审核 emotionEnter
const createOption = require('../util/option.js')
module.exports = (query, request) => {
const data = {
type: query.type || '4',
}
return request(
`/api/thinktank/audit/resource/detail`,
data,
createOption(query, 'eapi'),
)
}

View File

@ -0,0 +1,36 @@
// 云小编提交任务
//
// type:
// 1: 歌曲曲风审核 musicalStyleEnter
// 2: 歌曲语种审核 languageEnter
// 3: 歌曲原唱审核 oriSingerEnter
// 4: 情绪标签审核 emotionEnter
//
// taskId:
// 调用 thinktank/audit/resource/detail 获取
//
// judgement:
// 1: 同意, 2: 否决, 3: 跳过 (不算次数)
const createOption = require('../util/option.js')
module.exports = (query, request) => {
if (!query.taskId || !query.judgement)
return Promise.reject({
status: 400,
body: {
code: 400,
message: '参数不足',
},
})
const data = {
type: query.type || '4',
taskId: query.taskId,
judgement: query.judgement,
}
return request(
`/api/thinktank/audit/resource/update`,
data,
createOption(query, 'eapi'),
)
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -5493,6 +5493,92 @@ let data = encodeURIComponent(
**调用例子 :** `/ad/listening/rights/gain` **调用例子 :** `/ad/listening/rights/gain`
### 云小编 - 获取用户详情
说明: 登录后调用此接口, 获取云小编用户详情
**接口地址:** `/rep/ugc/user/get`
**调用例子:** `/rep/ugc/user/get`
### 云小编 - 每日签到
说明: 登录后调用此接口, 进行云小编签到, 领取 5 积分, 签到后 `/rep/ugc/user/get` 返回 `data.signed = 1`
**接口地址:** `/rep/ugc/user/sign`
**调用例子:** `/rep/ugc/user/sign`
### 云小编 - 查询会员任务状态
说明: 登录后调用此接口, 查询云小编会员任务状态, 当 `data.status = 20` 时, 可调用 `/rep/ugc/user/collect-vip` 领取会员
**接口地址:** `/rep/ugc/user/vip`
**调用例子:** `/rep/ugc/user/vip`
### 云小编 - 活动信息
说明: 登录后调用此接口, 查询云小编会员活动信息
**接口地址:** `/rep/ugc/activity/get`
**调用例子:** `/rep/ugc/activity/get`
### 云小编 - 获取任务
> 注意: 调用前请先使用官方客户端完成云小编“情绪标签审核”入站考试
**可选参数:**
`type`: 任务类型, 1: 歌曲曲风审核, 2: 歌曲语种审核, 3: 歌曲原唱审核, 4: 情绪标签审核, 默认 `4`
**接口地址:** `/thinktank/audit/resource/detail`
**调用例子:** `/thinktank/audit/resource/detail?type=4`
### 云小编 - 提交任务
> 注意: 投票结果会在后台审核, 一致 +3 积分, 不一致 -2 积分
**可选参数:**
`type`: 任务类型, 1: 歌曲曲风审核, 2: 歌曲语种审核, 3: 歌曲原唱审核, 4: 情绪标签审核, 默认 `4`
**必选参数:**
`taskId`: 任务 ID, 调用 `/thinktank/audit/resource/detail` 获取 `data.taskId`
`judgement`: 审核结果, 1: 同意, 2: 否决, 3: 跳过 (不算次数)
**接口地址:** `/thinktank/audit/resource/update`
**调用例子:** `/thinktank/audit/resource/update?type=4&taskId=123456&judgement=1`
### 云小编 - 领取任务积分
说明: 完成任务后调用此接口, 领取云小编任务积分
**可选参数:**
`activityId`: 活动 ID, 调用 `/rep/ugc/activity/get` 获取, 默认 `5001`
**接口地址:** `/rep/ugc/activity/collect`
**调用例子:** `/rep/ugc/activity/collect?activityId=5001`
### 云小编 - 领取一日会员
说明: 达成领取条件 (`/rep/ugc/user/vip`) 后调用此接口, 领取一日会员
**可选参数:**
`activityId`: 活动 ID, 调用 `/rep/ugc/activity/get` 获取, 默认 `5001`
**接口地址:** `/rep/ugc/user/collect-vip`
**调用例子:** `/rep/ugc/user/collect-vip?activityId=5001`
## 离线访问此文档 ## 离线访问此文档
此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问 此文档同时也是 Progressive Web Apps(PWA), 加入了 serviceWorker, 可离线访问

View File

@ -172,7 +172,7 @@
setTag('s1tag', 'busy', '注册中…') setTag('s1tag', 'busy', '注册中…')
setNum('s1num', false) setNum('s1num', false)
try { try {
const res = await fetch(nocache(base + '/register/checktoken?refresh=1')) const res = await fetch(nocache(base + '/register/checktoken/v3?refresh=1'))
const data = await res.json() const data = await res.json()
$('s1pre').textContent = JSON.stringify(data, null, 2) $('s1pre').textContent = JSON.stringify(data, null, 2)
if (data.token) { if (data.token) {

View File

@ -98,7 +98,8 @@ curl -s {origin}/search?keywords=网易云</code></pre>
<a href="/avatar_update.html">头像更新示例</a> · <a href="/avatar_update.html">头像更新示例</a> ·
<a href="/scrobble.html">听歌打卡示例</a> · <a href="/scrobble.html">听歌打卡示例</a> ·
<a href="/yidun.html">获取 CheckToken</a> · <a href="/yidun.html">获取 CheckToken</a> ·
<a href="/free_listen.html">免费听权益</a> <a href="/free_listen.html">免费听权益</a> ·
<a href="/ugc.html">云小编任务中心</a>
</div> </div>
</section> </section>

701
public/ugc.html Normal file
View File

@ -0,0 +1,701 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>云小编任务中心 - 网易云音乐 API Enhanced</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
min-height: 100vh;
background: #f5f5f5;
padding: 20px;
}
.container {
max-width: 600px;
margin: 40px auto;
background: white;
border-radius: 12px;
padding: 32px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
h1 {
font-size: 24px;
font-weight: 600;
color: #333;
margin-bottom: 8px;
text-align: center;
}
.subtitle {
font-size: 14px;
color: #666;
margin-bottom: 24px;
text-align: center;
}
.login-link {
display: block;
margin-bottom: 20px;
color: #666;
font-size: 14px;
text-decoration: none;
text-align: center;
}
.login-link:hover {
color: #333;
text-decoration: underline;
}
/* ---- Section ---- */
.section {
margin-bottom: 24px;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
.section:last-of-type {
border-bottom: none;
margin-bottom: 0;
padding-bottom: 0;
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 12px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #333;
}
/* ---- Form ---- */
.form-group {
margin-bottom: 16px;
text-align: left;
}
label {
display: block;
font-size: 13px;
font-weight: 500;
color: #555;
margin-bottom: 6px;
}
label .tag {
display: inline-block;
font-size: 11px;
font-weight: 400;
padding: 1px 6px;
border-radius: 3px;
margin-left: 6px;
}
label .tag.r {
background: #fee2e2;
color: #991b1b;
}
label .tag.o {
background: #fef3c7;
color: #92400e;
}
label .tag.g {
background: #d1fae5;
color: #065f46;
}
input[type="text"],
input[type="number"],
textarea {
width: 100%;
padding: 10px 14px;
border: 1px solid #ddd;
border-radius: 6px;
font-size: 14px;
outline: none;
font-family: inherit;
transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
border-color: #333;
}
textarea {
resize: vertical;
}
.row {
display: flex;
gap: 12px;
}
.row .form-group {
flex: 1;
}
.quick-fill {
margin-top: 5px;
font-size: 12px;
color: #666;
}
.quick-fill span {
color: #0066cc;
cursor: pointer;
margin-right: 8px;
}
.quick-fill span:hover {
text-decoration: underline;
}
.btn {
display: block;
width: 100%;
padding: 12px;
background: #333;
color: white;
font-size: 15px;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease;
border: none;
text-align: center;
margin-top: 20px;
}
.btn:hover {
background: #555;
}
.btn:disabled {
background: #ccc;
cursor: not-allowed;
}
.btn-sm {
display: inline-block;
width: auto;
padding: 6px 16px;
background: #333;
color: white;
font-size: 13px;
font-weight: 500;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s ease;
border: none;
text-align: center;
margin-top: 0;
}
.btn-sm:hover {
background: #555;
}
.btn-sm:disabled {
background: #ccc;
cursor: not-allowed;
}
.btn-sm.green {
background: #059669;
}
.btn-sm.green:hover {
background: #047857;
}
.btn-sm.green:disabled {
background: #a7f3d0;
}
.btn-sm.red {
background: #dc2626;
}
.btn-sm.red:hover {
background: #b91c1c;
}
.btn-sm.red:disabled {
background: #fca5a5;
}
.btn-sm.gray {
background: #6b7280;
}
.btn-sm.gray:hover {
background: #4b5563;
}
.btn-sm.gray:disabled {
background: #d1d5db;
}
.result {
margin-top: 16px;
padding: 12px 16px;
border-radius: 6px;
font-size: 14px;
text-align: left;
white-space: pre-wrap;
word-break: break-all;
font-family: monospace;
}
.result.success {
background: #d1fae5;
color: #065f46;
}
.result.error {
background: #fee2e2;
color: #991b1b;
}
.result.info {
background: #e0f2fe;
color: #0369a1;
}
.footer-link {
text-align: center;
margin-top: 24px;
font-size: 13px;
}
.footer-link a {
color: #666;
text-decoration: none;
}
.footer-link a:hover {
text-decoration: underline;
}
/* ---- Info Card ---- */
.info-card {
display: flex;
align-items: center;
gap: 12px;
padding: 16px;
background: #f9fafb;
border-radius: 8px;
border: 1px solid #eee;
}
.info-card .avatar {
width: 50px;
height: 50px;
border-radius: 50%;
object-fit: cover;
background: #e5e7eb;
}
.info-card .info-text {
flex: 1;
font-size: 14px;
color: #333;
}
.info-card .btn-sm {
flex-shrink: 0;
}
/* ---- Song Review ---- */
.song-review {
margin-top: 16px;
padding: 16px;
background: #f9fafb;
border-radius: 8px;
border: 1px solid #eee;
}
.song-review .cover {
width: 100px;
height: 100px;
border-radius: 6px;
object-fit: cover;
background: #e5e7eb;
display: block;
margin-bottom: 12px;
}
.song-review .song-title {
font-size: 14px;
font-weight: 600;
color: #333;
margin-bottom: 8px;
}
.song-review audio {
width: 100%;
margin-bottom: 8px;
}
.song-review .song-tag {
font-size: 13px;
color: #666;
margin-bottom: 10px;
}
.song-review .btn-group {
display: flex;
gap: 8px;
margin-bottom: 10px;
flex-wrap: wrap;
}
.song-review .lyric {
font-size: 13px;
color: #555;
background: #fff;
padding: 10px 12px;
border-radius: 6px;
border: 1px solid #e5e7eb;
white-space: pre-wrap;
max-height: 120px;
overflow-y: auto;
font-family: monospace;
line-height: 1.6;
}
.status-text {
font-size: 14px;
color: #888;
}
</style>
</head>
<body>
<div class="container">
<h1>云小编任务中心</h1>
<p class="subtitle">管理云音乐审核任务、签到与会员权益领取</p>
<a href="/qrlogin-nocookie.html" class="login-link">还没登录?点击登录</a>
<!-- Cookie -->
<div class="form-group">
<label for="cookie">Cookie <span class="tag o">可选</span></label>
<textarea id="cookie" placeholder="留空则默认读取本地存储的登录态" rows="2"></textarea>
<div class="quick-fill">
<span onclick="loadLocalCookie()">读取本地 Cookie</span>
<span onclick="clearCookie()">清除 Cookie</span>
</div>
</div>
<div class="section">
<div class="section-header">
<span class="section-title">用户信息</span>
<button class="btn-sm" id="userGet">获取用户详情</button>
</div>
<div class="info-card" id="user">
<img alt="头像" class="avatar" id="userAvatar" />
<span class="info-text" id="userName">未登录</span>
<button class="btn-sm green" id="userSign" disabled>签到</button>
</div>
</div>
<div class="section">
<div class="section-header">
<span class="section-title">会员领取</span>
<button class="btn-sm" id="vipGet">获取会员详情</button>
</div>
<div class="info-card" id="vip">
<span class="info-text" id="vipStatus">未载入</span>
<button class="btn-sm" id="vipCollect" disabled>领取</button>
</div>
</div>
<div class="section">
<div class="section-header">
<span class="section-title">审核任务</span>
<button class="btn-sm" id="taskGet">获取任务详情</button>
</div>
<div class="info-card" id="task">
<span class="info-text" id="taskInfo">[<span id="taskCount">0</span>/<span id="taskGoal">0</span>] 审核歌曲赚贡献分 (+66)</span>
<button class="btn-sm" id="taskStart" disabled>去完成</button>
</div>
<!-- Song Review -->
<div class="song-review" id="song" style="display: none;">
<img alt="封面" class="cover" id="songCover" />
<div class="song-title" id="songTitle">未载入</div>
<audio controls id="songAudio"></audio>
<div class="song-tag" id="songTag"></div>
<div class="btn-group">
<button class="btn-sm green" id="songApprove" disabled>同意</button>
<button class="btn-sm red" id="songReject" disabled>否决</button>
<button class="btn-sm gray" id="songSkip" disabled>跳过 (不计次数)</button>
</div>
<div class="lyric" id="songLyric">[00:00.00] 暂无歌词</div>
</div>
</div>
<div id="result" class="result" style="display: none;"></div>
<div class="footer-link">
<a href="/">返回首页</a>
</div>
</div>
<script src="https://fastly.jsdelivr.net/npm/axios@0.26.1/dist/axios.min.js"></script>
<script>
(function () {
var k_cookie = 'ncm_cookie';
var cookie = localStorage.getItem(k_cookie) || '';
/* ---- DOM refs ---- */
var cookieInput = document.getElementById('cookie');
var resultDiv = document.getElementById('result');
/* ---- Init ---- */
if (cookie) {
cookieInput.value = cookie;
}
/* ---- Cookie ---- */
window.loadLocalCookie = function () {
var local = localStorage.getItem(k_cookie);
if (local) {
cookie = local;
cookieInput.value = local;
showResult('已成功读取本地 Cookie', 'success');
} else {
showResult('未在本地发现登录 Cookie请先登录或手动粘贴', 'error');
}
};
window.clearCookie = function () {
cookie = '';
cookieInput.value = '';
localStorage.removeItem(k_cookie);
showResult('已清除本地 Cookie', 'info');
};
/* ---- Result ---- */
function hideResult() {
resultDiv.style.display = 'none';
}
function showResult(message, type) {
resultDiv.textContent = message;
resultDiv.className = 'result ' + type;
resultDiv.style.display = 'block';
}
function getCookie() {
var ck = cookieInput.value.trim();
if (ck) cookie = ck;
return ck || cookie || '';
}
/**
* 发起请求 (兼容旧版)
* @param {string} url
* @param {Record<string,string>} params
* @param {(resp:Record<string,any>)=>void} done
*/
function request(url, params, done) {
var xhr = new XMLHttpRequest();
xhr.responseType = 'json';
xhr.timeout = 1e4;
xhr.onload = function () {
var r = xhr.response;
if (r.code !== 200) {
showResult('错误 ' + r.code + ': ' + (r.message || '未知错误'), 'error');
} else {
done(r);
}
};
xhr.onerror = function () {
showResult('网络请求失败: ' + xhr.statusText, 'error');
};
var ck = getCookie();
if (ck) params.cookie = ck;
var s = '?_=' + Date.now();
for (var k in params) {
s += '&' + k + '=' + encodeURIComponent(params[k]);
}
xhr.open('GET', url + s);
xhr.send();
}
/// 用户信息 ///
var userAvatar = document.getElementById('userAvatar');
var userName = document.getElementById('userName');
var userSign = document.getElementById('userSign');
var userGet = document.getElementById('userGet');
userGet.onclick = function () {
request('rep/ugc/user/get', {}, function (res) {
var d = res.data;
if (d.imgUrl) userAvatar.src = d.imgUrl + '?param=50y50';
userName.textContent = d.name || '游客' + d.id;
userSign.disabled = d.signed;
showResult('用户信息加载成功', 'success');
});
};
userSign.onclick = function () {
if (!userSign.disabled) {
userSign.disabled = true;
request('rep/ugc/user/sign', {}, function (res) {
var d = res.data;
userSign.disabled = d;
showResult('签到' + (d ? '成功 ✓' : '失败 ✗'), d ? 'success' : 'error');
});
}
};
/// 会员领取 ///
var vipStatus = document.getElementById('vipStatus');
var vipCollect = document.getElementById('vipCollect');
var vipGet = document.getElementById('vipGet');
vipGet.onclick = function () {
request('rep/ugc/user/vip', {}, function (res) {
var d = res.data;
vipStatus.textContent = d.status + ': ' + d.title;
vipCollect.disabled = d.status !== 20;
showResult('会员详情加载成功', 'success');
});
};
vipCollect.onclick = function () {
if (!vipCollect.disabled) {
vipCollect.disabled = true;
request('rep/ugc/user/collect-vip', {}, function (res) {
var d = res.data;
vipCollect.disabled = d;
showResult('领取' + (d ? '成功 ✓' : '失败 ✗'), d ? 'success' : 'error');
});
}
};
/// 审核任务 ///
var taskCount = document.getElementById('taskCount');
var taskGoal = document.getElementById('taskGoal');
var taskStartBtn = document.getElementById('taskStart');
var taskGetBtn = document.getElementById('taskGet');
taskGetBtn.onclick = function () {
request('/rep/ugc/activity/get', {}, function (res) {
var d = res.data;
taskCount.textContent = d.count;
taskGoal.textContent = d.goalCount;
taskStartBtn.disabled = d.activityId !== 5001;
showResult('任务详情加载成功', 'success');
});
};
taskStartBtn.onclick = function () {
if (!taskStartBtn.disabled) taskStart();
};
/// 歌曲审核区域 ///
var song = document.getElementById('song');
var songCover = document.getElementById('songCover');
var songTitle = document.getElementById('songTitle');
var songAudio = document.getElementById('songAudio');
var songTag = document.getElementById('songTag');
var songApprove = document.getElementById('songApprove');
var songReject = document.getElementById('songReject');
var songSkip = document.getElementById('songSkip');
var songLyric = document.getElementById('songLyric');
/**
* 获取任务
*/
function taskStart() {
song.style.display = 'none';
request('/thinktank/audit/resource/detail', { type: '4' }, function (res) {
var d = res.data;
if (d.auditCount >= 50) {
request('rep/ugc/activity/collect', { activityId: '5001' }, function (res) {
showResult('积分领取' + (res.data ? '成功,可以兑换会员了!' : '失败'), res.data ? 'success' : 'error');
});
return;
}
songCover.src = d.coverUrl + '?param=100y100';
songTitle.textContent = '[' + d.resId + '] ' + d.resName + ' - ' + d.artists;
songTag.textContent = '[' + (d.auditCount + 1) + '/' + d.auditTaskCount + '] 当前结果: ' + d.initResult + '';
songLyric.textContent = (d.lyric || '') + (d.transLyric || '');
if (!songLyric.textContent.trim()) songLyric.textContent = '[00:00.00] 暂无歌词';
songAudio.src = d.songUrl;
songAudio.play().catch(function () { /* 自动播放被浏览器阻止 */ });
songApprove.onclick = function () { if (!songApprove.disabled) taskSubmit(d.taskId, '1'); };
songReject.onclick = function () { if (!songReject.disabled) taskSubmit(d.taskId, '2'); };
songSkip.onclick = function () { if (!songSkip.disabled) taskSubmit(d.taskId, '3'); };
songApprove.disabled = songReject.disabled = songSkip.disabled = true;
song.style.display = 'block';
setTimeout(function () {
songApprove.disabled = songReject.disabled = songSkip.disabled = false;
}, 3e3);
});
}
/**
* 提交任务
* @param {string} taskId
* @param {'1'|'2'|'3'} judgement
*/
function taskSubmit(taskId, judgement) {
songApprove.disabled = songReject.disabled = songSkip.disabled = true;
request(
'thinktank/audit/resource/update',
{ type: '4', taskId: taskId, judgement: judgement },
function (res) {
var d = res.data;
if (d.result) {
showResult('审核提交成功,加载下一首...', 'success');
taskStart();
} else {
showResult('未知状态: ' + JSON.stringify(d), 'error');
}
},
);
}
/// 一键载入 ///
document.getElementById('loadall').onclick = function () {
userGet.click();
vipGet.click();
taskGetBtn.click();
showResult('正在载入所有数据...', 'info');
};
window.loadLocalCookie();
})();
</script>
</body>
</html>

View File

@ -88,7 +88,7 @@
tag.textContent = '获取中…' tag.textContent = '获取中…'
try { try {
const url = base + '/register/checktoken' + (refresh ? '?refresh=1' : '') const url = base + '/register/checktoken/v2' + (refresh ? '?refresh=1' : '')
const res = await fetch(url) const res = await fetch(url)
const data = await res.json() const data = await res.json()
$('respDisplay').textContent = JSON.stringify(data, null, 2) $('respDisplay').textContent = JSON.stringify(data, null, 2)

View File

@ -15,7 +15,8 @@
"domain": "https://music.163.com", "domain": "https://music.163.com",
"clDomian": "https://clientlog.music.163.com", "clDomian": "https://clientlog.music.163.com",
"clDomian3": "https://clientlog3.music.163.com", "clDomian3": "https://clientlog3.music.163.com",
"dunDomain": "https://ac.dun.163yun.com", "dunDomainV3": "https://ac.dun.163yun.com",
"dunDomainV2": "https://ac.dun.163.com",
"encrypt": true, "encrypt": true,
"encryptResponse": false, "encryptResponse": false,
"clientSign": "18:C0:4D:B9:8F:FE@@@453832335F384641365F424635335F303030315F303031425F343434415F343643365F333638332@@@@@@6ff673ef74955b38bce2fa8562d95c976ed4758b1227c4e9ee345987cee17bc9", "clientSign": "18:C0:4D:B9:8F:FE@@@453832335F384641365F424635335F303030315F303031425F343434415F343643365F333638332@@@@@@6ff673ef74955b38bce2fa8562d95c976ed4758b1227c4e9ee345987cee17bc9",

View File

@ -18,7 +18,12 @@ const {
} = require('./index') } = require('./index')
const { URLSearchParams, URL } = require('url') const { URLSearchParams, URL } = require('url')
const { APP_CONF } = require('../util/config.json') const { APP_CONF } = require('../util/config.json')
const { getToken: antiCheatToken } = require('../module/register_checktoken') const {
getToken: antiCheatTokenV2,
} = require('../module/register_checktoken_v2')
const {
getToken: antiCheatTokenV3,
} = require('../module/register_checktoken_v3')
// 预先读取匿名token并缓存 // 预先读取匿名token并缓存
const anonymous_token = fs.readFileSync( const anonymous_token = fs.readFileSync(
@ -182,7 +187,15 @@ const generateRequestId = () => {
} }
const createRequest = (uri, data, options) => { const createRequest = (uri, data, options) => {
const token = options.checkToken ? antiCheatToken() : '' let token = ''
switch (options.checkToken) {
case 'v2':
token = antiCheatTokenV2()
break
case 'v3':
token = antiCheatTokenV3()
break
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// 变量声明和初始化 // 变量声明和初始化