Skip to content

Commit

Permalink
chore(style): sync with prettier
Browse files Browse the repository at this point in the history
Signed-off-by: Tianling Shen <[email protected]>
  • Loading branch information
1715173329 committed Dec 23, 2023
1 parent d264fb9 commit fe90925
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const cli = {
.slice(1)
.split('')
.map((string) => '-' + string)
)
)
: result.concat(part),
[]
);
Expand Down Expand Up @@ -203,10 +203,10 @@ const help = () => {
` ${option[0]}${pad(align - option[0].length)} ${slice(
option[1]
)}`
)
)
: console.log(
` ${option[0]}\n${pad(align + 4)}${slice(option[1])}`
);
);
};
if (positionals.length) console.log('\npositional arguments:');
positionals.forEach(publish);
Expand Down
18 changes: 9 additions & 9 deletions src/hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ hook.request.before = (ctx) => {
(req.url.startsWith('http://')
? ''
: (req.socket.encrypted ? 'https:' : 'http:') +
'//' +
(domainList.some((domain) =>
'//' +
(domainList.some((domain) =>
(req.headers.host || '').endsWith(domain)
)
)
? req.headers.host
: null)) + req.url;
const url = parse(req.url);
Expand Down Expand Up @@ -643,17 +643,17 @@ const tryMatch = (ctx) => {
? `${global.endpoint.replace(
'https://',
'http://'
)}/package/${crypto.base64.encode(song.url)}/${
)}/package/${crypto.base64.encode(song.url)}/${
item.id
}.${item.type}`
}.${item.type}`
: song.url;
} else {
item.url = global.endpoint
? `${
global.endpoint
}/package/${crypto.base64.encode(song.url)}/${
}/package/${crypto.base64.encode(song.url)}/${
item.id
}.${item.type}`
}.${item.type}`
: song.url;
}
item.md5 = song.md5 || crypto.md5.digest(song.url);
Expand All @@ -679,7 +679,7 @@ const tryMatch = (ctx) => {
? current.map((element) => [element])
: aggregation.map((element, index) =>
element.concat(current[index])
),
),
[]
)
.filter((pair) => pair[0] !== pair[1])[0];
Expand Down Expand Up @@ -737,7 +737,7 @@ const tryMatch = (ctx) => {
)
.toString()
.replace('_0', '')
); // reduce time cost
); // reduce time cost
tasks = jsonBody.data.map((item) => inject(item));
}
return Promise.all(tasks).catch((e) => e && logger.error(e));
Expand Down
2 changes: 1 addition & 1 deletion src/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const logger = pino(
messageFormat: messageFormat,
ignore: 'time,pid,hostname,scope',
errorProps: '*',
},
},
},
// Redirect the logs to destFile if specified.
destFile && pino.destination(destFile)
Expand Down
6 changes: 3 additions & 3 deletions src/provider/kuwo.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ const search = (info) => {
const track = (id) => {
const url = crypto.kuwoapi
? 'http://mobi.kuwo.cn/mobi.s?f=kuwo&q=' +
crypto.kuwoapi.encryptQuery(
crypto.kuwoapi.encryptQuery(
'corp=kuwo&source=kwplayer_ar_8.5.5.0_apk_keluze.apk&p2p=1&type=convert_url2&sig=0&format=' +
['flac', 'mp3']
.slice(select.ENABLE_FLAC ? 0 : 1)
.join('|') +
'&rid=' +
id
)
)
: 'http://antiserver.kuwo.cn/anti.s?type=convert_url&format=mp3&response=url&rid=MUSIC_' +
id; // flac refuse
id; // flac refuse
// : 'http://www.kuwo.cn/url?format=mp3&response=url&type=convert_url3&br=320kmp3&rid=' + id // flac refuse

return request('GET', url, { 'user-agent': 'okhttp/3.10.0' })
Expand Down

0 comments on commit fe90925

Please sign in to comment.