mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-01 18:33:33 +00:00
address comments
This commit is contained in:
parent
9eef570740
commit
85a10c799a
5 changed files with 29 additions and 21 deletions
|
|
@ -2,12 +2,14 @@ import axios, { AxiosResponse } from 'axios';
|
|||
import { load } from 'cheerio';
|
||||
import type { QueueSong } from '/@/renderer/api/types';
|
||||
|
||||
const search_url = 'https://genius.com/api/search/song';
|
||||
const SEARCH_URL = 'https://genius.com/api/search/song';
|
||||
|
||||
// Adapted from https://github.com/NyaomiDEV/Sunamu/blob/master/src/main/lyricproviders/genius.ts
|
||||
|
||||
async function getSongURL(metadata: QueueSong) {
|
||||
let result: AxiosResponse<any, any>;
|
||||
try {
|
||||
result = await axios.get(search_url, {
|
||||
result = await axios.get(SEARCH_URL, {
|
||||
params: {
|
||||
per_page: '1',
|
||||
q: `${metadata.artistName} ${metadata.name}`,
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import type { QueueSong } from '/@/renderer/api/types';
|
|||
const SEARCH_URL = 'https://music.163.com/api/search/get';
|
||||
const LYRICS_URL = 'https://music.163.com/api/song/lyric';
|
||||
|
||||
// Adapted from https://github.com/NyaomiDEV/Sunamu/blob/master/src/main/lyricproviders/netease.ts
|
||||
|
||||
async function getSongId(metadata: QueueSong) {
|
||||
let result: AxiosResponse<any, any>;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue