Comparing version 4.1.2 to 4.2.0
@@ -77,2 +77,4 @@ "use strict"; | ||
} | ||
// Broken for many channels | ||
/* istanbul ignore next */ | ||
this.featuredChannels = channel.brandingSettings.channel.featuredChannelsUrls ? | ||
@@ -261,2 +263,5 @@ channel.brandingSettings.channel.featuredChannelsUrls.map(id => `https://www.youtube.com/channel/${id}`) : []; | ||
} | ||
if (!this.data.brandingSettings.image) { | ||
this.data.brandingSettings.image = {}; | ||
} | ||
this.data.brandingSettings.image.bannerExternalUrl = yield this.youtube.oauth.uploadChannelBanner(image); | ||
@@ -263,0 +268,0 @@ return this.youtube.oauth.updateChannelBranding(this.id, this.data.brandingSettings); |
@@ -84,3 +84,3 @@ "use strict"; | ||
search(types, searchTerm, maxResults = 10, pageToken, fields) { | ||
return services_1.SearchService.search(this, types, searchTerm, maxResults, pageToken, fields); | ||
return services_1.SearchService.search(this, types, searchTerm, maxResults, pageToken, null, fields); | ||
} | ||
@@ -92,2 +92,3 @@ /** | ||
* @param pageToken The page token to start at. Provide this if you have received it as output from a call to a search method. | ||
* @param channelId The channel ID that you want to specifically search for. | ||
* @param category The category ID that you want to specifically search for. | ||
@@ -97,4 +98,4 @@ * @param onlyEmbeddable Whether or not to return only embeddable videos. | ||
*/ | ||
searchVideos(searchTerm, maxResults = 10, pageToken, category, onlyEmbeddable = false, eventType, type = 'any') { | ||
return services_1.SearchService.search(this, [entities_1.Video], searchTerm, maxResults, pageToken, null, category, onlyEmbeddable, eventType, type); | ||
searchVideos(searchTerm, maxResults = 10, pageToken, category, channelId, onlyEmbeddable = false, eventType, type = 'any') { | ||
return services_1.SearchService.search(this, [entities_1.Video], searchTerm, maxResults, pageToken, channelId, null, category, onlyEmbeddable, eventType, type); | ||
} | ||
@@ -101,0 +102,0 @@ /** |
@@ -20,3 +20,3 @@ "use strict"; | ||
/* istanbul ignore next */ | ||
static search(youtube, types, searchTerm, maxResults = 10, pageToken, fields, category, onlyEmbeddable = false, eventType, videoType) { | ||
static search(youtube, types, searchTerm, maxResults = 10, pageToken, channelId, fields, category, onlyEmbeddable = false, eventType, videoType) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -39,2 +39,5 @@ const type = types.map(t => t.endpoint.substring(0, t.endpoint.length - 1)).join(','); | ||
}; | ||
if (channelId) { | ||
data.channelId = channelId; | ||
} | ||
if (pageToken) { | ||
@@ -41,0 +44,0 @@ data.pageToken = pageToken; |
{ | ||
"name": "popyt", | ||
"version": "4.1.2", | ||
"version": "4.2.0", | ||
"description": "A very easy to use promise-based Youtube Data v3 API.", | ||
@@ -30,16 +30,16 @@ "homepage": "https://bbothell.me/popyt", | ||
"@istanbuljs/nyc-config-typescript": "1.0.1", | ||
"@types/chai": "4.2.12", | ||
"@types/gulp": "4.0.6", | ||
"@types/chai": "4.2.14", | ||
"@types/gulp": "4.0.7", | ||
"@types/gulp-sourcemaps": "0.0.32", | ||
"@types/merge2": "1.3.0", | ||
"@types/mocha": "8.0.3", | ||
"@types/node": "13.13.19", | ||
"@typescript-eslint/eslint-plugin": "4.1.1", | ||
"@typescript-eslint/parser": "4.1.1", | ||
"@types/node": "13.13.30", | ||
"@typescript-eslint/eslint-plugin": "4.7.0", | ||
"@typescript-eslint/parser": "4.7.0", | ||
"chai": "4.2.0", | ||
"coveralls": "3.1.0", | ||
"dotenv": "8.2.0", | ||
"eslint": "7.9.0", | ||
"eslint-plugin-import": "2.22.0", | ||
"eslint-plugin-jsdoc": "30.5.1", | ||
"eslint": "7.12.1", | ||
"eslint-plugin-import": "2.22.1", | ||
"eslint-plugin-jsdoc": "30.7.5", | ||
"fs-nextra": "0.5.1", | ||
@@ -51,8 +51,8 @@ "gulp": "4.0.2", | ||
"merge2": "1.4.1", | ||
"mocha": "8.1.3", | ||
"mocha": "8.2.1", | ||
"nyc": "15.1.0", | ||
"source-map-support": "0.5.19", | ||
"ts-node": "9.0.0", | ||
"typedoc": "0.19.1", | ||
"typescript": "4.0.2" | ||
"typedoc": "0.19.2", | ||
"typescript": "4.0.5" | ||
}, | ||
@@ -59,0 +59,0 @@ "repository": { |
@@ -12,6 +12,6 @@ # popyt | ||
Check out [our website](https://bbothell.me/popyt)! | ||
Check out [our website](https://bbothell.rocks/popyt)! | ||
# Examples | ||
## Check out [the documentation](https://bbothell.me/popyt/docs). | ||
## See [the documentation](https://bbothell.rocks/popyt/docs). | ||
Here are some basic methods: | ||
@@ -18,0 +18,0 @@ |
@@ -67,2 +67,3 @@ /// <reference types="node" /> | ||
* This channel's banners. | ||
* @deprecated See https://developers.google.com/youtube/v3/docs/channels#brandingSettings.image | ||
*/ | ||
@@ -104,3 +105,3 @@ banners: Banners; | ||
/** | ||
* The URLs of all of this channel's featured channels. | ||
* The URLs of all of this channel's featured channels. This property is broken for some channels. | ||
*/ | ||
@@ -107,0 +108,0 @@ featuredChannels: string[]; |
@@ -76,2 +76,3 @@ import { Video, Channel, Playlist, YTComment, Subscription, VideoCategory, GuideCategory, Language, Region, ChannelSection } from './entities'; | ||
* @param pageToken The page token to start at. Provide this if you have received it as output from a call to a search method. | ||
* @param channelId The channel ID that you want to specifically search for. | ||
* @param category The category ID that you want to specifically search for. | ||
@@ -81,3 +82,3 @@ * @param onlyEmbeddable Whether or not to return only embeddable videos. | ||
*/ | ||
searchVideos(searchTerm: string, maxResults?: number, pageToken?: string, category?: string, onlyEmbeddable?: boolean, eventType?: 'completed' | 'live' | 'upcoming', type?: 'any' | 'episode' | 'movie'): Promise<{ | ||
searchVideos(searchTerm: string, maxResults?: number, pageToken?: string, category?: string, channelId?: string, onlyEmbeddable?: boolean, eventType?: 'completed' | 'live' | 'upcoming', type?: 'any' | 'episode' | 'movie'): Promise<{ | ||
results: Video[]; | ||
@@ -84,0 +85,0 @@ prevPageToken: string; |
@@ -6,3 +6,3 @@ import YouTube, { Video, Channel, Playlist } from '..'; | ||
export declare class SearchService { | ||
static search(youtube: YouTube, types: (typeof Video | typeof Channel | typeof Playlist)[], searchTerm: string, maxResults?: number, pageToken?: string, fields?: string, category?: string, onlyEmbeddable?: boolean, eventType?: 'completed' | 'live' | 'upcoming', videoType?: 'any' | 'episode' | 'movie'): Promise<{ | ||
static search(youtube: YouTube, types: (typeof Video | typeof Channel | typeof Playlist)[], searchTerm: string, maxResults?: number, pageToken?: string, channelId?: string, fields?: string, category?: string, onlyEmbeddable?: boolean, eventType?: 'completed' | 'live' | 'upcoming', videoType?: 'any' | 'episode' | 'movie'): Promise<{ | ||
results: (Video | Channel | Playlist)[]; | ||
@@ -9,0 +9,0 @@ prevPageToken: string; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
476896
5867