fix(route): 云听专辑获取最新节目 (#11028)
This commit is contained in:
+15
-5
@@ -8,9 +8,7 @@ module.exports = async (ctx) => {
|
||||
const KEY = 'f0fc4c668392f9f9a447e48584c214ee';
|
||||
|
||||
const id = ctx.params.id;
|
||||
const size = ctx.query.limit ?? '100';
|
||||
|
||||
const params = `albumId=${id}&pageNo=0&pageSize=${size}`;
|
||||
const size = ctx.query.limit ? parseInt(ctx.query.limit) : 100;
|
||||
|
||||
const rootUrl = 'https://www.radio.cn';
|
||||
const apiRootUrl = 'https://ytmsout.radio.cn';
|
||||
@@ -18,7 +16,6 @@ module.exports = async (ctx) => {
|
||||
|
||||
const iconUrl = `${rootUrl}/pc-portal/image/icon_32.jpg`;
|
||||
const currentUrl = `${rootUrl}/pc-portal/sanji/detail.html?columnId=${id}`;
|
||||
const apiUrl = `${apiRootUrl}/web/appSingle/pageByAlbum?${params}`;
|
||||
const detailUrl = `${detailRootUrl}/ytsrv/srv/wifimusicbox/demand/detail`;
|
||||
|
||||
const detailResponse = await got({
|
||||
@@ -26,7 +23,7 @@ module.exports = async (ctx) => {
|
||||
url: detailUrl,
|
||||
form: {
|
||||
pageIndex: '0',
|
||||
sortType: '1',
|
||||
sortType: '2',
|
||||
mobileId: '',
|
||||
providerCode: '25010',
|
||||
pid: id,
|
||||
@@ -44,6 +41,19 @@ module.exports = async (ctx) => {
|
||||
|
||||
const data = detailResponse.data;
|
||||
|
||||
const count = data.count;
|
||||
|
||||
let pageNo = 1,
|
||||
pageSize = count - size;
|
||||
|
||||
if (pageSize <= 0) {
|
||||
pageNo = 0;
|
||||
pageSize = count;
|
||||
}
|
||||
|
||||
const params = `albumId=${id}&pageNo=${pageNo}&pageSize=${pageSize}`;
|
||||
const apiUrl = `${apiRootUrl}/web/appSingle/pageByAlbum?${params}`;
|
||||
|
||||
const timestamp = new Date().getTime();
|
||||
const sign = CryptoJS.MD5(`${params}×tamp=${timestamp}&key=${KEY}`).toString().toUpperCase();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user