feat(plugins): Add Novel PDF and Hiraeth Translation (#907)

* feat(plugins): Add Novel PDF and Hiraeth Translation

* feat(plugins): Add Icons

* Rename Icons
This commit is contained in:
Rajarshee Chatterjee
2024-04-28 19:35:28 +05:30
committed by GitHub
parent 593fa2f206
commit 20b0d0b386
4 changed files with 23 additions and 4 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

+19 -2
View File
@@ -349,7 +349,24 @@
"sourceName": "WorldNovel", "sourceName": "WorldNovel",
"options": { "options": {
"useNewChapterEndpoint": true, "useNewChapterEndpoint": true,
"lang":"French" "lang": "French"
}
},
{
"id": "hiraethtranslation",
"sourceSite": "https://hiraethtranslation.com/",
"sourceName": "Hiraeth Translation",
"options": {
"useNewChapterEndpoint": true
}
},
{
"id": "novelpdf",
"sourceSite": "https://novelpdf.xyz/",
"sourceName": "Novel PDF",
"options": {
"useNewChapterEndpoint": true,
"lang": "Thai"
} }
} }
] ]
+4 -2
View File
@@ -84,7 +84,10 @@ class MadaraPlugin implements Plugin.PluginBase {
''; '';
if (!novelName || !novelUrl) return; if (!novelName || !novelUrl) return;
const image = loadedCheerio(element).find('img'); const image = loadedCheerio(element).find('img');
const novelCover = image.attr('data-src') || image.attr('src'); const novelCover =
image.attr('data-src') ||
image.attr('src') ||
image.attr('data-lazy-srcset');
const novel: Plugin.NovelItem = { const novel: Plugin.NovelItem = {
name: novelName, name: novelName,
cover: novelCover, cover: novelCover,
@@ -133,7 +136,6 @@ class MadaraPlugin implements Plugin.PluginBase {
loadedCheerio('.summary_image > a > img').attr('data-lazy-src') || loadedCheerio('.summary_image > a > img').attr('data-lazy-src') ||
loadedCheerio('.summary_image > a > img').attr('data-src') || loadedCheerio('.summary_image > a > img').attr('data-src') ||
loadedCheerio('.summary_image > a > img').attr('src') || loadedCheerio('.summary_image > a > img').attr('src') ||
loadedCheerio('.summary_image > a > img').attr('src') ||
defaultCover; defaultCover;
loadedCheerio('.post-content_item, .post-content').each(function () { loadedCheerio('.post-content_item, .post-content').each(function () {