Skip to content
This repository has been archived by the owner on Oct 3, 2024. It is now read-only.

Commit

Permalink
Deploying to gh-pages from @ 44ef963 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
WaltersAsh committed Aug 13, 2023
1 parent 7b21b1b commit 93c548a
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 37 deletions.
34 changes: 16 additions & 18 deletions dev/Koushoku/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ exports.Koushoku = exports.KoushokuInfo = void 0;
const types_1 = require("@paperback/types");
const KoushokuParser_1 = require("./KoushokuParser");
exports.KoushokuInfo = {
version: '1.0.3',
version: '1.0.4',
name: 'Koushoku',
icon: 'icon.png',
author: 'WaltersAsh',
Expand Down Expand Up @@ -1664,6 +1664,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.testImageLink = exports.isLastPage = exports.getPages = exports.getGalleryData = exports.getAlbums = exports.getTags = exports.DOMAIN = void 0;
const entities = require("entities");
exports.DOMAIN = 'https://ksk.moe';
const REGEX_PAGE = /[0-9]+(.(jpg|png))/g;
async function getTags(requestManager, cheerio) {
const request = App.createRequest({
url: `${exports.DOMAIN}/tags/page/1`,
Expand Down Expand Up @@ -1765,26 +1766,23 @@ async function getPages(id, requestManager, cheerio) {
const length = parseInt($('span:contains("Pages")').text().split(' ')[0] ?? '');
const urlPieces = $('img').first().attr('src')?.split('/') ?? '';
const suffix = urlPieces[urlPieces?.length - 1] ?? '';
const pagesRequest = App.createRequest({
url: `${exports.DOMAIN}/read${id.slice(7)}/1`,
method: 'GET'
});
const pagesData = await requestManager.schedule(pagesRequest, 1);
const $$ = cheerio.load(pagesData.data, { xmlMode: true });
// Image format is not guranteed
// const imageFormat = suffix.slice(suffix.length, 3) ? 'jpg' : 'png';
const pageNumFormat = suffix.split('.')[0]?.length;
if (pageNumFormat === 2) {
for (let i = 1; i < length + 1; i++) {
// Pages start from 01, 02, 03..09, 10, 11...
const imageLink = i < 10 ? `${exports.DOMAIN}/resampled/${imageId}/0${i}.png` : `${exports.DOMAIN}/resampled/${imageId}/${i}.png`;
const testedImageLink = await testImageLink(imageLink, requestManager);
pages.push(testedImageLink);
}
}
else if (pageNumFormat === 3) {
for (let i = 1; i < length + 1; i++) {
// Pages start from 001, 002..010, 011..100, 101...
let imageLink = i < 10 ? `${exports.DOMAIN}/resampled/${imageId}/00${i}.png` : `${exports.DOMAIN}/resampled/${imageId}/0${i}.png`;
if (i > 99) {
imageLink = `${exports.DOMAIN}/resampled/${imageId}/${i}.png`;
}
const testedImageLink = await testImageLink(imageLink, requestManager);
pages.push(testedImageLink);
// Extract page nums from script
const pageNums = $$('script[type$=javascript]').last().toString();
const unsortedPageNumsList = pageNums.matchAll(REGEX_PAGE);
const pageNumsList = [...new Set(Array.from(unsortedPageNumsList, x => x[0]))];
if (pageNumFormat === 2 || pageNumFormat === 3) {
for (let i = 0; i < length; i++) {
const imageLink = `${exports.DOMAIN}/resampled/${imageId}/${pageNumsList[i]}`;
pages.push(imageLink);
}
}
else {
Expand Down
34 changes: 16 additions & 18 deletions dev/Koushoku/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,7 @@ exports.Koushoku = exports.KoushokuInfo = void 0;
const types_1 = require("@paperback/types");
const KoushokuParser_1 = require("./KoushokuParser");
exports.KoushokuInfo = {
version: '1.0.3',
version: '1.0.4',
name: 'Koushoku',
icon: 'icon.png',
author: 'WaltersAsh',
Expand Down Expand Up @@ -1664,6 +1664,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.testImageLink = exports.isLastPage = exports.getPages = exports.getGalleryData = exports.getAlbums = exports.getTags = exports.DOMAIN = void 0;
const entities = require("entities");
exports.DOMAIN = 'https://ksk.moe';
const REGEX_PAGE = /[0-9]+(.(jpg|png))/g;
async function getTags(requestManager, cheerio) {
const request = App.createRequest({
url: `${exports.DOMAIN}/tags/page/1`,
Expand Down Expand Up @@ -1765,26 +1766,23 @@ async function getPages(id, requestManager, cheerio) {
const length = parseInt($('span:contains("Pages")').text().split(' ')[0] ?? '');
const urlPieces = $('img').first().attr('src')?.split('/') ?? '';
const suffix = urlPieces[urlPieces?.length - 1] ?? '';
const pagesRequest = App.createRequest({
url: `${exports.DOMAIN}/read${id.slice(7)}/1`,
method: 'GET'
});
const pagesData = await requestManager.schedule(pagesRequest, 1);
const $$ = cheerio.load(pagesData.data, { xmlMode: true });
// Image format is not guranteed
// const imageFormat = suffix.slice(suffix.length, 3) ? 'jpg' : 'png';
const pageNumFormat = suffix.split('.')[0]?.length;
if (pageNumFormat === 2) {
for (let i = 1; i < length + 1; i++) {
// Pages start from 01, 02, 03..09, 10, 11...
const imageLink = i < 10 ? `${exports.DOMAIN}/resampled/${imageId}/0${i}.png` : `${exports.DOMAIN}/resampled/${imageId}/${i}.png`;
const testedImageLink = await testImageLink(imageLink, requestManager);
pages.push(testedImageLink);
}
}
else if (pageNumFormat === 3) {
for (let i = 1; i < length + 1; i++) {
// Pages start from 001, 002..010, 011..100, 101...
let imageLink = i < 10 ? `${exports.DOMAIN}/resampled/${imageId}/00${i}.png` : `${exports.DOMAIN}/resampled/${imageId}/0${i}.png`;
if (i > 99) {
imageLink = `${exports.DOMAIN}/resampled/${imageId}/${i}.png`;
}
const testedImageLink = await testImageLink(imageLink, requestManager);
pages.push(testedImageLink);
// Extract page nums from script
const pageNums = $$('script[type$=javascript]').last().toString();
const unsortedPageNumsList = pageNums.matchAll(REGEX_PAGE);
const pageNumsList = [...new Set(Array.from(unsortedPageNumsList, x => x[0]))];
if (pageNumFormat === 2 || pageNumFormat === 3) {
for (let i = 0; i < length; i++) {
const imageLink = `${exports.DOMAIN}/resampled/${imageId}/${pageNumsList[i]}`;
pages.push(imageLink);
}
}
else {
Expand Down
2 changes: 1 addition & 1 deletion dev/versioning.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"buildTime":"2023-07-25T11:42:35.295Z","sources":[{"id":"AsianToLick","name":"Asian to lick","author":"WaltersAsh","desc":"Extension to grab albums from Asian to lick","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"1.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://asiantolick.com","intents":5},{"id":"Buondua","name":"Buondua","author":"WaltersAsh","desc":"Extension to grab albums from Buon Dua","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"2.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://buondua.com","intents":5},{"id":"Kostaku","name":"Kostaku","author":"WaltersAsh","desc":"Extension to grab albums from Kostaku","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"2.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://kostaku.art","intents":5},{"id":"Koushoku","name":"Koushoku","author":"WaltersAsh","desc":"Extension to grab albums from Koushoku","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"1.0.3","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://ksk.moe","intents":5},{"id":"Xiutaku","name":"Xiutaku","author":"WaltersAsh","desc":"Extension to grab albums from Xiutaku","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"2.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://xiutaku.com","intents":5},{"id":"eHentai","name":"E-Hentai","author":"loik9081","desc":"Extension to grab galleries from E-Hentai","website":"https://github.com/loik9081","contentRating":"ADULT","version":"1.0.2","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://e-hentai.org","intents":5},{"id":"xsnvshen","name":"xsnvshen","author":"loik9081","desc":"Extension to grab galleries from xsnvshen","website":"https://github.com/loik9081","contentRating":"MATURE","version":"1.0.1","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://www.xsnvshen.com/","intents":5}],"builtWith":{"toolchain":"0.8.0-alpha.47","types":"0.8.0-alpha.47"}}
{"buildTime":"2023-08-13T04:13:35.839Z","sources":[{"id":"AsianToLick","name":"Asian to lick","author":"WaltersAsh","desc":"Extension to grab albums from Asian to lick","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"1.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://asiantolick.com","intents":5},{"id":"Buondua","name":"Buondua","author":"WaltersAsh","desc":"Extension to grab albums from Buon Dua","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"2.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://buondua.com","intents":5},{"id":"Kostaku","name":"Kostaku","author":"WaltersAsh","desc":"Extension to grab albums from Kostaku","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"2.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://kostaku.art","intents":5},{"id":"Koushoku","name":"Koushoku","author":"WaltersAsh","desc":"Extension to grab albums from Koushoku","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"1.0.4","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://ksk.moe","intents":5},{"id":"Xiutaku","name":"Xiutaku","author":"WaltersAsh","desc":"Extension to grab albums from Xiutaku","website":"https://github.com/WaltersAsh","contentRating":"ADULT","version":"2.0.0","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://xiutaku.com","intents":5},{"id":"eHentai","name":"E-Hentai","author":"loik9081","desc":"Extension to grab galleries from E-Hentai","website":"https://github.com/loik9081","contentRating":"ADULT","version":"1.0.2","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://e-hentai.org","intents":5},{"id":"xsnvshen","name":"xsnvshen","author":"loik9081","desc":"Extension to grab galleries from xsnvshen","website":"https://github.com/loik9081","contentRating":"MATURE","version":"1.0.1","icon":"icon.png","tags":[{"text":"18+","type":"danger"}],"websiteBaseURL":"https://www.xsnvshen.com/","intents":5}],"builtWith":{"toolchain":"0.8.0-alpha.47","types":"0.8.0-alpha.47"}}

0 comments on commit 93c548a

Please sign in to comment.