|
26 | 26 | }, |
27 | 27 | { |
28 | 28 | "cell_type": "code", |
29 | | - "execution_count": 2, |
| 29 | + "execution_count": 8, |
30 | 30 | "id": "59ab69c2", |
31 | 31 | "metadata": { |
32 | 32 | "ExecuteTime": { |
33 | | - "end_time": "2025-09-30T22:33:28.895480027Z", |
34 | | - "start_time": "2025-09-30T22:33:28.832413744Z" |
| 33 | + "end_time": "2025-10-06T16:19:19.223288122Z", |
| 34 | + "start_time": "2025-10-06T16:19:19.181975428Z" |
35 | 35 | } |
36 | 36 | }, |
37 | 37 | "outputs": [], |
38 | 38 | "source": [ |
39 | 39 | "from ReversingLabs.SDK.ticloud import AdvancedSearch\n", |
40 | | - "from ReversingLabs.SDK.advanced import AdvancedActions" |
| 40 | + "from ReversingLabs.SDK.advanced import AdvancedActions\n", |
| 41 | + "from ReversingLabs.SDK.helper import NotFoundError" |
41 | 42 | ] |
42 | 43 | }, |
43 | 44 | { |
|
56 | 57 | }, |
57 | 58 | { |
58 | 59 | "cell_type": "code", |
59 | | - "execution_count": 9, |
| 60 | + "execution_count": 2, |
60 | 61 | "id": "66ed0816", |
61 | 62 | "metadata": { |
62 | 63 | "ExecuteTime": { |
63 | | - "end_time": "2025-09-30T22:38:20.732097504Z", |
64 | | - "start_time": "2025-09-30T22:38:20.726257601Z" |
| 64 | + "end_time": "2025-10-06T16:07:31.622877806Z", |
| 65 | + "start_time": "2025-10-06T16:07:31.580200729Z" |
65 | 66 | } |
66 | 67 | }, |
67 | 68 | "outputs": [], |
|
96 | 97 | }, |
97 | 98 | { |
98 | 99 | "cell_type": "code", |
99 | | - "execution_count": 10, |
| 100 | + "execution_count": 3, |
100 | 101 | "id": "791783de", |
101 | 102 | "metadata": { |
102 | 103 | "ExecuteTime": { |
103 | | - "end_time": "2025-09-30T22:38:25.551755262Z", |
104 | | - "start_time": "2025-09-30T22:38:25.511153908Z" |
| 104 | + "end_time": "2025-10-06T16:07:38.279883073Z", |
| 105 | + "start_time": "2025-10-06T16:07:38.271437401Z" |
105 | 106 | } |
106 | 107 | }, |
107 | 108 | "outputs": [], |
|
123 | 124 | }, |
124 | 125 | { |
125 | 126 | "cell_type": "code", |
126 | | - "execution_count": 11, |
| 127 | + "execution_count": 4, |
127 | 128 | "id": "dbdf8739", |
128 | 129 | "metadata": { |
129 | 130 | "ExecuteTime": { |
130 | | - "end_time": "2025-09-30T22:38:28.047287138Z", |
131 | | - "start_time": "2025-09-30T22:38:28.035230497Z" |
| 131 | + "end_time": "2025-10-06T16:07:41.899534054Z", |
| 132 | + "start_time": "2025-10-06T16:07:41.889372552Z" |
132 | 133 | } |
133 | 134 | }, |
134 | 135 | "outputs": [], |
|
156 | 157 | }, |
157 | 158 | { |
158 | 159 | "cell_type": "code", |
159 | | - "execution_count": 12, |
| 160 | + "execution_count": 5, |
160 | 161 | "id": "067c7c95", |
161 | 162 | "metadata": { |
162 | 163 | "ExecuteTime": { |
163 | | - "end_time": "2025-09-30T22:38:30.576112670Z", |
164 | | - "start_time": "2025-09-30T22:38:30.567537234Z" |
| 164 | + "end_time": "2025-10-06T16:07:45.825858157Z", |
| 165 | + "start_time": "2025-10-06T16:07:45.814540127Z" |
165 | 166 | } |
166 | 167 | }, |
167 | 168 | "outputs": [], |
|
201 | 202 | }, |
202 | 203 | { |
203 | 204 | "cell_type": "code", |
204 | | - "execution_count": null, |
| 205 | + "execution_count": 11, |
205 | 206 | "id": "e39a9c90", |
206 | | - "metadata": {}, |
207 | | - "outputs": [], |
| 207 | + "metadata": { |
| 208 | + "ExecuteTime": { |
| 209 | + "end_time": "2025-10-06T16:22:21.156146195Z", |
| 210 | + "start_time": "2025-10-06T16:21:59.052563050Z" |
| 211 | + } |
| 212 | + }, |
| 213 | + "outputs": [ |
| 214 | + { |
| 215 | + "name": "stdout", |
| 216 | + "output_type": "stream", |
| 217 | + "text": [ |
| 218 | + "Total samples returned: 100\n", |
| 219 | + "Skipped the 64 samples due to no available results.\n", |
| 220 | + "Found URLs in 36 samples\n", |
| 221 | + "Grouped report written to report.json\n" |
| 222 | + ] |
| 223 | + } |
| 224 | + ], |
208 | 225 | "source": [ |
209 | 226 | "def main():\n", |
210 | 227 | " query_string = QUERY_STRING\n", |
|
234 | 251 | " minimal_results = []\n", |
235 | 252 | " enrichment_success_count = 0\n", |
236 | 253 | " urls_found_count = 0\n", |
| 254 | + " skipped_hashes = []\n", |
237 | 255 | " \n", |
238 | 256 | " for sample in results:\n", |
239 | 257 | " sha1 = sample.get(\"sha1\")\n", |
|
263 | 281 | " minimal_data[\"extracted_urls\"] = list(set(found_urls)) # Deduplicate\n", |
264 | 282 | " urls_found_count += 1\n", |
265 | 283 | " enrichment_success_count += 1\n", |
| 284 | + " \n", |
| 285 | + " except NotFoundError:\n", |
| 286 | + " skipped_hashes.append(sha1)\n", |
| 287 | + " \n", |
266 | 288 | " except Exception as e:\n", |
267 | 289 | " print(f\"Error enriching sample {sha1}: {e}\")\n", |
268 | 290 | " \n", |
269 | 291 | " minimal_results.append(minimal_data)\n", |
| 292 | + " \n", |
| 293 | + " if skipped_hashes: \n", |
| 294 | + " print(f\"Skipped {len(skipped_hashes)} samples due to no available results.\")\n", |
270 | 295 | "\n", |
271 | 296 | " print(f\"Found URLs in {urls_found_count} samples\")\n", |
272 | 297 | "\n", |
|
0 commit comments