1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "URLItem": [
10 {
11 "url": "https://download.samplelib.com/mp4/sample-5s.mp4",
12 "method": "GET",
13 "headers": {},
14 "fileName": "5s.mp4",
15 },
16 {
17 "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
18 "method": "GET",
19 "headers": { "User-Agent": "Custom-Downloader/1.0" },
20 },
21 {
22 "url": "https://www.reddit.com/",
23 "method": "GET",
24 "fileName": "reddit.html",
25 },
26 {
27 "url": "https://httpbin.org/bytes/2048",
28 "method": "GET",
29 },
30 {
31 "url": "https://www.youtube.com/",
32 "method": "GET",
33 },
34 {
35 "url": "https://file-examples.com/wp-content/storage/2017/02/file-sample_100kB.docx",
36 "method": "GET",
37 },
38 ],
39 "proxyConfig": { "useApifyProxy": False },
40}
41
42
43run = client.actor("dz_omar/universal-downloader").call(run_input=run_input)
44
45
46print("πΎ Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
47for item in client.dataset(run["defaultDatasetId"]).iterate_items():
48 print(item)
49
50