Skip to content

Commit

Permalink
fix reaperscans
Browse files Browse the repository at this point in the history
  • Loading branch information
Yentis committed Oct 19, 2022
1 parent 28c7a6a commit 4c91293
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
6 changes: 6 additions & 0 deletions src/classes/sites/reaperscans.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import PQueue from 'p-queue'
import { Manga } from 'src/classes/manga'
import { SiteType } from 'src/enums/siteEnum'
import HttpRequest from 'src/interfaces/httpRequest'
Expand All @@ -12,6 +13,11 @@ class ReaperScansData extends BaseData {
export class ReaperScans extends BaseSite {
siteType = SiteType.ReaperScans

constructor () {
super()
this.requestQueue = new PQueue({ interval: 1500, intervalCap: 1 })
}

protected getChapterUrl (data: ReaperScansData): string {
const url = data.chapterUrl?.getAttribute('href') || ''
if (url.startsWith('/')) return `${this.getUrl()}${url}`
Expand Down
2 changes: 0 additions & 2 deletions src/classes/sites/wordpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ export class WordPress extends BaseSite {
return `${volume} | ${chapter}`
} else if (chapter) {
return chapter
} else if (volume) {
return volume
} else {
return 'Unknown'
}
Expand Down
8 changes: 4 additions & 4 deletions src/services/test/bilibilicomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export async function testBiliBiliComics (): Promise<void> {
async function readUrl (site: BaseSite): Promise<void> {
const manga = await getMangaInfo(site.getTestUrl(), SITE_TYPE)
const desired = new Manga(site.getTestUrl(), SITE_TYPE)
desired.chapter = '660 Despicable! (2)'
desired.chapter = '662 Dress Lightly for Battle (2)'
desired.image = 'https://i0.hdslb.com/bfs/comic-static/[email protected]'
desired.title = 'Tales of Demons and Gods'
desired.chapterUrl = 'https://www.bilibilicomics.com/mc215/308329'
desired.chapterNum = 660
desired.chapterDate = '7 days ago'
desired.chapterUrl = 'https://www.bilibilicomics.com/mc215/308331'
desired.chapterNum = 662
desired.chapterDate = '4 days ago'

mangaEqual(manga, desired, false)
}
Expand Down
8 changes: 4 additions & 4 deletions src/services/test/copincomics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export async function testCopinComics (): Promise<void> {
async function readUrl (site: BaseSite): Promise<void> {
const manga = await getMangaInfo(site.getTestUrl(), SITE_TYPE)
const desired = new Manga(site.getTestUrl(), SITE_TYPE)
desired.chapter = 'Episode 59'
desired.chapter = 'Episode 60'
desired.image = 'https://s3.us-west-1.amazonaws.com/t.copincomics.com/img/title/301/PDMAu2zYHz_3x4.png'
desired.title = 'Return Survival'
desired.chapterUrl = ''
desired.chapterNum = 59
desired.chapterDate = '3 months ago'
desired.chapterNum = 60
desired.chapterDate = '4 months ago'

mangaEqual(manga, desired)
}
Expand All @@ -32,7 +32,7 @@ async function search (site: BaseSite): Promise<void> {
const results = await searchManga(QUERY, SITE_TYPE)
const desired = new Manga(site.getTestUrl(), SITE_TYPE)
desired.image = 'https://s3.us-west-1.amazonaws.com/t.copincomics.com/img/title/301/PDMAu2zYHz_3x4.png'
desired.chapter = 'Episode 59'
desired.chapter = 'Episode 60'
desired.url = 'https://copincomics.com/toon/301'

return searchValid(results, desired, QUERY)
Expand Down
14 changes: 7 additions & 7 deletions src/services/test/cubari.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ async function readUrl (site: BaseSite): Promise<void> {
desired.title = 'One Punch Man'
desired.chapterUrl = 'https://cubari.moe/read/gist/OPM/171/1/'
desired.chapterNum = 171
desired.chapterDate = '16 days ago'
desired.chapterDate = 'a month ago'

mangaEqual(manga, desired)
}

async function readUrlGuya (): Promise<void> {
const manga = await getMangaInfo('https://guya.moe/read/manga/Kaguya-Wants-To-Be-Confessed-To/', SITE_TYPE)
const desired = new Manga('https://guya.moe/read/manga/Kaguya-Wants-To-Be-Confessed-To/', SITE_TYPE)
desired.chapter = 'Miko Iino and Yu Ishigami’s Final Chapter, Part 1'
desired.image = 'https://guya.moe/media/manga/Kaguya-Wants-To-Be-Confessed-To/volume_covers/26/73174.webp'
desired.chapter = 'Miko Iino and Yu Ishigami’s Final Chapter, Part 2'
desired.image = 'https://guya.moe/media/manga/Kaguya-Wants-To-Be-Confessed-To/volume_covers/27/22149.webp'
desired.title = 'Kaguya-sama: Love is War'
desired.chapterUrl = 'https://guya.moe/read/manga/Kaguya-Wants-To-Be-Confessed-To/277/1/'
desired.chapterNum = 277
desired.chapterUrl = 'https://guya.moe/read/manga/Kaguya-Wants-To-Be-Confessed-To/278/1/'
desired.chapterNum = 278
desired.chapterDate = SiteUtils.getDateFromNow('a day ago')

mangaEqual(manga, desired)
Expand All @@ -45,8 +45,8 @@ async function readUrlGuya (): Promise<void> {
async function search (site: BaseSite): Promise<void> {
const results = await searchManga('kaguya-sama love is war', SITE_TYPE)
const desired = new Manga(site.getTestUrl(), SITE_TYPE)
desired.image = 'https://guya.moe/media/manga/Kaguya-Wants-To-Be-Confessed-To/volume_covers/26/73174.webp'
desired.chapter = 'Miko Iino and Yu Ishigami’s Final Chapter, Part 1'
desired.image = 'https://guya.moe/media/manga/Kaguya-Wants-To-Be-Confessed-To/volume_covers/27/22149.webp'
desired.chapter = 'Miko Iino and Yu Ishigami’s Final Chapter, Part 2'
desired.url = 'https://guya.moe/read/manga/Kaguya-Wants-To-Be-Confessed-To/'

return searchValid(results, desired, 'kaguya-sama: love is war')
Expand Down

0 comments on commit 4c91293

Please sign in to comment.