Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/consumet/consumet.ts
Browse files Browse the repository at this point in the history
# Conflicts:
#	dist/extractors/streamtape.js.map
#	dist/extractors/vidcloud.js.map
#	dist/providers/meta/anilist.js.map
#	dist/providers/movies/dramacool.js.map
#	dist/providers/movies/flixhq.js.map
#	dist/providers/movies/goku.js.map
#	dist/providers/movies/movidhdwatch.js.map
#	dist/utils/utils.js.map
  • Loading branch information
theonlymo committed May 14, 2024
2 parents c04db3a + 6059b41 commit 5299854
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 18 deletions.
4 changes: 3 additions & 1 deletion dist/providers/anime/gogoanime.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { AnimeParser, ISearch, IAnimeInfo, IEpisodeServer, StreamingServers, IAnimeResult, ISource } from '../../models';
import { AxiosAdapter } from 'axios';
import { AnimeParser, ISearch, IAnimeInfo, IEpisodeServer, StreamingServers, IAnimeResult, ISource, ProxyConfig } from '../../models';
declare class Gogoanime extends AnimeParser {
readonly name = "Gogoanime";
protected baseUrl: string;
protected logo: string;
protected classPath: string;
private readonly ajaxUrl;
constructor(customBaseURL?: string, proxy?: ProxyConfig, adapter?: AxiosAdapter);
/**
*
* @param query search query string
Expand Down
17 changes: 13 additions & 4 deletions dist/providers/anime/gogoanime.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/gogoanime.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/providers/anime/zoro.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare class Zoro extends AnimeParser {
protected baseUrl: string;
protected logo: string;
protected classPath: string;
constructor(customBaseURL?: string);
/**
* @param query Search query
* @param page Page number (optional)
Expand Down
3 changes: 2 additions & 1 deletion dist/providers/anime/zoro.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/zoro.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/providers/meta/anilist.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare class Anilist extends AnimeParser {
* @param proxyConfig proxy config (optional)
* @param adapter axios adapter (optional)
*/
constructor(provider?: AnimeParser, proxyConfig?: ProxyConfig | undefined, adapter?: AxiosAdapter);
constructor(provider?: AnimeParser, proxyConfig?: ProxyConfig | undefined, adapter?: AxiosAdapter, customBaseURL?: string);
/**
* @param query Search query
* @param page Page number (optional)
Expand Down
4 changes: 2 additions & 2 deletions dist/providers/meta/anilist.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/meta/anilist.js.map

Large diffs are not rendered by default.

24 changes: 21 additions & 3 deletions src/providers/anime/gogoanime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,30 @@ import { GogoCDN, StreamSB } from '../../extractors';

class Gogoanime extends AnimeParser {
override readonly name = 'Gogoanime';
protected override baseUrl = 'https://gogoanime3.co';
protected override baseUrl = 'https://anitaku.so';
protected override logo =
'https://play-lh.googleusercontent.com/MaGEiAEhNHAJXcXKzqTNgxqRmhuKB1rCUgb15UrN_mWUNRnLpO5T1qja64oRasO7mn0';
protected override classPath = 'ANIME.Gogoanime';
private readonly ajaxUrl = 'https://ajax.gogocdn.net/ajax';


constructor(
customBaseURL?: string,
proxy?: ProxyConfig,
adapter?: AxiosAdapter
) {
super(...arguments);
this.baseUrl = customBaseURL ? `https://${customBaseURL}` : this.baseUrl;
if (proxy) {
// Initialize proxyConfig if provided
this.setProxy(proxy);
}
if (adapter) {
// Initialize adapter if provided
this.setAxiosAdapter(adapter);
}
}

/**
*
* @param query search query string
Expand All @@ -50,7 +68,7 @@ class Gogoanime extends AnimeParser {
$('div.last_episodes > ul > li').each((i, el) => {
searchResult.results.push({
id: $(el).find('p.name > a').attr('href')?.split('/')[2]!,
title: $(el).find('p.name > a').attr('title')!,
title: $(el).find('p.name > a').text(),
url: `${this.baseUrl}/${$(el).find('p.name > a').attr('href')}`,
image: $(el).find('div > a > img').attr('src'),
releaseDate: $(el).find('p.released').text().trim(),
Expand Down Expand Up @@ -482,7 +500,7 @@ class Gogoanime extends AnimeParser {
const baseUrl = downloadUrl.split('?')[0];
const idParam = downloadUrl.match(/[?&]id=([^&]+)/);
const animeID = idParam ? idParam[1] : null;
if (captchaToken)
if (!captchaToken)
captchaToken = '03AFcWeA5zy7DBK82U_tctVKelJ6L2duTWac5at2zXjHLX8XqUm8tI6NKWMxGd2gjh1vi2hnEyRhVgbMhdb9WjexRsJkxTt-C-_iIIZ5yC3E5I19G5Q0buSTcIQIZS6tskrz-mDn-d37aWxAJtqbg0Yoo1XsdVc5Yf4sB-9iQxQK-W_9YLep_QaAz8uL17gMMlCz5WZM3dbBEEGmk_qPbJu_pZ8kk-lFPDzd6iBobcpyIDRZgTgD4bYUnby5WZc11i00mrRiRS3m-qSY0lprGaBqoyY1BbRkQZ25AGPp5al4kSwBZqpcVgLrs3bjdo8XVWAe73_XLa8HhqLWbz_m5Ebyl5F9awwL7w4qikGj-AK7v2G8pgjT22kDLIeenQ_ss4jYpmSzgnuTItur9pZVzpPkpqs4mzr6y274AmJjzppRTDH4VFtta_E02-R7Hc1rUD2kCYt9BqsD7kDjmetnvLtBm97q5XgBS8rQfeH4P-xqiTAsJwXlcrPybSjnwPEptqYCPX5St_BSj4NQfSuzZowXu_qKsP4hAaE9L2W36MvqePPlEm6LChBT3tnqUwcEYNe5k7lkAAbunxx8q_X5Q3iEdcFqt9_0GWHebRBd5abEbjbmoqqCoQeZt7AUvkXCRfBDne-bf25ypyTtwgyuvYMYXau3zGUjgPUO9WIotZwyKyrYmjsZJ7TiM';

let res = null;
Expand Down
7 changes: 7 additions & 0 deletions src/providers/anime/zoro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ class Zoro extends AnimeParser {
'https://is3-ssl.mzstatic.com/image/thumb/Purple112/v4/7e/91/00/7e9100ee-2b62-0942-4cdc-e9b93252ce1c/source/512x512bb.jpg';
protected override classPath = 'ANIME.Zoro';

constructor(
customBaseURL?: string
) {
super(...arguments);
this.baseUrl = customBaseURL ? `https://${customBaseURL}` : this.baseUrl;
}

/**
* @param query Search query
* @param page Page number (optional)
Expand Down
4 changes: 2 additions & 2 deletions src/providers/meta/anilist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ class Anilist extends AnimeParser {
* @param proxyConfig proxy config (optional)
* @param adapter axios adapter (optional)
*/
constructor(provider?: AnimeParser, public proxyConfig?: ProxyConfig, adapter?: AxiosAdapter) {
constructor(provider?: AnimeParser, public proxyConfig?: ProxyConfig, adapter?: AxiosAdapter, customBaseURL?:string) {
super(proxyConfig, adapter);
this.provider = provider || new Gogoanime(proxyConfig);
this.provider = provider || new Gogoanime(customBaseURL , proxyConfig);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion test/anime/zoro.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ANIME } from '../../src/providers';

jest.setTimeout(120000);

const zoro = new ANIME.Zoro();
const zoro = new ANIME.Zoro("hianime.to");

test('returns a filled array of anime list', async () => {
const data = await zoro.search('Overlord IV');
Expand Down

0 comments on commit 5299854

Please sign in to comment.