mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
fix(eslint): fix files which have eslint problems
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
require("dotenv").config();
|
||||
require('dotenv').config()
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const express = require('express')
|
||||
@@ -248,20 +248,28 @@ async function consturctServer(moduleDefs) {
|
||||
(req.baseUrl === '/song/url/v1' || req.baseUrl === '/song/url') &&
|
||||
process.env.ENABLE_GENERAL_UNBLOCK === 'true'
|
||||
) {
|
||||
const song = moduleResponse['body']['data'][0]
|
||||
if (song.freeTrialInfo !== null || !song.url || [1, 4].includes(song.fee)) {
|
||||
const match = require('@unblockneteasemusic/server')
|
||||
const source = process.env.UNBLOCK_SOURCE ? process.env.UNBLOCK_SOURCE.split(',') : ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou']
|
||||
logger.info("开始解灰", source)
|
||||
const { url } = await match(req.query.id, source)
|
||||
song.url = url
|
||||
song.freeTrialInfo = 'null'
|
||||
logger.info("解灰成功!")
|
||||
const song = moduleResponse.body.data[0]
|
||||
if (
|
||||
song.freeTrialInfo !== null ||
|
||||
!song.url ||
|
||||
[1, 4].includes(song.fee)
|
||||
) {
|
||||
const match = require('@unblockneteasemusic/server')
|
||||
const source = process.env.UNBLOCK_SOURCE
|
||||
? process.env.UNBLOCK_SOURCE.split(',')
|
||||
: ['pyncmd', 'bodian', 'kuwo', 'qq', 'migu', 'kugou']
|
||||
logger.info('开始解灰', source)
|
||||
const { url } = await match(req.query.id, source)
|
||||
song.url = url
|
||||
song.freeTrialInfo = 'null'
|
||||
logger.info('解灰成功!')
|
||||
}
|
||||
if (song.url.includes('kuwo')) {
|
||||
const proxy = process.env.PROXY_URL;
|
||||
if (song.url && song.url.includes('kuwo')) {
|
||||
const proxy = process.env.PROXY_URL
|
||||
const useProxy = process.env.ENABLE_PROXY || 'false'
|
||||
if (useProxy === 'true' && proxy) {song.proxyUrl = proxy + song.url}
|
||||
if (useProxy === 'true' && proxy) {
|
||||
song.proxyUrl = proxy + song.url
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user