-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
81 changed files
with
710 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export function FromHexString(hexString: string): Uint8Array { | ||
return Uint8Array.from(hexString.match(/.{1,2}/g).map((byte) => parseInt(byte, 16))); | ||
} | ||
|
||
export function GetBytesUTF8(text: string): Uint8Array { | ||
return new TextEncoder().encode(text); | ||
}; | ||
|
||
export function Uint8ToHexString(array: Uint8Array): string { | ||
return array.reduce((result, x) => result + x.toString(16).padStart(2, '0'), ''); | ||
} | ||
|
||
export function BufferToHexString(buffer: ArrayBuffer): string { | ||
return Uint8ToHexString(new Uint8Array(buffer)); | ||
} | ||
|
||
export function GetBytesB64(b64string: string): Uint8Array { | ||
return Uint8Array.from(window.atob(b64string), c => c.charCodeAt(0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Tags } from '../Tags'; | ||
import icon from './AllHentai.webp'; | ||
import { DecoratableMangaScraper } from '../providers/MangaPlugin'; | ||
import * as Common from './decorators/Common'; | ||
import * as Grouple from './decorators/Grouple'; | ||
import { FetchWindowScript } from '../platform/FetchProvider'; | ||
|
||
@Common.MangaCSS(/^{origin}\/[^/]+$/, Grouple.queryMangaTitle) | ||
@Common.MangasMultiPageCSS(Grouple.pathMangas, Grouple.queryMangas, 0, Grouple.pageMangaOffset, 1000, Common.AnchorInfoExtractor(true)) | ||
@Common.ChaptersSinglePageJS(Grouple.chapterScript, 500) | ||
@Grouple.PagesSinglePageJS() | ||
@Grouple.ImageAjaxWithMirrors() | ||
export default class extends DecoratableMangaScraper { | ||
public constructor() { | ||
super('allhentai', `AllHentai`, 'https://20.allhen.online', Tags.Language.Russian, Tags.Media.Manga, Tags.Rating.Pornographic, Tags.Source.Aggregator, Tags.Accessibility.DomainRotation); | ||
} | ||
|
||
public override get Icon() { | ||
return icon; | ||
} | ||
|
||
public override async Initialize(): Promise<void> { | ||
this.URI.href = await FetchWindowScript(new Request(this.URI), 'window.location.origin'); | ||
console.log(`Assigned URL '${this.URI}' to ${this.Title}`); | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { TestFixture } from '../../../test/WebsitesFixture'; | ||
|
||
const config = { | ||
plugin: { | ||
id: 'allhentai', | ||
title: 'AllHentai' | ||
}, | ||
container: { | ||
url: 'https://20.allhen.online/nochiu_ona_nimfomanka', | ||
id: '/nochiu_ona_nimfomanka', | ||
title: 'Ночью она нимфоманка' | ||
}, | ||
/* Need to be logged, and chapter link change with user id anyway | ||
child: { | ||
id: '/nochiu_ona_nimfomanka/vol1/4?mtr=1', | ||
title: '1 - 1', | ||
}, | ||
entry: { | ||
index: 0, | ||
size: 155_934, | ||
type: 'image/png' | ||
}*/ | ||
}; | ||
|
||
new TestFixture(config).AssertWebsite(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,62 @@ | ||
import { Tags } from '../Tags'; | ||
import icon from './BacaManga.webp'; | ||
import { DecoratableMangaScraper } from '../providers/MangaPlugin'; | ||
import * as MangaStream from './decorators/WordPressMangaStream'; | ||
import { Chapter, DecoratableMangaScraper, type Manga } from '../providers/MangaPlugin'; | ||
import * as Common from './decorators/Common'; | ||
import { FetchHTML, FetchJSON } from '../platform/FetchProvider'; | ||
|
||
@MangaStream.MangaCSS(/^{origin}\/manga\/[^/]+\/$/) | ||
@MangaStream.MangasSinglePageCSS() | ||
@MangaStream.ChaptersSinglePageCSS() | ||
@MangaStream.PagesSinglePageJS() | ||
type APIChapters = { | ||
list_chapter_html: string | ||
} | ||
|
||
function MangaInfoExtractor(anchor: HTMLAnchorElement) { | ||
return { | ||
id: anchor.pathname, | ||
title: anchor.querySelector<HTMLDivElement>('h3.text-white').textContent.trim() | ||
}; | ||
} | ||
|
||
@Common.MangaCSS(/^{origin}\/komik\/[^/]+\/$/, 'article header h1') | ||
@Common.MangasMultiPageCSS('/daftar-komik/page/{page}/', 'div.grid div[id*="post-"] > a', 1, 1, 0, MangaInfoExtractor) | ||
@Common.PagesSinglePageCSS('div.img-landmine div#chimg-auh img') | ||
@Common.ImageAjax() | ||
export default class extends DecoratableMangaScraper { | ||
|
||
public constructor() { | ||
super('bacamanga', 'BacaManga', 'https://bacamanga.id', Tags.Media.Manga, Tags.Media.Manhua, Tags.Media.Manhwa, Tags.Language.Indonesian, Tags.Source.Aggregator); | ||
super('bacamanga', 'BacaManga', 'https://bacamanga.cc', Tags.Media.Manga, Tags.Media.Manhua, Tags.Media.Manhwa, Tags.Language.Indonesian, Tags.Source.Aggregator); | ||
} | ||
|
||
public override get Icon() { | ||
return icon; | ||
} | ||
|
||
public override async FetchChapters(manga: Manga): Promise<Chapter[]> { | ||
const mangaUrl = new URL(manga.Identifier, this.URI); | ||
let dom = await FetchHTML(new Request(mangaUrl)); | ||
const series_id = new URL(dom.querySelector<HTMLLinkElement>('link[rel="shortlink"]').href).searchParams.get('p'); | ||
const chapters = this.ExtractChapters(dom, manga, 'div#chapter-list > a'); | ||
|
||
const { list_chapter_html } = await FetchJSON<APIChapters>(new Request(new URL('/wp-admin/admin-ajax.php', this.URI), { | ||
method: 'POST', | ||
body: new URLSearchParams({ | ||
action: 'get_list_chapter', | ||
series_id | ||
}).toString(), | ||
headers: { | ||
'Content-type': 'application/x-www-form-urlencoded; charset=UTF-8', | ||
'X-Requested-With': 'XMLHttpRequest', | ||
Referer: mangaUrl.href, | ||
Origin: this.URI.origin | ||
} | ||
})); | ||
dom = new DOMParser().parseFromString(list_chapter_html, 'text/html'); | ||
return chapters.concat( this.ExtractChapters(dom, manga, 'a')); | ||
} | ||
|
||
private ExtractChapters(document: Document, manga: Manga, selector: string): Chapter[] { | ||
return [...document.querySelectorAll<HTMLAnchorElement>(selector)].map(chapter => { | ||
const title = chapter.querySelector<HTMLDivElement>('div.text-white').innerText.trim(); | ||
return new Chapter(this, manga, chapter.pathname, title); | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.