Comparing version 0.2.1 to 0.2.2
{ | ||
"name": "yt-api", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"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", |
@@ -11,3 +11,3 @@ const snekfetch = require("snekfetch"); | ||
return new Promise(async (res, rej) => { | ||
let apiResponse = snekfetch.get(`https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,liveStreamingDetails,contentDetails&id=${id}&key=${this.key}`); | ||
let apiResponse = await snekfetch.get(`https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,liveStreamingDetails,contentDetails&id=${id}&key=${this.key}`); | ||
let json = JSON.parse(apiResponse.text); | ||
@@ -54,3 +54,3 @@ let data = json.items[0]; | ||
return new Promise(async (res, rej) => { | ||
let apiResponse = snekfetch.get(`https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=${encodeURIComponent(search)}&type=video&key=${this.key}`); | ||
let apiResponse = await snekfetch.get(`https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=${encodeURIComponent(search)}&type=video&key=${this.key}`); | ||
let json = JSON.parse(apiResponse.text); | ||
@@ -76,3 +76,3 @@ let data = json.items[0]; | ||
return new Promise(async (res, rej) => { | ||
let apiResponse = snekfetch.get(`https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=${encodeURIComponent(search)}&type=video&maxResults=${maxResults}&key=${this.key}`); | ||
let apiResponse = await snekfetch.get(`https://www.googleapis.com/youtube/v3/search?part=id,snippet&q=${encodeURIComponent(search)}&type=video&maxResults=${maxResults}&key=${this.key}`); | ||
let json = JSON.parse(apiResponse.text); | ||
@@ -79,0 +79,0 @@ if(!json.items[0]) rej("No videos were found for this search!"); |
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
8592