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.9 to 0.1.0

18

dist/entities/Util.js

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

var querystring = __importStar(require("querystring"));
var ytdl_core_1 = __importDefault(require("ytdl-core"));
var ytdl_core_discord_1 = __importDefault(require("ytdl-core-discord"));
var downloadURL = "https://www.youtube.com/download_my_video";

@@ -289,3 +289,3 @@ var Util = /** @class */ (function () {

url = "https://www.youtube.com/watch?v=" + id;
return [4 /*yield*/, ytdl_core_1.default.getInfo(url)];
return [4 /*yield*/, ytdl_core_discord_1.default.getInfo(url)];
case 2:

@@ -301,3 +301,5 @@ info = _a.sent();

writeStream = fs.createWriteStream(dest + "/" + clean + ".mp4");
ytdl_core_1.default(url, options).pipe(writeStream);
return [4 /*yield*/, ytdl_core_discord_1.default(url, options).then(function (r) { return r.pipe(writeStream); })];
case 3:
_a.sent();
this.awaitStream(writeStream);

@@ -384,3 +386,3 @@ return [2 /*return*/, dest + "/" + clean + ".mp4"];

url = "https://www.youtube.com/watch?v=" + id;
return [4 /*yield*/, ytdl_core_1.default.getInfo(url)];
return [4 /*yield*/, ytdl_core_discord_1.default.getInfo(url)];
case 2:

@@ -396,6 +398,8 @@ info = _a.sent();

writeStream = fs.createWriteStream(dest + "/" + clean + ".mp3");
ytdl_core_1.default(url, { filter: "audioonly" }).pipe(writeStream);
return [4 /*yield*/, this.awaitStream(writeStream)];
return [4 /*yield*/, ytdl_core_discord_1.default(url, { filter: "audioonly" }).then(function (r) { return r.pipe(writeStream); })];
case 3:
_a.sent();
return [4 /*yield*/, this.awaitStream(writeStream)];
case 4:
_a.sent();
return [2 /*return*/, dest + "/" + clean + ".mp3"];

@@ -481,3 +485,3 @@ }

url = "https://www.youtube.com/watch?v=" + id;
return [2 /*return*/, ytdl_core_1.default(url, { filter: "audioonly" })];
return [2 /*return*/, ytdl_core_discord_1.default(url, { filter: "audioonly" })];
}

@@ -484,0 +488,0 @@ });

@@ -5,3 +5,3 @@ import axios from "axios"

import * as stream from "stream"
import ytdl from "ytdl-core"
import ytdl from "ytdl-core-discord"
import api from "../API"

@@ -159,3 +159,3 @@ import {YoutubeDownloadOptions, YoutubeVideo, YoutubeVideoSearchItem} from "../types"

const writeStream = fs.createWriteStream(`${dest}/${clean}.mp4`)
ytdl(url, options).pipe(writeStream)
await ytdl(url, options).then((r) => r.pipe(writeStream))
this.awaitStream(writeStream)

@@ -207,3 +207,3 @@ return `${dest}/${clean}.mp4`

const writeStream = fs.createWriteStream(`${dest}/${clean}.mp3`)
ytdl(url, {filter: "audioonly"}).pipe(writeStream)
await ytdl(url, {filter: "audioonly"}).then((r) => r.pipe(writeStream))
await this.awaitStream(writeStream)

@@ -210,0 +210,0 @@ return `${dest}/${clean}.mp3`

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

@@ -38,4 +38,4 @@ "main": "dist/youtube.js",

"axios": "^0.19.0",
"ytdl-core": "^1.0.0"
"ytdl-core-discord": "^1.1.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