Skip to content

Commit

Permalink
feat(ytmp3): Add new utilities APIs
Browse files Browse the repository at this point in the history
* Included and exported the `extractVideoId`, `validateUrl`, and `validateId` functions as standalone API functions
* Included and exported all custom error class from `lib/error` module
* Exported the `YTURLUtils` (aliased from `URLUtils`) class for develoers working with YouTube URLs
  • Loading branch information
mitsuki31 committed Aug 21, 2024
1 parent 82094da commit 5d34846
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ const {
} = require('./lib/audioconv');
const { logger: log, dropNullAndUndefined } = require('./lib/utils');
const { importConfig } = require('./lib/config');
const URLUtils = require('./lib/url-utils');
const error = require('./lib/error');
const ytmp3 = require('./lib/ytmp3');
const pkg = require('./package.json');

Expand Down Expand Up @@ -456,10 +458,18 @@ module.exports = Object.freeze({
singleDownload: ytmp3.singleDownload,
batchDownload: ytmp3.batchDownload,
getVideosInfo: ytmp3.getVideosInfo,
// :: URLUtils
YTURLUtils: URLUtils, // aliased to `YTURLUtils` for readability
extractVideoId: URLUtils.extractVideoId,
validateUrl: URLUtils.validateUrl,
validateId: URLUtils.validateId,
// :: audioconv
defaultAudioConvOptions,
checkFfmpeg,
convertAudio,
// :: error
IDExtractorError: error.IDExtractorError,
UnknownOptionError: error.UnknownOptionError
});


Expand Down

0 comments on commit 5d34846

Please sign in to comment.