Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ytpl

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytpl - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

6

lib/main.js

@@ -26,3 +26,3 @@ const URL = require('url');

let error = parsed.json.alerts.find(a => a.alertRenderer && a.alertRenderer.type === 'ERROR');
if (error) throw new Error(`API-Error: ${UTIL.parseText(error.alertRenderer.text)}`);
if (error) throw new Error(`API-Error: ${UTIL.parseText(error.alertRenderer.text, '* no message *')}`);
}

@@ -48,3 +48,3 @@

url: `${BASE_PLIST_URL}list=${plistId}`,
title: UTIL.parseText(info.title),
title: UTIL.parseText(info.title, ''),
estimatedItemCount: UTIL.parseIntegerFromText(info.stats[0]),

@@ -54,3 +54,3 @@ views: info.stats.length === 3 ? UTIL.parseIntegerFromText(info.stats[1]) : 0,

bestThumbnail: thumbnails[0],
lastUpdated: UTIL.parseText(info.stats[2]),
lastUpdated: UTIL.parseText(info.stats[2], ''),
description: Array.isArray(info.description) && info.description.length ? UTIL.parseText(info.description) : null,

@@ -57,0 +57,0 @@ visibility: info.badges && JSON.stringify(info.badges).includes('UNLISTED') ? 'unlisted' : 'everyone',

@@ -24,3 +24,3 @@ const PATH = require('path');

return {
title: UTIL.parseText(info.title),
title: UTIL.parseText(info.title, ''),
index: info.index ? UTIL.parseIntegerFromText(info.index) : -1,

@@ -27,0 +27,0 @@ id: info.videoId,

@@ -37,3 +37,10 @@ const URL = require('url');

// Parsing utility
const parseText = exports.parseText = txt => txt.simpleText || txt.runs.map(a => a.text).join('');
const parseText = exports.parseText = (txt, def = null) => {
if (typeof txt !== 'object') return def;
if (Object.prototype.hasOwnProperty.call(txt, 'simpleText')) return txt.simpleText;
if (Array.isArray(txt.runs)) {
return txt.runs.map(a => a.text).join('');
}
return def;
};

@@ -40,0 +47,0 @@ exports.parseIntegerFromText = txt => Number(parseText(txt).replace(/\D+/g, ''));

{
"name": "ytpl",
"version": "2.1.0",
"version": "2.1.1",
"description": "Simple package to resolve YouTube playlists - no strings attached.",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc