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

ytdl-core

Package Overview
Dependencies
Maintainers
1
Versions
186
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ytdl-core - npm Package Compare versions

Comparing version 0.7.2 to 0.7.3

example/.npmignore

19

lib/util.js

@@ -101,5 +101,18 @@ var qs = require('querystring');

default:
format = formats.filter(function(format) {
return format.itag === '' + quality;
})[0];
var getFormat = function(itag) {
for (var i = 0, len = formats.length; i < len; i++) {
if (formats[i].itag === '' + itag) {
return formats[i];
}
}
return null;
};
if (Array.isArray(quality)) {
for (var i = 0, len = quality.length; i < len; i++) {
format = getFormat(quality[i]);
if (format) { break; }
}
} else {
format = getFormat(quality);
}

@@ -106,0 +119,0 @@ }

2

package.json

@@ -9,3 +9,3 @@ {

],
"version": "0.7.2",
"version": "0.7.3",
"repository": {

@@ -12,0 +12,0 @@ "type": "git",

@@ -25,3 +25,3 @@ # node-ytdl-core

* `quality` - Video quality to download. Can be an [itag value](http://en.wikipedia.org/wiki/YouTube#Quality_and_formats) value, or `highest`/`lowest`. Defaults to `highest`.
* `quality` - Video quality to download. Can be an [itag value](http://en.wikipedia.org/wiki/YouTube#Quality_and_formats) value, a list of itag values, or `highest`/`lowest`. Defaults to `highest`.
* `filter` - Can be `video` to filter for formats that contain video, `videoonly` for formats that contain video and no additional audio track. Can also be `audio` or `audioonly`. You can give a filtering function that gets called with each format available. Used to decide what format to download. This function is given the `format` object as its first argument, and should return true if the format is preferable.

@@ -28,0 +28,0 @@ * `format` - This can be a specific `format` object returned from `getInfo`. This is primarily used to download specific video or audio streams. **Note:** Supplying this option will ignore the `filter` and `quality` options since the format is explicitly provided.

@@ -145,2 +145,9 @@ var util = require('../lib/util');

});
describe('with list of itags given', function() {
it('Chooses matching format', function() {
var format = util.chooseFormat(sortedFormats, { quality: [99, 160, 18] });
assert.equal(format.itag, '160');
});
});
});

@@ -239,3 +246,4 @@

it('Retrieves formatted video description', function() {
var html = fs.readFileSync(path.resolve(__dirname, 'files/util/multiline-video-description'), 'utf8');
var html = fs.readFileSync(path.resolve(__dirname,
'files/util/multiline-video-description'), 'utf8');
var cleanDescription = util.getVideoDescription(html);

@@ -242,0 +250,0 @@ assert.ok(cleanDescription);

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