Skip to content

Commit

Permalink
refactor consumet-app.herokuapp.com -> api.consumet.org
Browse files Browse the repository at this point in the history
  • Loading branch information
riimuru committed Oct 4, 2022
1 parent 1bc1a83 commit a0006b4
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 29 deletions.
16 changes: 8 additions & 8 deletions dist/providers/anime/9anime.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/providers/anime/9anime.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/providers/movies/flixhq.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utils/extractors/rapidcloud.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/utils/extractors/rapidcloud.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 9 additions & 15 deletions src/providers/anime/9anime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ class NineAnime extends AnimeParser {

try {
const res = await axios.get(
`${this.baseUrl.replace('.to', '.id')}/filter?keyword=${encode(query).replace(
/%20/g,
'+'
)}&vrf=${encode(this.ev(query))}&page=${page}`
`${this.baseUrl}/filter?keyword=${encode(query).replace(/%20/g, '+')}&vrf=${encode(
this.ev(query)
)}&page=${page}`
);

const $ = load(res.data);
Expand Down Expand Up @@ -125,8 +124,7 @@ class NineAnime extends AnimeParser {
}

override async fetchAnimeInfo(animeUrl: string, isDub: boolean = false): Promise<IAnimeInfo> {
if (!animeUrl.startsWith(this.baseUrl.replace('.to', '.id')))
animeUrl = `${this.baseUrl.replace('.to', '.id')}/watch/${animeUrl}`;
if (!animeUrl.startsWith(this.baseUrl)) animeUrl = `${this.baseUrl}/watch/${animeUrl}`;

const animeInfo: IAnimeInfo = {
id: '',
Expand Down Expand Up @@ -221,9 +219,7 @@ class NineAnime extends AnimeParser {

const {
data: { result },
} = await axios.get(
`${this.baseUrl.replace('.to', '.id')}/ajax/episode/list/${id}?vrf=${encode(this.ev(id))}`
);
} = await axios.get(`${this.baseUrl}/ajax/episode/list/${id}?vrf=${encode(this.ev(id))}`);

const $$ = load(result);

Expand All @@ -244,7 +240,7 @@ class NineAnime extends AnimeParser {
number: number,
title: title,
isFiller: isFiller,
url: `${this.baseUrl.replace('.to', '.id')}/ajax/server/list/${id}?vrf=${this.ev(id)}`,
url: `${this.baseUrl}/ajax/server/list/${id}?vrf=${this.ev(id)}`,
};
})
.get();
Expand Down Expand Up @@ -324,10 +320,8 @@ class NineAnime extends AnimeParser {
}

override async fetchEpisodeServers(episodeId: string): Promise<IEpisodeServer[]> {
if (!episodeId.startsWith(this.baseUrl.replace('.to', '.id')))
episodeId = `${this.baseUrl.replace('.to', '.id')}/ajax/server/list/${episodeId}?vrf=${this.ev(
episodeId
)}`;
if (!episodeId.startsWith(this.baseUrl))
episodeId = `${this.baseUrl}/ajax/server/list/${episodeId}?vrf=${this.ev(episodeId)}`;

const {
data: { result },
Expand All @@ -340,7 +334,7 @@ class NineAnime extends AnimeParser {
const serverId = $(el).attr('data-link-id')!;
servers.push({
name: $(el).text().toLocaleLowerCase(),
url: `${this.baseUrl.replace('.to', '.id')}/ajax/server/${serverId}?vrf=${encode(this.ev(serverId))}`,
url: `${this.baseUrl}/ajax/server/${serverId}?vrf=${encode(this.ev(serverId))}`,
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/providers/movies/flixhq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ class FlixHQ extends MovieParser {

// (async () => {
// const movie = new FlixHQ();
// const movieInfo = await movie.fetchEpisodeSources('18617', 'movie/watch-top-gun-18617');
// const movieInfo = await movie.fetchEpisodeSources('1168337', 'tv/watch-vincenzo-67955');
// console.log(movieInfo);
// })();

Expand Down
2 changes: 1 addition & 1 deletion src/utils/extractors/rapidcloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RapidCloud extends VideoExtractor {

private readonly fallbackKey = 'c1d17096f2ca11b7';
private readonly host = 'https://rapid-cloud.co';
private readonly consumetApi = 'https://consumet-api.herokuapp.com';
private readonly consumetApi = 'https://api.consumet.org';
private readonly enimeApi = 'https://api.enime.moe';

override extract = async (videoUrl: URL): Promise<{ sources: IVideo[] } & { subtitles: ISubtitle[] }> => {
Expand Down

0 comments on commit a0006b4

Please sign in to comment.