Skip to content

Commit

Permalink
started zlibrary provider
Browse files Browse the repository at this point in the history
  • Loading branch information
prince-ao committed Jun 15, 2022
1 parent ddf9536 commit c33c055
Show file tree
Hide file tree
Showing 121 changed files with 2,847 additions and 26 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
dist/
*.tgz
yarn-error.log
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ yarn add @consumet/extensions

**Example** - searching for a book using the libgen provider.
```ts
import { BOOKS, COMICS } from "@consumet/extensions"
import { BOOKS } from "@consumet/extensions"

const book = new BOOKS.Libgen();

Expand Down
4 changes: 4 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { ANIME, BOOKS, COMICS } from './providers';
import { PROVIDERS_LIST } from './utils/providers-list';
export { ANIME, BOOKS, COMICS };
export { PROVIDERS_LIST };
10 changes: 10 additions & 0 deletions dist/index.js

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

1 change: 1 addition & 0 deletions dist/index.js.map

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

22 changes: 22 additions & 0 deletions dist/models/anime-parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { BaseParser } from '.';
declare abstract class AnimeParser extends BaseParser {
/**
* takes anime link or id
*
* returns anime info
*/
protected abstract fetchAnimeInfo(animeUrl: string): Promise<unknown>;
/**
* takes episode id
*
* returns episode sources (video links)
*/
protected abstract fetchEpisodeSources(episodeId: string, ...args: any): Promise<unknown>;
/**
* takes episode link
*
* returns episode servers (video links) available
*/
protected abstract fetchEpisodeServers(episodeLink: string): Promise<unknown>;
}
export default AnimeParser;
7 changes: 7 additions & 0 deletions dist/models/anime-parser.js

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

1 change: 1 addition & 0 deletions dist/models/anime-parser.js.map

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

10 changes: 10 additions & 0 deletions dist/models/base-parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { BaseProvider } from '.';
declare abstract class BaseParser extends BaseProvider {
/**
* Search for books/anime/manga/etc using the given query
*
* returns a promise resolving to a data object
*/
protected abstract search(query: string, ...args: any[]): Promise<unknown>;
}
export default BaseParser;
7 changes: 7 additions & 0 deletions dist/models/base-parser.js

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

1 change: 1 addition & 0 deletions dist/models/base-parser.js.map

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

38 changes: 38 additions & 0 deletions dist/models/base-provider.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { IProviderStats } from '.';
declare abstract class BaseProvider {
/**
* Name of the provider
*/
abstract readonly name: string;
/**
* The main URL of the provider
*/
protected abstract readonly baseUrl: string;
/**
* Most providers are english based, but if the provider is not english based override this value
*/
protected readonly languages: string[] | string;
/**
* override as `true` if the provider **only** supports NSFW content
*/
readonly isNSFW: boolean;
/**
* Logo of the provider (used in the website) or `undefined` if not available. ***128x128px is preferred***\
* Must be a valid URL (not a data URL)
*/
protected abstract readonly logo: string;
/**
* The class's path is determined by the provider's directory structure for example:\
* MangaDex class path is `MANGA.all.MangaDex`. **(case sensitive)**
*/
protected abstract readonly classPath: string;
/**
* override as `false` if the provider is **down** or **not working**
*/
readonly isWorking: boolean;
/**
* returns provider stats
*/
get toString(): IProviderStats;
}
export default BaseProvider;
34 changes: 34 additions & 0 deletions dist/models/base-provider.js

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

1 change: 1 addition & 0 deletions dist/models/base-provider.js.map

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

20 changes: 20 additions & 0 deletions dist/models/base-types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
export interface Book {
title: string;
authors: string[];
publisher: string;
year: string;
edition: string;
volume: string;
series: string;
isbn: string[];
link: string;
}
export interface Hashes {
AICH: string;
CRC32: string;
eDonkey: string;
MD5: string;
SHA1: string;
SHA256: string[];
TTH: string;
}
3 changes: 3 additions & 0 deletions dist/models/base-types.js

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

1 change: 1 addition & 0 deletions dist/models/base-types.js.map

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

4 changes: 4 additions & 0 deletions dist/models/book-parsers.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { BaseParser } from '.';
declare abstract class BookParser extends BaseParser {
}
export default BookParser;
7 changes: 7 additions & 0 deletions dist/models/book-parsers.js

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

1 change: 1 addition & 0 deletions dist/models/book-parsers.js.map

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

4 changes: 4 additions & 0 deletions dist/models/comic-parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { BaseParser } from '.';
declare abstract class ComicParser extends BaseParser {
}
export default ComicParser;
7 changes: 7 additions & 0 deletions dist/models/comic-parser.js

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

1 change: 1 addition & 0 deletions dist/models/comic-parser.js.map

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

11 changes: 11 additions & 0 deletions dist/models/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import BaseProvider from './base-provider';
import BaseParser from './base-parser';
import AnimeParser from './anime-parser';
import BookParser from './book-parsers';
import ComicParser from './comic-parser';
import VideoExtractor from './video-extractor';
import MangaParser from './manga-parser';
import LightNovelParser from './lightnovel-parser';
import { IProviderStats, IAnimeSearch, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, LibgenBook, StreamingServers, AnimeStatus, SubOrSub, IMangaResult, IMangaSearch, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelSearch, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, GetComicsComics, ComicRes } from './types';
import { LibgenBookObject, GetComicsComicsObject } from './type-objects';
export { BaseProvider, IProviderStats, BaseParser, AnimeParser, BookParser, IAnimeSearch, IAnimeEpisode, IAnimeInfo, IAnimeResult, IEpisodeServer, IVideo, VideoExtractor, LibgenBook, LibgenBookObject, StreamingServers, AnimeStatus, SubOrSub, LightNovelParser, MangaParser, IMangaResult, IMangaSearch, IMangaChapter, IMangaInfo, ILightNovelResult, ILightNovelSearch, ILightNovelInfo, ILightNovelChapter, ILightNovelChapterContent, ComicParser, GetComicsComics, GetComicsComicsObject, ComicRes, };
30 changes: 30 additions & 0 deletions dist/models/index.js

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

1 change: 1 addition & 0 deletions dist/models/index.js.map

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

16 changes: 16 additions & 0 deletions dist/models/lightnovel-parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BaseParser } from '.';
declare abstract class LighNovelParser extends BaseParser {
/**
* takes light novel link or id
*
* returns lightNovel info
*/
protected abstract fetchLighNovelInfo(lightNovelUrl: string, ...args: any): Promise<unknown>;
/**
* takes chapter id
*
* returns chapter content (text)
*/
protected abstract fetchChapterContent(chapterId: string, ...args: any): Promise<unknown>;
}
export default LighNovelParser;
7 changes: 7 additions & 0 deletions dist/models/lightnovel-parser.js

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

1 change: 1 addition & 0 deletions dist/models/lightnovel-parser.js.map

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

16 changes: 16 additions & 0 deletions dist/models/manga-parser.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { BaseParser } from '.';
declare abstract class MangaParser extends BaseParser {
/**
* takes manga link or id
*
* returns manga info with chapters
*/
protected abstract fetchMangaInfo(mangaUrl: string): Promise<unknown>;
/**
* takes chapter id
*
* returns chapter (image links)
*/
protected abstract fetchChapterPages(chapterId: string, ...args: any): Promise<unknown>;
}
export default MangaParser;
7 changes: 7 additions & 0 deletions dist/models/manga-parser.js

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

1 change: 1 addition & 0 deletions dist/models/manga-parser.js.map

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

48 changes: 48 additions & 0 deletions dist/models/type-objects.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { Hashes } from './base-types';
import { GetComicsComics, LibgenBook } from './types';
export declare class LibgenBookObject implements LibgenBook {
title: string;
authors: never[];
publisher: string;
year: string;
edition: string;
volume: string;
series: string;
isbn: never[];
link: string;
id: string;
language: string;
format: string;
size: string;
pages: string;
image: string;
description: string;
tableOfContents: string;
topic: string;
hashes: HashesObject;
}
declare class HashesObject implements Hashes {
AICH: string;
CRC32: string;
eDonkey: string;
MD5: string;
SHA1: string;
SHA256: never[];
TTH: string;
}
export declare class GetComicsComicsObject implements GetComicsComics {
image: string;
title: string;
year: string;
size: string;
excerpt: string;
description: string;
download: string;
category: string;
ufile: string;
mega: string;
mediafire: string;
zippyshare: string;
readOnline: string;
}
export {};
Loading

0 comments on commit c33c055

Please sign in to comment.