1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "mode": "metadata",
12 "videoUrls": [
13 "https://www.youtube.com/watch?v=jNQXAC9IVRw"
14 ],
15 "playlistUrls": [],
16 "channelUrls": [],
17 "searchQueries": [],
18 "videoQuality": "360p",
19 "container": "auto",
20 "audioOnly": false,
21 "audioFormat": "m4a",
22 "downloadSubtitles": false,
23 "subtitleLanguages": [
24 "en"
25 ],
26 "subtitleFormat": "vtt",
27 "includeTranscript": false,
28 "maxVideos": 1,
29 "maxMinutes": 30,
30 "maxMB": 100,
31 "allow4K": false,
32 "storage": "ephemeral_kvs",
33 "kvsName": "",
34 "storageRetentionDays": 7,
35 "s3Prefix": "youtube-downloader",
36 "s3Region": "auto",
37 "proxyConfiguration": {
38 "useApifyProxy": true
39 }
40};
41
42
43const run = await client.actor("nimbryxo-studio/youtube-video-playlist-and-channel-downloader").call(input);
44
45
46console.log('Results from dataset');
47console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
48const { items } = await client.dataset(run.defaultDatasetId).listItems();
49items.forEach((item) => {
50 console.dir(item);
51});
52
53