(url, options = { method: 'GET' })
| 17 | const MUSIC_SOURCE = Object.keys(MUSIC_QUALITY) |
| 18 | const { EVENT_NAMES, request, on, send, utils, env, version } = globalThis.lx |
| 19 | const httpFetch = (url, options = { method: 'GET' }) => { |
| 20 | return new Promise((resolve, reject) => { |
| 21 | request(url, options, (err, resp) => { |
| 22 | if (err) return reject(err) |
| 23 | resolve(resp) |
| 24 | }) |
| 25 | }) |
| 26 | } |
| 27 | const handleGetMusicUrl = async (source, musicInfo, quality) => { |
| 28 | const songId = musicInfo.hash ?? musicInfo.songmid |
| 29 |