Socket
Socket
Sign inDemoInstall

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.2.1 to 0.2.2

4

dist/entities/Util.d.ts

@@ -24,2 +24,6 @@ /// <reference types="node" />

downloadThumbnail: (videoResolvable: string, folder?: string, noDL?: boolean) => Promise<string>;
/**
* Gets a video's title from the url.
*/
getTitle: (videoResolvable: string) => Promise<string>;
}

@@ -509,2 +509,20 @@ "use strict";

}); };
/**
* Gets a video's title from the url.
*/
this.getTitle = function (videoResolvable) { return __awaiter(_this, void 0, void 0, function () {
var id, url, info;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.resolveID(videoResolvable, "video")];
case 1:
id = _a.sent();
url = "https://www.youtube.com/watch?v=" + id;
return [4 /*yield*/, ytdl_core_1["default"].getInfo(url)];
case 2:
info = _a.sent();
return [2 /*return*/, info.videoDetails.title];
}
});
}); };
}

@@ -511,0 +529,0 @@ return Util;

@@ -268,2 +268,12 @@ import axios from "axios"

}
/**
* Gets a video's title from the url.
*/
public getTitle = async (videoResolvable: string) => {
const id = await this.resolveID(videoResolvable, "video")
const url = `https://www.youtube.com/watch?v=${id}`
const info = await ytdl.getInfo(url)
return info.videoDetails.title
}
}

2

package.json
{
"name": "youtube.ts",
"version": "0.2.1",
"version": "0.2.2",
"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