Skip to content

Commit

Permalink
feat: biliFavColle
Browse files Browse the repository at this point in the history
  • Loading branch information
lovegaoshi committed Apr 23, 2024
1 parent 369e06e commit 48a6955
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 10 additions & 0 deletions __tests__/mediafetch/biliFavColle.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import fetcher from '../../src/utils/mediafetch/biliFavColle';
test('FavColle', async () => {
const content = await fetcher.regexFetch({
reExtracted: fetcher.regexSearchMatch.exec(
'https://space.bilibili.com/529249/favlist?fid=1061551&ftype=collect&ctype=21'
)!,
});
// console.log(content);
expect(content?.songList[0]?.id).not.toBeNull();
});
8 changes: 1 addition & 7 deletions src/utils/mediafetch/biliFavColle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ const URL_BILICOLLE_INFO =
'https://api.bilibili.com/x/space/fav/season/list?season_id={sid}&pn={pn}&ps=100';

const fetchBiliColleList = async (
mid: string,
sid: string,
progressEmitter: (val: number) => void = () => undefined,
favList: string[] = []
Expand All @@ -42,12 +41,7 @@ const regexFetch = async ({
useBiliTag,
}: regexFetchProps): Promise<NoxNetwork.NoxRegexFetch> => ({
songList: await biliShazamOnSonglist(
await fetchBiliColleList(
reExtracted[1]!,
reExtracted[2]!,
progressEmitter,
favList
),
await fetchBiliColleList(reExtracted[1]!, progressEmitter, favList),
false,
progressEmitter,
useBiliTag || false
Expand Down

0 comments on commit 48a6955

Please sign in to comment.