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

youtube.ts

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

youtube.ts - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

14

dist/entities/Util.js

@@ -257,3 +257,3 @@ "use strict";

this.downloadVideo = function (videoResolvable, dest, ytdlOptions) { return __awaiter(_this, void 0, void 0, function () {
var options, id, url, info, writeStream;
var options, id, url, info, clean, writeStream;
return __generator(this, function (_a) {

@@ -292,2 +292,3 @@ switch (_a.label) {

info = _a.sent();
clean = info.title.replace(/\//g, " ").replace(/\\/g, " ");
if (!dest)

@@ -299,6 +300,6 @@ dest = "./";

fs.mkdirSync(dest, { recursive: true });
writeStream = fs.createWriteStream(dest + "/" + info.title + ".mp4");
writeStream = fs.createWriteStream(dest + "/" + clean + ".mp4");
ytdl_core_1.default(url, options).pipe(writeStream);
this.awaitStream(writeStream);
return [2 /*return*/, dest + "/" + info.title + ".mp4"];
return [2 /*return*/, dest + "/" + clean + ".mp4"];
}

@@ -376,3 +377,3 @@ });

this.downloadMP3 = function (videoResolvable, dest) { return __awaiter(_this, void 0, void 0, function () {
var id, url, info, writeStream;
var id, url, info, clean, writeStream;
return __generator(this, function (_a) {

@@ -387,2 +388,3 @@ switch (_a.label) {

info = _a.sent();
clean = info.title.replace(/\//g, " ").replace(/\\/g, " ");
if (!dest)

@@ -394,6 +396,6 @@ dest = "./";

fs.mkdirSync(dest, { recursive: true });
writeStream = fs.createWriteStream(dest + "/" + info.title + ".mp3");
writeStream = fs.createWriteStream(dest + "/" + clean + ".mp3");
ytdl_core_1.default(url, { filter: "audioonly" }).pipe(writeStream);
this.awaitStream(writeStream);
return [2 /*return*/, dest + "/" + info.title + ".mp3"];
return [2 /*return*/, dest + "/" + clean + ".mp3"];
}

@@ -400,0 +402,0 @@ });

@@ -153,9 +153,10 @@ import axios from "axios"

const info = await ytdl.getInfo(url)
const clean = info.title.replace(/\//g, " ").replace(/\\/g, " ")
if (!dest) dest = "./"
if (dest.endsWith("/")) dest = dest.slice(0, -1)
if (!fs.existsSync(dest)) fs.mkdirSync(dest, {recursive: true})
const writeStream = fs.createWriteStream(`${dest}/${info.title}.mp4`)
const writeStream = fs.createWriteStream(`${dest}/${clean}.mp4`)
ytdl(url, options).pipe(writeStream)
this.awaitStream(writeStream)
return `${dest}/${info.title}.mp4`
return `${dest}/${clean}.mp4`
}

@@ -200,9 +201,10 @@

const info = await ytdl.getInfo(url)
const clean = info.title.replace(/\//g, " ").replace(/\\/g, " ")
if (!dest) dest = "./"
if (dest.endsWith("/")) dest = dest.slice(0, -1)
if (!fs.existsSync(dest)) fs.mkdirSync(dest, {recursive: true})
const writeStream = fs.createWriteStream(`${dest}/${info.title}.mp3`)
const writeStream = fs.createWriteStream(`${dest}/${clean}.mp3`)
ytdl(url, {filter: "audioonly"}).pipe(writeStream)
this.awaitStream(writeStream)
return `${dest}/${info.title}.mp3`
return `${dest}/${clean}.mp3`
}

@@ -209,0 +211,0 @@

{
"name": "youtube.ts",
"version": "0.0.7",
"version": "0.0.8",
"description": "Wrapper for the YouTube API with typings.",

@@ -5,0 +5,0 @@ "main": "dist/youtube.js",

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