Skip to content

Commit b01bd9e

Browse files
committed
Adding GenreList API.
1 parent 0cc5e94 commit b01bd9e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/gogoAnime.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,26 @@ export default class GoGoAnime {
429429
};
430430
}
431431

432+
async genreList(
433+
id: string,
434+
page = 1,
435+
axiosConfig?: AxiosRequestConfig
436+
): Promise<IPagination<IEntity>> {
437+
const res = await axios.get(
438+
this.getUrlWithBase(`/genre/${id}`, { page }),
439+
axiosConfig
440+
);
441+
const $ = cheerioLoad(res.data);
442+
443+
const { paginations, data } = this._getPaginatedAnimeList($);
444+
445+
return {
446+
page,
447+
data,
448+
paginations
449+
};
450+
}
451+
432452
async search(
433453
keyword: string,
434454
page?: number,

0 commit comments

Comments
 (0)