Add novel.ovh (#756)

* fix

* test

* fix
This commit is contained in:
Rider21
2024-02-07 20:51:25 +03:00
committed by GitHub
parent 1907814d87
commit db921e704f
12 changed files with 582 additions and 18 deletions
+24 -2
View File
@@ -3,7 +3,7 @@ import { Filters, FilterTypes } from "@libs/filterInputs";
import { Plugin } from "@typings/plugin";
import { NovelStatus } from "@libs/novelStatus";
import { load as parseHTML } from "cheerio";
// import { defaultCover } from "@libs/defaultCover";
import dayjs from "dayjs";
export interface RulateMetadata {
id: string;
@@ -152,7 +152,7 @@ class RulatePlugin implements Plugin.PluginBase {
chapters.push({
name: chapterName,
url: this.site + chapterUrl,
releaseTime: releaseDate,
releaseTime: this.parseDate(releaseDate),
chapterNumber: chapterIndex + 1,
});
}
@@ -210,6 +210,28 @@ class RulatePlugin implements Plugin.PluginBase {
return novels;
}
parseDate = (dateString: string | undefined = "") => {
const months: { [key: string]: number } = {
"янв.": 1,
"февр.": 2,
"мар.": 3,
"апр.": 4,
мая: 5,
"июн.": 6,
"июл.": 7,
"авг.": 8,
"сент.": 9,
"окт.": 10,
"нояб.": 11,
"дек.": 12,
};
const [day, month, year, , time] = dateString.split(" ");
if (day && months[month] && year && time) {
return dayjs(year + "-" + months[month] + "-" + day + " " + time).format("LLL");
}
return dateString || null;
};
fetchImage = fetchFile;
}