mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
style: 简化createOption
This commit is contained in:
+2
-8
@@ -1,11 +1,5 @@
|
||||
// 获取广告
|
||||
// 基于逆向网易云音乐 v9.5.45 RN Hermes 源码:
|
||||
// - adService.getAd() → Network.nativeRequest → /api/ad/get
|
||||
// - 需要 X-antiCheatToken 易盾反作弊头
|
||||
// - 使用 xeapi 加密
|
||||
//
|
||||
// 返回 extra.reqId 可用于 ad_listening_rights_gain 的 reqUid
|
||||
//
|
||||
|
||||
const createOption = require('../util/option.js')
|
||||
|
||||
module.exports = async (query, request) => {
|
||||
@@ -19,7 +13,7 @@ module.exports = async (query, request) => {
|
||||
const res = await request(`/api/ad/get`, data, option)
|
||||
const raw = res.body
|
||||
|
||||
// 提取广告中的 req_id (用于领取权益)
|
||||
// 提取广告中的 req_id
|
||||
let reqId = ''
|
||||
try {
|
||||
if (raw?.ads) {
|
||||
|
||||
Reference in New Issue
Block a user