Skip to content
This repository was archived by the owner on Nov 20, 2021. It is now read-only.

Commit 6d76b9f

Browse files
committed
Add new source and fix the old ones
1 parent 062ab00 commit 6d76b9f

File tree

7 files changed

+161
-13
lines changed

7 files changed

+161
-13
lines changed

‎src/DankeFurs/DankeFurs.ts

+21-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,38 @@
1-
import {SourceInfo} from "paperback-extensions-common"
1+
import {Request, SourceInfo, TagType} from "paperback-extensions-common"
22
import {GuyaTemplate} from "../GuyaTemplate";
33

44
const BASE = "https://danke.moe"
55

66
export const DankeFursInfo: SourceInfo = {
77
icon: "icon.png",
8-
version: "1.0.5",
8+
version: "1.1.0",
99
name: "DankeFurs",
1010
author: "PythonCoderAS",
1111
authorWebsite: "https://github.com/PythonCoderAS",
1212
description: "Extension that pulls manga from DankeFurs",
1313
language: "en",
1414
hentaiSource: false,
15-
websiteBaseURL: BASE
15+
websiteBaseURL: BASE,
16+
sourceTags: [
17+
{
18+
text: "Notifications",
19+
type: TagType.GREEN
20+
},
21+
{
22+
text: "Cloudflare",
23+
type: TagType.RED
24+
}
25+
]
1626
}
1727

1828
export class DankeFurs extends GuyaTemplate {
1929
readonly baseUrl: string = BASE;
30+
31+
32+
getCloudflareBypassRequest(): Request {
33+
return createRequestObject({
34+
url: this.baseUrl,
35+
method: "GET"
36+
});
37+
}
2038
}

‎src/Hachirumi/Hachirumi.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import {SourceInfo, TagType} from "paperback-extensions-common"
2+
import {GuyaTemplate} from "../GuyaTemplate";
3+
4+
const BASE = "https://hachirumi.com"
5+
6+
export const HachirumiInfo: SourceInfo = {
7+
icon: "icon.png",
8+
version: "1.0.0",
9+
name: "Hachirumi",
10+
author: "PythonCoderAS",
11+
authorWebsite: "https://github.com/PythonCoderAS",
12+
description: "Extension that pulls manga from Hachirumi",
13+
language: "en",
14+
hentaiSource: false,
15+
websiteBaseURL: BASE,
16+
sourceTags: [
17+
{
18+
text: "Notifications",
19+
type: TagType.GREEN
20+
}
21+
]
22+
}
23+
24+
export class Hachirumi extends GuyaTemplate {
25+
readonly baseUrl: string = BASE;
26+
}

‎src/Hachirumi/includes/icon.png

91.5 KB
Loading

‎src/MahouShoujoBu/MahouShoujoBu.ts

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
import {SourceInfo} from "paperback-extensions-common"
1+
import {SourceInfo, TagType} from "paperback-extensions-common"
22
import {GuyaTemplate} from "../GuyaTemplate";
33

4-
const BASE = "https://mahoushoujobu.com/"
4+
const BASE = "https://mahoushoujobu.com"
55

66
export const MahouShoujoBuInfo: SourceInfo = {
77
icon: "icon.png",
8-
version: "1.0.2",
8+
version: "1.0.3",
99
name: "MahouShoujoBu",
1010
author: "PythonCoderAS",
1111
authorWebsite: "https://github.com/PythonCoderAS",
1212
description: "Extension that pulls manga from MahouShoujoBu",
1313
language: "en",
1414
hentaiSource: false,
15-
websiteBaseURL: BASE
15+
websiteBaseURL: BASE,
16+
sourceTags: [
17+
{
18+
text: "Notifications",
19+
type: TagType.GREEN
20+
}
21+
]
1622
}
1723

1824
export class MahouShoujoBu extends GuyaTemplate {

‎src/SenManga/SenManga.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,28 @@ import {
99
SearchRequest,
1010
Source,
1111
SourceInfo,
12-
TagSection,
12+
TagSection, TagType,
1313
} from "paperback-extensions-common"
1414
import {SenMangaParser} from "./SenMangaParser";
1515

1616
const BASE = "https://raw.senmanga.com"
1717

1818
export const SenMangaInfo: SourceInfo = {
1919
icon: "icon.png",
20-
version: "1.0.3",
20+
version: "1.0.4",
2121
name: "SenManga",
2222
author: "PythonCoderAS",
2323
authorWebsite: "https://github.com/PythonCoderAS",
2424
description: "Extension that pulls manga from SenManga",
2525
language: "jp",
2626
hentaiSource: false,
27-
websiteBaseURL: BASE
27+
websiteBaseURL: BASE,
28+
sourceTags: [
29+
{
30+
text: "Notifications",
31+
type: TagType.GREEN
32+
}
33+
]
2834
}
2935

3036
export class SenManga extends Source {

‎src/VoidScans/VoidScans.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,28 @@ import {
77
Request, RequestManager,
88
SearchRequest,
99
Source,
10-
SourceInfo,
10+
SourceInfo, TagType,
1111
} from "paperback-extensions-common"
1212
import {VoidScansParser} from "./VoidScansParser";
1313

1414
const BASE = "https://voidscans.net"
1515

1616
export const VoidScansInfo: SourceInfo = {
1717
icon: "icon.svg",
18-
version: "1.4.1",
18+
version: "1.4.2",
1919
name: "VoidScans",
2020
author: "PythonCoderAS",
2121
authorWebsite: "https://github.com/PythonCoderAS",
2222
description: "Extension that pulls manga from VoidScans",
2323
language: "en",
2424
hentaiSource: false,
25-
websiteBaseURL: BASE
25+
websiteBaseURL: BASE,
26+
sourceTags: [
27+
{
28+
text: "Broken",
29+
type: TagType.RED
30+
}
31+
]
2632
}
2733

2834
export class VoidScans extends Source {

‎src/tests/Hachirumi.test.ts

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import cheerio from "cheerio";
2+
import { Hachirumi } from "../Hachirumi/Hachirumi";
3+
import { APIWrapper, Source } from "paperback-extensions-common";
4+
5+
describe("Hachirumi Tests", function () {
6+
var wrapper: APIWrapper = new APIWrapper();
7+
var source: Source = new Hachirumi(cheerio);
8+
var chai = require("chai"),
9+
expect = chai.expect;
10+
var chaiAsPromised = require("chai-as-promised");
11+
chai.use(chaiAsPromised);
12+
13+
var mangaId = "my-future-self-is-persuading-me-to-become-a-woman";
14+
15+
it("Retrieve Manga Details", async () => {
16+
let details = await wrapper.getMangaDetails(source, mangaId);
17+
expect(
18+
details,
19+
"No results found with test-defined ID [" + mangaId + "]"
20+
).to.exist;
21+
22+
// Validate that the fields are filled
23+
let data = details;
24+
expect(data.id, "Missing ID").to.be.not.empty;
25+
expect(data.image, "Missing Image").to.be.not.empty;
26+
expect(data.status, "Missing Status").to.exist;
27+
expect(data.author, "Missing Author").to.be.not.empty;
28+
expect(data.desc, "Missing Description").to.be.not.empty;
29+
expect(data.titles, "Missing Titles").to.be.not.empty;
30+
expect(data.rating, "Missing Rating").to.exist;
31+
});
32+
33+
it("Get Chapters", async () => {
34+
let data = await wrapper.getChapters(source, mangaId);
35+
36+
expect(data, "No chapters present for: [" + mangaId + "]").to.not.be.empty;
37+
38+
let entry = data[0];
39+
expect(entry.id, "No ID present").to.not.be.empty;
40+
expect(entry.time, "No date present").to.exist;
41+
expect(entry.name, "No title available").to.not.be.empty;
42+
expect(entry.chapNum, "No chapter number present").to.exist;
43+
expect(entry.volume, "No volume data available").to.not.be.empty;
44+
});
45+
46+
it("Get Chapter Details", async () => {
47+
let chapters = await wrapper.getChapters(source, mangaId);
48+
let data = await wrapper.getChapterDetails(source, mangaId, chapters[0].id);
49+
50+
expect(data, "No server response").to.exist;
51+
expect(data, "Empty server response").to.not.be.empty;
52+
53+
expect(data.id, "Missing ID").to.be.not.empty;
54+
expect(data.mangaId, "Missing MangaID").to.be.not.empty;
55+
expect(data.pages, "No pages present").to.be.not.empty;
56+
});
57+
58+
it("Testing search", async () => {
59+
let testSearch = createSearchRequest({
60+
title: "crossdressing",
61+
});
62+
63+
let search = await wrapper.searchRequest(source, testSearch);
64+
let result = search.results[0];
65+
66+
expect(result, "No response from server").to.exist;
67+
68+
expect(result.id, "No ID found for search query").to.be.not.empty;
69+
expect(result.image, "No image found for search").to.be.not.empty;
70+
expect(result.title, "No title").to.be.not.null;
71+
expect(result.subtitleText, "No subtitle text").to.be.not.null;
72+
});
73+
74+
it("Testing Home-Page aquisition", async () => {
75+
let homePages = await wrapper.getHomePageSections(source);
76+
expect(homePages, "No response from server").to.exist;
77+
});
78+
79+
it("Testing Notifications", async () => {
80+
const updates = await wrapper.filterUpdatedManga(source, new Date("2021-03-26"), [mangaId]);
81+
82+
expect(updates, "No server response").to.exist;
83+
expect(updates, "Empty server response").to.not.be.empty;
84+
expect(updates[0].ids, "No updates").to.not.be.empty;
85+
});
86+
});

0 commit comments

Comments
 (0)