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(
|
rank: parseInt(
|
||||||
$(el).find(".item .number")?.children()?.first()?.text()?.trim()
|
$(el).find(".item .number")?.children()?.first()?.text()?.trim()
|
||||||
),
|
),
|
||||||
|
id: $(el).find(".item .film-poster")?.attr("href")?.slice(1)?.trim(),
|
||||||
name: $(el)
|
name: $(el)
|
||||||
.find(".item .number .film-title.dynamic-name")
|
.find(".item .number .film-title.dynamic-name")
|
||||||
?.text()
|
?.text()
|
||||||
?.trim(),
|
?.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)
|
poster: $(el)
|
||||||
.find(".item .film-poster .film-poster-img")
|
.find(".item .film-poster .film-poster-img")
|
||||||
?.attr("data-src")
|
?.attr("data-src")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
export interface Anime {
|
export interface Anime {
|
||||||
id: string | null;
|
id: string | null;
|
||||||
name: string | null;
|
name: string | null;
|
||||||
|
jname: string | null;
|
||||||
poster: string | null;
|
poster: string | null;
|
||||||
duration: string | null;
|
duration: string | null;
|
||||||
type: string | null;
|
type: string | null;
|
||||||
@@ -15,6 +16,7 @@ type CommonAnimeProps = "id" | "name" | "poster";
|
|||||||
|
|
||||||
export interface Top10Anime extends Pick<Anime, CommonAnimeProps | "episodes"> {
|
export interface Top10Anime extends Pick<Anime, CommonAnimeProps | "episodes"> {
|
||||||
rank: number | null;
|
rank: number | null;
|
||||||
|
jname: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Top10AnimeTimePeriod = "day" | "week" | "month";
|
export type Top10AnimeTimePeriod = "day" | "week" | "month";
|
||||||
|
|||||||
+10
-6
@@ -39,6 +39,10 @@ export const extractAnimes = (
|
|||||||
.find(".film-detail .film-name .dynamic-name")
|
.find(".film-detail .film-name .dynamic-name")
|
||||||
?.text()
|
?.text()
|
||||||
?.trim(),
|
?.trim(),
|
||||||
|
jname: $(el)
|
||||||
|
.find(".film-detail .film-name .dynamic-name")
|
||||||
|
?.attr("data-jname")
|
||||||
|
?.trim() || null,
|
||||||
poster:
|
poster:
|
||||||
$(el)
|
$(el)
|
||||||
.find(".film-poster .film-poster-img")
|
.find(".film-poster .film-poster-img")
|
||||||
@@ -102,6 +106,7 @@ export const extractTop10Animes = (
|
|||||||
.trim() || null,
|
.trim() || null,
|
||||||
rank: Number($(el).find(".film-number span")?.text()?.trim()) || null,
|
rank: Number($(el).find(".film-number span")?.text()?.trim()) || null,
|
||||||
name: $(el).find(".film-detail .dynamic-name")?.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:
|
poster:
|
||||||
$(el)
|
$(el)
|
||||||
.find(".film-poster .film-poster-img")
|
.find(".film-poster .film-poster-img")
|
||||||
@@ -150,17 +155,16 @@ export const extractMostPopularAnimes = (
|
|||||||
?.slice(1)
|
?.slice(1)
|
||||||
.trim() || null,
|
.trim() || null,
|
||||||
name: $(el).find(".film-detail .dynamic-name")?.text()?.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:
|
jname:
|
||||||
$(el)
|
$(el)
|
||||||
.find(".film-detail .film-name .dynamic-name")
|
.find(".film-detail .film-name .dynamic-name")
|
||||||
.attr("data-jname")
|
.attr("data-jname")
|
||||||
?.trim() || null,
|
?.trim() || null,
|
||||||
|
poster:
|
||||||
|
$(el)
|
||||||
|
.find(".film-poster .film-poster-img")
|
||||||
|
?.attr("data-src")
|
||||||
|
?.trim() || null,
|
||||||
episodes: {
|
episodes: {
|
||||||
sub:
|
sub:
|
||||||
Number($(el)?.find(".fd-infor .tick .tick-sub")?.text()?.trim()) ||
|
Number($(el)?.find(".fd-infor .tick .tick-sub")?.text()?.trim()) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user