forked from consumet/providers-status
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchore-generator.ts
183 lines (177 loc) Β· 6.5 KB
/
chore-generator.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*GENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.*/
import {ANIME, BOOKS, MANGA, COMICS, LIGHT_NOVELS, MOVIES, META} from '@consumet/extensions'
import fs from "fs"
import {performance} from "perf_hooks"
const start = async() => {
let output = '| **provider** | **Status** | **Time** |\n|:--------:|:------:|:----:|\n'
let t0, t1 = performance.now()
const NineAnime = new ANIME.NineAnime()
try {
t0 = performance.now()
const NineAnimeRes = await NineAnime.search("One Piece")
t1 = performance.now()
if (NineAnimeRes.results){
output += `| [${NineAnime.name}](https://9anime.to) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${NineAnime.name}](https://9anime.to) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${NineAnime.name}](https://9anime.to) | π΄ 500 | 0s |\n`
}
const AnimePahe = new ANIME.AnimePahe()
try {
t0 = performance.now()
const AnimePaheRes = await AnimePahe.search("One Piece")
t1 = performance.now()
if (AnimePaheRes.results){
output += `| [${AnimePahe.name}](https://animepahe.com) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${AnimePahe.name}](https://animepahe.com) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${AnimePahe.name}](https://animepahe.com) | π΄ 500 | 0s |\n`
}
const Gogoanime = new ANIME.Gogoanime()
try {
t0 = performance.now()
const GogoanimeRes = await Gogoanime.search("One Piece")
t1 = performance.now()
if (GogoanimeRes.results){
output += `| [${Gogoanime.name}](https://gogoanime.gg) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${Gogoanime.name}](https://gogoanime.gg) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${Gogoanime.name}](https://gogoanime.gg) | π΄ 500 | 0s |\n`
}
const Zoro = new ANIME.Zoro()
try {
t0 = performance.now()
const ZoroRes = await Zoro.search("One Piece")
t1 = performance.now()
if (ZoroRes.results){
output += `| [${Zoro.name}](https://zoro.to) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${Zoro.name}](https://zoro.to) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${Zoro.name}](https://zoro.to) | π΄ 500 | 0s |\n`
}
const MangaDex = new MANGA.MangaDex()
try {
t0 = performance.now()
const MangaDexRes = await MangaDex.search("A")
t1 = performance.now()
if (MangaDexRes.results){
output += `| [${MangaDex.name}](https://mangadex.org) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${MangaDex.name}](https://mangadex.org) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${MangaDex.name}](https://mangadex.org) | π΄ 500 | 0s |\n`
}
const MangaHere = new MANGA.MangaHere()
try {
t0 = performance.now()
const MangaHereRes = await MangaHere.search("A")
t1 = performance.now()
if (MangaHereRes.results){
output += `| [${MangaHere.name}](http://www.mangahere.cc) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${MangaHere.name}](http://www.mangahere.cc) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${MangaHere.name}](http://www.mangahere.cc) | π΄ 500 | 0s |\n`
}
const MangaKakalot = new MANGA.MangaKakalot()
try {
t0 = performance.now()
const MangaKakalotRes = await MangaKakalot.search("A")
t1 = performance.now()
if (MangaKakalotRes.results){
output += `| [${MangaKakalot.name}](https://mangakakalot.com) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${MangaKakalot.name}](https://mangakakalot.com) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${MangaKakalot.name}](https://mangakakalot.com) | π΄ 500 | 0s |\n`
}
const Libgen = new BOOKS.Libgen()
try {
t0 = performance.now()
const LibgenRes = await Libgen.search("One Hundred Years of Solitude")
t1 = performance.now()
if (LibgenRes){
output += `| [${Libgen.name}](http://libgen) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${Libgen.name}](http://libgen) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${Libgen.name}](http://libgen) | π΄ 500 | 0s |\n`
}
const GetComics = new COMICS.GetComics()
try {
t0 = performance.now()
const GetComicsRes = await GetComics.search("batman")
t1 = performance.now()
if (GetComicsRes.containers){
output += `| [${GetComics.name}](https://getcomics.info/) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${GetComics.name}](https://getcomics.info/) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${GetComics.name}](https://getcomics.info/) | π΄ 500 | 0s |\n`
}
const ReadLightNovels = new LIGHT_NOVELS.ReadLightNovels()
try {
t0 = performance.now()
const ReadLightNovelsRes = await ReadLightNovels.search("classroom of the elite")
t1 = performance.now()
if (ReadLightNovelsRes.results){
output += `| [${ReadLightNovels.name}](https://readlightnovels.net) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${ReadLightNovels.name}](https://readlightnovels.net) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${ReadLightNovels.name}](https://readlightnovels.net) | π΄ 500 | 0s |\n`
}
const FlixHQ = new MOVIES.FlixHQ()
try {
t0 = performance.now()
const FlixHQRes = await FlixHQ.search("batman")
t1 = performance.now()
if (FlixHQRes.results){
output += `| [${FlixHQ.name}](https://flixhq.to) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${FlixHQ.name}](https://flixhq.to) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${FlixHQ.name}](https://flixhq.to) | π΄ 500 | 0s |\n`
}
const Anilist = new META.Anilist()
try {
t0 = performance.now()
const AnilistRes = await Anilist.search("A")
t1 = performance.now()
if (AnilistRes.results){
output += `| [${Anilist.name}](https://anilist.co/) | π’ 200 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
else {
output += `| [${Anilist.name}](https://anilist.co/) | π΄ 500 | ${((t1 - t0) / 1000).toPrecision(3)}s |\n`
}
} catch (e) {
output += `| [${Anilist.name}](https://anilist.co/) | π΄ 500 | 0s |\n`
}
fs.writeFileSync('./README.md', output)}
start()