Comparing version 2.6.0 to 2.6.1
@@ -810,4 +810,22 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.ytSearch = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){ | ||
var json = JSON.parse(jsonString); //console.log( json ) | ||
// check for errors (ex: noexist/unviewable playlist) | ||
var plerr = _jp.value(json, '$..alerts..alertRenderer'); | ||
if (plerr && typeof plerr.type === 'string' && plerr.type.toLowerCase() === 'error') { | ||
var plerrtext = 'playlist error, not found?'; | ||
if (_typeof(plerr.text) === 'object') { | ||
plerrtext = _jp.query(plerr.text, '$..text').join(''); | ||
} | ||
if (typeof plerr.text === 'string') { | ||
plerrtext = plerr.text; | ||
} | ||
throw new Error('playlist error: ' + plerrtext); | ||
} // ( _jp.value( json, '$..sidebar.playlistSidebarRenderer.items[0]..stats[2]..simpleText' ) ) || | ||
// TODO parse relevant json data with jsonpath | ||
var listId = _jp.value(json, '$..microformat..urlCanonical').split('=')[1]; // console.log( 'listId: ' + listId ) | ||
@@ -870,5 +888,8 @@ | ||
var DAY_IN_MS = 1000 * 60 * 60 * 24; | ||
if (words[0] === 'updated' && words[2].slice(0, 3) === 'day') { | ||
var ms = Date.now() - 1000 * 60 * 60 * 24 * words[1]; | ||
var d = new Date(ms); | ||
var ms = (Date.now() - DAY_IN_MS) * words[1]; | ||
var d = new Date(ms - 1 * DAY_IN_MS); // a day earlier than today | ||
if (d.toString() !== 'Invalid Date') return _toInternalDateString(d); | ||
@@ -875,0 +896,0 @@ } |
{ | ||
"name": "yt-search", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "search youtube", | ||
@@ -5,0 +5,0 @@ "main": "dist/yt-search.js", |
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
43823
964