1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "videos": [
12 {
13 "id": "cache-demo",
14 "title": "Reduce cloud costs with a cache",
15 "segments": [
16 {
17 "start": 0,
18 "dur": 2,
19 "text": "Welcome back, subscribe before we begin."
20 },
21 {
22 "start": 2,
23 "dur": 2,
24 "text": "Today we compare a simple cache."
25 },
26 {
27 "start": 4,
28 "dur": 10,
29 "text": "The cache avoids duplicate network requests. We measure storage and runtime cost for a repeated workload with the same input and compare recorded counters."
30 }
31 ]
32 },
33 {
34 "id": "zwrot-towaru",
35 "title": "Zwrot towaru w sklepie internetowym",
36 "text": "Zwrot towaru zaczyna się od numeru zamówienia i daty zakupu. Przygotuj opis produktu oraz potwierdzenie zakupu, potem sprawdź zasady sprzedawcy i zachowaj kopię zgłoszenia. Ten przykład przedstawia dostarczony scenariusz filmu do kontroli redakcyjnej. W dalszej części scenariusza wracamy do numeru zamówienia i sposobu zapisania potwierdzenia. To dane demonstracyjne do przeglądu tekstu."
37 },
38 {
39 "id": "produktvideo",
40 "title": "Produktvideo mit klarer Planung",
41 "segments": [
42 {
43 "start": 0,
44 "dur": 3,
45 "text": "Ein einfacher Trick garantiert immer perfekte Videos."
46 },
47 {
48 "start": 3,
49 "dur": 8,
50 "text": "Für das Produktvideo planen wir Licht, Ton und drei Aufnahmen. Danach vergleichen wir die Aufnahmen mit der Planung und prüfen die Aussagen im Skript."
51 }
52 ]
53 }
54 ],
55 "windowSeconds": 3,
56 "openingWords": 30,
57 "maxItems": 1
58};
59
60
61const run = await client.actor("danielmichalek/video-hook-analyzer").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71