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

Commit

Permalink
Fixed ComicK
Browse files Browse the repository at this point in the history
  • Loading branch information
Eltik committed May 19, 2023
1 parent 62eac9f commit 443e65b
Show file tree
Hide file tree
Showing 17 changed files with 13 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
7 changes: 5 additions & 2 deletions dist/mapping/impl/manga/comicK.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const axios_1 = __importDefault(require("axios"));
const _1 = __importDefault(require("."));
const cloudscraper_ts_1 = __importDefault(require("cloudscraper-ts"));
class ComicK extends _1.default {
rateLimit = 250;
id = "comick";
url = "https://comick.app";
formats = ["MANGA" /* Format.MANGA */, "ONE_SHOT" /* Format.ONE_SHOT */];
api = "https://api.comick.app";
async search(query) {
const data = (await (0, axios_1.default)(`${this.api}/v1.0/search?q=${encodeURIComponent(query)}&limit=25&page=1`)).data;
const data = JSON.parse(await (0, cloudscraper_ts_1.default)({
uri: `${this.api}/v1.0/search?q=${encodeURIComponent(query)}&limit=25&page=1`,
method: "GET",
}));
const results = [];
data.map((result) => {
let cover = result.md_covers ? result.md_covers[0] : null;
Expand Down
2 changes: 1 addition & 1 deletion dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/mapping/impl/manga/comicK.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";
import MangaProvider from ".";
import { Format, Result } from "../..";
import request from "cloudscraper-ts";

export default class ComicK extends MangaProvider {
override rateLimit = 250;
Expand All @@ -12,7 +12,12 @@ export default class ComicK extends MangaProvider {
private api = "https://api.comick.app";

override async search(query: string): Promise<Result[] | undefined> {
const data: SearchResult[] = (await axios(`${this.api}/v1.0/search?q=${encodeURIComponent(query)}&limit=25&page=1`)).data;
const data: SearchResult[] = JSON.parse(
await request({
uri: `${this.api}/v1.0/search?q=${encodeURIComponent(query)}&limit=25&page=1`,
method: "GET",
})
);

const results: Result[] = [];

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 443e65b

Please sign in to comment.