Skip to content

Commit

Permalink
added proxy to mangasee
Browse files Browse the repository at this point in the history
  • Loading branch information
Tdanks2000 committed Nov 6, 2022
1 parent 74e382b commit c73d763
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions dist/providers/manga/mangasee123.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ declare class Mangasee123 extends MangaParser {
protected baseUrl: string;
protected logo: string;
protected classPath: string;
private readonly sgProxy;
fetchMangaInfo: (mangaId: string, ...args: any) => Promise<IMangaInfo>;
fetchChapterPages: (chapterId: string, ...args: any) => Promise<IMangaChapterPage[]>;
search: (query: string, ...args: any[]) => Promise<ISearch<IMangaResult>>;
Expand Down
12 changes: 9 additions & 3 deletions dist/providers/manga/mangasee123.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/manga/mangasee123.js.map

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

14 changes: 11 additions & 3 deletions src/providers/manga/mangasee123.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class Mangasee123 extends MangaParser {
'https://scontent.fman4-1.fna.fbcdn.net/v/t1.6435-1/80033336_1830005343810810_419412485691408384_n.png?stp=dst-png_p148x148&_nc_cat=104&ccb=1-7&_nc_sid=1eb0c7&_nc_ohc=XpeoABDI-sEAX-5hLFV&_nc_ht=scontent.fman4-1.fna&oh=00_AT9nIRz5vPiNqqzNpSg2bJymX22rZ1JumYTKBqg_cD0Alg&oe=6317290E';
protected override classPath = 'MANGA.Mangasee123';

private readonly sgProxy = 'https://cors.proxy.consumet.org';

override fetchMangaInfo = async (mangaId: string, ...args: any): Promise<IMangaInfo> => {
const mangaInfo: IMangaInfo = {
id: mangaId,
Expand All @@ -26,7 +28,7 @@ class Mangasee123 extends MangaParser {
const url = `${this.baseUrl}/manga`;

try {
const { data } = await axios.get(`${url}/${mangaId}`);
const { data } = await axios.get(`${this.sgProxy}/${url}/${mangaId}`);
const $ = load(data);

const schemaScript = $('body > script:nth-child(15)').get()[0].children[0];
Expand Down Expand Up @@ -66,7 +68,7 @@ class Mangasee123 extends MangaParser {
const url = `${this.baseUrl}/read-online/${chapterId}-page-1.html`;

try {
const { data } = await axios.get(url);
const { data } = await axios.get(`${this.sgProxy}/${url}`);
const $ = load(data);

const chapterScript = $('body > script:nth-child(19)').get()[0].children[0];
Expand Down Expand Up @@ -104,7 +106,7 @@ class Mangasee123 extends MangaParser {
const sanitizedQuery = query.replace(/\s/g, '').toLowerCase();

try {
const { data } = await axios.get('https://mangasee123.com/_search.php');
const { data } = await axios.get(`${this.sgProxy}/https://mangasee123.com/_search.php`);

for (let i in data) {
let sanitizedAlts: string[] = [];
Expand Down Expand Up @@ -171,4 +173,10 @@ class Mangasee123 extends MangaParser {
};
}

// (async () => {
// const manga = new Mangasee123();
// const mediaInfo = await manga.search('oyasumi');
// console.log(mediaInfo);
// })();

export default Mangasee123;

0 comments on commit c73d763

Please sign in to comment.