Wrote docs for basic data getters
This commit is contained in:
parent
647c6ca0de
commit
c2d556a814
80
README.md
80
README.md
|
|
@ -21,54 +21,6 @@ Because of this, I decided to build my own version of a youtube music api with T
|
||||||
- Albums
|
- Albums
|
||||||
- Playlists
|
- Playlists
|
||||||
|
|
||||||
#### `getSong`
|
|
||||||
|
|
||||||
This function takes in the following parameters
|
|
||||||
|
|
||||||
| Name | Data Type | Description |
|
|
||||||
| :------ | :-------- | :---------- |
|
|
||||||
| videoId | `string` | Video ID |
|
|
||||||
|
|
||||||
The function returns a `Promise<`[SongFull](#SongFull)`>` which is the information about the song
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ytmusic.getSong("v7bnOxV4jAc").then(song => {
|
|
||||||
console.log(song)
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `getVideo`
|
|
||||||
|
|
||||||
This function takes in the following parameters
|
|
||||||
|
|
||||||
| Name | Data Type | Description |
|
|
||||||
| :------ | :-------- | :---------- |
|
|
||||||
| videoId | `string` | Video ID |
|
|
||||||
|
|
||||||
The function returns a `Promise<`[VideoFull](#VideoFull)`>` which is the information about the video
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ytmusic.getVideo("v7bnOxV4jAc").then(video => {
|
|
||||||
console.log(video)
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `getArtist`
|
|
||||||
|
|
||||||
This function takes in the following parameters
|
|
||||||
|
|
||||||
| Name | Data Type | Description |
|
|
||||||
| :------- | :-------- | :---------- |
|
|
||||||
| artistId | `string` | Artist ID |
|
|
||||||
|
|
||||||
The function returns a `Promise<`[ArtistFull](#ArtistFull)`>` which is the information about the artist
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ytmusic.getArtist("UCTUR0sVEkD8T5MlSHqgaI_Q").then(artist => {
|
|
||||||
console.log(artist)
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `getArtistSongs`
|
#### `getArtistSongs`
|
||||||
|
|
||||||
This function takes in the following parameters
|
This function takes in the following parameters
|
||||||
|
|
@ -101,38 +53,6 @@ ytmusic.getArtistAlbums("UCTUR0sVEkD8T5MlSHqgaI_Q").then(artistAlbums => {
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### `getAlbum`
|
|
||||||
|
|
||||||
This function takes in the following parameters
|
|
||||||
|
|
||||||
| Name | Data Type | Description |
|
|
||||||
| :------ | :-------- | :---------- |
|
|
||||||
| albumId | `string` | Album ID |
|
|
||||||
|
|
||||||
The function returns a `Promise<`[AlbumFull](#AlbumFull)`>` which is the information about the album
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ytmusic.getAlbum("MPREb_iG5q5DIdhdA").then(album => {
|
|
||||||
console.log(album)
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `getPlaylist`
|
|
||||||
|
|
||||||
This function takes in the following parameters
|
|
||||||
|
|
||||||
| Name | Data Type | Description |
|
|
||||||
| :--------- | :-------- | :---------- |
|
|
||||||
| playlistId | `string` | Playlist ID |
|
|
||||||
|
|
||||||
The function returns a `Promise<`[PlaylistFull](#PlaylistFull)`>` which is the information about the playlist (without the videos)
|
|
||||||
|
|
||||||
```ts
|
|
||||||
ytmusic.getPlaylist("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(playlist => {
|
|
||||||
console.log(playlist)
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### `getPlaylistVideos`
|
#### `getPlaylistVideos`
|
||||||
|
|
||||||
This function takes in the following parameters
|
This function takes in the following parameters
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Getting an album
|
||||||
|
|
||||||
|
`getAlbum()` will fetch you information about a specific album by it's ID.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
ytmusic.getAlbum("MPREb_iG5q5DIdhdA").then(album => {
|
||||||
|
console.log(album)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [reference](../../references/ytmusic-methods/getAlbum.html) for more information.
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Getting an artist
|
||||||
|
|
||||||
|
`getArtist()` will fetch you information about a specific artist by it's ID.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
ytmusic.getArtist("UCTUR0sVEkD8T5MlSHqgaI_Q").then(artist => {
|
||||||
|
console.log(artist)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [reference](../../references/ytmusic-methods/getArtist.html) for more information.
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Getting a playlist
|
||||||
|
|
||||||
|
`getPlaylist()` will fetch you information about a specific playlist by it's ID.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
ytmusic.getPlaylist("OLAK5uy_nRb467jR73IXKybwzw22_rTYIJ808x4Yc").then(playlist => {
|
||||||
|
console.log(playlist)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [reference](../../references/ytmusic-methods/getPlaylist.html) for more information.
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Getting a song
|
||||||
|
|
||||||
|
`getSong()` will fetch you information about a specific song by it's ID.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
ytmusic.getSong("v7bnOxV4jAc").then(song => {
|
||||||
|
console.log(song)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [reference](../../references/ytmusic-methods/getSong.html) for more information.
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# Getting a video
|
||||||
|
|
||||||
|
`getVideo()` will fetch you information about a specific video by it's ID.
|
||||||
|
|
||||||
|
```ts
|
||||||
|
ytmusic.getVideo("v7bnOxV4jAc").then(video => {
|
||||||
|
console.log(video)
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
See the [reference](../../references/ytmusic-methods/getVideo.html) for more information.
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# getAlbum
|
||||||
|
|
||||||
|
See the [guide](../../guides/usage/getAlbum.html) for information on how to use this.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Data Type | Description |
|
||||||
|
| :-------- | :-------- | :---------- |
|
||||||
|
| `albumId` | `string` | Album ID |
|
||||||
|
|
||||||
|
## Returns
|
||||||
|
|
||||||
|
`Promise<`[AlbumFull](../interfaces/AlbumFull.html)`>`
|
||||||
|
|
||||||
|
## TypeScript Source Code
|
||||||
|
|
||||||
|
```ts
|
||||||
|
public async getAlbum(albumId: string): Promise<AlbumFull>
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# getArtist
|
||||||
|
|
||||||
|
See the [guide](../../guides/usage/getArtist.html) for information on how to use this.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Data Type | Description |
|
||||||
|
| :--------- | :-------- | :---------- |
|
||||||
|
| `artistId` | `string` | Artist ID |
|
||||||
|
|
||||||
|
## Returns
|
||||||
|
|
||||||
|
`Promise<`[ArtistFull](../interfaces/ArtistFull.html)`>`
|
||||||
|
|
||||||
|
## TypeScript Source Code
|
||||||
|
|
||||||
|
```ts
|
||||||
|
public async getArtist(artistId: string): Promise<ArtistFull>
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# getPlaylist
|
||||||
|
|
||||||
|
See the [guide](../../guides/usage/getPlaylist.html) for information on how to use this.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Data Type | Description |
|
||||||
|
| :----------- | :-------- | :---------- |
|
||||||
|
| `playlistId` | `string` | Playlist ID |
|
||||||
|
|
||||||
|
## Returns
|
||||||
|
|
||||||
|
`Promise<`[PlaylistFull](../interfaces/PlaylistFull.html)`>`
|
||||||
|
|
||||||
|
## TypeScript Source Code
|
||||||
|
|
||||||
|
```ts
|
||||||
|
public async getPlaylist(playlistId: string): Promise<PlaylistFull>
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# getSong
|
||||||
|
|
||||||
|
See the [guide](../../guides/usage/getSong.html) for information on how to use this.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Data Type | Description |
|
||||||
|
| :-------- | :-------- | :---------- |
|
||||||
|
| `videoId` | `string` | Video ID |
|
||||||
|
|
||||||
|
## Returns
|
||||||
|
|
||||||
|
`Promise<`[SongFull](../interfaces/SongFull.html)`>`
|
||||||
|
|
||||||
|
## TypeScript Source Code
|
||||||
|
|
||||||
|
```ts
|
||||||
|
public async getSong(videoId: string): Promise<SongFull>
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
# getVideo
|
||||||
|
|
||||||
|
See the [guide](../../guides/usage/getVideo.html) for information on how to use this.
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Name | Data Type | Description |
|
||||||
|
| :-------- | :-------- | :---------- |
|
||||||
|
| `videoId` | `string` | Video ID |
|
||||||
|
|
||||||
|
## Returns
|
||||||
|
|
||||||
|
`Promise<`[VideoFull](../interfaces/VideoFull.html)`>`
|
||||||
|
|
||||||
|
## TypeScript Source Code
|
||||||
|
|
||||||
|
```ts
|
||||||
|
public async getVideo(videoId: string): Promise<VideoFull>
|
||||||
|
```
|
||||||
Loading…
Reference in New Issue