@devraiden/api
Advanced tools
| import { InstagramDownloader } from './Instagram.js'; | ||
| import { TikTokDownloader } from './TikTok.js'; | ||
| import { YouTubeDownloaders } from './YouTube.js'; | ||
| import { YouTubeSearchings } from './YouTubeSearching.js'; | ||
| export { InstagramDownloader, TikTokDownloader, YouTubeDownloaders, YouTubeSearchings }; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"} |
| import { InstagramDownloaderTypes } from './types'; | ||
| declare const InstagramDownloader: (url: string) => Promise<InstagramDownloaderTypes>; | ||
| export { InstagramDownloader }; | ||
| //# sourceMappingURL=Instagram.d.ts.map |
| {"version":3,"file":"Instagram.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/Instagram.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGnD,QAAA,MAAM,mBAAmB,QAAe,MAAM,KAAG,QAAQ,wBAAwB,CAahF,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"} |
| export {}; | ||
| //# sourceMappingURL=test.d.ts.map |
| {"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/test.ts"],"names":[],"mappings":""} |
| import { TikTokDownloaderTypes } from './types'; | ||
| declare const TikTokDownloader: (url: string) => Promise<TikTokDownloaderTypes>; | ||
| export { TikTokDownloader }; | ||
| //# sourceMappingURL=TikTok.d.ts.map |
| {"version":3,"file":"TikTok.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/TikTok.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,QAAA,MAAM,gBAAgB,QAAe,MAAM,KAAG,QAAQ,qBAAqB,CAa1E,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"} |
| interface TikTokDownloader { | ||
| author: { | ||
| username: string; | ||
| }; | ||
| description: string; | ||
| videos: { | ||
| [Key: string]: string; | ||
| }; | ||
| } | ||
| export declare type TikTokDownloaderTypes = TikTokDownloader & { | ||
| videos: { | ||
| without_watermark_v1: string; | ||
| without_watermark_v2: string; | ||
| without_watermark_raw: string; | ||
| }; | ||
| }; | ||
| interface InstagramDownloader { | ||
| url: string; | ||
| } | ||
| export declare type InstagramDownloaderTypes = InstagramDownloader & { | ||
| thumbnail: string; | ||
| }; | ||
| export interface YouTubeDownloader { | ||
| video_id: string; | ||
| video_v_id: string; | ||
| video_thumbnail: string; | ||
| video_title: string; | ||
| files: { | ||
| video: YouTubeDownloaderVideoOrAudio; | ||
| audio: YouTubeDownloaderVideoOrAudio; | ||
| }; | ||
| } | ||
| export declare type YouTubeDownloaderVideoOrAudio = { | ||
| [key: string]: { | ||
| video_quality: string; | ||
| video_sizeH: string; | ||
| video_size: number; | ||
| download_link(): Promise<string>; | ||
| }; | ||
| }; | ||
| export interface YouTubeSearching { | ||
| video: { | ||
| author: string; | ||
| authorUrl?: string; | ||
| videoId: string; | ||
| url: string; | ||
| thumbnail: string; | ||
| title: string; | ||
| description?: string; | ||
| publishedTimes: string; | ||
| durationH: string; | ||
| durationS: number; | ||
| duration: string; | ||
| viewH: string; | ||
| view: string; | ||
| type: 'video'; | ||
| }[]; | ||
| channel: { | ||
| channelId: string; | ||
| url: string; | ||
| channelName: string; | ||
| profileUrl: string; | ||
| isVerif: boolean; | ||
| subscriberH: string; | ||
| subscribers: string; | ||
| videoCOunt: number; | ||
| description: string; | ||
| type: 'channel'; | ||
| }[]; | ||
| playlist: { | ||
| playlistId: string; | ||
| title: string; | ||
| thumbnail: string; | ||
| video: { | ||
| videoId: string; | ||
| title: string; | ||
| durationH: string; | ||
| duration: string; | ||
| }[]; | ||
| type: 'mix'; | ||
| }[]; | ||
| } | ||
| export {}; | ||
| //# sourceMappingURL=types.d.ts.map |
| {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/types.ts"],"names":[],"mappings":"AAAA,UAAU,gBAAgB;IACtB,MAAM,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;KACpB,CAAA;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KACzB,CAAA;CACJ;AAED,oBAAY,qBAAqB,GAAG,gBAAgB,GAAG;IACnD,MAAM,EAAE;QACJ,oBAAoB,EAAE,MAAM,CAAC;QAC7B,oBAAoB,EAAE,MAAM,CAAC;QAC7B,qBAAqB,EAAE,MAAM,CAAC;KACjC,CAAA;CACJ,CAAA;AAED,UAAU,mBAAmB;IACzB,GAAG,EAAE,MAAM,CAAE;CAChB;AAED,oBAAY,wBAAwB,GAAG,mBAAmB,GAAG;IACzD,SAAS,EAAE,MAAM,CAAC;CACrB,CAAA;AAED,MAAM,WAAW,iBAAiB;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE;QACH,KAAK,EAAE,6BAA6B,CAAC;QACrC,KAAK,EAAE,6BAA6B,CAAC;KACxC,CAAA;CACJ;AAED,oBAAY,6BAA6B,GAAG;IACxC,CAAC,GAAG,EAAE,MAAM,GAAG;QACX,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,aA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| ||
| declare const YouTubeDownloaders: (url: string) => Promise<YouTubeDownloader>; | ||
| export { YouTubeDownloaders }; | ||
| //# sourceMappingURL=YouTube.d.ts.map |
| {"version":3,"file":"YouTube.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/YouTube.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAG5C,QAAA,MAAM,kBAAkB,QAAc,MAAM,KAAG,QAAQ,iBAAiB,CAavE,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"} |
| import { YouTubeSearching } from './types'; | ||
| declare const YouTubeSearchings: (title: string) => Promise<YouTubeSearching>; | ||
| export { YouTubeSearchings }; | ||
| //# sourceMappingURL=YouTubeSearching.d.ts.map |
| {"version":3,"file":"YouTubeSearching.d.ts","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/YouTubeSearching.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,QAAA,MAAM,iBAAiB,UAAiB,MAAM,KAAG,QAAQ,gBAAgB,CAaxE,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"} |
| export declare class ErrorAPI extends Error { | ||
| readonly date: Date; | ||
| constructor(message: any, options?: {}); | ||
| static Errors(message: any, options?: {}): ErrorAPI; | ||
| } | ||
| //# sourceMappingURL=errors.d.ts.map |
| {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../../src/API/utils/errors.ts"],"names":[],"mappings":"AACA,qBAAa,QAAS,SAAQ,KAAK;IAC/B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;gBAEP,OAAO,EAAE,GAAG,EAAE,OAAO,KAAK;IASvC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,KAAK,GAAG,QAAQ;CAGtD"} |
| export * from './API/Controller/Media'; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.YouTubeSearchings = exports.YouTubeDownloaders = exports.TikTokDownloader = exports.InstagramDownloader = void 0; | ||
| const Instagram_js_1 = require("./Instagram.js"); | ||
| Object.defineProperty(exports, "InstagramDownloader", { enumerable: true, get: function () { return Instagram_js_1.InstagramDownloader; } }); | ||
| const TikTok_js_1 = require("./TikTok.js"); | ||
| Object.defineProperty(exports, "TikTokDownloader", { enumerable: true, get: function () { return TikTok_js_1.TikTokDownloader; } }); | ||
| const YouTube_js_1 = require("./YouTube.js"); | ||
| Object.defineProperty(exports, "YouTubeDownloaders", { enumerable: true, get: function () { return YouTube_js_1.YouTubeDownloaders; } }); | ||
| const YouTubeSearching_js_1 = require("./YouTubeSearching.js"); | ||
| Object.defineProperty(exports, "YouTubeSearchings", { enumerable: true, get: function () { return YouTubeSearching_js_1.YouTubeSearchings; } }); | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/index.ts"],"names":[],"mappings":";;;AAAA,iDAAqD;AAK5C,oGALA,kCAAmB,OAKA;AAJ5B,2CAA+C;AAIjB,iGAJrB,4BAAgB,OAIqB;AAH9C,6CAAkD;AAGF,mGAHvC,+BAAkB,OAGuC;AAFlE,+DAA0D;AAEU,kGAF3D,uCAAiB,OAE2D"} |
| "use strict"; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.InstagramDownloader = void 0; | ||
| const axios_1 = __importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const InstagramDownloader = async (url) => { | ||
| const instagram = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/instagram', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (instagram instanceof Error) | ||
| throw new errors_1.ErrorAPI('Error while fetching instagram data', instagram); | ||
| return instagram.data; | ||
| }; | ||
| exports.InstagramDownloader = InstagramDownloader; | ||
| //# sourceMappingURL=Instagram.js.map |
| {"version":3,"file":"Instagram.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/Instagram.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,+CAA8C;AAE9C,MAAM,mBAAmB,GAAG,KAAK,EAAE,GAAW,EAAqC,EAAE;IACjF,MAAM,SAAS,GAAG,MAAM,IAAA,eAAK,EAAC;QAC1B,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EAAE;YACL,IAAI,EAAE,GAAG;SACZ;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,SAAS,YAAY,KAAK;QAAE,MAAM,IAAI,iBAAQ,CAAC,qCAAqC,EAAE,SAAS,CAAC,CAAC;IAErG,OAAO,SAAS,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC;AAEO,kDAAmB"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const chai_1 = require("chai"); | ||
| const index_js_1 = require("./index.js"); | ||
| describe('Media', () => { | ||
| describe('TikTok Scraper', function () { | ||
| it('TikTokDownloader', function (done) { | ||
| (0, index_js_1.TikTokDownloader)('https://vt.tiktok.com/ZSdcacgM1/?k=1').then(function (res) { | ||
| (0, chai_1.expect)(res).to.be.an('object'); | ||
| (0, chai_1.expect)(res.author).to.be.an('object'); | ||
| (0, chai_1.expect)(res.author.username).to.be.a('string'); | ||
| (0, chai_1.expect)(res.description).to.be.a('string'); | ||
| (0, chai_1.expect)(res.videos).to.be.an('object'); | ||
| (0, chai_1.expect)(res.videos.without_watermark_v1).to.be.a('string'); | ||
| (0, chai_1.expect)(res.videos.without_watermark_v2).to.be.a('string'); | ||
| (0, chai_1.expect)(res.videos.without_watermark_raw).to.be.a('string'); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| }); | ||
| describe('InstagramDownloader', () => { | ||
| it('InstagramDownloader', (done) => { | ||
| (0, index_js_1.InstagramDownloader)('https://www.instagram.com/p/CcgDk-AFZKN/').then((res) => { | ||
| (0, chai_1.expect)(res).to.be.an('array'); | ||
| (0, chai_1.expect)(res).to.have.lengthOf.at.least(1); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| }); | ||
| describe('YouTube', function () { | ||
| it('YouTube Downloader', (done) => { | ||
| (0, index_js_1.YouTubeDownloaders)('https://www.youtube.com/watch?v=g-nG6n7yx3Q').then((res) => { | ||
| (0, chai_1.expect)(res).to.be.an('object'); | ||
| (0, chai_1.expect)(res.video_thumbnail).to.be.a('string'); | ||
| (0, chai_1.expect)(res.video_title).to.be.a('string'); | ||
| (0, chai_1.expect)(res.files.video).to.be.an('object'); | ||
| (0, chai_1.expect)(res.files.audio).to.be.an('object'); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| it('YouTube Searchings', (done) => { | ||
| (0, index_js_1.YouTubeSearchings)('Minecraft').then((res) => { | ||
| (0, chai_1.expect)(res).to.be.an('object'); | ||
| (0, chai_1.expect)(res.video).to.be.an('array'); | ||
| (0, chai_1.expect)(res.video).to.have.lengthOf.at.least(1); | ||
| (0, chai_1.expect)(res.channel).to.be.an('array'); | ||
| (0, chai_1.expect)(res.playlist).to.be.an('array'); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| }); | ||
| }); | ||
| //# sourceMappingURL=test.js.map |
| {"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/test.ts"],"names":[],"mappings":";;AAAA,+BAA8B;AAC9B,yCAA0G;AAE1G,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACnB,QAAQ,CAAC,gBAAgB,EAAE;QACvB,EAAE,CAAC,kBAAkB,EAAE,UAAU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;YAClB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oBAAoB,EAAE,CAAC,IAAI,EAAE,EAAE;YAC9B,IAAA,4BAAiB,EAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxC,IAAA,aAAM,EAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;gBAC/B,IAAA,aAAM,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBACpC,IAAA,aAAM,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC/C,IAAA,aAAM,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBACtC,IAAA,aAAM,EAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBAEvC,OAAO,IAAI,EAAE,CAAC;YAClB,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"} |
| "use strict"; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.TikTokDownloader = void 0; | ||
| const axios_1 = __importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const TikTokDownloader = async (url) => { | ||
| const tiktoks = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/tiktok', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (tiktoks instanceof Error) | ||
| throw new errors_1.ErrorAPI('Error while fetching tiktok data', tiktoks); | ||
| return tiktoks.data; | ||
| }; | ||
| exports.TikTokDownloader = TikTokDownloader; | ||
| //# sourceMappingURL=TikTok.js.map |
| {"version":3,"file":"TikTok.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/TikTok.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,+CAA8C;AAE9C,MAAM,gBAAgB,GAAG,KAAK,EAAE,GAAW,EAAkC,EAAE;IAC3E,MAAM,OAAO,GAAG,MAAM,IAAA,eAAK,EAAC;QACxB,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,sCAAsC;QAC3C,OAAO,EAAE;YACL,IAAI,EAAE,GAAG;SACZ;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,OAAO,YAAY,KAAK;QAAE,MAAM,IAAI,iBAAQ,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IAE9F,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC;AAEO,4CAAgB"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/types.ts"],"names":[],"mappings":""} |
| "use strict"; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.YouTubeDownloaders = void 0; | ||
| const axios_1 = __importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const YouTubeDownloaders = async (url) => { | ||
| const youtube = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (youtube instanceof errors_1.ErrorAPI) | ||
| throw new errors_1.ErrorAPI('Error while fetching YouTube data.', youtube); | ||
| return youtube.data; | ||
| }; | ||
| exports.YouTubeDownloaders = YouTubeDownloaders; | ||
| //# sourceMappingURL=YouTube.js.map |
| {"version":3,"file":"YouTube.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/YouTube.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,+CAA8C;AAE9C,MAAM,kBAAkB,GAAE,KAAK,EAAE,GAAW,EAA8B,EAAE;IACxE,MAAM,OAAO,GAAG,MAAM,IAAA,eAAK,EAAC;QACxB,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,uCAAuC;QAC5C,OAAO,EAAE;YACL,IAAI,EAAE,GAAG;SACZ;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,OAAO,YAAY,iBAAQ;QAAE,MAAM,IAAI,iBAAQ,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;IAEnG,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC;AAEO,gDAAkB"} |
| "use strict"; | ||
| var __importDefault = (this && this.__importDefault) || function (mod) { | ||
| return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.YouTubeSearchings = void 0; | ||
| const axios_1 = __importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const YouTubeSearchings = async (title) => { | ||
| const searching = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube/search', | ||
| headers: { | ||
| value: title | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (searching instanceof Error) | ||
| throw new errors_1.ErrorAPI('Error while fetching YouTube Search result data.', searching); | ||
| return searching.data; | ||
| }; | ||
| exports.YouTubeSearchings = YouTubeSearchings; | ||
| //# sourceMappingURL=YouTubeSearching.js.map |
| {"version":3,"file":"YouTubeSearching.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/YouTubeSearching.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAE1B,+CAA8C;AAE9C,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAAa,EAA6B,EAAE;IACzE,MAAM,SAAS,GAAG,MAAM,IAAA,eAAK,EAAC;QAC1B,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,8CAA8C;QACnD,OAAO,EAAE;YACL,KAAK,EAAE,KAAK;SACf;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,SAAS,YAAY,KAAK;QAAE,MAAM,IAAI,iBAAQ,CAAC,kDAAkD,EAAE,SAAS,CAAC,CAAC;IAElH,OAAO,SAAS,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC;AAEO,8CAAiB"} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ErrorAPI = void 0; | ||
| /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
| class ErrorAPI extends Error { | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| constructor(message, options = {}) { | ||
| super(message); | ||
| this.name = 'ErrorAPI'; | ||
| this.date = new Date(); | ||
| this.message = message + [ | ||
| 'If you though this is a bug from our API, Please report this immediately to our support server https://discord.gg/du5rZjJNrq' | ||
| ].join('\n'); | ||
| } | ||
| static Errors(message, options = {}) { | ||
| return new ErrorAPI(message, options); | ||
| } | ||
| } | ||
| exports.ErrorAPI = ErrorAPI; | ||
| //# sourceMappingURL=errors.js.map |
| {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/API/utils/errors.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,MAAa,QAAS,SAAQ,KAAK;IAE/B,6DAA6D;IAC7D,YAAa,OAAY,EAAE,OAAO,GAAG,EAAE;QACnC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG;YACrB,8HAA8H;SACjI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,OAAY,EAAE,OAAO,GAAG,EAAE;QACpC,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;CACJ;AAfD,4BAeC"} |
| "use strict"; | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| var desc = Object.getOwnPropertyDescriptor(m, k); | ||
| if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
| desc = { enumerable: true, get: function() { return m[k]; } }; | ||
| } | ||
| Object.defineProperty(o, k2, desc); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("./API/Controller/Media"), exports); | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC"} |
| { | ||
| "type": "commonjs" | ||
| } |
| import { InstagramDownloader } from './Instagram.js'; | ||
| import { TikTokDownloader } from './TikTok.js'; | ||
| import { YouTubeDownloaders } from './YouTube.js'; | ||
| import { YouTubeSearchings } from './YouTubeSearching.js'; | ||
| export { InstagramDownloader, TikTokDownloader, YouTubeDownloaders, YouTubeSearchings }; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAC"} |
| import Axios from 'axios'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const InstagramDownloader = async (url) => { | ||
| const instagram = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/instagram', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (instagram instanceof Error) | ||
| throw new ErrorAPI('Error while fetching instagram data', instagram); | ||
| return instagram.data; | ||
| }; | ||
| export { InstagramDownloader }; | ||
| //# sourceMappingURL=Instagram.js.map |
| {"version":3,"file":"Instagram.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/Instagram.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,mBAAmB,GAAG,KAAK,EAAE,GAAW,EAAqC,EAAE;IACjF,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC;QAC1B,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,yCAAyC;QAC9C,OAAO,EAAE;YACL,IAAI,EAAE,GAAG;SACZ;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,SAAS,YAAY,KAAK;QAAE,MAAM,IAAI,QAAQ,CAAC,qCAAqC,EAAE,SAAS,CAAC,CAAC;IAErG,OAAO,SAAS,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"} |
| import { expect } from 'chai'; | ||
| import { TikTokDownloader, InstagramDownloader, YouTubeDownloaders, YouTubeSearchings } from './index.js'; | ||
| describe('Media', () => { | ||
| describe('TikTok Scraper', function () { | ||
| it('TikTokDownloader', function (done) { | ||
| TikTokDownloader('https://vt.tiktok.com/ZSdcacgM1/?k=1').then(function (res) { | ||
| expect(res).to.be.an('object'); | ||
| expect(res.author).to.be.an('object'); | ||
| expect(res.author.username).to.be.a('string'); | ||
| expect(res.description).to.be.a('string'); | ||
| expect(res.videos).to.be.an('object'); | ||
| expect(res.videos.without_watermark_v1).to.be.a('string'); | ||
| expect(res.videos.without_watermark_v2).to.be.a('string'); | ||
| expect(res.videos.without_watermark_raw).to.be.a('string'); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| }); | ||
| describe('InstagramDownloader', () => { | ||
| it('InstagramDownloader', (done) => { | ||
| InstagramDownloader('https://www.instagram.com/p/CcgDk-AFZKN/').then((res) => { | ||
| expect(res).to.be.an('array'); | ||
| expect(res).to.have.lengthOf.at.least(1); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| }); | ||
| describe('YouTube', function () { | ||
| it('YouTube Downloader', (done) => { | ||
| YouTubeDownloaders('https://www.youtube.com/watch?v=g-nG6n7yx3Q').then((res) => { | ||
| expect(res).to.be.an('object'); | ||
| expect(res.video_thumbnail).to.be.a('string'); | ||
| expect(res.video_title).to.be.a('string'); | ||
| expect(res.files.video).to.be.an('object'); | ||
| expect(res.files.audio).to.be.an('object'); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| it('YouTube Searchings', (done) => { | ||
| YouTubeSearchings('Minecraft').then((res) => { | ||
| expect(res).to.be.an('object'); | ||
| expect(res.video).to.be.an('array'); | ||
| expect(res.video).to.have.lengthOf.at.least(1); | ||
| expect(res.channel).to.be.an('array'); | ||
| expect(res.playlist).to.be.an('array'); | ||
| return done(); | ||
| }).catch(done); | ||
| }); | ||
| }); | ||
| }); | ||
| //# sourceMappingURL=test.js.map |
| {"version":3,"file":"test.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAC9B,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE1G,QAAQ,CAAC,OAAO,EAAE,GAAG,EAAE;IACnB,QAAQ,CAAC,gBAAgB,EAAE;QACvB,EAAE,CAAC,kBAAkB,EAAE,UAAU,IAAI;YACjC,gBAAgB,CAAC,sCAAsC,CAAC,CAAC,IAAI,CAAC,UAAU,GAAG;gBACvE,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;gBAC/B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;gBACtC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAC9C,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAC1C,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;gBACtC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;gBAC1D,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,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{ ErrorAPI } from '../../utils/errors'; | ||
| const TikTokDownloader = async (url) => { | ||
| const tiktoks = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/tiktok', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (tiktoks instanceof Error) | ||
| throw new ErrorAPI('Error while fetching tiktok data', tiktoks); | ||
| return tiktoks.data; | ||
| }; | ||
| export { TikTokDownloader }; | ||
| //# sourceMappingURL=TikTok.js.map |
| {"version":3,"file":"TikTok.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/TikTok.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,gBAAgB,GAAG,KAAK,EAAE,GAAW,EAAkC,EAAE;IAC3E,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC;QACxB,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,sCAAsC;QAC3C,OAAO,EAAE;YACL,IAAI,EAAE,GAAG;SACZ;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,OAAO,YAAY,KAAK;QAAE,MAAM,IAAI,QAAQ,CAAC,kCAAkC,EAAE,OAAO,CAAC,CAAC;IAE9F,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"} |
| export {}; | ||
| //# sourceMappingURL=types.js.map |
| {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/types.ts"],"names":[],"mappings":""} |
| import Axios from 'axios'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const YouTubeDownloaders = async (url) => { | ||
| const youtube = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (youtube instanceof ErrorAPI) | ||
| throw new ErrorAPI('Error while fetching YouTube data.', youtube); | ||
| return youtube.data; | ||
| }; | ||
| export { YouTubeDownloaders }; | ||
| //# sourceMappingURL=YouTube.js.map |
| {"version":3,"file":"YouTube.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/YouTube.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,kBAAkB,GAAE,KAAK,EAAE,GAAW,EAA8B,EAAE;IACxE,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC;QACxB,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,uCAAuC;QAC5C,OAAO,EAAE;YACL,IAAI,EAAE,GAAG;SACZ;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,OAAO,YAAY,QAAQ;QAAE,MAAM,IAAI,QAAQ,CAAC,oCAAoC,EAAE,OAAO,CAAC,CAAC;IAEnG,OAAO,OAAO,CAAC,IAAI,CAAC;AACxB,CAAC,CAAC;AAEF,OAAO,EAAE,kBAAkB,EAAE,CAAC"} |
| import Axios from 'axios'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const YouTubeSearchings = async (title) => { | ||
| const searching = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube/search', | ||
| headers: { | ||
| value: title | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (searching instanceof Error) | ||
| throw new ErrorAPI('Error while fetching YouTube Search result data.', searching); | ||
| return searching.data; | ||
| }; | ||
| export { YouTubeSearchings }; | ||
| //# sourceMappingURL=YouTubeSearching.js.map |
| {"version":3,"file":"YouTubeSearching.js","sourceRoot":"","sources":["../../../../../src/API/Controller/Media/YouTubeSearching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,iBAAiB,GAAG,KAAK,EAAE,KAAa,EAA6B,EAAE;IACzE,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC;QAC1B,MAAM,EAAE,KAAK;QACb,GAAG,EAAE,8CAA8C;QACnD,OAAO,EAAE;YACL,KAAK,EAAE,KAAK;SACf;QACD,YAAY,EAAE,MAAM;KACvB,CAAC,CAAC;IAEH,IAAI,SAAS,YAAY,KAAK;QAAE,MAAM,IAAI,QAAQ,CAAC,kDAAkD,EAAE,SAAS,CAAC,CAAC;IAElH,OAAO,SAAS,CAAC,IAAI,CAAC;AAC1B,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"} |
| /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
| export class ErrorAPI extends Error { | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| constructor(message, options = {}) { | ||
| super(message); | ||
| this.name = 'ErrorAPI'; | ||
| this.date = new Date(); | ||
| this.message = message + [ | ||
| 'If you though this is a bug from our API, Please report this immediately to our support server https://discord.gg/du5rZjJNrq' | ||
| ].join('\n'); | ||
| } | ||
| static Errors(message, options = {}) { | ||
| return new ErrorAPI(message, options); | ||
| } | ||
| } | ||
| //# sourceMappingURL=errors.js.map |
| {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../src/API/utils/errors.ts"],"names":[],"mappings":"AAAA,uDAAuD;AACvD,MAAM,OAAO,QAAS,SAAQ,KAAK;IAE/B,6DAA6D;IAC7D,YAAa,OAAY,EAAE,OAAO,GAAG,EAAE;QACnC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,GAAG;YACrB,8HAA8H;SACjI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,MAAM,CAAC,OAAY,EAAE,OAAO,GAAG,EAAE;QACpC,OAAO,IAAI,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;CACJ"} |
| export * from './API/Controller/Media'; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"} |
| { | ||
| "type": "module" | ||
| } |
| /* eslint-disable @typescript-eslint/no-var-requires */ | ||
| const child_process = require('child_process'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const { promisify } = require('util'); | ||
| const exec = promisify(child_process.exec); | ||
| const fsAccess = promisify(fs.access); | ||
| const fileExists = async (filePath) => | ||
| fsAccess(filePath) | ||
| .then(() => true) | ||
| .catch(() => false); | ||
| const libPath = path.join(__dirname, '../lib'); | ||
| async function compileTypeScript () { | ||
| const out = await exec('npm run build').catch((error) => { | ||
| console.error('@devraiden/api:', 'Error running TypeScript\n', error); | ||
| process.exit(1); | ||
| }); | ||
| if (out.stdout.trim()) console.log(out.stdout); | ||
| if (out.stderr.trim()) console.error(out.stderr); | ||
| } | ||
| async function compileTypeScriptIfRequired () { | ||
| const typesPath = path.join(libPath, '@types'); | ||
| const libExists = await fileExists(libPath); | ||
| const typesExists = await fileExists(typesPath); | ||
| if (libExists && typesExists) return; | ||
| console.log('@devraiden/api:', 'Compiling TypeScript...'); | ||
| await compileTypeScript(); | ||
| } | ||
| if (require.main === module) compileTypeScriptIfRequired(); |
| /* eslint-disable @typescript-eslint/no-var-requires */ | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
| const { promisify } = require('util'); | ||
| const fsAccess = promisify(fs.access); | ||
| const fileExists = async (filePath) => | ||
| fsAccess(filePath) | ||
| .then(() => true) | ||
| .catch(() => false); | ||
| const libPath = path.join(__dirname, '../lib'); | ||
| async function writePackageJson () { | ||
| const libExists = await fileExists(libPath); | ||
| if (!libExists) { | ||
| console.error('@devraiden/api:', 'Lib folder not found after compiling TypeScript'); | ||
| process.exit(1); | ||
| } | ||
| const libCjs = path.join(libPath, 'cjs'); | ||
| const libCjsExists = await fileExists(libCjs); | ||
| if (libCjsExists) { | ||
| const packageJson = JSON.stringify({ type: 'commonjs' }, null, 2); | ||
| await fs.promises.writeFile(path.join(libCjs, 'package.json'), packageJson); | ||
| } else console.warn('@devraiden/api:', 'CJS folder not found'); | ||
| const libEsm = path.join(libPath, 'esm'); | ||
| const libEsmExists = await fileExists(libEsm); | ||
| if (libEsmExists) { | ||
| const packageJson = JSON.stringify({ type: 'module' }, null, 2); | ||
| await fs.promises.writeFile(path.join(libEsm, 'package.json'), packageJson); | ||
| } else console.warn('@devraiden/api:', 'ESM folder not found'); | ||
| const typesPath = path.join(libPath, '@types'); | ||
| const typesExists = await fileExists(typesPath); | ||
| if (!typesExists && !libEsmExists && !libCjsExists) { | ||
| console.error('@devraiden/api:', 'No compiled TypeScript files found'); | ||
| process.exit(1); | ||
| } | ||
| } | ||
| if (require.main === module) writePackageJson(); |
+36
-9
| { | ||
| "name": "@devraiden/api", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "Dev Raiden multipurpose API.", | ||
| "main": "dist/index.js", | ||
| "scripts": { | ||
| "dev": "nodemon", | ||
| "prod": "tsc && node ." | ||
| "prod": "tsc && node .", | ||
| "test": "npm run build && npm run test:cjs && npm run test:esm", | ||
| "test:cjs": "mocha --timeout 20000 ./lib/cjs/**/test.js", | ||
| "test:esm": "mocha --timeout 20000 ./lib/esm/**/test.js", | ||
| "build": "npm run clean && npm run build:cjs && npm run build:esm && npm run build:types && node scripts/write-package.js", | ||
| "build:cjs": "tsc --p src/tsconfig.cjs.json", | ||
| "build:esm": "tsc --p src/tsconfig.esm.json", | ||
| "build:types": "tsc --p tsconfig.types.json", | ||
| "lint:fix": "npx eslint src/** --fix --ignore-pattern src/*.json", | ||
| "clean": "rimraf ./lib", | ||
| "prepare": "node scripts/compile-typescript.js" | ||
| }, | ||
@@ -25,2 +34,3 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "@types/chai": "^4.3.1", | ||
| "@types/node": "^18.0.0", | ||
@@ -35,3 +45,6 @@ "@typescript-eslint/eslint-plugin": "^5.28.0", | ||
| "dependencies": { | ||
| "axios": "^0.27.2" | ||
| "@types/mocha": "^9.1.1", | ||
| "axios": "^0.27.2", | ||
| "chai": "^4.3.6", | ||
| "mocha": "^10.0.0" | ||
| }, | ||
@@ -48,2 +61,9 @@ "nodemonConfig": { | ||
| }, | ||
| "repository": { | ||
| "url": "git://github.com/Dev-Raiden/raiden-api.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/Dev-Raiden/raiden-api/issues" | ||
| }, | ||
| "homepage": "https://github.com/Dev-Raiden/raiden-api#readme", | ||
| "exports": { | ||
@@ -56,9 +76,16 @@ ".": { | ||
| }, | ||
| "repository": { | ||
| "url": "git://github.com/Dev-Raiden/raiden-api.git" | ||
| "main": "./lib/cjs/index.js", | ||
| "types": "./lib/@types/index.d.ts", | ||
| "engines": { | ||
| "node": ">= 16" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/Dev-Raiden/raiden-api/issues" | ||
| "directories": { | ||
| "lib": "lib", | ||
| "src": "src", | ||
| "scripts": "scripts" | ||
| }, | ||
| "homepage": "https://github.com/Dev-Raiden/raiden-api#readme" | ||
| "files": [ | ||
| "lib/*", | ||
| "scripts/*" | ||
| ] | ||
| } |
Sorry, the diff of this file is not supported yet
-35
| { | ||
| "root": true, | ||
| "env": { | ||
| "node": true | ||
| }, | ||
| "parser": "@typescript-eslint/parser", | ||
| "plugins": [ | ||
| "@typescript-eslint" | ||
| ], | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/eslint-recommended", | ||
| "plugin:@typescript-eslint/recommended" | ||
| ], | ||
| "rules": { | ||
| "comma-spacing": "error", | ||
| "comma-style": "error", | ||
| "max-nested-callbacks": ["error", { "max": 4 }], | ||
| "max-statements-per-line": ["error", { "max": 2 }], | ||
| "no-multi-spaces": "error", | ||
| "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], | ||
| "no-trailing-spaces": ["error"], | ||
| "no-var": "error", | ||
| "object-curly-spacing": ["error", "always"], | ||
| "prefer-const": "error", | ||
| "quotes": ["error", "single"], | ||
| "semi": ["error", "always"], | ||
| "space-before-blocks": "error", | ||
| "spaced-comment": "error", | ||
| "yoda": "error" | ||
| }, | ||
| "parserOptions": { | ||
| "ecmaVersion": "latest" | ||
| } | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const tslib_1 = require("tslib"); | ||
| tslib_1.__exportStar(require("./Instagram"), exports); | ||
| tslib_1.__exportStar(require("./YouTubeSearching"), exports); | ||
| tslib_1.__exportStar(require("./YouTube"), exports); | ||
| tslib_1.__exportStar(require("./TikTok"), exports); | ||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9zcmMvQVBJL0NvbnRyb2xsZXIvTWVkaWEvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsc0RBQTRCO0FBQzVCLDZEQUFtQztBQUNuQyxvREFBMEI7QUFDMUIsbURBQXlCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9JbnN0YWdyYW0nO1xuZXhwb3J0ICogZnJvbSAnLi9Zb3VUdWJlU2VhcmNoaW5nJztcbmV4cG9ydCAqIGZyb20gJy4vWW91VHViZSc7XG5leHBvcnQgKiBmcm9tICcuL1Rpa1Rvayc7Il19 |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.InstagramDownloader = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const axios_1 = tslib_1.__importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const InstagramDownloader = async (url) => { | ||
| const instagram = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/instagram', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (instagram instanceof Error) | ||
| throw new errors_1.ErrorAPI('Error while fetching instagram data', instagram); | ||
| return instagram.data; | ||
| }; | ||
| exports.InstagramDownloader = InstagramDownloader; | ||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5zdGFncmFtLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL0FQSS9Db250cm9sbGVyL01lZGlhL0luc3RhZ3JhbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsMERBQTBCO0FBRTFCLCtDQUE4QztBQUU5QyxNQUFNLG1CQUFtQixHQUFHLEtBQUssRUFBRSxHQUFXLEVBQXFDLEVBQUU7SUFDakYsTUFBTSxTQUFTLEdBQUcsTUFBTSxJQUFBLGVBQUssRUFBQztRQUMxQixNQUFNLEVBQUUsS0FBSztRQUNiLEdBQUcsRUFBRSx5Q0FBeUM7UUFDOUMsT0FBTyxFQUFFO1lBQ0wsSUFBSSxFQUFFLEdBQUc7U0FDWjtRQUNELFlBQVksRUFBRSxNQUFNO0tBQ3ZCLENBQUMsQ0FBQztJQUVILElBQUksU0FBUyxZQUFZLEtBQUs7UUFBRSxNQUFNLElBQUksaUJBQVEsQ0FBQyxxQ0FBcUMsRUFBRSxTQUFTLENBQUMsQ0FBQztJQUVyRyxPQUFPLFNBQVMsQ0FBQyxJQUFJLENBQUM7QUFDMUIsQ0FBQyxDQUFDO0FBRU8sa0RBQW1CIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IEF4aW9zIGZyb20gJ2F4aW9zJztcbmltcG9ydCB7IEluc3RhZ3JhbURvd25sb2FkZXJUeXBlcyB9IGZyb20gJy4uLy4uJztcbmltcG9ydCB7IEVycm9yQVBJIH0gZnJvbSAnLi4vLi4vdXRpbHMvZXJyb3JzJztcblxuY29uc3QgSW5zdGFncmFtRG93bmxvYWRlciA9IGFzeW5jICh1cmw6IHN0cmluZyk6IFByb21pc2U8SW5zdGFncmFtRG93bmxvYWRlclR5cGVzPiA9PiB7XG4gICAgY29uc3QgaW5zdGFncmFtID0gYXdhaXQgQXhpb3Moe1xuICAgICAgICBtZXRob2Q6ICdHRVQnLFxuICAgICAgICB1cmw6ICdodHRwczovL2FwaS5kZXZyYWlkZW4udGVjaC92MS9pbnN0YWdyYW0nLFxuICAgICAgICBoZWFkZXJzOiB7XG4gICAgICAgICAgICB1cmxzOiB1cmxcbiAgICAgICAgfSxcbiAgICAgICAgcmVzcG9uc2VUeXBlOiAnanNvbidcbiAgICB9KTtcblxuICAgIGlmIChpbnN0YWdyYW0gaW5zdGFuY2VvZiBFcnJvcikgdGhyb3cgbmV3IEVycm9yQVBJKCdFcnJvciB3aGlsZSBmZXRjaGluZyBpbnN0YWdyYW0gZGF0YScsIGluc3RhZ3JhbSk7XG5cbiAgICByZXR1cm4gaW5zdGFncmFtLmRhdGE7XG59O1xuXG5leHBvcnQgeyBJbnN0YWdyYW1Eb3dubG9hZGVyIH07Il19 |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.TikTokDownloader = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const axios_1 = tslib_1.__importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const TikTokDownloader = async (url) => { | ||
| const tiktoks = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/tiktok', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (tiktoks instanceof Error) | ||
| throw new errors_1.ErrorAPI('Error while fetching tiktok data', tiktoks); | ||
| return tiktoks.data;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9IGF3YWl0IEF4aW9zKHtcbiAgICAgICAgbWV0aG9kOiAnR0VUJyxcbiAgICAgICAgdXJsOiAnaHR0cHM6Ly9hcGkuZGV2cmFpZGVuLnRlY2gvdjEvdGlrdG9rJyxcbiAgICAgICAgaGVhZGVyczoge1xuICAgICAgICAgICAgdXJsczogdXJsXG4gICAgICAgIH0sXG4gICAgICAgIHJlc3BvbnNlVHlwZTogJ2pzb24nXG4gICAgfSk7XG5cbiAgICBpZiAodGlrdG9rcyBpbnN0YW5jZW9mIEVycm9yKSB0aHJvdyBuZXcgRXJyb3JBUEkoJ0Vycm9yIHdoaWxlIGZldGNoaW5nIHRpa3RvayBkYXRhJywgdGlrdG9rcyk7XG5cbiAgICByZXR1cm4gdGlrdG9rcy5kYXRhO1xufTtcblxuZXhwb3J0IHsgVGlrVG9rRG93bmxvYWRlciB9OyJdfQ== |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.YouTubeDownloaders = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const axios_1 = tslib_1.__importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const YouTubeDownloaders = async (url) => { | ||
| const youtube = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (youtube instanceof errors_1.ErrorAPI) | ||
| throw new errors_1.ErrorAPI('Error while fetching YouTube data.', youtube); | ||
| return youtube.data; | ||
| }; | ||
| exports.YouTubeDownloaders = YouTubeDownloaders; | ||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiWW91VHViZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BUEkvQ29udHJvbGxlci9NZWRpYS9Zb3VUdWJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiO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XG5cbiAgICBpZiAoeW91dHViZSBpbnN0YW5jZW9mIEVycm9yQVBJKSB0aHJvdyBuZXcgRXJyb3JBUEkoJ0Vycm9yIHdoaWxlIGZldGNoaW5nIFlvdVR1YmUgZGF0YS4nLCB5b3V0dWJlKTtcblxuICAgIHJldHVybiB5b3V0dWJlLmRhdGE7XG59O1xuXG5leHBvcnQgeyBZb3VUdWJlRG93bmxvYWRlcnMgfTsiXX0= |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.YouTubeSearchings = void 0; | ||
| const tslib_1 = require("tslib"); | ||
| const axios_1 = tslib_1.__importDefault(require("axios")); | ||
| const errors_1 = require("../../utils/errors"); | ||
| const YouTubeSearchings = async (title) => { | ||
| const searching = await (0, axios_1.default)({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube/search', | ||
| headers: { | ||
| value: title | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (searching instanceof Error) | ||
| throw new errors_1.ErrorAPI('Error while fetching YouTube Search result data.', searching); | ||
| return searching.data; | ||
| }; | ||
| exports.YouTubeSearchings = YouTubeSearchings; | ||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiWW91VHViZVNlYXJjaGluZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9BUEkvQ29udHJvbGxlci9NZWRpYS9Zb3VUdWJlU2VhcmNoaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSwwREFBMEI7QUFFMUIsK0NBQThDO0FBRTlDLE1BQU0saUJBQWlCLEdBQUcsS0FBSyxFQUFFLEtBQWEsRUFBNkIsRUFBRTtJQUN6RSxNQUFNLFNBQVMsR0FBRyxNQUFNLElBQUEsZUFBSyxFQUFDO1FBQzFCLE1BQU0sRUFBRSxLQUFLO1FBQ2IsR0FBRyxFQUFFLDhDQUE4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xuZXhwb3J0IHsgWW91VHViZVNlYXJjaGluZ3MgfTsiXX0= |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.ErrorAPI = void 0; | ||
| /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
| class ErrorAPI extends Error { | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| constructor(message, options = {}) { | ||
| super(message); | ||
| this.name = 'ErrorAPI'; | ||
| this.date = new Date(); | ||
| this.message = message + [ | ||
| 'If you though this is a bug from our API, Please report this immediately to our support server https://discord.gg/du5rZjJNrq' | ||
| ].join('\n'); | ||
| } | ||
| static Errors(message, options = {}) { | ||
| return new ErrorAPI(message, options); | ||
| } | ||
| } | ||
| exports.ErrorAPI = ErrorAPI; | ||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL0FQSS91dGlscy9lcnJvcnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdURBQXVEO0FBQ3ZELE1BQWEsUUFBUyxTQUFRLEtBQUs7SUFFL0IsNkRBQTZEO0lBQzdELFlBQWEsT0FBWSxFQUFFLE9BQU8sR0FBRyxFQUFFO1FBQ25DLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNmLElBQUksQ0FBQyxJQUFJLEdBQUcsVUFBVSxDQUFDO1FBQ3ZCLElBQUksQ0FBQyxJQUFJLEdBQUcsSUFBSSxJQUFJLEVBQUUsQ0FBQztRQUN2QixJQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sR0FBRztZQUNyQiw4SEFBOEg7U0FDakksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDakIsQ0FBQztJQUVELE1BQU0sQ0FBQyxNQUFNLENBQUMsT0FBWSxFQUFFLE9BQU8sR0FBRyxFQUFFO1FBQ3BDLE9BQU8sSUFBSSxRQUFRLENBQUMsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQzFDLENBQUM7Q0FDSjtBQWZELDRCQWVDIiwic291cmNlc0NvbnRlbnQiOlsiLyogZXNsaW50LWRpc2FibGUgQHR5cGVzY3JpcHQtZXNsaW50L25vLWV4cGxpY2l0LWFueSAqL1xuZXhwb3J0IGNsYXNzIEVycm9yQVBJIGV4dGVuZHMgRXJyb3Ige1xuICAgIHJlYWRvbmx5IGRhdGU6IERhdGU7XG4gICAgLy8gZXNsaW50LWRpc2FibGUtbmV4dC1saW5lIEB0eXBlc2NyaXB0LWVzbGludC9uby11bnVzZWQtdmFyc1xuICAgIGNvbnN0cnVjdG9yIChtZXNzYWdlOiBhbnksIG9wdGlvbnMgPSB7fSkge1xuICAgICAgICBzdXBlcihtZXNzYWdlKTtcbiAgICAgICAgdGhpcy5uYW1lID0gJ0Vycm9yQVBJJztcbiAgICAgICAgdGhpcy5kYXRlID0gbmV3IERhdGUoKTtcbiAgICAgICAgdGhpcy5tZXNzYWdlID0gbWVzc2FnZSArIFtcbiAgICAgICAgICAgICdJZiB5b3UgdGhvdWdoIHRoaXMgaXMgYSBidWcgZnJvbSBvdXIgQVBJLCBQbGVhc2UgcmVwb3J0IHRoaXMgaW1tZWRpYXRlbHkgdG8gb3VyIHN1cHBvcnQgc2VydmVyIGh0dHBzOi8vZGlzY29yZC5nZy9kdTVyWmpKTnJxJ1xuICAgICAgICBdLmpvaW4oJ1xcbicpO1xuICAgIH1cblxuICAgIHN0YXRpYyBFcnJvcnMobWVzc2FnZTogYW55LCBvcHRpb25zID0ge30pOiBFcnJvckFQSSB7XG4gICAgICAgIHJldHVybiBuZXcgRXJyb3JBUEkobWVzc2FnZSwgb3B0aW9ucyk7XG4gICAgfVxufSJdfQ== |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const tslib_1 = require("tslib"); | ||
| tslib_1.__exportStar(require("./API/Controller/Media"), exports); | ||
| //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsaUVBQXVDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9BUEkvQ29udHJvbGxlci9NZWRpYSc7Il19 |
Sorry, the diff of this file is not supported yet
| export * from './Instagram'; | ||
| export * from './YouTubeSearching'; | ||
| export * from './YouTube'; | ||
| export * from './TikTok'; |
| import Axios from 'axios'; | ||
| import { InstagramDownloaderTypes } from '../..'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const InstagramDownloader = async (url: string): Promise<InstagramDownloaderTypes> => { | ||
| const instagram = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/instagram', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (instagram instanceof Error) throw new ErrorAPI('Error while fetching instagram data', instagram); | ||
| return instagram.data; | ||
| }; | ||
| export { InstagramDownloader }; |
| import Axios from 'axios'; | ||
| import { TikTokDownloaderTypes } from '../..'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const TikTokDownloader = async (url: string): Promise<TikTokDownloaderTypes> => { | ||
| const tiktoks = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/tiktok', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (tiktoks instanceof Error) throw new ErrorAPI('Error while fetching tiktok data', tiktoks); | ||
| return tiktoks.data; | ||
| }; | ||
| export { TikTokDownloader }; |
| import Axios from 'axios'; | ||
| import { YouTubeDownloader } from '../..'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const YouTubeDownloaders= async (url: string): Promise<YouTubeDownloader> => { | ||
| const youtube = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube', | ||
| headers: { | ||
| urls: url | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (youtube instanceof ErrorAPI) throw new ErrorAPI('Error while fetching YouTube data.', youtube); | ||
| return youtube.data; | ||
| }; | ||
| export { YouTubeDownloaders }; |
| import Axios from 'axios'; | ||
| import { YouTubeSearching } from '../..'; | ||
| import { ErrorAPI } from '../../utils/errors'; | ||
| const YouTubeSearchings = async (title: string): Promise<YouTubeSearching> => { | ||
| const searching = await Axios({ | ||
| method: 'GET', | ||
| url: 'https://api.devraiden.tech/v1/youtube/search', | ||
| headers: { | ||
| value: title | ||
| }, | ||
| responseType: 'json' | ||
| }); | ||
| if (searching instanceof Error) throw new ErrorAPI('Error while fetching YouTube Search result data.', searching); | ||
| return searching.data; | ||
| }; | ||
| export { YouTubeSearchings }; |
| interface TikTokDownloader { | ||
| author: string; | ||
| description: string; | ||
| video: { | ||
| [Key: string]: string; | ||
| } | ||
| } | ||
| export type TikTokDownloaderTypes = TikTokDownloader & { | ||
| video: { | ||
| without_watermark_v1: string; | ||
| without_watermark_v2: string; | ||
| without_watermark_raw: string; | ||
| } | ||
| } | ||
| interface InstagramDownloader { | ||
| url: string ; | ||
| } | ||
| export type InstagramDownloaderTypes = InstagramDownloader & { | ||
| thumbnail: string; | ||
| } | ||
| interface YouTubeDownloader { | ||
| video_id: string, | ||
| video_v_id: string; | ||
| video_thumbnail: string; | ||
| video_title: string; | ||
| files: { | ||
| video: YouTubeDownloaderVideoOrAudio; | ||
| audio: YouTubeDownloaderVideoOrAudio; | ||
| } | ||
| } | ||
| export type YouTubeDownloaderVideoOrAudio = { | ||
| [key: string]: { | ||
| video_quality: string; | ||
| video_sizeH: string; | ||
| video_size: number; | ||
| video_download(): Promise<string>; | ||
| } | ||
| } | ||
| export interface YouTubeSearching { | ||
| video: { | ||
| author: string; | ||
| authorUrl?: string; | ||
| videoId: string; | ||
| url: string; | ||
| thumbnail: string; | ||
| title: string; | ||
| description?: string; | ||
| publishedTimes: string; | ||
| durationH: string; | ||
| durationS: number; | ||
| duration: string; | ||
| viewH: string; | ||
| view: string; | ||
| type: 'video'; | ||
| }[]; | ||
| channels: { | ||
| channelId: string; | ||
| url: string; | ||
| channelName: string; | ||
| profileUrl: string; | ||
| isVerif: boolean; | ||
| subscriberH: string; | ||
| subscribers: string; | ||
| videoCOunt: number; | ||
| description: string; | ||
| type: 'channel'; | ||
| }[]; | ||
| playlist: { | ||
| playlistId: string; | ||
| title: string; | ||
| thumbnail: string; | ||
| video: { | ||
| videoId: string; | ||
| title: string; | ||
| durationH: string; | ||
| duration: string; | ||
| }[]; | ||
| type: 'mix'; | ||
| }[]; | ||
| } |
| /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
| export class ErrorAPI extends Error { | ||
| readonly date: Date; | ||
| // eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
| constructor (message: any, options = {}) { | ||
| super(message); | ||
| this.name = 'ErrorAPI'; | ||
| this.date = new Date(); | ||
| this.message = message + [ | ||
| 'If you though this is a bug from our API, Please report this immediately to our support server https://discord.gg/du5rZjJNrq' | ||
| ].join('\n'); | ||
| } | ||
| static Errors(message: any, options = {}): ErrorAPI { | ||
| return new ErrorAPI(message, options); | ||
| } | ||
| } |
| export * from './API/Controller/Media'; |
| { | ||
| "compilerOptions": { | ||
| "module": "CommonJS", | ||
| "target": "ES2020", | ||
| "outDir": "dist", | ||
| "sourceMap": false, | ||
| "inlineSourceMap": true, | ||
| "inlineSources": true, | ||
| "incremental": true, | ||
| "esModuleInterop": true, | ||
| "experimentalDecorators": true, | ||
| "emitDecoratorMetadata": true, | ||
| "noImplicitAny": false, | ||
| "skipLibCheck": true, | ||
| "resolveJsonModule": true, | ||
| "importHelpers": true | ||
| }, | ||
| "include": ["src/**/*"], | ||
| "exclude": ["node_modules"] | ||
| } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
61
177.27%495
73.08%76208
-2.71%4
300%8
14.29%4
100%2
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added