youtube.ts
Advanced tools
Comparing version 0.2.9 to 0.3.0
@@ -46,11 +46,7 @@ "use strict"; | ||
(function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var d, c; | ||
var c; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, youtube.util.downloadMP3("https://www.youtube.com/watch?v=OJf04b6884E", "./videos")]; | ||
case 0: return [4 /*yield*/, youtube.util.downloadThumbnail("https://www.youtube.com/watch?v=OJf04b6884E", "./videos")]; | ||
case 1: | ||
d = _a.sent(); | ||
console.log(d); | ||
return [4 /*yield*/, youtube.util.downloadThumbnail("https://www.youtube.com/watch?v=OJf04b6884E", "./videos")]; | ||
case 2: | ||
c = _a.sent(); | ||
@@ -57,0 +53,0 @@ console.log(c); |
@@ -50,3 +50,3 @@ "use strict"; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, login_1.youtube.channels.get("tenpi")]; | ||
case 0: return [4 /*yield*/, login_1.youtube.channels.get("pewdiepie")]; | ||
case 1: | ||
@@ -79,3 +79,3 @@ response = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, login_1.youtube.channels.allComments("tenpi")]; | ||
case 0: return [4 /*yield*/, login_1.youtube.channels.allComments("pewdiepie")]; | ||
case 1: | ||
@@ -82,0 +82,0 @@ response = _a.sent(); |
@@ -64,3 +64,3 @@ "use strict"; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, login_1.youtube.videos.search({ q: "tenpi geometry dash osu" })]; | ||
case 0: return [4 /*yield*/, login_1.youtube.videos.search({ q: "osu" })]; | ||
case 1: | ||
@@ -67,0 +67,0 @@ response = _a.sent(); |
MIT License | ||
Copyright (c) 2020 Tenpi | ||
Copyright (c) 2020 Moebits | ||
@@ -5,0 +5,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
{ | ||
"name": "youtube.ts", | ||
"version": "0.2.9", | ||
"version": "0.3.0", | ||
"description": "Wrapper for the YouTube API with typings.", | ||
@@ -16,3 +16,3 @@ "main": "dist/youtube.js", | ||
"type": "git", | ||
"url": "https://github.com/Tenpi/youtube.ts" | ||
"url": "https://github.com/Moebits/youtube.ts" | ||
}, | ||
@@ -26,6 +26,5 @@ "keywords": [ | ||
], | ||
"author": "Tenpi", | ||
"author": "Moebits", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@tenpi/tslint": "^1.0.5", | ||
"@types/chai": "^4.2.4", | ||
@@ -32,0 +31,0 @@ "@types/mocha": "^5.2.7", |
<div align="left"> | ||
<p> | ||
<a href="https://tenpi.github.io/youtube.ts/"><img src="https://raw.githubusercontent.com/Tenpi/youtube.ts/master/images/youtube.tslogo.png" width="500" /></a> | ||
<a href="https://moebits.github.io/youtube.ts/"><img src="https://raw.githubusercontent.com/Moebits/youtube.ts/master/images/youtube.tslogo.png" width="500" /></a> | ||
</p> | ||
@@ -32,4 +32,4 @@ <p> | ||
const channel = await youtube.channels.get("https://www.youtube.com/channel/UC8qU4aFe81jzG1attsyQ5wQ") | ||
const channelByCustomURL = await youtube.channels.get("https://www.youtube.com/c/tenpi") | ||
const channelByQuery = await youtube.channels.get("tenpi") | ||
const channelByCustomURL = await youtube.channels.get("https://www.youtube.com/c/mychannel") | ||
const channelByQuery = await youtube.channels.get("mychannel") | ||
@@ -41,4 +41,4 @@ | ||
/*You can get the comments in the discussion tab, or all comments in all videos on the channel.*/ | ||
const discussionComments = await youtube.channels.comments("tenpi") | ||
const allComments = await youtube.channels.allComments("tenpi") | ||
const discussionComments = await youtube.channels.comments("mychannel") | ||
const allComments = await youtube.channels.allComments("mychannel") | ||
@@ -45,0 +45,0 @@ /*If the channel has their subscriptions set to public, you can also retrieve them all.*/ |
13
start.ts
@@ -7,17 +7,4 @@ import Youtube from "./youtube" | ||
(async () => { | ||
// const result = await youtube.playlists.items("https://www.youtube.com/playlist?list=PL1BC175_2xP8ifSS9CM92G5eIOPRG1g7t") | ||
// const result = await youtube.playlists.item("PL1BC175_2xP8ifSS9CM92G5eIOPRG1g7t", "tenpi - moonlight (chill)") | ||
// const result = await youtube.channels.comments("tenpi") | ||
// const result = await youtube.comments.thread("UgzNgGMYuY6qJl0RV7d4AaABAg") | ||
// const result = await youtube.comments.get("UgzNgGMYuY6qJl0RV7d4AaABAg") | ||
// const result = await youtube.channels.subscriptions("https://www.youtube.com/channel/UCwgEMWqaNlp0TVb5BLqO-jg/videos") | ||
// await youtube.util.downloadMyVideo("mLJQ0HO5Alc", key, cookie, "./videos") | ||
// await youtube.util.downloadMyVideos("tenpi", key, cookie, "./videos/tenpi") | ||
// await youtube.util.downloadMP3("https://www.youtube.com/watch?v=LysVlPg2fd8", "./videos/ytdl/bad") | ||
// await youtube.util.downloadChannelVideos("UC8qU4aFe81jzG1attsyQ5wQ", "./videos/tenpi") | ||
// console.log(result.items[0]) | ||
const d = await youtube.util.downloadMP3("https://www.youtube.com/watch?v=OJf04b6884E", "./videos") | ||
console.log(d) | ||
const c = await youtube.util.downloadThumbnail("https://www.youtube.com/watch?v=OJf04b6884E", "./videos") | ||
console.log(c) | ||
})() |
@@ -7,3 +7,3 @@ import {assert} from "chai" | ||
it("should get a channel", async function() { | ||
const response = await youtube.channels.get("tenpi") | ||
const response = await youtube.channels.get("pewdiepie") | ||
assert(response.hasOwnProperty("brandingSettings")) | ||
@@ -18,3 +18,3 @@ }) | ||
it("should search for all comments", async function() { | ||
const response = await youtube.channels.allComments("tenpi") | ||
const response = await youtube.channels.allComments("pewdiepie") | ||
assert(response.hasOwnProperty("items")) | ||
@@ -21,0 +21,0 @@ }) |
@@ -12,3 +12,3 @@ import {assert} from "chai" | ||
it("should search for videos", async function() { | ||
const response = await youtube.videos.search({q: "tenpi geometry dash osu"}) | ||
const response = await youtube.videos.search({q: "osu"}) | ||
assert(response.hasOwnProperty("items")) | ||
@@ -15,0 +15,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
8
154612
68
3337
1