Updated README

This commit is contained in:
Zechariah 2022-03-28 03:23:05 +08:00
parent 59c6458738
commit f14a478d7d
1 changed files with 14 additions and 23 deletions

View File

@ -22,14 +22,6 @@ Because of this, I decided to build my own version of a youtube music api with T
## Installation ## Installation
With `yarn`
```
$ yarn add ytmusic-api
```
With `npm`
``` ```
$ npm i ytmusic-api $ npm i ytmusic-api
``` ```
@ -294,7 +286,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| Name | Data Type | Description | | Name | Data Type | Description |
| :--------- | :---------------------------------- | :------------------ | | :--------- | :---------------------------------- | :------------------ |
| type | `"SONG"` | Type of data | | type | `"SONG"` | Type of data |
| videoId | `string \| null` | YouTube Video ID | | videoId | `string` | YouTube Video ID |
| name | `string` | Name | | name | `string` | Name |
| artists | [ArtistBasic](#ArtistBasic)`[]` | Artists | | artists | [ArtistBasic](#ArtistBasic)`[]` | Artists |
| album | [AlbumBasic](#AlbumBasic) | Album | | album | [AlbumBasic](#AlbumBasic) | Album |
@ -306,7 +298,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| Name | Data Type | Description | | Name | Data Type | Description |
| :-------------- | :---------------------------------- | :--------------------- | | :-------------- | :---------------------------------- | :--------------------- |
| type | `"SONG"` | Type of data | | type | `"SONG"` | Type of data |
| videoId | `string \| null` | YouTube Video ID | | videoId | `string` | YouTube Video ID |
| name | `string` | Name | | name | `string` | Name |
| artists | [ArtistBasic](#ArtistBasic)`[]` | Artists | | artists | [ArtistBasic](#ArtistBasic)`[]` | Artists |
| duration | `number` | Duration in seconds | | duration | `number` | Duration in seconds |
@ -320,7 +312,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| Name | Data Type | Description | | Name | Data Type | Description |
| :--------- | :---------------------------------- | :------------------------------ | | :--------- | :---------------------------------- | :------------------------------ |
| type | `"VIDEO"` | Type of data | | type | `"VIDEO"` | Type of data |
| videoId | `string \| null` | YouTube Video ID | | videoId | `string` | YouTube Video ID |
| name | `string` | Name | | name | `string` | Name |
| artists | [ArtistBasic](#ArtistBasic)`[]` | Channels that created the video | | artists | [ArtistBasic](#ArtistBasic)`[]` | Channels that created the video |
| views | `number` | View count | | views | `number` | View count |
@ -332,7 +324,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| Name | Data Type | Description | | Name | Data Type | Description |
| :---------- | :---------------------------------- | :------------------------------------- | | :---------- | :---------------------------------- | :------------------------------------- |
| type | `"VIDEO"` | Type of data | | type | `"VIDEO"` | Type of data |
| videoId | `string \| null` | YouTube Video ID | | videoId | `string` | YouTube Video ID |
| name | `string` | Name | | name | `string` | Name |
| artists | [ArtistBasic](#ArtistBasic)`[]` | Channels that created the video | | artists | [ArtistBasic](#ArtistBasic)`[]` | Channels that created the video |
| views | `number` | View count | | views | `number` | View count |
@ -348,7 +340,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| Name | Data Type | Description | | Name | Data Type | Description |
| :------- | :--------------- | :---------- | | :------- | :--------------- | :---------- |
| artistId | `string \| null` | Artist ID | | artistId | `string` | Artist ID |
| name | `string` | Name | | name | `string` | Name |
#### `ArtistDetailed` #### `ArtistDetailed`
@ -368,7 +360,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| artistId | `string` | Artist ID | | artistId | `string` | Artist ID |
| name | `string` | Name | | name | `string` | Name |
| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | | thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails |
| description | `string \| null` | Description | | description | `string` | Description |
| subscribers | `number` | Number of subscribers the Artist has | | subscribers | `number` | Number of subscribers the Artist has |
| topSongs | `Omit<`[SongDetailed](#SongDetailed)`, "duration">[]` | Top Songs from Artist | | topSongs | `Omit<`[SongDetailed](#SongDetailed)`, "duration">[]` | Top Songs from Artist |
| topAlbums | [AlbumDetailed](#AlbumDetailed)`[]` | Top Albums from Artist | | topAlbums | [AlbumDetailed](#AlbumDetailed)`[]` | Top Albums from Artist |
@ -403,7 +395,7 @@ ytmusic.getPlaylistVideos("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(play
| artists | [ArtistBasic](#ArtistBasic)`[]` | Creators of the Album | | artists | [ArtistBasic](#ArtistBasic)`[]` | Creators of the Album |
| year | `number` | Publication Year | | year | `number` | Publication Year |
| thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails | | thumbnails | [ThumbnailFull](#ThumbnailFull)`[]` | Thumbnails |
| description | `string \| null` | Description | | description | `string` | Description |
| songs | [SongDetailed](#SongDetailed)`[]` | Songs in the Album | | songs | [SongDetailed](#SongDetailed)`[]` | Songs in the Album |
#### `PlaylistFull` #### `PlaylistFull`
@ -426,7 +418,7 @@ A lot of the credit should go to [youtube-music-api](https://npmjs.com/package/y
## Testing ## Testing
YTMusic API's data return types are tested with Jest. To run the tests, run the command YTMusic API's data return types are tested with Mocha. To run the tests, run the command
``` ```
$ npm run test $ npm run test
@ -435,18 +427,17 @@ $ npm run test
## Built with ## Built with
- TypeScript - TypeScript
- [![@types/jest](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@types/jest?style=flat-square)](https://npmjs.com/package/@types/jest) - [![@types/mocha](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@types/mocha?style=flat-square)](https://npmjs.com/package/@types/mocha)
- [![@types/node](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@types/node?style=flat-square)](https://npmjs.com/package/@types/node)
- [![@types/tough-cookie](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@types/tough-cookie?style=flat-square)](https://npmjs.com/package/@types/tough-cookie) - [![@types/tough-cookie](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@types/tough-cookie?style=flat-square)](https://npmjs.com/package/@types/tough-cookie)
- [![typescript](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/typescript?style=flat-square)](https://npmjs.com/package/typescript) - [![typescript](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/typescript?style=flat-square)](https://npmjs.com/package/typescript)
- Axios - Axios
- [![axios](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/axios?style=flat-square)](https://npmjs.com/package/axios) - [![axios](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/axios?style=flat-square)](https://npmjs.com/package/axios)
- Tough Cookie - Tough Cookie
- [![tough-cookie](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/tough-cookie?style=flat-square)](https://npmjs.com/package/tough-cookie) - [![tough-cookie](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/tough-cookie?style=flat-square)](https://npmjs.com/package/tough-cookie)
- Jest - Mocha
- [![@babel/core](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@babel/core?style=flat-square)](https://npmjs.com/package/@babel/core) - [![mocha](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/mocha?style=flat-square)](https://npmjs.com/package/mocha)
- [![@babel/preset-env](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@babel/preset-env?style=flat-square)](https://npmjs.com/package/@babel/preset-env) - [![mocha.parallel](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/mocha.parallel?style=flat-square)](https://npmjs.com/package/mocha.parallel)
- [![@babel/preset-typescript](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/@babel/preset-typescript?style=flat-square)](https://npmjs.com/package/@babel/preset-typescript) - [![ts-mocha](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/ts-mocha?style=flat-square)](https://npmjs.com/package/ts-mocha)
- [![babel-jest](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/babel-jest?style=flat-square)](https://npmjs.com/package/babel-jest)
- [![jest](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/jest?style=flat-square)](https://npmjs.com/package/jest)
- Miscellaneous - Miscellaneous
- [![validate-any](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/validate-any?style=flat-square)](https://npmjs.com/package/validate-any) - [![validate-any](https://img.shields.io/github/package-json/dependency-version/zS1L3NT/ts-npm-ytmusic-api/dev/validate-any?style=flat-square)](https://npmjs.com/package/validate-any)