1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "videoUrls": [
12 "https://www.youtube.com/shorts/C4exbdl5H-s",
13 "https://www.tiktok.com/@tiktok/video/7681695065927912735"
14 ],
15 "datasetVideoField": "videoUrl",
16 "layers": [
17 "transcriptSegments",
18 "transcriptFull",
19 "hook",
20 "onscreenText",
21 "keywords",
22 "chapters"
23 ],
24 "language": "auto",
25 "hookSeconds": 3,
26 "whisperModel": "small",
27 "ocrMaxVideoSeconds": 180,
28 "timeoutPerVideo": 240,
29 "proxyConfiguration": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ]
34 }
35};
36
37
38const run = await client.actor("ntriqpro/video-transcript-hooks").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48