1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

添加hifini_music爬虫代码

This commit is contained in:
2022-10-28 00:23:50 +08:00
parent a39fa9dc18
commit 6ce6b0cd46
3 changed files with 218 additions and 0 deletions

View File

@@ -35,8 +35,24 @@ async function query(opts) {
return return_data;
}
async function getRedirectUrl(url) {
return await new Promise((resolve, reject) => {
request({
url: url,
followRedirect: false
}, function (err, res, body) {
if (err) {
reject(err);
}
// console.log(res.headers.location);
resolve(res.headers.location);
});
});
}
module.exports = {
get: get,
getApiResult: getApiResult,
query: query,
getRedirectUrl: getRedirectUrl,
}