1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "urls": [
12 {
13 "url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
14 }
15 ],
16 "enableViews": true,
17 "enableTranscription": false,
18 "viewCounts": 1,
19 "watchTime": 30,
20 "randomizeWatchTime": true,
21 "randomPause": true,
22 "screenshotPause": false,
23 "browsers": 2,
24 "captureScreenshots": true,
25 "screenshotQuality": "super-low",
26 "detectBotVerification": true,
27 "screenshotOnBotDetection": true,
28 "maxRetries": 1,
29 "playShorts": false,
30 "includeTimestamps": false,
31 "preferredLanguage": "",
32 "webhookUrl": "",
33 "webhookId": "",
34 "debugMode": false,
35 "proxyConfiguration": {
36 "useApifyProxy": true,
37 "apifyProxyGroups": [
38 "RESIDENTIAL"
39 ],
40 "apifyProxyCountry": "NL"
41 }
42};
43
44
45const run = await client.actor("nocodeventure/youtube-view-transcript-generator").call(input);
46
47
48console.log('Results from dataset');
49console.log(`πΎ Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
50const { items } = await client.dataset(run.defaultDatasetId).listItems();
51items.forEach((item) => {
52 console.dir(item);
53});
54
55