1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "videoUrl": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
12 "clips": [
13 {
14 "name": "intro_clip",
15 "start": "00:00:00",
16 "end": "00:00:15"
17 },
18 {
19 "name": "clip_1",
20 "start": "00:01:30",
21 "end": "00:01:45"
22 },
23 {
24 "name": "clip_2",
25 "start": "00:02:30",
26 "end": "00:02:45"
27 }
28 ],
29 "proxy": {
30 "useApifyProxy": true,
31 "apifyProxyGroups": [
32 "RESIDENTIAL"
33 ]
34 }
35};
36
37
38const run = await client.actor("fractalai/youtube-video-clipper").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