Comparing version 0.2.5 to 0.2.6
{ | ||
"name": "yt-api", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "A light weight, easy, and super fast way of interacting with the YouTube Data API v3.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -25,2 +25,15 @@ # Welcome to the yt-api a light weight, easy, and super fast way of interacting with the YouTube Data API v3. | ||
# Getting playlists | ||
```javascript | ||
API.getPlaylist("PLxYB-Vuz54ip2mYZrZvit7l6kHL5gGHZI").then(p => { | ||
console.log(` | ||
Playlist title: ${p.playlistTitle} | ||
Playlist thumbnail: ${p.playlistThumbnail} | ||
Playlist creator: ${p.playlistCreator} | ||
Playlist id: ${p.playlistId} | ||
Playlist videos: ${p.playlistVideos.map(v=>`${v.title} | ${v.url}`).join('\n')} | ||
`); | ||
}); | ||
``` | ||
# Searching for a video | ||
@@ -27,0 +40,0 @@ ```javascript |
@@ -30,3 +30,3 @@ const snekfetch = require("snekfetch"); | ||
category: data.snippet.categoryId, | ||
thumbnail: `https://i.ytimg.com/vi/${data.snippet.resourceId.videoId}/${data.snippet.thumbnails ? "maxres" : "mq" }default.jpg`, | ||
thumbnail: `https://i.ytimg.com/vi/${data.id}/${data.snippet.thumbnails ? "maxres" : "mq" }default.jpg`, | ||
description: data.snippet.description, | ||
@@ -79,3 +79,3 @@ publishDate: data.snippet.publishedAt, | ||
playlistId: playlistId, | ||
playlistThumbnail: playlistParsed.items[0].snippet.thumbnails.maxres.url, | ||
playlistThumbnail: playlistParsed.items[0].snippet.thumbnails ? playlistParsed.items[0].snippet.thumbnails.maxres.url : playlistParsed.items[0].snippet.thumbnails.medium.url, | ||
playlistCreator: playlistParsed.items[0].snippet.channelTitle, | ||
@@ -82,0 +82,0 @@ playlistVideos: videos |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11449
56