style: prettier format changes
This commit is contained in:
+3
-17
@@ -1,35 +1,21 @@
|
||||
# [2.12.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.11.3...v2.12.0) (2025-04-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **getNextEpisodeSchedule:** add `/anime/:animeId/next-episode-schedule` endpoint ([f5cd341](https://github.com/ghoshRitesh12/aniwatch-api/commit/f5cd3415d8134da1ab1e3b3f8f9be6b5212aa353))
|
||||
|
||||
|
||||
- **getNextEpisodeSchedule:** add `/anime/:animeId/next-episode-schedule` endpoint ([f5cd341](https://github.com/ghoshRitesh12/aniwatch-api/commit/f5cd3415d8134da1ab1e3b3f8f9be6b5212aa353))
|
||||
|
||||
## [2.11.3](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.11.2...v2.11.3) (2025-03-20)
|
||||
|
||||
|
||||
|
||||
## [2.11.2](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.11.1...v2.11.2) (2025-03-15)
|
||||
|
||||
|
||||
|
||||
## [2.11.1](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.11.0...v2.11.1) (2025-01-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **ts build error:** fixed ts build error due to conflicting types ([cb5a467](https://github.com/ghoshRitesh12/aniwatch-api/commit/cb5a4672a8c3b0729bbb4522a3af252f7b336b97))
|
||||
|
||||
|
||||
- **ts build error:** fixed ts build error due to conflicting types ([cb5a467](https://github.com/ghoshRitesh12/aniwatch-api/commit/cb5a4672a8c3b0729bbb4522a3af252f7b336b97))
|
||||
|
||||
# [2.11.0](https://github.com/ghoshRitesh12/aniwatch-api/compare/v2.10.0...v2.11.0) (2024-12-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **`/qtip`:** add new `/qtip` endpoint ([f0acd89](https://github.com/ghoshRitesh12/aniwatch-api/commit/f0acd89d87e5e62c12e20a95225ca9261fefe411))
|
||||
|
||||
|
||||
|
||||
- **`/qtip`:** add new `/qtip` endpoint ([f0acd89](https://github.com/ghoshRitesh12/aniwatch-api/commit/f0acd89d87e5e62c12e20a95225ca9261fefe411))
|
||||
|
||||
+17
-17
@@ -8,8 +8,8 @@ Thank you for your interest in contributing to aniwatch-api. We appreciate whate
|
||||
- [Ground Rules & Expectations](#ground-rules--expectations)
|
||||
- [How To Contribute](#how-to-contribute)
|
||||
- [Prerequisites](#prerequisites)
|
||||
- [Clone the repository](#clone-the-repository)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Clone the repository](#clone-the-repository)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Commit Messages](#commit-messages)
|
||||
|
||||
## Types of contributions we are looking for
|
||||
@@ -42,10 +42,10 @@ To contribute to this project, you must know the following:
|
||||
- [NodeJS](https://nodejs.org/)
|
||||
- [TypeScript](https://www.typescriptlang.org/)
|
||||
- Web Scraping
|
||||
- [Cheerio](https://cheerio.js.org/)
|
||||
- [Axios](https://axios-http.com/docs/intro)
|
||||
- [CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
|
||||
- [Browser Dev Tools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/What_are_browser_developer_tools)
|
||||
- [Cheerio](https://cheerio.js.org/)
|
||||
- [Axios](https://axios-http.com/docs/intro)
|
||||
- [CSS Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors)
|
||||
- [Browser Dev Tools](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Tools_and_setup/What_are_browser_developer_tools)
|
||||
|
||||
### Clone the repository
|
||||
|
||||
@@ -58,9 +58,9 @@ git clone https://github.com/<your_username>/aniwatch-api
|
||||
|
||||
3. Creating a new branch <br/>
|
||||
Replace \<new-branch-name> with any of the following naming conventions: <br/>
|
||||
- `feature/<branch-name>` - for adding new features
|
||||
- `bug/<branch-name>` - for fixing known bugs
|
||||
- `misc/<branch-name>` - for anything other than bug or features
|
||||
- `feature/<branch-name>` - for adding new features
|
||||
- `bug/<branch-name>` - for fixing known bugs
|
||||
- `misc/<branch-name>` - for anything other than bug or features
|
||||
|
||||
```bash
|
||||
git checkout -b <new-branch-name>
|
||||
@@ -70,14 +70,14 @@ git checkout -b <new-branch-name>
|
||||
|
||||
- `src` directory contains all the source code required for this project
|
||||
|
||||
- `controllers` directory contains all the controller logic
|
||||
- `types` directory contains all types & interfaces used for this project
|
||||
- `parsers` directory contains all the parsing aka scraping logic
|
||||
- `routes` directory contains all the routers
|
||||
- `utils` directory contains handy utility methods and properties
|
||||
- `config` directory contains api configuration related files
|
||||
- `extractors` directory contains anime streaming url extractor files
|
||||
<br/><br/>
|
||||
- `controllers` directory contains all the controller logic
|
||||
- `types` directory contains all types & interfaces used for this project
|
||||
- `parsers` directory contains all the parsing aka scraping logic
|
||||
- `routes` directory contains all the routers
|
||||
- `utils` directory contains handy utility methods and properties
|
||||
- `config` directory contains api configuration related files
|
||||
- `extractors` directory contains anime streaming url extractor files
|
||||
<br/><br/>
|
||||
|
||||
- `test` directory contains all the tests that needs to be evaluated
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
# <p align="center">Aniwatch API</p>
|
||||
|
||||
<div align="center">
|
||||
A free RESTful API serving anime information from <a href="https://hianime.to" target="_blank">hianime.to</a>
|
||||
A free RESTful API serving anime information from <a href="https://hianimez.to" target="_blank">hianimez.to</a>
|
||||
|
||||
<br/>
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
> [!IMPORTANT]
|
||||
>
|
||||
> 1. [https://api-aniwatch.onrender.com](https://api-aniwatch.onrender.com/) is only meant to demo the API and has rate-limiting enabled to minimize bandwidth consumption. It is recommended to deploy your own instance for personal use by customizing the API as you need it to be.
|
||||
> 2. This API is just an unofficial API for [hianime.to](https://hianime.to) and is in no other way officially related to the same.
|
||||
> 2. This API is just an unofficial API for [hianimez.to](https://hianimez.to) and is in no other way officially related to the same.
|
||||
> 3. The content that this API provides is not mine, nor is it hosted by me. These belong to their respective owners. This API just demonstrates how to build an API that scrapes websites and uses their content.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
+226
-225
@@ -2,276 +2,277 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Aniwatch API</title>
|
||||
<meta name="content-language" content="en">
|
||||
<!-- <meta http-equiv="Content-Security-Policy"
|
||||
<meta charset="utf-8">
|
||||
<title>Aniwatch API</title>
|
||||
<meta name="content-language" content="en">
|
||||
<!-- <meta http-equiv="Content-Security-Policy"
|
||||
content="default-src 'self' https://api-aniwatch.onrender.com; style-src 'unsafe-inline'; img-src 'self' https://raw.githubusercontent.com https://img.shields.io https://contrib.rocks"> -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Aniwatch API">
|
||||
<meta name="theme-color" content="#d5b3ff">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<link rel="canonical" href="https://api-aniwatch.onrender.com">
|
||||
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
|
||||
<meta property="og:image"
|
||||
content="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png">
|
||||
<meta property="og:url" content="https://api-aniwatch.onrender.com">
|
||||
<meta property="og:image:width" content="500">
|
||||
<meta property="og:image:height" content="500">
|
||||
<meta property="og:site_name" content="aniwatch">
|
||||
<meta property="og:type" content="website">
|
||||
<meta name="twitter:card" content="summary_image">
|
||||
<meta name="twitter:site" content="@aniwatch-api">
|
||||
<meta name="twitter:title" content="Aniwatch API">
|
||||
<meta name="twitter:description" content="Node.js API for obtaining anime information from hianime.to">
|
||||
<meta name="twitter:image:src"
|
||||
content="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png">
|
||||
<meta name="keywords" content="hianime api scraper anime aniwatch node express typescript">
|
||||
<meta property="og:title" content="Aniwatch API">
|
||||
<meta name="description" content="Node.js API for obtaining anime information from hianime.to">
|
||||
<meta property="og:description" content="Node.js API for obtaining anime information from hianime.to">
|
||||
<link rel="shortcut icon"
|
||||
href="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="title" content="Aniwatch API">
|
||||
<meta name="theme-color" content="#d5b3ff">
|
||||
<meta name="color-scheme" content="dark">
|
||||
<link rel="canonical" href="https://api-aniwatch.onrender.com">
|
||||
<meta name="robots" content="index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1">
|
||||
<meta property="og:image"
|
||||
content="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png">
|
||||
<meta property="og:url" content="https://api-aniwatch.onrender.com">
|
||||
<meta property="og:image:width" content="500">
|
||||
<meta property="og:image:height" content="500">
|
||||
<meta property="og:site_name" content="aniwatch">
|
||||
<meta property="og:type" content="website">
|
||||
<meta name="twitter:card" content="summary_image">
|
||||
<meta name="twitter:site" content="@aniwatch-api">
|
||||
<meta name="twitter:title" content="Aniwatch API">
|
||||
<meta name="twitter:description" content="Node.js API for obtaining anime information from hianimez.to">
|
||||
<meta name="twitter:image:src"
|
||||
content="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png">
|
||||
<meta name="keywords" content="hianime api scraper anime aniwatch node express typescript">
|
||||
<meta property="og:title" content="Aniwatch API">
|
||||
<meta name="description" content="Node.js API for obtaining anime information from hianimez.to">
|
||||
<meta property="og:description" content="Node.js API for obtaining anime information from hianimez.to">
|
||||
<link rel="shortcut icon"
|
||||
href="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png">
|
||||
|
||||
<style>
|
||||
* {
|
||||
--accent: #d5b3ff;
|
||||
box-sizing: border-box;
|
||||
font-family: sans-serif;
|
||||
transition:
|
||||
0.15s ease scale,
|
||||
0.15s ease width,
|
||||
0.15s ease height,
|
||||
0.15s ease gap;
|
||||
}
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: sans-serif;
|
||||
transition:
|
||||
0.15s ease scale,
|
||||
0.15s ease width,
|
||||
0.15s ease height,
|
||||
0.15s ease gap;
|
||||
}
|
||||
|
||||
html {
|
||||
color-scheme: dark;
|
||||
height: 100%;
|
||||
}
|
||||
html {
|
||||
--accent: #d5b3ff;
|
||||
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-family: sans-serif;
|
||||
background-color: #151518;
|
||||
padding: 0rem 1rem 0 1rem;
|
||||
min-height: 98vh;
|
||||
}
|
||||
height: 100%;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
section {
|
||||
margin-block: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
}
|
||||
body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
font-family: sans-serif;
|
||||
background-color: #151518;
|
||||
padding: 0rem 1rem 0 1rem;
|
||||
min-height: 98vh;
|
||||
}
|
||||
|
||||
section::before {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
section {
|
||||
margin-block: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: start;
|
||||
position: relative;
|
||||
isolation: isolate;
|
||||
}
|
||||
|
||||
position: absolute;
|
||||
inset: -2rem 0 0 0;
|
||||
isolation: isolate;
|
||||
z-index: -1;
|
||||
section::before {
|
||||
content: "";
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
background-color: #7300ff;
|
||||
opacity: .35;
|
||||
border-radius: 50%;
|
||||
filter: blur(12rem);
|
||||
}
|
||||
position: absolute;
|
||||
inset: -2rem 0 0 0;
|
||||
isolation: isolate;
|
||||
z-index: -1;
|
||||
|
||||
@media (min-width: 640px) {
|
||||
section::before {
|
||||
background-color: #7300ffbb;
|
||||
opacity: .3;
|
||||
}
|
||||
}
|
||||
background-color: #7300ff;
|
||||
opacity: .35;
|
||||
border-radius: 50%;
|
||||
filter: blur(12rem);
|
||||
}
|
||||
|
||||
.overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
@media (min-width: 640px) {
|
||||
section::before {
|
||||
background-color: #7300ffbb;
|
||||
opacity: .3;
|
||||
}
|
||||
}
|
||||
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
isolation: isolate;
|
||||
z-index: -1;
|
||||
.overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
isolation: isolate;
|
||||
z-index: -1;
|
||||
|
||||
.overlay .child {
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
opacity: .4;
|
||||
filter: blur(5rem);
|
||||
background-image: url(https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/wano_kuni.png);
|
||||
}
|
||||
.overlay .child {
|
||||
background-position: center center;
|
||||
background-size: cover;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.overlay .child {
|
||||
opacity: .35;
|
||||
filter: blur(8rem);
|
||||
}
|
||||
}
|
||||
opacity: .4;
|
||||
filter: blur(5rem);
|
||||
background-image: url(https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/wano_kuni.png);
|
||||
}
|
||||
|
||||
.overlay::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
@media (min-width: 640px) {
|
||||
.overlay .child {
|
||||
opacity: .35;
|
||||
filter: blur(8rem);
|
||||
}
|
||||
}
|
||||
|
||||
background: url("https://hianime.to/images/live-thumb.png") repeat;
|
||||
}
|
||||
.overlay::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 2;
|
||||
|
||||
h2 {
|
||||
color: var(--accent);
|
||||
margin-top: 0;
|
||||
font-size: 1.65rem;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
text-wrap: balance;
|
||||
}
|
||||
background: url("https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/dot.png") repeat;
|
||||
}
|
||||
|
||||
a {
|
||||
line-height: 1.3;
|
||||
text-wrap: balance;
|
||||
color: var(--accent);
|
||||
}
|
||||
h2 {
|
||||
color: var(--accent);
|
||||
margin-top: 0;
|
||||
font-size: 1.65rem;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
img {
|
||||
object-fit: cover;
|
||||
max-width: 100%;
|
||||
font-size: .9rem;
|
||||
}
|
||||
a {
|
||||
line-height: 1.3;
|
||||
text-wrap: balance;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
#anime_girl {
|
||||
width: 100%;
|
||||
max-width: 10rem;
|
||||
}
|
||||
img {
|
||||
object-fit: cover;
|
||||
max-width: 100%;
|
||||
font-size: .9rem;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
#anime_girl {
|
||||
max-width: 12rem;
|
||||
}
|
||||
}
|
||||
#anime_girl {
|
||||
width: 100%;
|
||||
max-width: 10rem;
|
||||
}
|
||||
|
||||
.img-wrapper {
|
||||
aspect-ratio: 1/1;
|
||||
max-width: 12rem;
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
width: fit-content;
|
||||
margin: 1rem auto 1.5rem auto;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
#anime_girl {
|
||||
max-width: 12rem;
|
||||
}
|
||||
}
|
||||
|
||||
.api-stats-container {
|
||||
display: flex;
|
||||
gap: .2rem .5rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.img-wrapper {
|
||||
aspect-ratio: 1/1;
|
||||
max-width: 12rem;
|
||||
border-radius: 1rem;
|
||||
overflow: hidden;
|
||||
width: fit-content;
|
||||
margin: 1rem auto 1.5rem auto;
|
||||
}
|
||||
|
||||
.api-stats-container a {
|
||||
flex-shrink: 0;
|
||||
user-select: none;
|
||||
}
|
||||
.api-stats-container {
|
||||
display: flex;
|
||||
gap: .2rem .5rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.contributors {
|
||||
margin-top: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
.api-stats-container a {
|
||||
flex-shrink: 0;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.contributors {
|
||||
margin-top: 1rem;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<!--
|
||||
IMPORTANT:
|
||||
1. The hosted version of this API is only meant to demo the API and would have rate-limiting enabled to minimise bandwidth
|
||||
consumption. It is recommended to deploy your own instance for personal use by customizing the API as you need it to be.
|
||||
2. This API is just an unofficial API for hianime.to and is in no other way officially related to the same.
|
||||
2. This API is just an unofficial API for hianimez.to and is in no other way officially related to the same.
|
||||
3. The content that this API provides is not mine, nor is it hosted by me. These belong to their respective owners. This
|
||||
API just demonstrates how to build an API that scrapes websites and uses their content.
|
||||
-->
|
||||
|
||||
<body>
|
||||
<span class="overlay">
|
||||
<span class="child"></span>
|
||||
</span>
|
||||
<span class="overlay">
|
||||
<span class="child"></span>
|
||||
</span>
|
||||
|
||||
<section>
|
||||
<h2>
|
||||
Welcome to the unofficial
|
||||
<a href="https://hianime.to/home" style="text-underline-offset: 3px;">hianime.to</a>
|
||||
API
|
||||
<span style="-webkit-text-fill-color: var(--accent)">⚔️</span>
|
||||
</h2>
|
||||
<section>
|
||||
<h2>
|
||||
Welcome to the unofficial
|
||||
<a href="https://hianimez.to/home" style="text-underline-offset: 3px;">hianimez.to</a>
|
||||
API
|
||||
<span style="-webkit-text-fill-color: var(--accent)">⚔️</span>
|
||||
</h2>
|
||||
|
||||
<div class="api-stats-container">
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/ghoshRitesh12/aniwatch-api?style=social" alt="Stars"
|
||||
decoding="async">
|
||||
</a>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/network/members">
|
||||
<img src="https://img.shields.io/github/forks/ghoshRitesh12/aniwatch-api?style=social" alt="Forks"
|
||||
decoding="async">
|
||||
</a>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/issues?q=is%3Aissue+is%3Aopen+">
|
||||
<img src="https://img.shields.io/github/issues/ghoshRitesh12/aniwatch-api?style=social&logo=github" alt="Issues"
|
||||
decoding="async">
|
||||
</a>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/releases/latest">
|
||||
<img
|
||||
src="https://img.shields.io/github/v/release/ghoshRitesh12/aniwatch-api?display_name=release&style=social&logo=github"
|
||||
alt="Version" decoding="async">
|
||||
</a>
|
||||
</div>
|
||||
<div class="api-stats-container">
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/ghoshRitesh12/aniwatch-api?style=social" alt="Stars"
|
||||
decoding="async">
|
||||
</a>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/network/members">
|
||||
<img src="https://img.shields.io/github/forks/ghoshRitesh12/aniwatch-api?style=social" alt="Forks"
|
||||
decoding="async">
|
||||
</a>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/issues?q=is%3Aissue+is%3Aopen+">
|
||||
<img src="https://img.shields.io/github/issues/ghoshRitesh12/aniwatch-api?style=social&logo=github"
|
||||
alt="Issues" decoding="async">
|
||||
</a>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/releases/latest">
|
||||
<img src="https://img.shields.io/github/v/release/ghoshRitesh12/aniwatch-api?display_name=release&style=social&logo=github"
|
||||
alt="Version" decoding="async">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;">
|
||||
<div class="img-wrapper">
|
||||
<img draggable="false" id="anime_girl"
|
||||
src="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png"
|
||||
alt="kawai_anime_girl" decoding="async" fetchpriority="high" style="user-select: none;" />
|
||||
</div>
|
||||
<div style="text-align: center;">
|
||||
<div class="img-wrapper">
|
||||
<img draggable="false" id="anime_girl"
|
||||
src="https://raw.githubusercontent.com/ghoshRitesh12/aniwatch-api/refs/heads/main/public/img/hianime_v2.png"
|
||||
alt="kawai_anime_girl" decoding="async" fetchpriority="high" style="user-select: none;" />
|
||||
</div>
|
||||
|
||||
<div style="display: flex; align-items: center; gap: .5rem; text-underline-offset: 3px;">
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/releases/latest" rel="noopener noreferer">
|
||||
Checkout latest changelogs
|
||||
</a>
|
||||
<div style="display: flex; align-items: center; gap: .5rem; text-underline-offset: 3px;">
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/releases/latest" rel="noopener noreferer">
|
||||
Checkout latest changelogs
|
||||
</a>
|
||||
|
||||
<span style="font-size: .9rem;">•</span>
|
||||
<span style="font-size: .9rem;">•</span>
|
||||
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api#documentation" rel="noopener noreferer">
|
||||
Visit docs for more information
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api#documentation" rel="noopener noreferer">
|
||||
Visit docs for more information
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="contributors">
|
||||
<p style="text-wrap: balance; line-height: 1.2;">Thanks to the following people for keeping this
|
||||
project alive and
|
||||
relevant.</p>
|
||||
<div class="contributors">
|
||||
<p style="text-wrap: balance; line-height: 1.2;">Thanks to the following people for keeping this
|
||||
project alive and
|
||||
relevant.</p>
|
||||
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/graphs/contributors"
|
||||
style="display: block; margin-bottom: 1rem; user-select: none;">
|
||||
<img src="https://contrib.rocks/image?repo=ghoshRitesh12/aniwatch-api" alt="Contributors" decoding="async">
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
<a href="https://github.com/ghoshRitesh12/aniwatch-api/graphs/contributors"
|
||||
style="display: block; margin-bottom: 1rem; user-select: none;">
|
||||
<img src="https://contrib.rocks/image?repo=ghoshRitesh12/aniwatch-api" alt="Contributors"
|
||||
decoding="async">
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,8 +1,8 @@
|
||||
type CacheVariables = {
|
||||
CACHE_CONFIG: {
|
||||
key: string;
|
||||
duration: number;
|
||||
};
|
||||
CACHE_CONFIG: {
|
||||
key: string;
|
||||
duration: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type AniwatchAPIVariables = {} & CacheVariables;
|
||||
export type AniwatchAPIVariables = CacheVariables & {};
|
||||
|
||||
@@ -5,11 +5,11 @@ const animeId = "steinsgate-3";
|
||||
|
||||
// npx vitest run animeAboutInfo.test.ts
|
||||
test(`GET /api/v2/hianime/anime/${animeId}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getInfo(animeId);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getInfo(animeId);
|
||||
|
||||
expect(data.anime.info.name).not.toEqual(null);
|
||||
expect(data.recommendedAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(Object.keys(data.anime.moreInfo)).not.toEqual([]);
|
||||
expect(data.anime.info.name).not.toEqual(null);
|
||||
expect(data.recommendedAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(Object.keys(data.anime.moreInfo)).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,12 +5,12 @@ const category = "subbed-anime";
|
||||
|
||||
// npx vitest run animeCategory.test.ts
|
||||
test(`GET /api/v2/hianime/category/${category}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getCategoryAnime(category);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getCategoryAnime(category);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -7,12 +7,12 @@ const category = "sub";
|
||||
|
||||
// npx vitest run animeEpisodeSrcs.test.ts
|
||||
test(`GET /api/v2/hianime/episode/sources?animeEpisodeId=${animeEpisodeId}&server=${server}&category=${category}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeSources(
|
||||
animeEpisodeId,
|
||||
server,
|
||||
category
|
||||
);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeSources(
|
||||
animeEpisodeId,
|
||||
server,
|
||||
category
|
||||
);
|
||||
|
||||
expect(data.sources).not.toEqual([]);
|
||||
expect(data.sources).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,9 +5,9 @@ const animeId = "steinsgate-3";
|
||||
|
||||
// npx vitest run animeEpisodes.test.ts
|
||||
test(`GET /api/v2/hianime/anime/${animeId}/episodes`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodes(animeId);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodes(animeId);
|
||||
|
||||
expect(data.totalEpisodes).not.toEqual(0);
|
||||
expect(data.episodes).not.toEqual([]);
|
||||
expect(data.totalEpisodes).not.toEqual(0);
|
||||
expect(data.episodes).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -6,11 +6,11 @@ const page = 2;
|
||||
|
||||
// npx vitest run animeGenre.test.ts
|
||||
test(`GET /api/v2/hianime/genre/${genreName}?page=${page}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const hianime = new HiAnime.Scraper();
|
||||
|
||||
const data = await hianime.getGenreAnime(genreName, page);
|
||||
const data = await hianime.getGenreAnime(genreName, page);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -6,12 +6,12 @@ const page = 2;
|
||||
|
||||
// npx vitest run animeProducer.test.ts
|
||||
test(`GET /api/v2/hianime/producer/${producerName}?page=${page}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getProducerAnimes(producerName, page);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getProducerAnimes(producerName, page);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -4,14 +4,14 @@ import { HiAnime } from "aniwatch";
|
||||
const query = "monster";
|
||||
const page = 1;
|
||||
const filter: HiAnime.SearchFilters = {
|
||||
genres: "seinen,psychological",
|
||||
genres: "seinen,psychological",
|
||||
};
|
||||
|
||||
// npx vitest run animeSearch.test.ts
|
||||
test(`GET /api/v2/hianime/search?q=${query}&page=${page}&genres=${filter.genres}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.search(query, page, filter);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.search(query, page, filter);
|
||||
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(data.animes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,8 +5,8 @@ const query = "one piece";
|
||||
|
||||
// npx vitest run animeSearchSuggestion.test.ts
|
||||
test(`GET /api/v2/hianime/search/suggestion?q=${query}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.searchSuggestions(query);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.searchSuggestions(query);
|
||||
|
||||
expect(data.suggestions).not.toEqual([]);
|
||||
expect(data.suggestions).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,11 +5,11 @@ const animeEpisodeId = "steinsgate-0-92?ep=2055";
|
||||
|
||||
// npx vitest run episodeServers.test.ts
|
||||
test(`GET /api/v2/hianime/episode/servers?animeEpisodeId=${animeEpisodeId}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeServers(animeEpisodeId);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEpisodeServers(animeEpisodeId);
|
||||
|
||||
expect(data.episodeId).not.toEqual(null);
|
||||
expect(data.episodeNo).not.toEqual(0);
|
||||
expect(data.sub).not.toEqual([]);
|
||||
expect(data.dub).not.toEqual([]);
|
||||
expect(data.episodeId).not.toEqual(null);
|
||||
expect(data.episodeNo).not.toEqual(0);
|
||||
expect(data.sub).not.toEqual([]);
|
||||
expect(data.dub).not.toEqual([]);
|
||||
});
|
||||
|
||||
@@ -5,13 +5,13 @@ const padZero = (num: number) => (num < 10 ? `0${num}` : num.toString());
|
||||
|
||||
const d = new Date();
|
||||
const date = `${d.getFullYear()}-${padZero(d.getMonth() + 1)}-${padZero(
|
||||
d.getDate()
|
||||
d.getDate()
|
||||
)}`;
|
||||
|
||||
// npx vitest run estimatedSchedule.test.ts
|
||||
test(`GET /api/v2/hianime/schedule?date=${date}`, async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEstimatedSchedule(date);
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getEstimatedSchedule(date);
|
||||
|
||||
expect(data.scheduledAnimes).not.toEqual([]);
|
||||
expect(data.scheduledAnimes).not.toEqual([]);
|
||||
});
|
||||
|
||||
+14
-14
@@ -2,20 +2,20 @@ import { expect, test } from "vitest";
|
||||
import { HiAnime } from "aniwatch";
|
||||
|
||||
test("GET /api/v2/hianime/home", async () => {
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getHomePage();
|
||||
const hianime = new HiAnime.Scraper();
|
||||
const data = await hianime.getHomePage();
|
||||
|
||||
expect(data.spotlightAnimes).not.toEqual([]);
|
||||
expect(data.trendingAnimes).not.toEqual([]);
|
||||
expect(data.latestEpisodeAnimes).not.toEqual([]);
|
||||
expect(data.topUpcomingAnimes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(data.mostFavoriteAnimes).not.toEqual([]);
|
||||
expect(data.latestCompletedAnimes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
expect(data.spotlightAnimes).not.toEqual([]);
|
||||
expect(data.trendingAnimes).not.toEqual([]);
|
||||
expect(data.latestEpisodeAnimes).not.toEqual([]);
|
||||
expect(data.topUpcomingAnimes).not.toEqual([]);
|
||||
expect(data.topAiringAnimes).not.toEqual([]);
|
||||
expect(data.mostPopularAnimes).not.toEqual([]);
|
||||
expect(data.mostFavoriteAnimes).not.toEqual([]);
|
||||
expect(data.latestCompletedAnimes).not.toEqual([]);
|
||||
expect(data.genres).not.toEqual([]);
|
||||
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
expect(data.top10Animes.today).not.toEqual([]);
|
||||
expect(data.top10Animes.week).not.toEqual([]);
|
||||
expect(data.top10Animes.month).not.toEqual([]);
|
||||
});
|
||||
|
||||
+5
-5
@@ -1,9 +1,9 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
name: "aniwatch-api",
|
||||
environment: "node",
|
||||
testTimeout: 15000,
|
||||
},
|
||||
test: {
|
||||
name: "aniwatch-api",
|
||||
environment: "node",
|
||||
testTimeout: 15000,
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user