scrapebadger 0.15.0 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.d.cts +1600 -77
- package/dist/index.d.ts +1600 -77
- package/dist/index.js +619 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +610 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5048,6 +5048,612 @@ var EbayClient = class {
|
|
|
5048
5048
|
}
|
|
5049
5049
|
};
|
|
5050
5050
|
|
|
5051
|
+
// src/youtube/search.ts
|
|
5052
|
+
var SearchClient8 = class {
|
|
5053
|
+
client;
|
|
5054
|
+
constructor(client) {
|
|
5055
|
+
this.client = client;
|
|
5056
|
+
}
|
|
5057
|
+
/**
|
|
5058
|
+
* Search YouTube videos / channels / playlists with the full filter matrix.
|
|
5059
|
+
*
|
|
5060
|
+
* @param params - Search parameters including query, filters, and continuation.
|
|
5061
|
+
* @returns A page of search results with chips, refinements, and a continuation token.
|
|
5062
|
+
* @throws AuthenticationError - If the API key is invalid.
|
|
5063
|
+
* @throws ValidationError - If the parameters are invalid.
|
|
5064
|
+
*/
|
|
5065
|
+
async search(params) {
|
|
5066
|
+
return this.client.request("/v1/youtube/search", {
|
|
5067
|
+
params: {
|
|
5068
|
+
query: params.query,
|
|
5069
|
+
type: params.type,
|
|
5070
|
+
sort_by: params.sort_by,
|
|
5071
|
+
upload_date: params.upload_date,
|
|
5072
|
+
duration: params.duration,
|
|
5073
|
+
features: params.features,
|
|
5074
|
+
gl: params.gl,
|
|
5075
|
+
hl: params.hl,
|
|
5076
|
+
continuation: params.continuation
|
|
5077
|
+
}
|
|
5078
|
+
});
|
|
5079
|
+
}
|
|
5080
|
+
/**
|
|
5081
|
+
* Get YouTube keyword autocomplete suggestions.
|
|
5082
|
+
*
|
|
5083
|
+
* @param query - Partial search query prefix.
|
|
5084
|
+
* @param options - Optional region parameters (gl, hl).
|
|
5085
|
+
* @returns Autocomplete suggestions.
|
|
5086
|
+
*/
|
|
5087
|
+
async autocomplete(query, options = {}) {
|
|
5088
|
+
return this.client.request("/v1/youtube/autocomplete", {
|
|
5089
|
+
params: { query, gl: options.gl, hl: options.hl }
|
|
5090
|
+
});
|
|
5091
|
+
}
|
|
5092
|
+
};
|
|
5093
|
+
|
|
5094
|
+
// src/youtube/videos.ts
|
|
5095
|
+
var VideosClient3 = class {
|
|
5096
|
+
client;
|
|
5097
|
+
constructor(client) {
|
|
5098
|
+
this.client = client;
|
|
5099
|
+
}
|
|
5100
|
+
/**
|
|
5101
|
+
* Get a single video's full detail (merged `player` + `next`).
|
|
5102
|
+
*
|
|
5103
|
+
* @param videoId - The YouTube video id.
|
|
5104
|
+
* @param options - Optional region parameters (gl, hl).
|
|
5105
|
+
* @returns Full video detail including engagement, channel, chapters, and heatmap.
|
|
5106
|
+
* @throws NotFoundError - If the video doesn't exist or is unavailable.
|
|
5107
|
+
*/
|
|
5108
|
+
async get(videoId, options = {}) {
|
|
5109
|
+
return this.client.request(`/v1/youtube/videos/${videoId}`, {
|
|
5110
|
+
params: { gl: options.gl, hl: options.hl }
|
|
5111
|
+
});
|
|
5112
|
+
}
|
|
5113
|
+
/**
|
|
5114
|
+
* Get related / recommended videos for a video.
|
|
5115
|
+
*
|
|
5116
|
+
* @param videoId - The YouTube video id.
|
|
5117
|
+
* @param options - Optional region parameters and a continuation token.
|
|
5118
|
+
* @returns Related results with a continuation token.
|
|
5119
|
+
*/
|
|
5120
|
+
async related(videoId, options = {}) {
|
|
5121
|
+
return this.client.request(
|
|
5122
|
+
`/v1/youtube/videos/${videoId}/related`,
|
|
5123
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5124
|
+
);
|
|
5125
|
+
}
|
|
5126
|
+
/**
|
|
5127
|
+
* Get a page of top-level comments for a video.
|
|
5128
|
+
*
|
|
5129
|
+
* @param videoId - The YouTube video id.
|
|
5130
|
+
* @param options - Optional sort order, continuation token, and region.
|
|
5131
|
+
* @returns A page of comments with sorting tokens and a continuation token.
|
|
5132
|
+
*/
|
|
5133
|
+
async comments(videoId, options = {}) {
|
|
5134
|
+
return this.client.request(
|
|
5135
|
+
`/v1/youtube/videos/${videoId}/comments`,
|
|
5136
|
+
{
|
|
5137
|
+
params: {
|
|
5138
|
+
sort_by: options.sort_by,
|
|
5139
|
+
continuation: options.continuation,
|
|
5140
|
+
gl: options.gl,
|
|
5141
|
+
hl: options.hl
|
|
5142
|
+
}
|
|
5143
|
+
}
|
|
5144
|
+
);
|
|
5145
|
+
}
|
|
5146
|
+
/**
|
|
5147
|
+
* Get a page of replies to a single comment.
|
|
5148
|
+
*
|
|
5149
|
+
* @param videoId - The YouTube video id.
|
|
5150
|
+
* @param commentId - The comment id whose replies to fetch.
|
|
5151
|
+
* @param options - The required replies continuation token plus region.
|
|
5152
|
+
* @returns A page of replies with a continuation token.
|
|
5153
|
+
*/
|
|
5154
|
+
async replies(videoId, commentId, options) {
|
|
5155
|
+
return this.client.request(
|
|
5156
|
+
`/v1/youtube/videos/${videoId}/comments/${commentId}/replies`,
|
|
5157
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5158
|
+
);
|
|
5159
|
+
}
|
|
5160
|
+
/**
|
|
5161
|
+
* Get a video's transcript in the selected language.
|
|
5162
|
+
*
|
|
5163
|
+
* @param videoId - The YouTube video id.
|
|
5164
|
+
* @param options - Optional language and region parameters.
|
|
5165
|
+
* @returns The transcript with timed segments and full text.
|
|
5166
|
+
*/
|
|
5167
|
+
async transcript(videoId, options = {}) {
|
|
5168
|
+
return this.client.request(
|
|
5169
|
+
`/v1/youtube/videos/${videoId}/transcript`,
|
|
5170
|
+
{ params: { language: options.language, gl: options.gl, hl: options.hl } }
|
|
5171
|
+
);
|
|
5172
|
+
}
|
|
5173
|
+
/**
|
|
5174
|
+
* List a video's available caption tracks.
|
|
5175
|
+
*
|
|
5176
|
+
* @param videoId - The YouTube video id.
|
|
5177
|
+
* @param options - Optional region parameters.
|
|
5178
|
+
* @returns The available caption tracks and translation languages.
|
|
5179
|
+
*/
|
|
5180
|
+
async captions(videoId, options = {}) {
|
|
5181
|
+
return this.client.request(
|
|
5182
|
+
`/v1/youtube/videos/${videoId}/captions`,
|
|
5183
|
+
{ params: { gl: options.gl, hl: options.hl } }
|
|
5184
|
+
);
|
|
5185
|
+
}
|
|
5186
|
+
/**
|
|
5187
|
+
* Get a video's stream / format metadata (best-effort; URLs may be PO-token gated).
|
|
5188
|
+
*
|
|
5189
|
+
* @param videoId - The YouTube video id.
|
|
5190
|
+
* @param options - Optional content region and player client.
|
|
5191
|
+
* @returns Streaming metadata with muxed and adaptive formats.
|
|
5192
|
+
*/
|
|
5193
|
+
async streams(videoId, options = {}) {
|
|
5194
|
+
return this.client.request(
|
|
5195
|
+
`/v1/youtube/videos/${videoId}/streams`,
|
|
5196
|
+
{ params: { gl: options.gl, client: options.client } }
|
|
5197
|
+
);
|
|
5198
|
+
}
|
|
5199
|
+
/**
|
|
5200
|
+
* Get a page of live-chat (or chat-replay) messages for a video.
|
|
5201
|
+
*
|
|
5202
|
+
* @param videoId - The YouTube video id.
|
|
5203
|
+
* @param options - Optional continuation token, replay flag, and region.
|
|
5204
|
+
* @returns A page of live-chat messages with a continuation token.
|
|
5205
|
+
*/
|
|
5206
|
+
async liveChat(videoId, options = {}) {
|
|
5207
|
+
return this.client.request(
|
|
5208
|
+
`/v1/youtube/videos/${videoId}/live_chat`,
|
|
5209
|
+
{
|
|
5210
|
+
params: {
|
|
5211
|
+
continuation: options.continuation,
|
|
5212
|
+
replay: options.replay,
|
|
5213
|
+
gl: options.gl,
|
|
5214
|
+
hl: options.hl
|
|
5215
|
+
}
|
|
5216
|
+
}
|
|
5217
|
+
);
|
|
5218
|
+
}
|
|
5219
|
+
/**
|
|
5220
|
+
* Fetch detail for up to 50 videos concurrently.
|
|
5221
|
+
*
|
|
5222
|
+
* @param params - The video ids (≤50) plus optional region parameters.
|
|
5223
|
+
* @returns Successfully fetched videos plus per-id errors.
|
|
5224
|
+
*/
|
|
5225
|
+
async batch(params) {
|
|
5226
|
+
return this.client.request("/v1/youtube/videos/batch", {
|
|
5227
|
+
method: "POST",
|
|
5228
|
+
body: { video_ids: params.video_ids, gl: params.gl, hl: params.hl }
|
|
5229
|
+
});
|
|
5230
|
+
}
|
|
5231
|
+
async oembed(arg) {
|
|
5232
|
+
const url = typeof arg === "string" ? arg : arg.url;
|
|
5233
|
+
return this.client.request("/v1/youtube/oembed", { params: { url } });
|
|
5234
|
+
}
|
|
5235
|
+
};
|
|
5236
|
+
|
|
5237
|
+
// src/youtube/channels.ts
|
|
5238
|
+
var ChannelsClient = class {
|
|
5239
|
+
client;
|
|
5240
|
+
constructor(client) {
|
|
5241
|
+
this.client = client;
|
|
5242
|
+
}
|
|
5243
|
+
/**
|
|
5244
|
+
* Get full channel detail (accepts a UC id, @handle, or custom URL).
|
|
5245
|
+
*
|
|
5246
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5247
|
+
* @param options - Optional region parameters.
|
|
5248
|
+
* @returns Full channel detail.
|
|
5249
|
+
* @throws NotFoundError - If the channel doesn't exist.
|
|
5250
|
+
*/
|
|
5251
|
+
async get(channelId, options = {}) {
|
|
5252
|
+
return this.client.request(`/v1/youtube/channels/${channelId}`, {
|
|
5253
|
+
params: { gl: options.gl, hl: options.hl }
|
|
5254
|
+
});
|
|
5255
|
+
}
|
|
5256
|
+
/**
|
|
5257
|
+
* Get a page of a channel's long-form videos.
|
|
5258
|
+
*
|
|
5259
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5260
|
+
* @param options - Optional continuation token and region.
|
|
5261
|
+
* @returns A page of video cards with a continuation token.
|
|
5262
|
+
*/
|
|
5263
|
+
async videos(channelId, options = {}) {
|
|
5264
|
+
return this.client.request(
|
|
5265
|
+
`/v1/youtube/channels/${channelId}/videos`,
|
|
5266
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5267
|
+
);
|
|
5268
|
+
}
|
|
5269
|
+
/**
|
|
5270
|
+
* Get a page of a channel's Shorts.
|
|
5271
|
+
*
|
|
5272
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5273
|
+
* @param options - Optional continuation token and region.
|
|
5274
|
+
* @returns A page of Shorts cards with a continuation token.
|
|
5275
|
+
*/
|
|
5276
|
+
async shorts(channelId, options = {}) {
|
|
5277
|
+
return this.client.request(
|
|
5278
|
+
`/v1/youtube/channels/${channelId}/shorts`,
|
|
5279
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5280
|
+
);
|
|
5281
|
+
}
|
|
5282
|
+
/**
|
|
5283
|
+
* Get a page of a channel's live streams.
|
|
5284
|
+
*
|
|
5285
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5286
|
+
* @param options - Optional continuation token and region.
|
|
5287
|
+
* @returns A page of stream cards with a continuation token.
|
|
5288
|
+
*/
|
|
5289
|
+
async streams(channelId, options = {}) {
|
|
5290
|
+
return this.client.request(
|
|
5291
|
+
`/v1/youtube/channels/${channelId}/streams`,
|
|
5292
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5293
|
+
);
|
|
5294
|
+
}
|
|
5295
|
+
/**
|
|
5296
|
+
* Get a page of a channel's playlists.
|
|
5297
|
+
*
|
|
5298
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5299
|
+
* @param options - Optional continuation token and region.
|
|
5300
|
+
* @returns A page of playlist cards with a continuation token.
|
|
5301
|
+
*/
|
|
5302
|
+
async playlists(channelId, options = {}) {
|
|
5303
|
+
return this.client.request(
|
|
5304
|
+
`/v1/youtube/channels/${channelId}/playlists`,
|
|
5305
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5306
|
+
);
|
|
5307
|
+
}
|
|
5308
|
+
/**
|
|
5309
|
+
* Get a page of a channel's community posts.
|
|
5310
|
+
*
|
|
5311
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5312
|
+
* @param options - Optional continuation token and region.
|
|
5313
|
+
* @returns A page of community posts with a continuation token.
|
|
5314
|
+
*/
|
|
5315
|
+
async community(channelId, options = {}) {
|
|
5316
|
+
return this.client.request(
|
|
5317
|
+
`/v1/youtube/channels/${channelId}/community`,
|
|
5318
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5319
|
+
);
|
|
5320
|
+
}
|
|
5321
|
+
/**
|
|
5322
|
+
* Get a channel's lightweight about payload.
|
|
5323
|
+
*
|
|
5324
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5325
|
+
* @param options - Optional region parameters.
|
|
5326
|
+
* @returns The channel about payload.
|
|
5327
|
+
*/
|
|
5328
|
+
async about(channelId, options = {}) {
|
|
5329
|
+
return this.client.request(
|
|
5330
|
+
`/v1/youtube/channels/${channelId}/about`,
|
|
5331
|
+
{ params: { gl: options.gl, hl: options.hl } }
|
|
5332
|
+
);
|
|
5333
|
+
}
|
|
5334
|
+
/**
|
|
5335
|
+
* Get a channel's subscriber count (fast).
|
|
5336
|
+
*
|
|
5337
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5338
|
+
* @param options - Optional region parameters.
|
|
5339
|
+
* @returns The subscriber count.
|
|
5340
|
+
*/
|
|
5341
|
+
async subscriberCount(channelId, options = {}) {
|
|
5342
|
+
return this.client.request(
|
|
5343
|
+
`/v1/youtube/channels/${channelId}/subscriber_count`,
|
|
5344
|
+
{ params: { gl: options.gl, hl: options.hl } }
|
|
5345
|
+
);
|
|
5346
|
+
}
|
|
5347
|
+
/**
|
|
5348
|
+
* Search within a single channel.
|
|
5349
|
+
*
|
|
5350
|
+
* @param channelId - The channel id, @handle, or custom URL.
|
|
5351
|
+
* @param options - The required query plus optional continuation and region.
|
|
5352
|
+
* @returns A page of search results scoped to the channel.
|
|
5353
|
+
*/
|
|
5354
|
+
async search(channelId, options) {
|
|
5355
|
+
return this.client.request(
|
|
5356
|
+
`/v1/youtube/channels/${channelId}/search`,
|
|
5357
|
+
{
|
|
5358
|
+
params: {
|
|
5359
|
+
query: options.query,
|
|
5360
|
+
continuation: options.continuation,
|
|
5361
|
+
gl: options.gl,
|
|
5362
|
+
hl: options.hl
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
);
|
|
5366
|
+
}
|
|
5367
|
+
/**
|
|
5368
|
+
* Resolve a @handle or URL to canonical YouTube ids.
|
|
5369
|
+
*
|
|
5370
|
+
* @param options - A `handle` or `url` (one is required) plus optional region.
|
|
5371
|
+
* @returns The resolved channel / video / playlist ids.
|
|
5372
|
+
*/
|
|
5373
|
+
async resolve(options = {}) {
|
|
5374
|
+
return this.client.request("/v1/youtube/channels/resolve", {
|
|
5375
|
+
params: { handle: options.handle, url: options.url, gl: options.gl, hl: options.hl }
|
|
5376
|
+
});
|
|
5377
|
+
}
|
|
5378
|
+
};
|
|
5379
|
+
|
|
5380
|
+
// src/youtube/playlists.ts
|
|
5381
|
+
var PlaylistsClient = class {
|
|
5382
|
+
client;
|
|
5383
|
+
constructor(client) {
|
|
5384
|
+
this.client = client;
|
|
5385
|
+
}
|
|
5386
|
+
/**
|
|
5387
|
+
* Get full playlist detail plus the first page of items.
|
|
5388
|
+
*
|
|
5389
|
+
* @param playlistId - The playlist id.
|
|
5390
|
+
* @param options - Optional region parameters.
|
|
5391
|
+
* @returns Full playlist detail with a continuation token.
|
|
5392
|
+
* @throws NotFoundError - If the playlist doesn't exist.
|
|
5393
|
+
*/
|
|
5394
|
+
async get(playlistId, options = {}) {
|
|
5395
|
+
return this.client.request(`/v1/youtube/playlists/${playlistId}`, {
|
|
5396
|
+
params: { gl: options.gl, hl: options.hl }
|
|
5397
|
+
});
|
|
5398
|
+
}
|
|
5399
|
+
/**
|
|
5400
|
+
* Get a continuation page of a playlist's items.
|
|
5401
|
+
*
|
|
5402
|
+
* @param playlistId - The playlist id.
|
|
5403
|
+
* @param options - Optional continuation token and region.
|
|
5404
|
+
* @returns A page of playlist items with a continuation token.
|
|
5405
|
+
*/
|
|
5406
|
+
async items(playlistId, options = {}) {
|
|
5407
|
+
return this.client.request(
|
|
5408
|
+
`/v1/youtube/playlists/${playlistId}/items`,
|
|
5409
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5410
|
+
);
|
|
5411
|
+
}
|
|
5412
|
+
/**
|
|
5413
|
+
* Resolve an auto-generated mix / radio (RD…) queue.
|
|
5414
|
+
*
|
|
5415
|
+
* @param mixId - The mix / radio playlist id.
|
|
5416
|
+
* @param options - Optional region parameters.
|
|
5417
|
+
* @returns The mix as a playlist queue.
|
|
5418
|
+
*/
|
|
5419
|
+
async mix(mixId, options = {}) {
|
|
5420
|
+
return this.client.request(`/v1/youtube/mixes/${mixId}`, {
|
|
5421
|
+
params: { gl: options.gl, hl: options.hl }
|
|
5422
|
+
});
|
|
5423
|
+
}
|
|
5424
|
+
};
|
|
5425
|
+
|
|
5426
|
+
// src/youtube/community.ts
|
|
5427
|
+
var CommunityClient = class {
|
|
5428
|
+
client;
|
|
5429
|
+
constructor(client) {
|
|
5430
|
+
this.client = client;
|
|
5431
|
+
}
|
|
5432
|
+
/**
|
|
5433
|
+
* Get a single community post's detail.
|
|
5434
|
+
*
|
|
5435
|
+
* @param postId - The community post id.
|
|
5436
|
+
* @param options - Optional region parameters.
|
|
5437
|
+
* @returns The community post.
|
|
5438
|
+
* @throws NotFoundError - If the post doesn't exist.
|
|
5439
|
+
*/
|
|
5440
|
+
async get(postId, options = {}) {
|
|
5441
|
+
return this.client.request(`/v1/youtube/posts/${postId}`, {
|
|
5442
|
+
params: { gl: options.gl, hl: options.hl }
|
|
5443
|
+
});
|
|
5444
|
+
}
|
|
5445
|
+
/**
|
|
5446
|
+
* Get a page of comments on a community post.
|
|
5447
|
+
*
|
|
5448
|
+
* @param postId - The community post id.
|
|
5449
|
+
* @param options - Optional continuation token and region.
|
|
5450
|
+
* @returns A page of comments with a continuation token.
|
|
5451
|
+
*/
|
|
5452
|
+
async comments(postId, options = {}) {
|
|
5453
|
+
return this.client.request(
|
|
5454
|
+
`/v1/youtube/posts/${postId}/comments`,
|
|
5455
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5456
|
+
);
|
|
5457
|
+
}
|
|
5458
|
+
};
|
|
5459
|
+
|
|
5460
|
+
// src/youtube/shorts.ts
|
|
5461
|
+
var ShortsClient2 = class {
|
|
5462
|
+
client;
|
|
5463
|
+
constructor(client) {
|
|
5464
|
+
this.client = client;
|
|
5465
|
+
}
|
|
5466
|
+
/**
|
|
5467
|
+
* Get a single Short's detail.
|
|
5468
|
+
*
|
|
5469
|
+
* @param videoId - The Short's video id.
|
|
5470
|
+
* @param options - Optional region parameters.
|
|
5471
|
+
* @returns The Short detail.
|
|
5472
|
+
* @throws NotFoundError - If the Short doesn't exist or is unavailable.
|
|
5473
|
+
*/
|
|
5474
|
+
async get(videoId, options = {}) {
|
|
5475
|
+
return this.client.request(`/v1/youtube/shorts/${videoId}`, {
|
|
5476
|
+
params: { gl: options.gl, hl: options.hl }
|
|
5477
|
+
});
|
|
5478
|
+
}
|
|
5479
|
+
/**
|
|
5480
|
+
* Get a page of Shorts attributed to a given sound / music id (best-effort).
|
|
5481
|
+
*
|
|
5482
|
+
* @param soundId - The sound / music id.
|
|
5483
|
+
* @param options - Optional continuation token and region.
|
|
5484
|
+
* @returns A page of Shorts cards with a continuation token.
|
|
5485
|
+
*/
|
|
5486
|
+
async bySound(soundId, options = {}) {
|
|
5487
|
+
return this.client.request(
|
|
5488
|
+
`/v1/youtube/shorts/by_sound/${soundId}`,
|
|
5489
|
+
{ params: { continuation: options.continuation, gl: options.gl, hl: options.hl } }
|
|
5490
|
+
);
|
|
5491
|
+
}
|
|
5492
|
+
};
|
|
5493
|
+
|
|
5494
|
+
// src/youtube/trending.ts
|
|
5495
|
+
var TrendingClient2 = class {
|
|
5496
|
+
client;
|
|
5497
|
+
constructor(client) {
|
|
5498
|
+
this.client = client;
|
|
5499
|
+
}
|
|
5500
|
+
/**
|
|
5501
|
+
* Get a page of the trending feed.
|
|
5502
|
+
*
|
|
5503
|
+
* @param options - Optional feed type, continuation token, and region.
|
|
5504
|
+
* @returns A page of trending items with a continuation token.
|
|
5505
|
+
*/
|
|
5506
|
+
async get(options = {}) {
|
|
5507
|
+
return this.client.request("/v1/youtube/trending", {
|
|
5508
|
+
params: {
|
|
5509
|
+
type: options.type,
|
|
5510
|
+
continuation: options.continuation,
|
|
5511
|
+
gl: options.gl,
|
|
5512
|
+
hl: options.hl
|
|
5513
|
+
}
|
|
5514
|
+
});
|
|
5515
|
+
}
|
|
5516
|
+
/**
|
|
5517
|
+
* Get a page of trending Shorts.
|
|
5518
|
+
*
|
|
5519
|
+
* @param options - Optional continuation token and region.
|
|
5520
|
+
* @returns A page of trending Shorts with a continuation token.
|
|
5521
|
+
*/
|
|
5522
|
+
async shorts(options = {}) {
|
|
5523
|
+
return this.client.request("/v1/youtube/trending/shorts", {
|
|
5524
|
+
params: { continuation: options.continuation, gl: options.gl, hl: options.hl }
|
|
5525
|
+
});
|
|
5526
|
+
}
|
|
5527
|
+
/**
|
|
5528
|
+
* Get a page of videos under a hashtag.
|
|
5529
|
+
*
|
|
5530
|
+
* @param tag - The hashtag (with or without a leading `#`).
|
|
5531
|
+
* @param options - Optional continuation token and region.
|
|
5532
|
+
* @returns A page of hashtag results with a continuation token.
|
|
5533
|
+
*/
|
|
5534
|
+
async hashtag(tag, options = {}) {
|
|
5535
|
+
return this.client.request(`/v1/youtube/hashtags/${tag}`, {
|
|
5536
|
+
params: { continuation: options.continuation, gl: options.gl, hl: options.hl }
|
|
5537
|
+
});
|
|
5538
|
+
}
|
|
5539
|
+
/**
|
|
5540
|
+
* Get a page of the guest home / recommendations feed (best-effort).
|
|
5541
|
+
*
|
|
5542
|
+
* @param options - Optional continuation token and region.
|
|
5543
|
+
* @returns A page of home-feed results with a continuation token.
|
|
5544
|
+
*/
|
|
5545
|
+
async home(options = {}) {
|
|
5546
|
+
return this.client.request("/v1/youtube/home", {
|
|
5547
|
+
params: { continuation: options.continuation, gl: options.gl, hl: options.hl }
|
|
5548
|
+
});
|
|
5549
|
+
}
|
|
5550
|
+
};
|
|
5551
|
+
|
|
5552
|
+
// src/youtube/music.ts
|
|
5553
|
+
var MusicClient2 = class {
|
|
5554
|
+
client;
|
|
5555
|
+
constructor(client) {
|
|
5556
|
+
this.client = client;
|
|
5557
|
+
}
|
|
5558
|
+
/**
|
|
5559
|
+
* Search YouTube Music (songs / albums / artists / playlists).
|
|
5560
|
+
*
|
|
5561
|
+
* @param params - The required query plus optional continuation and region.
|
|
5562
|
+
* @returns A page of search results with a continuation token.
|
|
5563
|
+
*/
|
|
5564
|
+
async search(params) {
|
|
5565
|
+
return this.client.request("/v1/youtube/music/search", {
|
|
5566
|
+
params: {
|
|
5567
|
+
query: params.query,
|
|
5568
|
+
continuation: params.continuation,
|
|
5569
|
+
gl: params.gl,
|
|
5570
|
+
hl: params.hl
|
|
5571
|
+
}
|
|
5572
|
+
});
|
|
5573
|
+
}
|
|
5574
|
+
};
|
|
5575
|
+
|
|
5576
|
+
// src/youtube/reference.ts
|
|
5577
|
+
var ReferenceClient6 = class {
|
|
5578
|
+
client;
|
|
5579
|
+
constructor(client) {
|
|
5580
|
+
this.client = client;
|
|
5581
|
+
}
|
|
5582
|
+
/**
|
|
5583
|
+
* List YouTube video categories (Data-API parity).
|
|
5584
|
+
*
|
|
5585
|
+
* @param options - Optional content region (default: "US").
|
|
5586
|
+
* @returns The categories for the region.
|
|
5587
|
+
*/
|
|
5588
|
+
async categories(options = {}) {
|
|
5589
|
+
return this.client.request("/v1/youtube/categories", {
|
|
5590
|
+
params: { gl: options.gl }
|
|
5591
|
+
});
|
|
5592
|
+
}
|
|
5593
|
+
/**
|
|
5594
|
+
* List supported UI languages (hl codes).
|
|
5595
|
+
*
|
|
5596
|
+
* @returns The supported UI languages.
|
|
5597
|
+
*/
|
|
5598
|
+
async languages() {
|
|
5599
|
+
return this.client.request("/v1/youtube/languages");
|
|
5600
|
+
}
|
|
5601
|
+
/**
|
|
5602
|
+
* List supported content regions (gl codes).
|
|
5603
|
+
*
|
|
5604
|
+
* @returns The supported content regions.
|
|
5605
|
+
*/
|
|
5606
|
+
async regions() {
|
|
5607
|
+
return this.client.request("/v1/youtube/regions");
|
|
5608
|
+
}
|
|
5609
|
+
/**
|
|
5610
|
+
* List the regions the scraper explicitly geo-targets (proxy-pinned).
|
|
5611
|
+
*
|
|
5612
|
+
* @returns The supported scraper markets.
|
|
5613
|
+
*/
|
|
5614
|
+
async markets() {
|
|
5615
|
+
return this.client.request("/v1/youtube/markets");
|
|
5616
|
+
}
|
|
5617
|
+
};
|
|
5618
|
+
|
|
5619
|
+
// src/youtube/client.ts
|
|
5620
|
+
var YoutubeClient = class {
|
|
5621
|
+
/** Client for full-matrix search and keyword autocomplete */
|
|
5622
|
+
search;
|
|
5623
|
+
/** Client for video detail, comments, transcript, captions, streams, live chat, batch, and oEmbed */
|
|
5624
|
+
videos;
|
|
5625
|
+
/** Client for channel detail, tab feeds, about, subscriber count, search, and resolve */
|
|
5626
|
+
channels;
|
|
5627
|
+
/** Client for playlist detail, items pagination, and mixes */
|
|
5628
|
+
playlists;
|
|
5629
|
+
/** Client for community post detail and post comments */
|
|
5630
|
+
community;
|
|
5631
|
+
/** Client for single-Short detail and Shorts by sound */
|
|
5632
|
+
shorts;
|
|
5633
|
+
/** Client for the trending feed, trending shorts, hashtag feed, and home feed */
|
|
5634
|
+
trending;
|
|
5635
|
+
/** Client for YouTube Music search */
|
|
5636
|
+
music;
|
|
5637
|
+
/** Client for reference data (categories, languages, regions, markets) */
|
|
5638
|
+
reference;
|
|
5639
|
+
/**
|
|
5640
|
+
* Create a new YouTube client.
|
|
5641
|
+
*
|
|
5642
|
+
* @param client - The base HTTP client for making requests.
|
|
5643
|
+
*/
|
|
5644
|
+
constructor(client) {
|
|
5645
|
+
this.search = new SearchClient8(client);
|
|
5646
|
+
this.videos = new VideosClient3(client);
|
|
5647
|
+
this.channels = new ChannelsClient(client);
|
|
5648
|
+
this.playlists = new PlaylistsClient(client);
|
|
5649
|
+
this.community = new CommunityClient(client);
|
|
5650
|
+
this.shorts = new ShortsClient2(client);
|
|
5651
|
+
this.trending = new TrendingClient2(client);
|
|
5652
|
+
this.music = new MusicClient2(client);
|
|
5653
|
+
this.reference = new ReferenceClient6(client);
|
|
5654
|
+
}
|
|
5655
|
+
};
|
|
5656
|
+
|
|
5051
5657
|
// src/client.ts
|
|
5052
5658
|
var ScrapeBadger = class {
|
|
5053
5659
|
baseClient;
|
|
@@ -5069,6 +5675,8 @@ var ScrapeBadger = class {
|
|
|
5069
5675
|
tiktok;
|
|
5070
5676
|
/** eBay scraper API client — 12 endpoints across 18 markets */
|
|
5071
5677
|
ebay;
|
|
5678
|
+
/** YouTube scraper API client — 39 endpoints */
|
|
5679
|
+
youtube;
|
|
5072
5680
|
/**
|
|
5073
5681
|
* Create a new ScrapeBadger client.
|
|
5074
5682
|
*
|
|
@@ -5112,9 +5720,10 @@ var ScrapeBadger = class {
|
|
|
5112
5720
|
this.shopee = new ShopeeClient(this.baseClient);
|
|
5113
5721
|
this.tiktok = new TikTokClient(this.baseClient);
|
|
5114
5722
|
this.ebay = new EbayClient(this.baseClient);
|
|
5723
|
+
this.youtube = new YoutubeClient(this.baseClient);
|
|
5115
5724
|
}
|
|
5116
5725
|
};
|
|
5117
5726
|
|
|
5118
|
-
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, CommunitiesClient, ConflictError, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient7 as EbaySearchClient, SellersClient2 as EbaySellersClient, GeoClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, InsufficientCreditsError, ListsClient, NotFoundError, RateLimitError, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient5 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient6 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient4 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, collectAll, verifyWebhookSignature };
|
|
5727
|
+
export { AccountRestrictedError, AmazonClient, ListingsClient as AmazonListingsClient, ProductsClient2 as AmazonProductsClient, ReferenceClient2 as AmazonReferenceClient, SearchClient4 as AmazonSearchClient, SellersClient as AmazonSellersClient, AuthenticationError, CommunitiesClient, ConflictError, CategoriesClient as EbayCategoriesClient, EbayClient, ItemsClient2 as EbayItemsClient, ReferenceClient5 as EbayReferenceClient, SearchClient7 as EbaySearchClient, SellersClient2 as EbaySellersClient, GeoClient, AiModeClient as GoogleAiModeClient, AutocompleteClient as GoogleAutocompleteClient, GoogleClient, FinanceClient as GoogleFinanceClient, FlightsClient as GoogleFlightsClient, HotelsClient as GoogleHotelsClient, ImagesClient as GoogleImagesClient, JobsClient as GoogleJobsClient, LensClient as GoogleLensClient, MapsClient as GoogleMapsClient, NewsClient as GoogleNewsClient, PatentsClient as GooglePatentsClient, ProductsClient as GoogleProductsClient, ScholarClient as GoogleScholarClient, SearchClient2 as GoogleSearchClient, ShoppingClient as GoogleShoppingClient, ShortsClient as GoogleShortsClient, TrendsClient2 as GoogleTrendsClient, VideosClient as GoogleVideosClient, InsufficientCreditsError, ListsClient, NotFoundError, RateLimitError, RedditClient, PostsClient as RedditPostsClient, SearchClient3 as RedditSearchClient, SubredditsClient as RedditSubredditsClient, UsersClient3 as RedditUsersClient, ScrapeBadger, ScrapeBadgerError, ServerError, ShopeeClient, ProductsClient3 as ShopeeProductsClient, ReferenceClient3 as ShopeeReferenceClient, ReviewsClient as ShopeeReviewsClient, SearchClient5 as ShopeeSearchClient, SpacesClient, StreamClient, AdsClient as TikTokAdsClient, TikTokClient, HashtagsClient as TikTokHashtagsClient, MusicClient as TikTokMusicClient, ReferenceClient4 as TikTokReferenceClient, SearchClient6 as TikTokSearchClient, TrendingClient as TikTokTrendingClient, UsersClient4 as TikTokUsersClient, VideosClient2 as TikTokVideosClient, TimeoutError, TrendsClient, TweetsClient, TwitterClient, UsersClient, ValidationError, VintedClient, ItemsClient as VintedItemsClient, ReferenceClient as VintedReferenceClient, SearchClient as VintedSearchClient, UsersClient2 as VintedUsersClient, WebClient, WebSocketStreamError, ChannelsClient as YoutubeChannelsClient, YoutubeClient, CommunityClient as YoutubeCommunityClient, MusicClient2 as YoutubeMusicClient, PlaylistsClient as YoutubePlaylistsClient, ReferenceClient6 as YoutubeReferenceClient, SearchClient8 as YoutubeSearchClient, ShortsClient2 as YoutubeShortsClient, TrendingClient2 as YoutubeTrendingClient, VideosClient3 as YoutubeVideosClient, collectAll, verifyWebhookSignature };
|
|
5119
5728
|
//# sourceMappingURL=index.mjs.map
|
|
5120
5729
|
//# sourceMappingURL=index.mjs.map
|