Skip to content

Commit

Permalink
Merge pull request #149 from koikiss-dev/TokyoTF
Browse files Browse the repository at this point in the history
Fix: Comick provider, Add: status inmanga
  • Loading branch information
koikiss-dev authored Feb 15, 2024
2 parents 572744d + 33a576d commit 10c9802
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 427 deletions.
484 changes: 83 additions & 401 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"format": "prettier --ignore-path .gitignore --write \"**/*.+(js|ts|json)\"",
"linter": "npx eslint src/scraper/* src/routes/*",
"linter:win": "npx eslint src/scraper/** src/routes/**",
"build": "tsc",
"build": "tsc && tsc-alias",
"start:dev": "nodemon src/index.ts",
"test": "jest --coverage"
},
Expand Down Expand Up @@ -50,15 +50,16 @@
"express": "^4.18.2",
"helmet": "^6.0.1",
"morgan": "^1.10.0",
"ts-alias": "^0.0.7",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.8",
"tsconfig-paths": "^4.2.0",
"underscore": "^1.13.6",
"unpacker": "^1.0.1"
},
"devDependencies": {
"@commitlint/config-conventional": "^17.4.4",
"@tsconfig/recommended": "^1.0.2",
"@types/cors": "^2.8.17",
"@types/express": "^4.17.17",
"@types/jest": "^29.5.0",
"@types/morgan": "^1.9.4",
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import zoro from "../src/routes/v1/anime/zoro/ZoroRoutes";
import monoschinos from "../src/routes/v1/anime/monoschinos/MonosChinosRoute";
import tioanime from '../src/routes/v1/anime/tioanime/TioAnimeRoute'
import WcoStream from "../src/routes/v1/anime/wcostream/wcostreamRoutes";
//import AnimeBlix from "../src/routes/v1/anime/animeblix/AnimeBlixRoutes";
import AnimeBlix from "../src/routes/v1/anime/animeblix/AnimeBlixRoutes";
import Animevostfr from "../src/routes/v1/anime/animevostfr/AnimevostfrRoutes";

/* Manga */
Expand Down Expand Up @@ -45,7 +45,7 @@ app.use(monoschinos);
app.use(zoro);
app.use(tioanime)
app.use(WcoStream);
//app.use(AnimeBlix);
app.use(AnimeBlix);
app.use(Animevostfr);

/* anime */
Expand Down
2 changes: 1 addition & 1 deletion src/routes/v1/anime/animeblix/AnimeBlixRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from "express";
import { AnimeBlix } from "../../../../scraper/sites/anime/AnimeBlix/AnimeBlix";
import { AnimeBlix } from "../../../../scraper/sites/anime/animeBlixs/AnimeBlix";

const Anime = new AnimeBlix();
const router = Router();
Expand Down
38 changes: 27 additions & 11 deletions src/scraper/sites/manga/comick/Comick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,34 @@ import { IResultSearch } from "../../../../types/search";
axios.defaults.withCredentials = true
axios.defaults.headers.common["User-Agent"] = "Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG SM-G532G) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/12.0 Chrome/79.0.3945.136 Mobile Safari/537.36";

/** List of Domains
* https://comick.app
*
* https://api.comick.app
*
* https://api.comick.io
*
* https://comick.cc
*
* https://meo.comick.pictures
*/


export class Comick {
readonly url = "https://comick.app";
readonly api = "https://api.comick.app"
readonly api = "https://api.comick.io"

async GetMangaByFilter(search?: string, type?: number, year?: string, genre?: string) {
try {
const { data } = await axios.get(`${this.api}/v1.0/search`, {
params: {
q: search,
type: type,
status: type,
year: year,
genre: genre,
}
});

const ResultList: IResultSearch<IMangaResult> = {
results: []
}
Expand All @@ -46,18 +59,21 @@ export class Comick {
async GetMangaInfo(manga: string, lang: string): Promise<Manga> {
try {
const { data } = await axios.get(`${this.api}/comic/${manga}`);
const currentLang = lang ? `?lang=${lang}` : ""
// build static
///_next/data/S1XqseNRmzozm3TaUH1lU/comic/00-solo-leveling.json
const currentLang = lang ? `?lang=${lang}` : `?lang=en`
const mangaInfoParseObj = data

const dataApi = await axios.get(`${this.api}/comic/${mangaInfoParseObj.comic.hid}/chapters${currentLang}`);

const MangaInfo: Manga = {
id: mangaInfoParseObj.comic.id,
title: mangaInfoParseObj.comic.title,
altTitles: mangaInfoParseObj.comic.md_titles.map((e: { title: string; }) => e.title),
url: `/manga/comick/title/${mangaInfoParseObj.comic.slug}`,
description: mangaInfoParseObj.comic.desc,
isNSFW: mangaInfoParseObj.comic.hentai,
langlist: mangaInfoParseObj.langList,
status: mangaInfoParseObj.comic.status == "1" ? "ongoing" : "completed",
authors: mangaInfoParseObj.authors.map((e: { name: string; }) => e.name),
genres: mangaInfoParseObj.comic.md_comic_md_genres.map((e: { md_genres: {name:string;} }) => e.md_genres.name),
Expand Down Expand Up @@ -116,11 +132,11 @@ export class Comick {
if (JSON.parse($("#__NEXT_DATA__").html()).isFallback == false) {
const mangaChapterInfoParseObj = JSON.parse($("#__NEXT_DATA__").html()).props.pageProps
const mindate = new Date(mangaChapterInfoParseObj.chapter.created_at);

const MangaChapterInfoChapter: MangaChapter = {
id: mangaChapterInfoParseObj.chapter.id,
title: mangaChapterInfoParseObj.chapter.title,
url: `/manga/comick/chapter/`,
title: mangaChapterInfoParseObj.seoTitle,
url: `/manga/comick/chapter/${manga}`,
number: mangaChapterInfoParseObj.chapter.chap,
images: mangaChapterInfoParseObj.chapter.md_images.map((e: { w: number; h: number; name: string; b2key: string; }) => {
return {
Expand All @@ -145,11 +161,11 @@ export class Comick {
const dataBuild = await axios.get(`${this.url}/_next/data/${buildid}/comic/${currentUrl}`);

const mindate = new Date(dataBuild.data.pageProps.chapter.created_at);

const MangaChapterInfoChapter: MangaChapter = {
id: dataBuild.data.pageProps.chapter.id,
title: dataBuild.data.pageProps.chapter.title,
url: `/manga/comick/chapter/`,
title: dataBuild.data.pageProps.seoTitle,
url: `/manga/comick/chapter/${manga}`,
number: dataBuild.data.pageProps.chapter.chap,
images: dataBuild.data.pageProps.chapter.md_images.map((s: { w: number; h: number; name: string; b2key: string; }) => {
return {
Expand Down
3 changes: 0 additions & 3 deletions src/scraper/sites/manga/inmanga/Inmanga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,8 @@ export class Inmanga {
async GetMangaInfo(manga: string,cid: string): Promise<Manga> {
try {
const dataPost = await axios.get(`${this.url}/ver/manga/${manga}/${cid}`);

console.log(dataPost)
const $_ = cheerio.load(dataPost.data);


const MangaInfo: Manga = {
id: cid,
title: $_("div.col-md-3.col-sm-4 div.panel-heading.visible-xs").text(),
Expand Down
6 changes: 6 additions & 0 deletions src/types/manga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ export interface IManga {
genres?: string[];
/** A list of the characters that are part of the history of manga */
characters?: string[];

/** list of available languages */
langlist?: string[];

/**
* Contains a total list of chapters that make up the manga.
* The 'volumes' property indicates the rank in the list of chapters
Expand Down Expand Up @@ -157,6 +161,8 @@ export class Manga implements IManga {
/** @inheritdoc */
authors?: string[];
/** @inheritdoc */
langlist?: string[];
/** @inheritdoc */
genres?: string[];
/** @inheritdoc */
characters?: string[];
Expand Down
18 changes: 11 additions & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"extends": "@tsconfig/recommended/tsconfig.json",
"ts-node": {
"require": ["tsconfig-paths/register"]
},
"compilerOptions": {
"target": "es6",
"module": "commonjs",
Expand All @@ -20,24 +23,25 @@
"noImplicitThis": false,
"strictNullChecks": false,
"outDir": "./build",
"baseUrl": "./src",
"paths": {
"@animetypes/*": [
"./src/types/*",
"./types/*",
],
"@providers/*":[
"./src/scraper/sites/anime/*",
"./src/scraper/sites/manga/*",
"./src/scraper/sites/doramas/*"
"./scraper/sites/anime/*",
"./scraper/sites/manga/*",
"./scraper/sites/doramas/*"

],
"@routes/manga/*": [
"./src/routes/v1/manga/*"
"./routes/v1/manga/*"
],
"@routes/anime/*": [
"./src/routes/v1/anime/*"
"./routes/v1/anime/*"
],
"@routes/doramas/*": [
"./src/routes/v1/doramas/*"
"./routes/v1/doramas/*"
],
}
},
Expand Down

0 comments on commit 10c9802

Please sign in to comment.