diff --git a/dist/models/types.d.ts b/dist/models/types.d.ts index 781def749..563b4ee8a 100644 --- a/dist/models/types.d.ts +++ b/dist/models/types.d.ts @@ -312,7 +312,8 @@ export interface ISource { export declare enum TvType { TVSERIES = "TV Series", MOVIE = "Movie", - ANIME = "Anime" + ANIME = "Anime", + PEOPLE = "People" } export interface IMovieEpisode { id: string; @@ -334,6 +335,14 @@ export interface IMovieResult { type?: TvType; [x: string]: unknown; } +export interface IPeopleResult { + id: string; + name: string; + rating?: string; + image?: string; + movies: IMovieResult[]; + [x: string]: unknown; +} export interface INewsFeed extends INews { /** topics of the feed */ topics: Topics[]; diff --git a/dist/models/types.js b/dist/models/types.js index 8d2b2fb04..c147dca1b 100644 --- a/dist/models/types.js +++ b/dist/models/types.js @@ -57,6 +57,7 @@ var TvType; TvType["TVSERIES"] = "TV Series"; TvType["MOVIE"] = "Movie"; TvType["ANIME"] = "Anime"; + TvType["PEOPLE"] = "People"; })(TvType || (exports.TvType = TvType = {})); var Genres; (function (Genres) { diff --git a/dist/models/types.js.map b/dist/models/types.js.map index 2006120d4..00de8fbef 100644 --- a/dist/models/types.js.map +++ b/dist/models/types.js.map @@ -1 +1 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":";;;AA0DA,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;AACvB,CAAC,EAXW,WAAW,2BAAX,WAAW,QAWtB;AA+FD,IAAY,gBAkBX;AAlBD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;I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AbD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,sBAAN,MAAM,QAajB"} \ No newline at end of file +{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/models/types.ts"],"names":[],"mappings":";;;AA0DA,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,wBAAS,CAAA;IACT,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,oCAAqB,CAAA;AACvB,CAAC,EAXW,WAAW,2BAAX,WAAW,QAWtB;AA+FD,IAAY,gBAkBX;AAlBD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,uCAAmB,CAAA;IACnB,2CAAuB,CAAA;IACvB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;IACrB,mBAAmB;IACnB,uCAAmB,CAAA;IACnB,yCAAqB,CAAA;IACrB,iDAA6B,CAAA;IAC7B,iDAA6B,CAAA;IAC7B,2CAAuB,CAAA;IACvB,6CAAyB,CAAA;IACzB,uCAAmB,CAAA;AACrB,CAAC,EAlBW,gBAAgB,gCAAhB,gBAAgB,QAkB3B;AAED,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,sCAAuB,CAAA;IACvB,8CAA+B,CAAA;IAC/B,kCAAmB,CAAA;AACrB,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB;AAED,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,uBAAW,CAAA;IACX,yBAAa,CAAA;AACf,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB;AA2ID;;GAEG;AACH,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,gCAAsB,CAAA;IACtB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EALW,MAAM,sBAAN,MAAM,QAKjB;AAqFD,IAAY,MAmBX;AAnBD,WAAY,MAAM;IAChB,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,uBAAa,CAAA;IACb,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;IAC/B,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,yCAA+B,CAAA;IAC/B,2BAAiB,CAAA;IACjB,uCAA6B,CAAA;IAC7B,+BAAqB,CAAA;AACvB,CAAC,EAnBW,MAAM,sBAAN,MAAM,QAmBjB;AAED,IAAY,MAaX;AAbD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,iCAAuB,CAAA;IACvB,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,+BAAqB,CAAA;IACrB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,yBAAe,CAAA;IACf,2BAAiB,CAAA;AACnB,CAAC,EAbW,MAAM,sBAAN,MAAM,QAajB"} \ No newline at end of file diff --git a/dist/providers/meta/tmdb.d.ts b/dist/providers/meta/tmdb.d.ts index bf3306729..a02d39351 100644 --- a/dist/providers/meta/tmdb.d.ts +++ b/dist/providers/meta/tmdb.d.ts @@ -1,4 +1,5 @@ import { ISearch, IAnimeInfo, IAnimeResult, ISource, IEpisodeServer, MovieParser, TvType, IMovieResult, IMovieInfo, ProxyConfig } from '../../models'; +import { IPeopleResult } from '../../models/types'; import { AxiosAdapter } from 'axios'; declare class TMDB extends MovieParser { private apiKey; @@ -10,6 +11,12 @@ declare class TMDB extends MovieParser { supportedTypes: Set; private provider; constructor(apiKey?: string, provider?: MovieParser, proxyConfig?: ProxyConfig, adapter?: AxiosAdapter); + /** + * @param type trending type: tv series, movie, people or all + * @param timePeriod trending time period day or week + * @param page page number + */ + fetchTrending: (type: string | 'all', timePeriod?: 'day' | 'week', page?: number) => Promise>; /** * @param query search query * @param page page number diff --git a/dist/providers/meta/tmdb.js b/dist/providers/meta/tmdb.js index fe4d2c097..8542ca5ef 100644 --- a/dist/providers/meta/tmdb.js +++ b/dist/providers/meta/tmdb.js @@ -16,6 +16,74 @@ class TMDB extends models_1.MovieParser { this.logo = 'https://pbs.twimg.com/profile_images/1243623122089041920/gVZIvphd_400x400.jpg'; this.classPath = 'META.TMDB'; this.supportedTypes = new Set([models_1.TvType.MOVIE, models_1.TvType.TVSERIES, models_1.TvType.ANIME]); + /** + * @param type trending type: tv series, movie, people or all + * @param timePeriod trending time period day or week + * @param page page number + */ + this.fetchTrending = async (type, timePeriod = 'day', page = 1) => { + const trendingUrl = `${this.apiUrl}/trending/${type.toLowerCase() === models_1.TvType.MOVIE.toLowerCase() + ? 'movie' + : type.toLowerCase() === models_1.TvType.TVSERIES.toLowerCase() + ? 'tv' + : type.toLowerCase() === models_1.TvType.PEOPLE.toLowerCase() + ? 'person' + : 'all'}/${timePeriod}?page=${page}&api_key=${this.apiKey}&language=en-US`; + const result = { + currentPage: page, + hasNextPage: false, + results: [], + }; + try { + const { data } = await this.client.get(trendingUrl); + if (data.results.length < 1) + return result; + result.hasNextPage = page + 1 <= data.total_pages; + result.currentPage = page; + result.totalResults = data.total_results; + result.totalPages = data.total_pages; + result.results = data.results.map((result) => { + if (result.media_type !== 'person') { + const date = new Date((result === null || result === void 0 ? void 0 : result.release_date) || (result === null || result === void 0 ? void 0 : result.first_air_date)); + const movie = { + id: result.id, + title: (result === null || result === void 0 ? void 0 : result.title) || (result === null || result === void 0 ? void 0 : result.name), + image: `https://image.tmdb.org/t/p/original${result === null || result === void 0 ? void 0 : result.poster_path}`, + type: result.media_type === 'movie' ? models_1.TvType.MOVIE : models_1.TvType.TVSERIES, + rating: (result === null || result === void 0 ? void 0 : result.vote_average) || 0, + releaseDate: `${date.getFullYear()}` || '0', + }; + return movie; + } + else { + const user = { + id: result.id, + name: result.name, + rating: result.popularity, + image: `https://image.tmdb.org/t/p/original${result === null || result === void 0 ? void 0 : result.profile_path}`, + movies: [], + }; + user.movies = result['known_for'].map((movie) => { + const date = new Date((movie === null || movie === void 0 ? void 0 : movie.release_date) || (movie === null || movie === void 0 ? void 0 : movie.first_air_date)); + const xmovie = { + id: movie.id, + title: (movie === null || movie === void 0 ? void 0 : movie.title) || (movie === null || movie === void 0 ? void 0 : movie.name), + image: `https://image.tmdb.org/t/p/original${movie === null || movie === void 0 ? void 0 : movie.poster_path}`, + type: movie.media_type === 'movie' ? models_1.TvType.MOVIE : models_1.TvType.TVSERIES, + rating: (movie === null || movie === void 0 ? void 0 : movie.vote_average) || 0, + releaseDate: `${date.getFullYear()}` || '0', + }; + return xmovie; + }); + return user; + } + }); + return result; + } + catch (err) { + throw new Error(err.message); + } + }; /** * @param query search query * @param page page number diff --git a/dist/providers/meta/tmdb.js.map b/dist/providers/meta/tmdb.js.map index 72a13cac1..7de67d602 100644 --- a/dist/providers/meta/tmdb.js.map +++ b/dist/providers/meta/tmdb.js.map @@ -1 +1 @@ -{"version":3,"file":"tmdb.js","sourceRoot":"","sources":["../../../src/providers/meta/tmdb.ts"],"names":[],"mappings":";;;;;AAAA,yCAYsB;AACtB,uCAAgD;AAChD,8DAAsC;AAGtC,MAAM,IAAK,SAAQ,oBAAW;IAU5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,OAAO,CAAC,CAAC,CAAC,0CAAE,EAAE,KAAI,SAAS,CAAC;QAChD,CAAC,CAAC;QAEF;;;WAGG;QACM,wBAAmB,GAAG,KAAK,EAAE,EAAU,EAAE,GAAG,IAAS,EAAoB,EAAE;YAClF,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;QACxD,CAAC,CAAC;QAEF;;;YAGI;QACK,wBAAmB,GAAG,KAAK,EAAE,SAAiB,EAAE,GAAG,IAAS,EAA6B,EAAE;YAClG,OAAO,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,SAAS,EAAE,GAAG,IAAI,CAAC,CAAC;QAC/D,CAAC,CAAC;QAtZA,IAAI,CAAC,QAAQ,GAAG,QAAQ,IAAI,IAAI,gBAAM,EAAE,CAAC;IAC3C,CAAC;CAsZF;AAED,iBAAiB;AACjB,6BAA6B;AAC7B,mDAAmD;AACnD,qGAAqG;AACrG,0BAA0B;AAC1B,QAAQ;AAER,kBAAe,IAAI,CAAC"} \ No newline at end of file diff --git a/docs/providers/tmdb.md b/docs/providers/tmdb.md index 7f29ec7ef..5c31aa634 100644 --- a/docs/providers/tmdb.md +++ b/docs/providers/tmdb.md @@ -9,10 +9,63 @@ const tmdb = new META.TMDB();

Methods

+- [fetchTrending](#fetchtrending) - [search](#search) - [fetchMediaInfo](#fetchmediainfo) - [fetchEpisodeSources](#fetchepisodesources) +### fetchTrending + +

Parameters

+ +| Parameter | Type | Description | +| --------------------- | -------- | ----------------------------------------------------------------------------------- | +| type | `string` | type of trending option we want('movie', 'tv series', 'people' or 'all') | +| timePeriod (optional) | `string` | the duration of trending we want ('day' or 'week') | +| page (optional) | `number` | page number to search for. | + +```ts +tmdb.fetchTrending("the flash").then(data => { + console.log(data); +}) +``` + +returns a promise which resolves into an array of anime. (*[`Promise>`](https://github.com/consumet/consumet.ts/blob/master/src/models/types.ts#L328-L336)*)\ +output: +```js +{ + currentPage: 1, + results: [ + { + id: 848326, + title: 'Rebel Moon - Part One: A Child of Fire', + image: 'https://image.tmdb.org/t/p/original/ui4DrH1cKk2vkHshcUcGt2lKxCm.jpg', + type: 'Movie', + rating: 6.457, + releaseDate: '2023' + }, + { + id: 572802, + title: 'Aquaman and the Lost Kingdom', + image: 'https://image.tmdb.org/t/p/original/8xV47NDrjdZDpkVcCFqkdHa3T0C.jpg', + type: 'Movie', + rating: 6.551, + releaseDate: '2023' + }, + { + id: 930564, + title: 'Saltburn', + image: 'https://image.tmdb.org/t/p/original/qjhahNLSZ705B5JP92YMEYPocPz.jpg', + type: 'Movie', + rating: 7.2, + releaseDate: '2023' + }, + {...} + ... + ] +} +``` + ### search

Parameters

diff --git a/src/models/types.ts b/src/models/types.ts index 5dd06cbc5..aba24ce7c 100644 --- a/src/models/types.ts +++ b/src/models/types.ts @@ -341,6 +341,7 @@ export enum TvType { TVSERIES = 'TV Series', MOVIE = 'Movie', ANIME = 'Anime', + PEOPLE = 'People', } export interface IMovieEpisode { @@ -365,6 +366,15 @@ export interface IMovieResult { [x: string]: unknown; // other unkown fields } +export interface IPeopleResult { + id: string; + name: string; + rating?: string; + image?: string; + movies: IMovieResult[]; + [x: string]: unknown; // other unkown fields +} + export interface INewsFeed extends INews { /** topics of the feed */ topics: Topics[]; diff --git a/src/providers/meta/tmdb.ts b/src/providers/meta/tmdb.ts index 7220d7294..180177917 100644 --- a/src/providers/meta/tmdb.ts +++ b/src/providers/meta/tmdb.ts @@ -11,6 +11,7 @@ import { ProxyConfig, IMovieEpisode, } from '../../models'; +import { IPeopleResult } from '../../models/types'; import { compareTwoStrings } from '../../utils'; import FlixHQ from '../movies/flixhq'; import { AxiosAdapter } from 'axios'; @@ -35,6 +36,90 @@ class TMDB extends MovieParser { this.provider = provider || new FlixHQ(); } + /** + * @param type trending type: tv series, movie, people or all + * @param timePeriod trending time period day or week + * @param page page number + */ + fetchTrending = async ( + type: string | 'all', + timePeriod: 'day' | 'week' = 'day', + page: number = 1 + ): Promise> => { + const trendingUrl = `${this.apiUrl}/trending/${ + type.toLowerCase() === TvType.MOVIE.toLowerCase() + ? 'movie' + : type.toLowerCase() === TvType.TVSERIES.toLowerCase() + ? 'tv' + : type.toLowerCase() === TvType.PEOPLE.toLowerCase() + ? 'person' + : 'all' + }/${timePeriod}?page=${page}&api_key=${this.apiKey}&language=en-US`; + + const result: ISearch = { + currentPage: page, + hasNextPage: false, + results: [], + }; + + try { + const { data } = await this.client.get(trendingUrl); + + if (data.results.length < 1) return result; + + result.hasNextPage = page + 1 <= data.total_pages; + result.currentPage = page; + result.totalResults = data.total_results; + result.totalPages = data.total_pages; + + result.results = data.results.map((result: any) => { + if (result.media_type !== 'person') { + const date = new Date(result?.release_date || result?.first_air_date); + + const movie: IMovieResult = { + id: result.id, + title: result?.title || result?.name, + image: `https://image.tmdb.org/t/p/original${result?.poster_path}`, + type: result.media_type === 'movie' ? TvType.MOVIE : TvType.TVSERIES, + rating: result?.vote_average || 0, + releaseDate: `${date.getFullYear()}` || '0', + }; + + return movie; + } else { + const user: IPeopleResult = { + id: result.id, + name: result.name, + rating: result.popularity, + image: `https://image.tmdb.org/t/p/original${result?.profile_path}`, + movies: [], + }; + + user.movies = result['known_for'].map((movie: any) => { + const date = new Date(movie?.release_date || movie?.first_air_date); + + const xmovie: IMovieResult = { + id: movie.id, + title: movie?.title || movie?.name, + image: `https://image.tmdb.org/t/p/original${movie?.poster_path}`, + type: movie.media_type === 'movie' ? TvType.MOVIE : TvType.TVSERIES, + rating: movie?.vote_average || 0, + releaseDate: `${date.getFullYear()}` || '0', + }; + + return xmovie; + }); + + return user; + } + }); + + return result; + } catch (err) { + throw new Error((err as Error).message); + } + }; + /** * @param query search query * @param page page number diff --git a/test/meta/tmdb.test.ts b/test/meta/tmdb.test.ts index f74dfdf4d..bec7c37c3 100644 --- a/test/meta/tmdb.test.ts +++ b/test/meta/tmdb.test.ts @@ -1,3 +1,4 @@ +import { TvType } from '../../src/models'; import { META } from '../../src/providers'; jest.setTimeout(120000); @@ -11,6 +12,26 @@ test('returns a filled array of movie list', async () => { expect(data.results).not.toEqual([]); }); +test('returns a filled array of trending movie list', async () => { + const data = await tmdb.fetchTrending('movie'); + expect(data.results).not.toEqual([]); +}); + +test('returns a filled array of trending tv-series list', async () => { + const data = await tmdb.fetchTrending('TV Series'); + expect(data.results).not.toEqual([]); +}); + +test('returns a filled array of trending people list', async () => { + const data = await tmdb.fetchTrending('People'); + expect(data.results).not.toEqual([]); +}); + +test('returns a filled array of all trending list', async () => { + const data = await tmdb.fetchTrending('all'); + expect(data.results).not.toEqual([]); +}); + test('returns a filled object of anime data', async () => { const data = await tmdb.fetchMediaInfo('60735', 'tv'); expect(data).not.toBeNull();