mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-05 21:58:56 +08:00
移除试听接口
This commit is contained in:
parent
4611e79719
commit
c28c0196a9
@ -2,7 +2,7 @@ const defaultSetting: LX.AppSetting = {
|
||||
version: '2.0',
|
||||
'common.isAutoTheme': false,
|
||||
'common.langId': null,
|
||||
'common.apiSource': 'empty',
|
||||
'common.apiSource': '',
|
||||
'common.sourceNameType': 'alias',
|
||||
'common.shareType': 'system',
|
||||
'common.isAgreePact': false,
|
||||
|
@ -38,8 +38,7 @@ const Content = () => {
|
||||
<Text selectable style={styles.bold} >一、数据来源</Text>
|
||||
<Text selectable style={styles.text} >1.1 本项目的数据来源原理是从各官方音乐平台的公开服务器中拉取数据(与未登录状态在官方平台APP获取的数据相同),经过对数据简单地筛选与合并后进行展示,因此本项目不对数据的准确性负责。</Text>
|
||||
<Text selectable style={styles.text} >1.2 本项目本身没有获取某个音频数据的能力,本项目使用的在线音频数据来源来自软件设置内“音乐来源”设置所选择的“源”返回的在线链接。例如播放某首歌,本项目所做的只是将希望播放的歌曲名字、歌手名字等信息传递给“源”,若“源”返回了一个链接,则本项目将认为这就是该歌曲的音频数据而进行使用,至于这是不是正确的音频数据本项目无法校验其准确性,所以使用本项目的过程中可能会出现希望播放的音频与实际播放的音频不对应或者无法播放的问题。</Text>
|
||||
<Text selectable style={styles.text} >1.3 本项目内置的“试听接口”源的工作原理是尝试直接从对应官方平台公开服务器获取免费歌曲的音频连接(与未登录状态在官方平台APP获取的歌曲链接相同),所以若某首歌若无法在处于未登录状态的官方平台APP播放,则理论上“试听接口”源也无法播放该歌曲。</Text>
|
||||
<Text selectable style={styles.text} >1.4 本项目的非官方平台数据(例如我的收藏列表)来自使用者本地系统或者使用者连接的同步服务,本项目不对这些数据的合法性、准确性负责。{'\n'}</Text>
|
||||
<Text selectable style={styles.text} >1.3 本项目的非官方平台数据(例如我的收藏列表)来自使用者本地系统或者使用者连接的同步服务,本项目不对这些数据的合法性、准确性负责。{'\n'}</Text>
|
||||
<Text selectable style={styles.bold} >二、版权数据</Text>
|
||||
<Text selectable style={styles.text} >2.1 使用本项目的过程中可能会产生版权数据。对于这些版权数据,本项目不拥有它们的所有权。为了避免侵权,使用者务必在 <Text style={styles.bold}>24小时内</Text> 清除使用本项目的过程中所产生的版权数据。{'\n'}</Text>
|
||||
<Text selectable style={styles.bold} >三、音乐平台别名</Text>
|
||||
|
@ -48,7 +48,11 @@ const ListItem = ({ item, activeId, onRemove, onChangeAllowShowUpdateAlert }: {
|
||||
) : null
|
||||
}
|
||||
</Text>
|
||||
<Text size={12} color={theme['c-font-label']}>{item.description}</Text>
|
||||
{
|
||||
item.description ? (
|
||||
<Text size={12} color={theme['c-font-label']}>{item.description}</Text>
|
||||
) : null
|
||||
}
|
||||
<CheckBox check={item.allowShowUpdateAlert} label={t('user_api_allow_show_update_alert')} onChange={changeAllowShowUpdateAlert} size={0.86} />
|
||||
</View>
|
||||
<View style={styles.listItemRight}>
|
||||
|
@ -6,24 +6,6 @@ const sources: Array<{
|
||||
disabled: boolean
|
||||
supportQualitys: Partial<Record<LX.OnlineSource, LX.Quality[]>>
|
||||
}> = [
|
||||
{
|
||||
id: 'empty',
|
||||
name: 'empty',
|
||||
disabled: false,
|
||||
supportQualitys: {},
|
||||
},
|
||||
{
|
||||
id: 'direct',
|
||||
name: '直连接口',
|
||||
disabled: false,
|
||||
supportQualitys: {
|
||||
kw: ['128k'],
|
||||
kg: ['128k'],
|
||||
tx: ['128k'],
|
||||
wy: ['128k'],
|
||||
mg: ['128k'],
|
||||
},
|
||||
},
|
||||
]
|
||||
|
||||
export default sources
|
||||
|
@ -7,11 +7,11 @@ import apiSourceInfo from './api-source-info'
|
||||
// import test_api_wy from './wy/api-test'
|
||||
// import test_api_mg from './mg/api-test'
|
||||
|
||||
import direct_api_kg from './kg/api-direct'
|
||||
import direct_api_kw from './kw/api-direct'
|
||||
import direct_api_tx from './tx/api-direct'
|
||||
import direct_api_wy from './wy/api-direct'
|
||||
import direct_api_mg from './mg/api-direct'
|
||||
// import direct_api_kg from './kg/api-direct'
|
||||
// import direct_api_kw from './kw/api-direct'
|
||||
// import direct_api_tx from './tx/api-direct'
|
||||
// import direct_api_wy from './wy/api-direct'
|
||||
// import direct_api_mg from './mg/api-direct'
|
||||
|
||||
import settingState from '@/store/setting/state'
|
||||
|
||||
@ -24,11 +24,11 @@ const apiList = {
|
||||
// test_api_tx,
|
||||
// test_api_wy,
|
||||
// test_api_mg,
|
||||
direct_api_kg,
|
||||
direct_api_kw,
|
||||
direct_api_tx,
|
||||
direct_api_wy,
|
||||
direct_api_mg,
|
||||
// direct_api_kg,
|
||||
// direct_api_kw,
|
||||
// direct_api_tx,
|
||||
// direct_api_wy,
|
||||
// direct_api_mg,
|
||||
// test_api_tx: require('./tx/api-test'),
|
||||
// test_api_wy: require('./wy/api-test'),
|
||||
// test_api_xm: require('./xm/api-test'),
|
||||
|
@ -1,22 +0,0 @@
|
||||
import { httpFetch } from '../../request'
|
||||
import { timeout } from '../options'
|
||||
|
||||
// https://github.com/listen1/listen1_chrome_extension/blob/master/js/provider/kugou.js
|
||||
export default {
|
||||
getMusicUrl(songInfo, type) {
|
||||
const target_url = `https://wwwapi.kugou.com/yy/index.php?r=play/getdata&hash=${songInfo.hash}&platid=4&album_id=${songInfo.albumId}&mid=00000000000000000000000000000000`
|
||||
const requestObj = httpFetch(target_url, {
|
||||
method: 'get',
|
||||
timeout,
|
||||
})
|
||||
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||
// console.log(body)
|
||||
|
||||
if (body.status !== 1) return Promise.reject(new Error(body.err_code))
|
||||
if (body.data.is_free_part || !body.data.play_backup_url) return Promise.reject(new Error('failed'))
|
||||
|
||||
return Promise.resolve({ type, url: body.data.play_backup_url })
|
||||
})
|
||||
return requestObj
|
||||
},
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
import { httpFetch } from '../../request'
|
||||
import { timeout } from '../options'
|
||||
|
||||
export default {
|
||||
getMusicUrl(songInfo, type) {
|
||||
const target_url = `http://www.kuwo.cn/api/v1/www/music/playUrl?mid=${songInfo.songmid}&type=music&br=${type}`
|
||||
const requestObj = httpFetch(target_url, {
|
||||
method: 'get',
|
||||
timeout,
|
||||
headers: {
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0',
|
||||
Referer: 'http://kuwo.cn/',
|
||||
Secret: '14da58a88a83170f11c3a63bb0ff6aec68a7487b64551a1f997356d719980a2b028f34f5',
|
||||
cookie: 'Hm_Iuvt_cdb524f42f0cer9b268e4v7y734w5esq24=4cGcsx3ej3tkYfeGrFtdS2kSZ6YD3nbD',
|
||||
},
|
||||
credentials: 'omit',
|
||||
})
|
||||
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||
// console.log(JSON.stringify(body))
|
||||
if (body.code != 200) return Promise.reject(new Error('failed'))
|
||||
|
||||
return { type, url: body.data.url }
|
||||
})
|
||||
return requestObj
|
||||
},
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
import { httpFetch } from '../../request'
|
||||
import { timeout } from '../options'
|
||||
|
||||
// https://github.com/listen1/listen1_chrome_extension/blob/master/js/provider/migu.js
|
||||
|
||||
const qualitys = {
|
||||
'128k': 'PQ',
|
||||
'320k': 'HQ',
|
||||
flac: 'SQ',
|
||||
flac32bit: 'ZQ',
|
||||
}
|
||||
|
||||
export default {
|
||||
getMusicUrl(songInfo, type) {
|
||||
const quality = qualitys[type]
|
||||
const target_url = `https://app.c.nf.migu.cn/MIGUM2.0/strategy/listen-url/v2.2?netType=01&resourceType=E&songId=${songInfo.songmid}&toneFlag=${quality}`
|
||||
const requestObj = httpFetch(target_url, {
|
||||
method: 'get',
|
||||
timeout,
|
||||
headers: {
|
||||
channel: '0146951',
|
||||
uid: 1234,
|
||||
},
|
||||
})
|
||||
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||
// console.log(body)
|
||||
|
||||
let playUrl = body.data?.url
|
||||
if (!playUrl) return Promise.reject(new Error('failed'))
|
||||
|
||||
if (playUrl.startsWith('//')) playUrl = `https:${playUrl}`
|
||||
|
||||
return { type, url: playUrl.replace(/\+/g, '%2B') }
|
||||
})
|
||||
return requestObj
|
||||
},
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
import { httpFetch } from '../../request'
|
||||
import { timeout } from '../options'
|
||||
|
||||
// https://github.com/listen1/listen1_chrome_extension/blob/master/js/provider/qq.js
|
||||
|
||||
const fileConfig = {
|
||||
'128k': {
|
||||
s: 'M500',
|
||||
e: '.mp3',
|
||||
bitrate: '128kbps',
|
||||
},
|
||||
'320k': {
|
||||
s: 'M800',
|
||||
e: '.mp3',
|
||||
bitrate: '320kbps',
|
||||
},
|
||||
flac: {
|
||||
s: 'F000',
|
||||
e: '.flac',
|
||||
bitrate: 'FLAC',
|
||||
},
|
||||
}
|
||||
|
||||
export default {
|
||||
getMusicUrl(songInfo, type) {
|
||||
const target_url = 'https://u.y.qq.com/cgi-bin/musicu.fcg'
|
||||
// thanks to https://github.com/Rain120/qq-music-api/blob/2b9cb811934888a532545fbd0bf4e4ab2aea5dbe/routers/context/getMusicPlay.js
|
||||
const guid = '10000'
|
||||
const songmidList = [songInfo.songmid]
|
||||
const uin = '0'
|
||||
|
||||
const fileInfo = fileConfig[type]
|
||||
const file =
|
||||
songmidList.length === 1 &&
|
||||
`${fileInfo.s}${songInfo.songmid}${songInfo.songmid}${fileInfo.e}`
|
||||
|
||||
const reqData = {
|
||||
req_0: {
|
||||
module: 'vkey.GetVkeyServer',
|
||||
method: 'CgiGetVkey',
|
||||
param: {
|
||||
filename: file ? [file] : [],
|
||||
guid,
|
||||
songmid: songmidList,
|
||||
songtype: [0],
|
||||
uin,
|
||||
loginflag: 1,
|
||||
platform: '20',
|
||||
},
|
||||
},
|
||||
loginUin: uin,
|
||||
comm: {
|
||||
uin,
|
||||
format: 'json',
|
||||
ct: 24,
|
||||
cv: 0,
|
||||
},
|
||||
}
|
||||
const requestObj = httpFetch(`${target_url}?format=json&data=${JSON.stringify(reqData)}`, {
|
||||
method: 'get',
|
||||
timeout,
|
||||
})
|
||||
requestObj.promise = requestObj.promise.then(({ body }) => {
|
||||
// console.log(body)
|
||||
|
||||
const { purl } = body.req_0.data.midurlinfo[0]
|
||||
|
||||
// vip
|
||||
if (purl === '') return Promise.reject(new Error('failed'))
|
||||
|
||||
const url = body.req_0.data.sip[0] + purl
|
||||
|
||||
return { type, url }
|
||||
})
|
||||
return requestObj
|
||||
},
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
import { httpFetch } from '../../request'
|
||||
import { timeout } from '../options'
|
||||
import { eapi } from './utils/crypto'
|
||||
|
||||
// https://github.com/listen1/listen1_chrome_extension/blob/master/js/provider/netease.js
|
||||
|
||||
const qualitys = {
|
||||
'128k': 128000,
|
||||
'320k': 320000,
|
||||
flac: 999000,
|
||||
}
|
||||
|
||||
let cookie = 'os=pc'
|
||||
|
||||
export default {
|
||||
getMusicUrl(songInfo, type) {
|
||||
const quality = qualitys[type]
|
||||
const target_url = 'https://interface3.music.163.com/eapi/song/enhance/player/url'
|
||||
const eapiUrl = '/api/song/enhance/player/url'
|
||||
|
||||
const d = {
|
||||
ids: `[${songInfo.songmid}]`,
|
||||
br: quality,
|
||||
}
|
||||
const data = eapi(eapiUrl, d)
|
||||
|
||||
const requestObj = httpFetch(target_url, {
|
||||
method: 'POST',
|
||||
timeout,
|
||||
form: data,
|
||||
headers: {
|
||||
cookie,
|
||||
},
|
||||
})
|
||||
requestObj.promise = requestObj.promise.then(({ headers, body }) => {
|
||||
// console.log(body)
|
||||
|
||||
if (headers.cookie) cookie = headers.cookie
|
||||
|
||||
const { url } = body.data[0]
|
||||
if (!url) return Promise.reject(new Error('failed'))
|
||||
return { type, url }
|
||||
})
|
||||
return requestObj
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user