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.8.0 to 0.8.1

test/files/unknown-vid/get_video_info

3

lib/util.js

@@ -236,2 +236,5 @@ var qs = require('querystring');

}
if (!idRegex.test(id)) {
throw new Error('Video id (' + id + ') does not match expected format (' + idRegex.toString() + ')');
}
return id;

@@ -238,0 +241,0 @@ };

2

package.json

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

],
"version": "0.8.0",
"version": "0.8.1",
"repository": {

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

@@ -96,3 +96,3 @@ var assert = require('assert-diff');

describe('from a non-existant video', function() {
var id = 'not-found';
var id = 'unknown-vid';
var url = VIDEO_BASE + id;

@@ -99,0 +99,0 @@

@@ -225,12 +225,18 @@ var util = require('../lib/util');

var id;
id = util.getVideoID('http://www.youtube.com/watch?v=VIDEO_ID');
assert(id, 'VIDEO_ID');
id = util.getVideoID('http://youtu.be/VIDEO_ID');
assert(id, 'VIDEO_ID');
id = util.getVideoID('http://youtube.com/v/VIDEO_ID');
assert(id, 'VIDEO_ID');
id = util.getVideoID('http://youtube.com/embed/VIDEO_ID');
assert(id, 'VIDEO_ID');
id = util.getVideoID('http://www.youtube.com/watch?v=RAW_VIDEOID');
assert(id, 'RAW_VIDEOID');
id = util.getVideoID('http://youtu.be/RAW_VIDEOID');
assert(id, 'RAW_VIDEOID');
id = util.getVideoID('http://youtube.com/v/RAW_VIDEOID');
assert(id, 'RAW_VIDEOID');
id = util.getVideoID('http://youtube.com/embed/RAW_VIDEOID');
assert(id, 'RAW_VIDEOID');
id = util.getVideoID('RAW_VIDEOID'); // Video ids are 11-character long
assert(id, 'RAW_VIDEOID');
assert.throws(function () {
util.getVideoID('www.youtube.com');
}, Error, 'No video id found: www.youtube.com');
assert.throws(function () {
util.getVideoID('www.youtube.com/playlist?list=1337');
}, Error, 'Video id (playlist) does not match expected format (/^[a-zA-Z0-9-_]{11}$/)');
});

@@ -237,0 +243,0 @@ });

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