better-youtube-api
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -23,5 +23,5 @@ "use strict"; | ||
const video = data; | ||
this._length = video.contentDetails.duration; | ||
this.minutes = parseInt(this._length.substring(this._length.indexOf('PT') + 2, this._length.indexOf('M'))); | ||
this.seconds = parseInt(this._length.substring(this._length.indexOf('M') + 1, this._length.length - 1)); | ||
this._length = new Date(video.contentDetails.duration); | ||
this.minutes = this._length.getMinutes() + (this._length.getHours() * 60); | ||
this.seconds = this._length.getSeconds(); | ||
this.likes = Number(video.statistics.likeCount); | ||
@@ -28,0 +28,0 @@ this.dislikes = Number(video.statistics.dislikeCount); |
{ | ||
"name": "better-youtube-api", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "A very easy to use promise-based Youtube Data v3 API.", | ||
@@ -5,0 +5,0 @@ "main": "out/index.js", |
@@ -60,3 +60,3 @@ import { YouTube } from '..' | ||
private _length: string | ||
private _length: Date | ||
@@ -122,5 +122,5 @@ /** | ||
this._length = video.contentDetails.duration | ||
this.minutes = parseInt(this._length.substring(this._length.indexOf('PT') + 2, this._length.indexOf('M'))) | ||
this.seconds = parseInt(this._length.substring(this._length.indexOf('M') + 1, this._length.length - 1)) | ||
this._length = new Date(video.contentDetails.duration) | ||
this.minutes = this._length.getMinutes() + (this._length.getHours() * 60) | ||
this.seconds = this._length.getSeconds() | ||
@@ -127,0 +127,0 @@ this.likes = Number(video.statistics.likeCount) |
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
30
76054