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