youtube.ts
Advanced tools
Comparing version 0.0.9 to 0.1.0
@@ -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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157081
3306
+ Addedytdl-core-discord@^1.1.0
+ Added@types/node@15.14.9(transitive)
+ Addedm3u8stream@0.8.6(transitive)
+ Addedminiget@4.2.3(transitive)
+ Addedprism-media@1.3.5(transitive)
+ Addedytdl-core@4.11.5(transitive)
+ Addedytdl-core-discord@1.3.1(transitive)
- Removedytdl-core@^1.0.0
- Removedhtml-entities@1.4.0(transitive)
- Removedm3u8stream@0.6.5(transitive)
- Removedminiget@1.7.2(transitive)
- Removedytdl-core@1.0.9(transitive)