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.16 to 0.7.17

2

example/proxy.js

@@ -6,3 +6,3 @@ var urlParse = require('url').parse;

var stream = ytdl('https://www.youtube.com/watch?v=2UBFIhS1YBk', {
request: function(url, callback) {
request: function(url, options, callback) {
var parsed = urlParse(url);

@@ -9,0 +9,0 @@ return http.get({

@@ -212,3 +212,6 @@ var qs = require('querystring');

* - http://www.youtube.com/watch?v=VIDEO_ID
* - http://m.youtube.com/watch?v=VIDEO_ID
* - http://youtu.be/VIDEO_ID
* - http://www.youtube.com/v/VIDEO_ID
* - http://www.youtube.com/embed/VIDEO_ID
*

@@ -219,5 +222,8 @@ * @param {String} link

exports.getVideoID = function(link) {
var linkParsed = url.parse(link, true);
var id = linkParsed.hostname === 'youtu.be' ?
linkParsed.pathname.slice(1) : linkParsed.query.v;
var parsed = url.parse(link, true);
var id = parsed.query.v;
if (parsed.hostname === 'youtu.be' || !id) {
var s = parsed.pathname.split('/');
id = s[s.length - 1];
}
if (!id) {

@@ -224,0 +230,0 @@ throw new Error('No video id found: ' + link);

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

],
"version": "0.7.16",
"version": "0.7.17",
"repository": {

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

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

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');
});

@@ -231,0 +235,0 @@ });

Sorry, the diff of this file is not supported yet

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