Skip to content

Commit

Permalink
feat(dramacool): Add recent-shows and recent-movies routes to DramaCo…
Browse files Browse the repository at this point in the history
…ol, trailer field to IMovieInfo,

refactor(goku, moviehdwatch): Implement movie fetching by country and genre. Standardize outputs (e.g., remove `.replace('SS ', '')` from Goku).
  • Loading branch information
2004durgesh committed Aug 11, 2024
1 parent 3df99b0 commit 23fb0db
Show file tree
Hide file tree
Showing 12 changed files with 550 additions and 59 deletions.
75 changes: 74 additions & 1 deletion docs/providers/dramacool.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const dramacool = new MOVIES.DramaCool();
- [fetchEpisodeSources](#fetchepisodesources)
- [fetchEpisodeServers](#fetchepisodeservers)
- [fetchPopular](#fetchpopular)
- [fetchRecentMovies](#fetchrecentmovies)
- [fetchRecentTvShows](#fetchrecenttvshows)

### search
> Note: This method is a subclass of the [`BaseParser`](https://github.com/consumet/extensions/blob/master/src/models/base-parser.ts) class. meaning it is available across most categories.
Expand Down Expand Up @@ -139,7 +141,8 @@ output:
url: 'https://asiancdn.com/images/db287e9dc37d8c5b67c2498e3ef07c5a/1.vtt',
lang: 'Default (maybe)'
}
]
],
download: 'https://asianbxkiun.pro/download?id=MjMwOTI2&title=Vincenzo+%282021%29+episode+1&typesub=SUB' //only for AsianLoad
}
```

Expand Down Expand Up @@ -213,4 +216,74 @@ output:
{...}
]
}
```


### fetchRecentMovies

```ts
dramacool.fetchRecentMovies.then(data => {
console.log(data);
})
```

returns a promise which resolves into an array of movies. (*[`Promise<ISearch<IMovieResult>>`](https://github.com/consumet/extensions/blob/master/src/models/types.ts#L328-L336)*)\
output:
```js
{
currentPage: 1,
totalPages: 207,
hasNextPage: true,
results: [
{
id: 'drama-detail/cross-',
title: 'Mission Cross (2024)',
url: 'https://dramacool.com.pa/mission-cross-2024-episode-1.html',
image: 'https://asianimg.pro/cover/cross--1723170340.png'
},
{
id: 'drama-detail/mentalese-express-2023',
title: 'Mentalese Express (2023)',
url: 'https://dramacool.com.pa/mentalese-express-2023-episode-1.html',
image: 'https://asianimg.pro/cover/mentalese-express-2023-1723173905.png'
},
{...}
]
}
```


### fetchRecentTvShows

```ts
dramacool.fetchRecentTvShows.then(data => {
console.log(data);
})
```

returns a promise which resolves into an array of movies. (*[`Promise<ISearch<IMovieResult>>`](https://github.com/consumet/extensions/blob/master/src/models/types.ts#L328-L336)*)\
output:
```js
{
currentPage: 1,
totalPages: 376,
hasNextPage: true,
results: [
{
id: 'drama-detail/kimi-to-yukite-saku-shinsengumi-seishunroku',
title: 'Kimi to Yukite Saku: Shinsengumi Seishunroku (2024)',
url: 'https://dramacool.com.pa/kimi-to-yukite-saku-shinsengumi-seishunroku-2024-episode-12.html',
image: 'https://asianimg.pro/cover/kimi-to-yukite-saku-shinsengumi-seishunroku-1711089348.png',
episodeNumber: '12'
},
{
id: 'drama-detail/ayaka-chan-wa-hiroko-senpai-ni-koishiteru',
title: 'Ayaka-chan wa Hiroko-senpai ni Koishiteru (2024)',
url: 'https://dramacool.com.pa/ayaka-chan-wa-hiroko-senpai-ni-koishiteru-2024-episode-6.html',
image: 'https://asianimg.pro/cover/ayaka-chan-wa-hiroko-senpai-ni-koishiteru-2024-1719580986.png',
episodeNumber: '6'
},
{...}
]
}
```
30 changes: 16 additions & 14 deletions docs/providers/flixhq.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const flixhq = new MOVIES.FlixHQ();
- [fetchRecentTvShows](#fetchrecenttvshows)
- [fetchTrendingMovies](#fetchtrendingmovies)
- [fetchTrendingTvShows](#fetchtrendingtvshows)
- [fetchByCountry](#fetchbycountry)
- [fetchByGenre](#fetchbygenre)

### search
> Note: This method is a subclass of the [`BaseParser`](https://github.com/consumet/extensions/blob/master/src/models/base-parser.ts) class. meaning it is available across most categories.
Expand Down Expand Up @@ -433,22 +435,22 @@ output:
hasNextPage: true,
results: [
{
id: 'movie/watch-no-new-friends-105202',
title: 'No New Friends',
url: 'https://flixhq.to/movie/watch-no-new-friends-105202',
image: 'https://img.flixhq.to/xxrz/250x400/379/16/30/16304d1c6302e6b078f6b74d5ff58347/16304d1c6302e6b078f6b74d5ff58347.jpg',
releaseDate: '2024',
seasons: undefined,
type: 'Movie'
id: 'tv/watch-are-you-sure-112516',
title: 'Are You Sure?!',
url: 'https://flixhq.to/tv/watch-are-you-sure-112516',
image: 'https://img.flixhq.to/xxrz/250x400/379/56/5f/565fad67a9c9343acf4260994f565e62/565fad67a9c9343acf4260994f565e62.jpg',
type: 'TV Series',
season: 'SS 1',
latestEpisode: 'EPS 2'
},
{
id: 'tv/watch-shogun-106618',
title: 'Shōgun',
url: 'https://flixhq.to/tv/watch-shogun-106618',
image: 'https://img.flixhq.to/xxrz/250x400/379/a7/fc/a7fca6a36c98856de5e71d120a16e521/a7fca6a36c98856de5e71d120a16e521.jpg',
releaseDate: undefined,
seasons: 1,
type: 'TV Series'
id: 'movie/watch-mission-cross-112537',
title: 'Mission: Cross',
url: 'https://flixhq.to/movie/watch-mission-cross-112537',
image: 'https://img.flixhq.to/xxrz/250x400/379/b6/24/b62476092851e487dbf78d75162e2be9/b62476092851e487dbf78d75162e2be9.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '100m'
},
{...}
]
Expand Down
80 changes: 80 additions & 0 deletions docs/providers/goku.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const goku = new MOVIES.Goku();
- [fetchRecentTvShows](#fetchrecenttvshows)
- [fetchTrendingMovies](#fetchtrendingmovies)
- [fetchTrendingTvShows](#fetchtrendingtvshows)
- [fetchByCountry](#fetchbycountry)
- [fetchByGenre](#fetchbygenre)

### search
> Note: This method is a subclass of the [`BaseParser`](https://github.com/consumet/extensions/blob/master/src/models/base-parser.ts) class. meaning it is available across most categories.
Expand Down Expand Up @@ -369,3 +371,81 @@ output:
{...},
]
```

### fetchByCountry

```ts
goku.fetchByCountrty('india-105').then(data => {
console.log(data);
})
```

returns a promise which resolves into an array of tv shows. (*[`Promise<ISearch<IMovieResult>>`](https://github.com/consumet/extensions/blob/master/src/models/types.ts#L328-L336)*)\
output:

```js
{
currentPage: 1,
hasNextPage: true,
results: [
{
id: 'movie/watch-bloody-ishq-112024',
title: 'Bloody Ishq',
url: 'https://goku.sx/movie/watch-bloody-ishq-112024',
image: 'https://img.goku.sx/xxrz/250x400/576/c4/14/c414870b61993b268593d962994d15a8/c414870b61993b268593d962994d15a8.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '138min'
},
{
id: 'movie/watch-wild-wild-punjab-111226',
title: 'Wild Wild Punjab',
url: 'https://goku.sx/movie/watch-wild-wild-punjab-111226',
image: 'https://img.goku.sx/xxrz/250x400/576/ec/d7/ecd7abd2c25ef985c1cbd55fa62a97b8/ecd7abd2c25ef985c1cbd55fa62a97b8.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '111min'
},
{...},
]
}
```

### fetchByGenre

```ts
goku.fetchByGenre('action-1').then(data => {
console.log(data);
})
```

returns a promise which resolves into an array of tv shows. (*[`Promise<ISearch<IMovieResult>>`](https://github.com/consumet/extensions/blob/master/src/models/types.ts#L328-L336)*)\
output:

```js
{
currentPage: 1,
hasNextPage: true,
results: [
{
id: 'movie/watch-the-pastor-111166',
title: 'The Pastor',
url: 'https://goku.sx/movie/watch-the-pastor-111166',
image: 'https://img.goku.sx/xxrz/250x400/576/cf/98/cf98db6049fd31178a415817f2de796b/cf98db6049fd31178a415817f2de796b.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '88min'
},
{
id: 'movie/watch-ang-pintor-at-ang-paraluman-112501',
title: 'Ang Pintor At Ang Paraluman',
url: 'https://goku.sx/movie/watch-ang-pintor-at-ang-paraluman-112501',
image: 'https://img.goku.sx/xxrz/250x400/576/4a/0f/4a0f7df9c4a0d91ae81330d37e8f551e/4a0f7df9c4a0d91ae81330d37e8f551e.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '104min'
},
{...},
]
}
```
80 changes: 80 additions & 0 deletions docs/providers/moviehdwatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const moviesHd = new MOVIES.MovieHdWatch();
- [fetchRecentTvShows](#fetchrecenttvshows)
- [fetchTrendingMovies](#fetchtrendingmovies)
- [fetchTrendingTvShows](#fetchtrendingtvshows)
- [fetchByCountry](#fetchbycountry)
- [fetchByGenre](#fetchbygenre)

### search
> Note: This method is a subclass of the [`BaseParser`](https://github.com/consumet/extensions/blob/master/src/models/base-parser.ts) class. meaning it is available across most categories.
Expand Down Expand Up @@ -434,3 +436,81 @@ output:
{...},
]
```

### fetchByCountry

```ts
moviesHd.fetchByCountrty('KR').then(data => {
console.log(data);
})
```

returns a promise which resolves into an array of tv shows. (*[`Promise<ISearch<IMovieResult>>`](https://github.com/consumet/extensions/blob/master/src/models/types.ts#L328-L336)*)\
output:

```js
{
currentPage: 1,
hasNextPage: true,
results: [
{
id: 'tv/watch-are-you-sure-online-112516',
title: 'Are You Sure?!',
url: 'https://movieshd.watch/tv/watch-are-you-sure-online-112516',
image: 'https://img.movieshd.watch/xxrz/250x400/391/56/5f/565fad67a9c9343acf4260994f565e62/565fad67a9c9343acf4260994f565e62.jpg',
type: 'TV Series',
season: 'SS 1',
latestEpisode: 'EPS 2'
},
{
id: 'movie/watch-mission-cross-online-112537',
title: 'Mission: Cross',
url: 'https://movieshd.watch/movie/watch-mission-cross-online-112537',
image: 'https://img.movieshd.watch/xxrz/250x400/391/b6/24/b62476092851e487dbf78d75162e2be9/b62476092851e487dbf78d75162e2be9.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '100m'
},
{...},
]
}
```

### fetchByGenre

```ts
moviesHd.fetchByGenre('drama').then(data => {
console.log(data);
})
```

returns a promise which resolves into an array of tv shows. (*[`Promise<ISearch<IMovieResult>>`](https://github.com/consumet/extensions/blob/master/src/models/types.ts#L328-L336)*)\
output:

```js
{
currentPage: 1,
hasNextPage: true,
results: [
{
id: 'movie/watch-the-pastor-online-111166',
title: 'The Pastor',
url: 'https://movieshd.watch/movie/watch-the-pastor-online-111166',
image: 'https://img.movieshd.watch/xxrz/250x400/391/cf/98/cf98db6049fd31178a415817f2de796b/cf98db6049fd31178a415817f2de796b.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '88m'
},
{
id: 'movie/watch-ang-pintor-at-ang-paraluman-online-112501',
title: 'Ang Pintor At Ang Paraluman',
url: 'https://movieshd.watch/movie/watch-ang-pintor-at-ang-paraluman-online-112501',
image: 'https://img.movieshd.watch/xxrz/250x400/391/4a/0f/4a0f7df9c4a0d91ae81330d37e8f551e/4a0f7df9c4a0d91ae81330d37e8f551e.jpg',
type: 'Movie',
releaseDate: '2024',
duration: '104m'
},
{...},
]
}
```
2 changes: 2 additions & 0 deletions src/models/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface ISearch<T> {

export interface Trailer {
id: string;
url?: string;
site?: string;
thumbnail?: string;
thumbnailHash?: string | null;
Expand Down Expand Up @@ -423,6 +424,7 @@ export interface IMovieInfo extends IMovieResult {
casts?: string[];
tags?: string[];
totalEpisodes?: number;
trailer?: Trailer;
seasons?: { season: number; image?: string; episodes: IMovieEpisode[] }[];
episodes?: IMovieEpisode[];
}
Expand Down
Loading

0 comments on commit 23fb0db

Please sign in to comment.