fix: added japanese anime names to all responses
This commit is contained in:
@@ -118,11 +118,15 @@ async function scrapeHomePage(): Promise<ScrapedHomePage | HttpError> {
|
||||
rank: parseInt(
|
||||
$(el).find(".item .number")?.children()?.first()?.text()?.trim()
|
||||
),
|
||||
id: $(el).find(".item .film-poster")?.attr("href")?.slice(1)?.trim(),
|
||||
name: $(el)
|
||||
.find(".item .number .film-title.dynamic-name")
|
||||
?.text()
|
||||
?.trim(),
|
||||
id: $(el).find(".item .film-poster")?.attr("href")?.slice(1)?.trim(),
|
||||
jname: $(el)
|
||||
.find(".item .number .film-title.dynamic-name")
|
||||
?.attr("data-jname")
|
||||
?.trim(),
|
||||
poster: $(el)
|
||||
.find(".item .film-poster .film-poster-img")
|
||||
?.attr("data-src")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export interface Anime {
|
||||
id: string | null;
|
||||
name: string | null;
|
||||
jname: string | null;
|
||||
poster: string | null;
|
||||
duration: string | null;
|
||||
type: string | null;
|
||||
@@ -15,6 +16,7 @@ type CommonAnimeProps = "id" | "name" | "poster";
|
||||
|
||||
export interface Top10Anime extends Pick<Anime, CommonAnimeProps | "episodes"> {
|
||||
rank: number | null;
|
||||
jname: string | null;
|
||||
}
|
||||
|
||||
export type Top10AnimeTimePeriod = "day" | "week" | "month";
|
||||
|
||||
+10
-6
@@ -39,6 +39,10 @@ export const extractAnimes = (
|
||||
.find(".film-detail .film-name .dynamic-name")
|
||||
?.text()
|
||||
?.trim(),
|
||||
jname: $(el)
|
||||
.find(".film-detail .film-name .dynamic-name")
|
||||
?.attr("data-jname")
|
||||
?.trim() || null,
|
||||
poster:
|
||||
$(el)
|
||||
.find(".film-poster .film-poster-img")
|
||||
@@ -102,6 +106,7 @@ export const extractTop10Animes = (
|
||||
.trim() || null,
|
||||
rank: Number($(el).find(".film-number span")?.text()?.trim()) || null,
|
||||
name: $(el).find(".film-detail .dynamic-name")?.text()?.trim() || null,
|
||||
jname: $(el).find(".film-detail .dynamic-name")?.attr("data-jname")?.trim() || null,
|
||||
poster:
|
||||
$(el)
|
||||
.find(".film-poster .film-poster-img")
|
||||
@@ -150,17 +155,16 @@ export const extractMostPopularAnimes = (
|
||||
?.slice(1)
|
||||
.trim() || null,
|
||||
name: $(el).find(".film-detail .dynamic-name")?.text()?.trim() || null,
|
||||
poster:
|
||||
$(el)
|
||||
.find(".film-poster .film-poster-img")
|
||||
?.attr("data-src")
|
||||
?.trim() || null,
|
||||
jname:
|
||||
$(el)
|
||||
.find(".film-detail .film-name .dynamic-name")
|
||||
.attr("data-jname")
|
||||
?.trim() || null,
|
||||
|
||||
poster:
|
||||
$(el)
|
||||
.find(".film-poster .film-poster-img")
|
||||
?.attr("data-src")
|
||||
?.trim() || null,
|
||||
episodes: {
|
||||
sub:
|
||||
Number($(el)?.find(".fd-infor .tick .tick-sub")?.text()?.trim()) ||
|
||||
|
||||
Reference in New Issue
Block a user