Skip to content

Commit

Permalink
Merge pull request #137 from koikiss-dev/TokyoTF
Browse files Browse the repository at this point in the history
Fixed: Paths Typescript, Add new devDependencies
  • Loading branch information
koikiss-dev authored Feb 2, 2024
2 parents 4acaac3 + 0adc3e5 commit 188502d
Show file tree
Hide file tree
Showing 19 changed files with 821 additions and 593 deletions.
506 changes: 103 additions & 403 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"api",
"multimedia",
"anime",
"doramas",
"movies",
"series",
"manga"
Expand All @@ -46,14 +47,14 @@
"express": "^4.18.2",
"helmet": "^6.0.1",
"morgan": "^1.10.0",
"puppeteer": "^19.4.1",
"ts-node": "^10.9.1",
"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 All @@ -70,6 +71,7 @@
"prettier": "^3.0.3",
"pretty": "^2.0.0",
"ts-jest": "^29.1.0",
"tsconfig-paths": "^4.2.0",
"tslib": "^2.5.0",
"typescript": "^4.9.5"
}
Expand Down
46 changes: 29 additions & 17 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,33 @@ import express from "express";
import morgan from "morgan";
import index from "./routes/app";
import providersList from "./routes/providers";
import flv from "./routes/v1/anime/animeflv/AnimeflvRoutes";
import latinhd from "./routes/v1/anime/animelatinohd/AnimeLatinoHDRoutes";
import gogoanime from "./routes/v1/anime/gogoanime/GogoAnimeRoute";
import zoro from "./routes/v1/anime/zoro/ZoroRoutes";
import monoschinos from "./routes/v1/anime/monoschinos/MonosChinosRoute";
import tioanime from './routes/v1/anime/tioanime/TioAnimeRoute'
import comick from "./routes/v1/manga/comick/ComickRoutes";

import inmanga from "./routes/v1/manga/inmanga/InmangaRoutes";
import nhentai from "./routes/v1/manga/nhentai/NhentaiRoutes"
import mangareader from "./routes/v1/manga/mangareader/MangaReaderRoutes";
import manganelo from "./routes/v1/manga/manganelo/ManganeloRoutes";
import helmet from "helmet";
import cors from 'cors'
import WcoStream from "./routes/v1/anime/wcostream/wcostreamRoutes";


/* Anime */
import flv from "@routes/anime/animeflv/AnimeflvRoutes";
import latinhd from "@routes/anime/animelatinohd/AnimeLatinoHDRoutes";
import gogoanime from "@routes/anime/gogoanime/GogoAnimeRoute";
import zoro from "@routes/anime/zoro/ZoroRoutes";
import monoschinos from "@routes/anime/monoschinos/MonosChinosRoute";
import tioanime from '@routes/anime/tioanime/TioAnimeRoute'
import WcoStream from "@routes/anime/wcostream/wcostreamRoutes";
import AnimeBlix from "@routes/anime/animeblix/AnimeBlixRoutes";

/* Manga */
import comick from "@routes/manga/comick/ComickRoutes";
import inmanga from "@routes/manga/inmanga/InmangaRoutes";
import nhentai from "@routes/manga/nhentai/NhentaiRoutes"
import mangareader from "@routes/manga/mangareader/MangaReaderRoutes";
import manganelo from "@routes/manga/manganelo/ManganeloRoutes";

const app = express();
const port = process.env.PORT || 3000;

app.use(index);
app.use(providersList);

//config
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
Expand All @@ -31,24 +38,28 @@ app.use(cors())

//routes

/*anime*/
/* anime */

app.use(flv);
app.use(latinhd);
app.use(gogoanime);
app.use(monoschinos);
app.use(zoro);
app.use(tioanime)
app.use(WcoStream);
/*anime*/
app.use(AnimeBlix);

/* anime */

/* Manga */

/*Manga*/
app.use(comick);
app.use(inmanga);
app.use(nhentai)
app.use(mangareader);
app.use(manganelo);
/*Manga*/

/* Manga */


/*error */
Expand All @@ -60,6 +71,7 @@ interface ErrorResponse {
};
}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
app.use((err, res, _next) => {
//console.log(err.statusCode);
let response: ErrorResponse;
Expand Down
31 changes: 31 additions & 0 deletions src/routes/v1/anime/animeblix/AnimeBlixRoutes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Router } from "express";
import { AnimeBlix } from "../../../../scraper/sites/anime/AnimeBlix/AnimeBlix";
const Anime = new AnimeBlix();
const router = Router();

// Filter
router.get("/anime/animeblix/filter", async (req, res) => {
const { search, type, page, year, genre } = req.query

const data = await Anime.GetAnimeByFilter(search as string, type as unknown as number, page as unknown as number, year as string, genre as string)
res.send(data)
});

// Anime Info +(Episodes list)
router.get("/anime/animeblix/name/:name", async (req, res) => {

const { name } = req.params
const data = await Anime.GetAnimeInfo(name.includes("ver-")? name.replace("ver-","") : name)
res.send(data)

});

// Episode Info +(Video Servers)
router.get("/anime/animeblix/episode/:episode", async (req, res) => {
const { episode } = req.params
const data = await Anime.GetEpisodeServers(episode)
res.send(data)

});

export default router
2 changes: 1 addition & 1 deletion src/routes/v1/anime/animelatinohd/AnimeLatinoHDRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from "express";
import { AnimeLatinoHD } from "../../../../scraper/sites/anime/animelatinohd/AnimeLatinoHD";
import { AnimeLatinoHD } from "@providers/animelatinohd/AnimeLatinoHD";
const Anime = new AnimeLatinoHD();
const router = Router();

Expand Down
12 changes: 6 additions & 6 deletions src/routes/v1/anime/wcostream/wcostreamRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Router } from "express";
import { WcoStream } from "../../../../scraper/sites/anime/wcostream/WcoStream";
import { WcoStream } from "@providers/wcostream/WcoStream";
import { RuntimeUnpacked } from "@animetypes/utils";
const Anime = new WcoStream();
const router = Router();

Expand All @@ -25,14 +26,13 @@ router.get("/anime/wcostream/filter", async (req, res) => {
res.send(data)
})

/*
Global API
*/

router.post("/runtime/unpacked", async (req,res) => {
const {base64} = req.body
const data = await Anime.RuntimeUnpacked(base64)
const {base64,unBuffer} = req.body
const data = await RuntimeUnpacked(base64,unBuffer)
return res.send(data)
})



export default router
32 changes: 32 additions & 0 deletions src/routes/v1/doramas/dramanice/DramaniceRoutes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { Router } from "express";
import { Dramanice } from "@providers/dramanice/Dramanice";
const Dorama = new Dramanice();
const router = Router();

// Filter
router.get("/anime/animelatinohd/filter", async (req, res) => {
const { search, type, page, year, genre } = req.query

const data = await Dorama.GetAnimeByFilter(search as string, type as unknown as number, page as unknown as number, year as string, genre as string)
res.send(data)
});

// Anime Info +(Episodes list)
router.get("/anime/animelatinohd/name/:name", async (req, res) => {

const { name } = req.params
const data = await Dorama.GetAnimeInfo(name)
res.send(data)

});

// Episode Info +(Video Servers)
router.get("/anime/animelatinohd/episode/:episode", async (req, res) => {
const { lang } = req.query
const { episode } = req.params
const data = await Dorama.GetEpisodeServers(episode, lang as string)
res.send(data)

});

export default router
2 changes: 1 addition & 1 deletion src/routes/v1/manga/comick/ComickRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from "express";
import { Comick } from "../../../../scraper/sites/manga/comick/Comick";
import { Comick } from "@providers/comick/Comick";
const Manga = new Comick();
const router = Router();

Expand Down
4 changes: 2 additions & 2 deletions src/routes/v1/manga/inmanga/InmangaRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Router } from "express";
import { Inmanga } from "../../../../scraper/sites/manga/inmanga/Inmanga";
import { Inmanga } from "@providers/inmanga/Inmanga";
const Manga = new Inmanga();
const router = Router();


router.get("/manga/inmanga/filter", async (req, res) => {
const { search, type, genre } = req.query;
const data = await Manga.GetMangaByFilter(search as string, type as unknown as number, genre as string[]);
const data = await Manga.GetMangaByFilter(search as string, type as unknown as number, genre as []);

res.send(data)
});
Expand Down
Loading

0 comments on commit 188502d

Please sign in to comment.