Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #146

Merged
merged 44 commits into from
Feb 9, 2024
Merged

Dev #146

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
901bf14
Remove fetch in AnimeBlix
TokyoTF Feb 6, 2024
d3c3bbc
Add Animevostfr
TokyoTF Feb 7, 2024
470a972
test
TokyoTF Feb 7, 2024
2935344
Test change
TokyoTF Feb 7, 2024
a61c35d
up
TokyoTF Feb 7, 2024
0edae7a
test up 2
TokyoTF Feb 7, 2024
2fc6532
dude wtf
TokyoTF Feb 7, 2024
725e232
i'm so
TokyoTF Feb 7, 2024
cd39a1e
check
TokyoTF Feb 7, 2024
2dc4c30
Revert "Add Animevostfr"
TokyoTF Feb 7, 2024
5c5911e
fx
TokyoTF Feb 7, 2024
e6662d0
test
TokyoTF Feb 7, 2024
50cf324
test 1
TokyoTF Feb 7, 2024
0643003
fx vercel
TokyoTF Feb 7, 2024
24a644c
ad rt
TokyoTF Feb 7, 2024
e98fba6
? y
TokyoTF Feb 7, 2024
782e6ba
test
TokyoTF Feb 7, 2024
c6689ed
test
TokyoTF Feb 7, 2024
138fa48
Remove @ path
TokyoTF Feb 7, 2024
861bdda
oh dude
TokyoTF Feb 7, 2024
0f0660c
More and more xd
TokyoTF Feb 7, 2024
f61f085
test rare
TokyoTF Feb 7, 2024
84b54a9
omg
TokyoTF Feb 7, 2024
46cfd6d
a
TokyoTF Feb 7, 2024
6a23fea
Vercel fix the fk paths ts
TokyoTF Feb 7, 2024
8b77608
Revert "Vercel fix the fk paths ts"
TokyoTF Feb 7, 2024
7a588eb
Revert "a"
TokyoTF Feb 7, 2024
29a914b
Revert "omg"
TokyoTF Feb 7, 2024
733b46d
Revert "test rare"
TokyoTF Feb 7, 2024
105ea8f
Finished: name/Animevostfr
TokyoTF Feb 7, 2024
1051a97
Finished: Episode/Animevostfr
TokyoTF Feb 8, 2024
1417e6b
Merge branch 'dev' into TokyoTF
TokyoTF Feb 8, 2024
9e6858d
Fix command start
TokyoTF Feb 8, 2024
db76b9f
min fix
TokyoTF Feb 8, 2024
88db369
rm baseURL
TokyoTF Feb 8, 2024
f5a85d6
Up tsc-alias
TokyoTF Feb 8, 2024
1c5af75
Vercel fix the paths
TokyoTF Feb 8, 2024
e631bfc
pre-commit broke my wsl github desktop
TokyoTF Feb 8, 2024
826c57c
dude what
TokyoTF Feb 8, 2024
da81b26
f vercel,windows,npm
TokyoTF Feb 9, 2024
5bddd79
Merge pull request #145 from koikiss-dev/TokyoTF
koikiss-dev Feb 9, 2024
6dbf611
Merge remote-tracking branch 'origin/main' into dev
koikiss-dev Feb 9, 2024
99c2fea
fix
koikiss-dev Feb 9, 2024
74043a0
bug with patterns
koikiss-dev Feb 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .gitbook/assets/JIMOV_logo (1).png
Binary file not shown.
Binary file removed .gitbook/assets/JIMOV_logo.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .gitbook/assets/image.png
Binary file not shown.
433 changes: 293 additions & 140 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@
"description": "API for scraping multimedia content such as anime, movies, series, and manga",
"main": "src/index.ts",
"scripts": {
"start": "ts-node src/index.ts",
"start": "node ./build/src/index.js",
"server": "nodemon src/index.ts",
"start:vercel": "node build/index.js",
"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",
"zoro": "ts-node src/scraper/sites/anime/zoro/Zoro.ts",
"heroku-postbuild": "npm run build",
"start:dev": "nodemon src/index.ts",
"test": "jest --coverage"
},
"pre-commit": [
"ts.check",
"build",
"add-build"
],
"keywords": [
"scraper",
"api",
Expand Down Expand Up @@ -47,8 +50,9 @@
"express": "^4.18.2",
"helmet": "^6.0.1",
"morgan": "^1.10.0",
"puppeteer": "^19.4.1",
"ts-alias": "^0.0.7",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.8",
"underscore": "^1.13.6",
"unpacker": "^1.0.1"
},
Expand Down
42 changes: 26 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
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 index from "../src/routes/app";
import providersList from "../src/routes/providers";
import helmet from "helmet";
import cors from 'cors'
import WcoStream from "./routes/v1/anime/wcostream/wcostreamRoutes";

/* Anime */
import flv from "../src/routes/v1/anime/animeflv/AnimeflvRoutes";
import latinhd from "../src/routes/v1/anime/animelatinohd/AnimeLatinoHDRoutes";
import gogoanime from "../src/routes/v1/anime/gogoanime/GogoAnimeRoute";
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 Animevostfr from "../src/routes/v1/anime/animevostfr/AnimevostfrRoutes";

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

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

Expand All @@ -39,7 +45,11 @@ app.use(monoschinos);
app.use(zoro);
app.use(tioanime)
app.use(WcoStream);
/*anime*/
//app.use(AnimeBlix);
app.use(Animevostfr);

/* anime */


/*Manga*/
app.use(comick);
Expand Down
32 changes: 32 additions & 0 deletions src/routes/v1/anime/animeblix/AnimeBlixRoutes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
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
31 changes: 31 additions & 0 deletions src/routes/v1/anime/animevostfr/AnimevostfrRoutes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { Router } from "express";
import { Animevostfr } from "../../../../scraper/sites/anime/animevostfr/Animevostfr";
const Anime = new Animevostfr();
const router = Router();

// Filter
router.get("/anime/animevostfr/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/animevostfr/name/:name", async (req, res) => {

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

});

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

});

export default router
1 change: 1 addition & 0 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 { RuntimeUnpacked } from "@animetypes/utils";
const Anime = new WcoStream();
const router = Router();

Expand Down
2 changes: 1 addition & 1 deletion src/routes/v1/doramas/dramanice/DramaniceRoutes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Router } from "express";
import { Dramanice } from "@providers/dramanice/Dramanice";
import { Dramanice } from "../../../../scraper/sites/doramas/dramanice/Dramanice";
const Dorama = new Dramanice();
const router = Router();

Expand Down
163 changes: 163 additions & 0 deletions src/scraper/sites/anime/AnimeBlix/AnimeBlix.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
import * as cheerio from "cheerio";
import axios from "axios";
import { Anime } from "../../../../types/anime";
import { Episode, EpisodeServer } from "../../../../types/episode";
import { AnimeSearch, ResultSearch, IResultSearch, IAnimeSearch } from "../../../../types/search";
//import { Calendar } from "@animetypes/date";

/** List of Domains
* https://vwv.animeblix.org
*
* https://animeblix.xyz
*
* https://animeblix.com
*
*/

export class AnimeBlix {
readonly url = "https://vwv.animeblix.org";
readonly api = "https://api.animelatinohd.com";

async GetAnimeInfo(anime: string): Promise<Anime> {
try {
const { data } = await axios.get(`${this.url}/animes/${anime.includes("ver-") ? anime : "ver-"+anime}`);
const $ = cheerio.load(data);

const AnimeTypes = $(".cn .info .r .u li span:contains('Tipo:')").next()
const AnimeStatus = $(".cn .info .r .u li span[class='em']").length ? $(".cn .info .r .u li span[class='em']").text() : $(".cn .info .r .u li span[class='fi']").length ? $(".cn .info .r .u li span[class='fi']").text() : $(".cn .info .r .u li span[class='es']").text()
const AnimeDate = $(".cn .info .r .u li span:contains('Fecha de emisión:')").next().text().trim().replace(" -", "").split(" ")

const Dates = AnimeDate[0] ? new Date(String(AnimeDate[0])) : null
const DateFormat = new Intl.DateTimeFormat("en", { day: "numeric", month: "numeric", year: "numeric" }).format(Dates).split("/")


const AcceptAlts = $(".cn .info .r .u").next().find("li").text().replace("Nombre original: ", "").replace("Nombre en inglés: ", "---").replace("Nombre en japones: ", "---")

let AltsSlice: number = 0

if (AcceptAlts.includes("Támbien conocido como:")) {
AltsSlice = AcceptAlts.indexOf("Támbien conocido como:")
} else if (AcceptAlts.includes("Estudio(s):")) {
AltsSlice = AcceptAlts.indexOf("Estudio(s):")
} else if (AcceptAlts.includes("Producido por:")) {
AltsSlice = AcceptAlts.indexOf("Producido por:")
} else if (AcceptAlts.includes("Licenciada por:")) {
AltsSlice = AcceptAlts.indexOf("Licenciada por:")
}

const AltNames = AcceptAlts.slice(0, AltsSlice)
const AnimeInfo: Anime = {
name: $(".cn .ti h1 strong").text(),
url: `/anime/animeblix/name/${anime}`,
synopsis: $(".cn .info .r .tx .content p").first().text(),
alt_name: [...AltNames.split("---")],
image: {
url: $(".cn .info .l .i img").attr("data-src")
},
genres: [...$(".cn .info .r .gn li").text().split(",")],
type: AnimeTypes.length ? AnimeTypes.text() == "TV" ? "Anime" : AnimeTypes.text() == "Pelicula" ? "Movie" : AnimeTypes.text() == "Ova" ? "OVA" : "Null" : "Null", //tv,pelicula,especial,ova
status: AnimeStatus,
date: AnimeDate[0] ? { year: DateFormat[2], month: DateFormat[1], day: DateFormat[0] } : null,
episodes: []
}

const ListEpisodeIndex = $(".sc .cn #l").html()
const RemoveSymbols: RegExp = /[^0-9,]+/g;
const ReplaceSymbols: RegExp = /(,)+/g;
const ListEpisode = ListEpisodeIndex.slice(ListEpisodeIndex.indexOf("var eps = "), ListEpisodeIndex.indexOf(";</") - 1).replace(RemoveSymbols, "").replace(ReplaceSymbols, ",").slice(0, ListEpisodeIndex.lastIndexOf(",", -1)).split(",")

ListEpisode.map((e) => {
const AnimeEpisode: Episode = {
name: "Episode " +e,
number: e,
image: "",
url: `/anime/animeblix/episode/${anime+"-"+e}`
}

AnimeInfo.episodes.push(AnimeEpisode);
})

return AnimeInfo;

} catch (error) {
console.log(error)
}
}
async GetEpisodeServers(episode: string): Promise<Episode> {
try {

const number = episode.substring(episode.lastIndexOf("-") + 1)
const anime = episode.substring(0, episode.lastIndexOf("-"))

const { data } = await axios.get(`${this.url}/${anime.replace("ver-","")}-${number}`);
const $ = cheerio.load(data);

const AnimeEpisodeInfo: Episode = {
name: number,
url: `/anime/animeblix/episode/${episode}`,
number: number,
image: "",
servers: []
}


$("").map((e) => {

const Server: EpisodeServer = {
name: "e.server.title",
url: "",
}

Server.url = "https://api.animelatinohd.com/stream/"
Server.name = String(e)

AnimeEpisodeInfo.servers.push(Server)
})

return AnimeEpisodeInfo;
} catch (error) {
console.log(error)
}
}

async GetAnimeByFilter(search?: string, type?: number, page?: number, year?: string, genre?: string): Promise<IResultSearch<IAnimeSearch>> {
try {
const { data } = await axios.get(`${this.api}/api/anime/list`, {
params: {
search: search,
type: type,
year: year,
genre: genre,
page: page
}
});

const animeSearchParseObj = data

const animeSearch: ResultSearch<IAnimeSearch> = {
nav: {
count: animeSearchParseObj.data.length,
current: animeSearchParseObj.current_page,
next: animeSearchParseObj.data.length < 28 ? 0 : animeSearchParseObj.current_page + 1,
hasNext: animeSearchParseObj.data.length < 28 ? false : true
},
results: []
}
animeSearchParseObj.data.map(e => {
const animeSearchData: AnimeSearch = {
name: e.name,
image: "https://www.themoviedb.org/t/p/original" + e.poster + "?&w=53&q=95",
url: `/anime/animelatinohd/name/${e.slug}`,
type: ""
}
animeSearch.results.push(animeSearchData)
})
return animeSearch;
} catch (error) {
console.log(error)
}
}

}


6 changes: 3 additions & 3 deletions src/scraper/sites/anime/animelatinohd/AnimeLatinoHD.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as cheerio from "cheerio";
import axios from "axios";
import { Anime } from "@animetypes/anime";
import { Episode, EpisodeServer } from "@animetypes/episode";
import { AnimeSearch, ResultSearch, IResultSearch, IAnimeSearch } from "@animetypes/search";
import { Anime } from "../../../../types/anime";
import { Episode, EpisodeServer } from "../../../../types/episode";
import { AnimeSearch, ResultSearch, IResultSearch, IAnimeSearch } from "../../../../types/search";

export class AnimeLatinoHD {
readonly url = "https://www.animelatinohd.com";
Expand Down
Loading
Loading