crawlberg 1.12.0 → 1.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/crawlberg_rb/native/Cargo.lock +75 -147
- data/ext/crawlberg_rb/native/Cargo.toml +3 -3
- data/ext/crawlberg_rb/src/lib.rs +258 -57
- data/lib/crawlberg/version.rb +2 -2
- data/sig/types.rbs +10 -4
- metadata +2 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d94c2b28c7e7bc04835352b1e68dd17e01e73435438d896869793e8205dda557
|
|
4
|
+
data.tar.gz: af40fde2be40012801c809a9a29aa588f7b5e173f06c7c97a553b8edabf38fc4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 40b098a85ecdbead4feb24b6364064e2ce2efcc5bb0feb8b9c2df00cef4a1de529fb3a9b2c5496568aaee0b03b5e9f3913732b0c9cdc882561c91e811d017bca
|
|
7
|
+
data.tar.gz: d6d13a3632dbf1f84a21c53dfd1432de7f79be1ed3f818dd19883af9fd4fbc3258a13fb918de4db8b390320b642b5c19543aad67f6ce62928311d675d3c667cc
|
|
@@ -229,9 +229,9 @@ dependencies = [
|
|
|
229
229
|
|
|
230
230
|
[[package]]
|
|
231
231
|
name = "brotli"
|
|
232
|
-
version = "9.
|
|
232
|
+
version = "9.1.1"
|
|
233
233
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
234
|
-
checksum = "
|
|
234
|
+
checksum = "627b7cfb0578f0eafce087a90fcd40add1231900b69e4d4de2d456260a4f5d81"
|
|
235
235
|
dependencies = [
|
|
236
236
|
"alloc-no-stdlib",
|
|
237
237
|
"alloc-stdlib",
|
|
@@ -240,9 +240,9 @@ dependencies = [
|
|
|
240
240
|
|
|
241
241
|
[[package]]
|
|
242
242
|
name = "brotli-decompressor"
|
|
243
|
-
version = "6.0
|
|
243
|
+
version = "6.2.0"
|
|
244
244
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
245
|
-
checksum = "
|
|
245
|
+
checksum = "34c6783f42c21c952ad7112b354f0ba2f10760e9decea5b1b60523d6e270faaf"
|
|
246
246
|
dependencies = [
|
|
247
247
|
"alloc-no-stdlib",
|
|
248
248
|
"alloc-stdlib",
|
|
@@ -274,9 +274,9 @@ checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
|
|
274
274
|
|
|
275
275
|
[[package]]
|
|
276
276
|
name = "cc"
|
|
277
|
-
version = "1.
|
|
277
|
+
version = "1.10.0"
|
|
278
278
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
279
|
-
checksum = "
|
|
279
|
+
checksum = "86e055fa6e3e40ad6187ba25b6855eeb635d5271f8e0f0e1e9a5826b8d75bea0"
|
|
280
280
|
dependencies = [
|
|
281
281
|
"find-msvc-tools",
|
|
282
282
|
"jobserver",
|
|
@@ -537,9 +537,9 @@ dependencies = [
|
|
|
537
537
|
|
|
538
538
|
[[package]]
|
|
539
539
|
name = "crawlberg"
|
|
540
|
-
version = "1.12.
|
|
540
|
+
version = "1.12.2"
|
|
541
541
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
542
|
-
checksum = "
|
|
542
|
+
checksum = "8949315433622c191e4f83b23041a46f02f6096839149706af09715f75280971"
|
|
543
543
|
dependencies = [
|
|
544
544
|
"ahash",
|
|
545
545
|
"aho-corasick",
|
|
@@ -635,7 +635,7 @@ dependencies = [
|
|
|
635
635
|
|
|
636
636
|
[[package]]
|
|
637
637
|
name = "crawlberg-rb"
|
|
638
|
-
version = "1.12.
|
|
638
|
+
version = "1.12.2"
|
|
639
639
|
dependencies = [
|
|
640
640
|
"crawlberg",
|
|
641
641
|
"futures",
|
|
@@ -648,9 +648,9 @@ dependencies = [
|
|
|
648
648
|
|
|
649
649
|
[[package]]
|
|
650
650
|
name = "crawlberg-robots"
|
|
651
|
-
version = "1.12.
|
|
651
|
+
version = "1.12.2"
|
|
652
652
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
653
|
-
checksum = "
|
|
653
|
+
checksum = "30cb48557123dd4e13fd756b83490faf9aaeb7d70e1bcd74a410c4f12a9b6320"
|
|
654
654
|
|
|
655
655
|
[[package]]
|
|
656
656
|
name = "crc32fast"
|
|
@@ -804,9 +804,9 @@ dependencies = [
|
|
|
804
804
|
|
|
805
805
|
[[package]]
|
|
806
806
|
name = "fancy-regex"
|
|
807
|
-
version = "0.
|
|
807
|
+
version = "0.20.0"
|
|
808
808
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
809
|
-
checksum = "
|
|
809
|
+
checksum = "20ed7f62ce0ae0da1a8b93c3c7104ab7e0760a74491e097c701fff966e945390"
|
|
810
810
|
dependencies = [
|
|
811
811
|
"bit-set",
|
|
812
812
|
"regex-automata",
|
|
@@ -881,15 +881,6 @@ version = "1.3.0"
|
|
|
881
881
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
882
882
|
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
|
883
883
|
|
|
884
|
-
[[package]]
|
|
885
|
-
name = "fsevent-sys"
|
|
886
|
-
version = "4.1.0"
|
|
887
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
888
|
-
checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
|
|
889
|
-
dependencies = [
|
|
890
|
-
"libc",
|
|
891
|
-
]
|
|
892
|
-
|
|
893
884
|
[[package]]
|
|
894
885
|
name = "futures"
|
|
895
886
|
version = "0.3.34"
|
|
@@ -1086,9 +1077,9 @@ checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
|
|
|
1086
1077
|
|
|
1087
1078
|
[[package]]
|
|
1088
1079
|
name = "html-to-markdown-rs"
|
|
1089
|
-
version = "3.18.
|
|
1080
|
+
version = "3.18.7"
|
|
1090
1081
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1091
|
-
checksum = "
|
|
1082
|
+
checksum = "259eff8de02b67e436fa4ccd377dbf6105d530fc405f20489677f417cf673a7a"
|
|
1092
1083
|
dependencies = [
|
|
1093
1084
|
"ahash",
|
|
1094
1085
|
"astral-tl",
|
|
@@ -1262,9 +1253,9 @@ dependencies = [
|
|
|
1262
1253
|
|
|
1263
1254
|
[[package]]
|
|
1264
1255
|
name = "icu_casemap"
|
|
1265
|
-
version = "2.
|
|
1256
|
+
version = "2.4.0"
|
|
1266
1257
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1267
|
-
checksum = "
|
|
1258
|
+
checksum = "1a6f143e9349267b80ae071a6ec25d4797c45756d8b2671a8b24b7b25b81ab94"
|
|
1268
1259
|
dependencies = [
|
|
1269
1260
|
"icu_casemap_data",
|
|
1270
1261
|
"icu_collections",
|
|
@@ -1278,15 +1269,15 @@ dependencies = [
|
|
|
1278
1269
|
|
|
1279
1270
|
[[package]]
|
|
1280
1271
|
name = "icu_casemap_data"
|
|
1281
|
-
version = "2.
|
|
1272
|
+
version = "2.4.0"
|
|
1282
1273
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1283
|
-
checksum = "
|
|
1274
|
+
checksum = "71a5c321208537711696af55bc2ab5dad939e4f6e0aef92dd6a2555deceedf3a"
|
|
1284
1275
|
|
|
1285
1276
|
[[package]]
|
|
1286
1277
|
name = "icu_collections"
|
|
1287
|
-
version = "2.
|
|
1278
|
+
version = "2.4.0"
|
|
1288
1279
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1289
|
-
checksum = "
|
|
1280
|
+
checksum = "fe090a42a0d3140fed8c63263ed1fecc02422cb2f4bfe55cd8de2de1b8e105dd"
|
|
1290
1281
|
dependencies = [
|
|
1291
1282
|
"displaydoc",
|
|
1292
1283
|
"potential_utf",
|
|
@@ -1299,9 +1290,9 @@ dependencies = [
|
|
|
1299
1290
|
|
|
1300
1291
|
[[package]]
|
|
1301
1292
|
name = "icu_locale_core"
|
|
1302
|
-
version = "2.
|
|
1293
|
+
version = "2.4.0"
|
|
1303
1294
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1304
|
-
checksum = "
|
|
1295
|
+
checksum = "25d29b57c17c6528d0dc4c2141cfa2d08200465acb537a3909c8b9b8a4a984c0"
|
|
1305
1296
|
dependencies = [
|
|
1306
1297
|
"displaydoc",
|
|
1307
1298
|
"litemap",
|
|
@@ -1313,9 +1304,9 @@ dependencies = [
|
|
|
1313
1304
|
|
|
1314
1305
|
[[package]]
|
|
1315
1306
|
name = "icu_normalizer"
|
|
1316
|
-
version = "2.
|
|
1307
|
+
version = "2.4.0"
|
|
1317
1308
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1318
|
-
checksum = "
|
|
1309
|
+
checksum = "404a3b8c486f205c87fe7f23ab6894d84a4ad76d6e4671ae1981ba7def87c599"
|
|
1319
1310
|
dependencies = [
|
|
1320
1311
|
"icu_collections",
|
|
1321
1312
|
"icu_normalizer_data",
|
|
@@ -1327,15 +1318,15 @@ dependencies = [
|
|
|
1327
1318
|
|
|
1328
1319
|
[[package]]
|
|
1329
1320
|
name = "icu_normalizer_data"
|
|
1330
|
-
version = "2.
|
|
1321
|
+
version = "2.4.0"
|
|
1331
1322
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1332
|
-
checksum = "
|
|
1323
|
+
checksum = "20f0088bfb7441f7a37fa0c9e20cb1e9cba1cac6b9ce8cd2a6dc44294f8e8cbc"
|
|
1333
1324
|
|
|
1334
1325
|
[[package]]
|
|
1335
1326
|
name = "icu_properties"
|
|
1336
|
-
version = "2.
|
|
1327
|
+
version = "2.4.0"
|
|
1337
1328
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1338
|
-
checksum = "
|
|
1329
|
+
checksum = "2ea83d991c56158f7cf898bf86436c1dfe7c07ee82fe88951f2695c9f37a379f"
|
|
1339
1330
|
dependencies = [
|
|
1340
1331
|
"displaydoc",
|
|
1341
1332
|
"icu_collections",
|
|
@@ -1348,15 +1339,15 @@ dependencies = [
|
|
|
1348
1339
|
|
|
1349
1340
|
[[package]]
|
|
1350
1341
|
name = "icu_properties_data"
|
|
1351
|
-
version = "2.
|
|
1342
|
+
version = "2.4.0"
|
|
1352
1343
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1353
|
-
checksum = "
|
|
1344
|
+
checksum = "b98f29af82d02b163fe50161388350e743bb3107cc8e8c2f7314cb505faddfcf"
|
|
1354
1345
|
|
|
1355
1346
|
[[package]]
|
|
1356
1347
|
name = "icu_provider"
|
|
1357
|
-
version = "2.
|
|
1348
|
+
version = "2.4.0"
|
|
1358
1349
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1359
|
-
checksum = "
|
|
1350
|
+
checksum = "413099315636c588ee8f011190b329b971a09a8fae9d157e01dcae8379468514"
|
|
1360
1351
|
dependencies = [
|
|
1361
1352
|
"displaydoc",
|
|
1362
1353
|
"icu_locale_core",
|
|
@@ -1747,20 +1738,21 @@ dependencies = [
|
|
|
1747
1738
|
|
|
1748
1739
|
[[package]]
|
|
1749
1740
|
name = "notify"
|
|
1750
|
-
version = "8.2.
|
|
1741
|
+
version = "8.2.1"
|
|
1751
1742
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1752
|
-
checksum = "
|
|
1743
|
+
checksum = "82f812702fbc75d35416d3f884e04925be7e9498f4eceea2e24ba34559284674"
|
|
1753
1744
|
dependencies = [
|
|
1754
1745
|
"bitflags",
|
|
1755
|
-
"fsevent-sys",
|
|
1756
1746
|
"inotify",
|
|
1757
1747
|
"kqueue",
|
|
1758
1748
|
"libc",
|
|
1759
1749
|
"log",
|
|
1760
1750
|
"mio",
|
|
1761
1751
|
"notify-types",
|
|
1752
|
+
"objc2-core-foundation",
|
|
1753
|
+
"objc2-core-services",
|
|
1762
1754
|
"walkdir",
|
|
1763
|
-
"windows-sys 0.
|
|
1755
|
+
"windows-sys 0.61.2",
|
|
1764
1756
|
]
|
|
1765
1757
|
|
|
1766
1758
|
[[package]]
|
|
@@ -1805,6 +1797,16 @@ dependencies = [
|
|
|
1805
1797
|
"bitflags",
|
|
1806
1798
|
]
|
|
1807
1799
|
|
|
1800
|
+
[[package]]
|
|
1801
|
+
name = "objc2-core-services"
|
|
1802
|
+
version = "0.3.2"
|
|
1803
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1804
|
+
checksum = "583300ad934cba24ff5292aee751ecc070f7ca6b39a574cc21b7b5e588e06a0b"
|
|
1805
|
+
dependencies = [
|
|
1806
|
+
"libc",
|
|
1807
|
+
"objc2-core-foundation",
|
|
1808
|
+
]
|
|
1809
|
+
|
|
1808
1810
|
[[package]]
|
|
1809
1811
|
name = "objc2-io-kit"
|
|
1810
1812
|
version = "0.3.2"
|
|
@@ -1823,9 +1825,9 @@ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
|
|
|
1823
1825
|
|
|
1824
1826
|
[[package]]
|
|
1825
1827
|
name = "openssl-probe"
|
|
1826
|
-
version = "0.2.
|
|
1828
|
+
version = "0.2.2"
|
|
1827
1829
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1828
|
-
checksum = "
|
|
1830
|
+
checksum = "7e036b411754132fd6b74e94b74e9a13c5cf606fa93d1885c35860d3060820b1"
|
|
1829
1831
|
|
|
1830
1832
|
[[package]]
|
|
1831
1833
|
name = "opentelemetry"
|
|
@@ -1994,9 +1996,9 @@ dependencies = [
|
|
|
1994
1996
|
|
|
1995
1997
|
[[package]]
|
|
1996
1998
|
name = "psl"
|
|
1997
|
-
version = "2.1.
|
|
1999
|
+
version = "2.1.245"
|
|
1998
2000
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1999
|
-
checksum = "
|
|
2001
|
+
checksum = "46cce9bc841c0eeb395275a775d11e3cc91b904e6ab370a9a42369e111b3038e"
|
|
2000
2002
|
dependencies = [
|
|
2001
2003
|
"psl-types",
|
|
2002
2004
|
]
|
|
@@ -2291,9 +2293,9 @@ dependencies = [
|
|
|
2291
2293
|
|
|
2292
2294
|
[[package]]
|
|
2293
2295
|
name = "rustix"
|
|
2294
|
-
version = "1.1.
|
|
2296
|
+
version = "1.1.6"
|
|
2295
2297
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2296
|
-
checksum = "
|
|
2298
|
+
checksum = "e5e76742e5294153d4dde1207dbec5bdd81eef6fabdc0d2118babadabfd858aa"
|
|
2297
2299
|
dependencies = [
|
|
2298
2300
|
"bitflags",
|
|
2299
2301
|
"errno",
|
|
@@ -2580,9 +2582,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
|
2580
2582
|
|
|
2581
2583
|
[[package]]
|
|
2582
2584
|
name = "smallvec"
|
|
2583
|
-
version = "1.16.
|
|
2585
|
+
version = "1.16.4"
|
|
2584
2586
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2585
|
-
checksum = "
|
|
2587
|
+
checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
|
|
2586
2588
|
|
|
2587
2589
|
[[package]]
|
|
2588
2590
|
name = "socket2"
|
|
@@ -2820,9 +2822,9 @@ dependencies = [
|
|
|
2820
2822
|
|
|
2821
2823
|
[[package]]
|
|
2822
2824
|
name = "tinystr"
|
|
2823
|
-
version = "0.8.
|
|
2825
|
+
version = "0.8.5"
|
|
2824
2826
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
2825
|
-
checksum = "
|
|
2827
|
+
checksum = "abc840c238154d58f9e86b2792261edfde565a17696e1cda1a449de27979801a"
|
|
2826
2828
|
dependencies = [
|
|
2827
2829
|
"displaydoc",
|
|
2828
2830
|
"serde_core",
|
|
@@ -3219,9 +3221,9 @@ dependencies = [
|
|
|
3219
3221
|
|
|
3220
3222
|
[[package]]
|
|
3221
3223
|
name = "webpki-root-certs"
|
|
3222
|
-
version = "1.0.
|
|
3224
|
+
version = "1.0.11"
|
|
3223
3225
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3224
|
-
checksum = "
|
|
3226
|
+
checksum = "e49d0e65abc00c142e8f9428da991da9f1a250c39be97459901eb12b9b49f62a"
|
|
3225
3227
|
dependencies = [
|
|
3226
3228
|
"rustls-pki-types",
|
|
3227
3229
|
]
|
|
@@ -3390,16 +3392,7 @@ version = "0.52.0"
|
|
|
3390
3392
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3391
3393
|
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
|
|
3392
3394
|
dependencies = [
|
|
3393
|
-
"windows-targets
|
|
3394
|
-
]
|
|
3395
|
-
|
|
3396
|
-
[[package]]
|
|
3397
|
-
name = "windows-sys"
|
|
3398
|
-
version = "0.60.2"
|
|
3399
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3400
|
-
checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb"
|
|
3401
|
-
dependencies = [
|
|
3402
|
-
"windows-targets 0.53.5",
|
|
3395
|
+
"windows-targets",
|
|
3403
3396
|
]
|
|
3404
3397
|
|
|
3405
3398
|
[[package]]
|
|
@@ -3417,31 +3410,14 @@ version = "0.52.6"
|
|
|
3417
3410
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3418
3411
|
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
|
|
3419
3412
|
dependencies = [
|
|
3420
|
-
"windows_aarch64_gnullvm
|
|
3421
|
-
"windows_aarch64_msvc
|
|
3422
|
-
"windows_i686_gnu
|
|
3423
|
-
"windows_i686_gnullvm
|
|
3424
|
-
"windows_i686_msvc
|
|
3425
|
-
"windows_x86_64_gnu
|
|
3426
|
-
"windows_x86_64_gnullvm
|
|
3427
|
-
"windows_x86_64_msvc
|
|
3428
|
-
]
|
|
3429
|
-
|
|
3430
|
-
[[package]]
|
|
3431
|
-
name = "windows-targets"
|
|
3432
|
-
version = "0.53.5"
|
|
3433
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3434
|
-
checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3"
|
|
3435
|
-
dependencies = [
|
|
3436
|
-
"windows-link",
|
|
3437
|
-
"windows_aarch64_gnullvm 0.53.1",
|
|
3438
|
-
"windows_aarch64_msvc 0.53.1",
|
|
3439
|
-
"windows_i686_gnu 0.53.1",
|
|
3440
|
-
"windows_i686_gnullvm 0.53.1",
|
|
3441
|
-
"windows_i686_msvc 0.53.1",
|
|
3442
|
-
"windows_x86_64_gnu 0.53.1",
|
|
3443
|
-
"windows_x86_64_gnullvm 0.53.1",
|
|
3444
|
-
"windows_x86_64_msvc 0.53.1",
|
|
3413
|
+
"windows_aarch64_gnullvm",
|
|
3414
|
+
"windows_aarch64_msvc",
|
|
3415
|
+
"windows_i686_gnu",
|
|
3416
|
+
"windows_i686_gnullvm",
|
|
3417
|
+
"windows_i686_msvc",
|
|
3418
|
+
"windows_x86_64_gnu",
|
|
3419
|
+
"windows_x86_64_gnullvm",
|
|
3420
|
+
"windows_x86_64_msvc",
|
|
3445
3421
|
]
|
|
3446
3422
|
|
|
3447
3423
|
[[package]]
|
|
@@ -3459,96 +3435,48 @@ version = "0.52.6"
|
|
|
3459
3435
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3460
3436
|
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
|
|
3461
3437
|
|
|
3462
|
-
[[package]]
|
|
3463
|
-
name = "windows_aarch64_gnullvm"
|
|
3464
|
-
version = "0.53.1"
|
|
3465
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3466
|
-
checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53"
|
|
3467
|
-
|
|
3468
3438
|
[[package]]
|
|
3469
3439
|
name = "windows_aarch64_msvc"
|
|
3470
3440
|
version = "0.52.6"
|
|
3471
3441
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3472
3442
|
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
|
|
3473
3443
|
|
|
3474
|
-
[[package]]
|
|
3475
|
-
name = "windows_aarch64_msvc"
|
|
3476
|
-
version = "0.53.1"
|
|
3477
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3478
|
-
checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006"
|
|
3479
|
-
|
|
3480
3444
|
[[package]]
|
|
3481
3445
|
name = "windows_i686_gnu"
|
|
3482
3446
|
version = "0.52.6"
|
|
3483
3447
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3484
3448
|
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
|
|
3485
3449
|
|
|
3486
|
-
[[package]]
|
|
3487
|
-
name = "windows_i686_gnu"
|
|
3488
|
-
version = "0.53.1"
|
|
3489
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3490
|
-
checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3"
|
|
3491
|
-
|
|
3492
3450
|
[[package]]
|
|
3493
3451
|
name = "windows_i686_gnullvm"
|
|
3494
3452
|
version = "0.52.6"
|
|
3495
3453
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3496
3454
|
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
|
|
3497
3455
|
|
|
3498
|
-
[[package]]
|
|
3499
|
-
name = "windows_i686_gnullvm"
|
|
3500
|
-
version = "0.53.1"
|
|
3501
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3502
|
-
checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c"
|
|
3503
|
-
|
|
3504
3456
|
[[package]]
|
|
3505
3457
|
name = "windows_i686_msvc"
|
|
3506
3458
|
version = "0.52.6"
|
|
3507
3459
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3508
3460
|
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
|
|
3509
3461
|
|
|
3510
|
-
[[package]]
|
|
3511
|
-
name = "windows_i686_msvc"
|
|
3512
|
-
version = "0.53.1"
|
|
3513
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3514
|
-
checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2"
|
|
3515
|
-
|
|
3516
3462
|
[[package]]
|
|
3517
3463
|
name = "windows_x86_64_gnu"
|
|
3518
3464
|
version = "0.52.6"
|
|
3519
3465
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3520
3466
|
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
|
|
3521
3467
|
|
|
3522
|
-
[[package]]
|
|
3523
|
-
name = "windows_x86_64_gnu"
|
|
3524
|
-
version = "0.53.1"
|
|
3525
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3526
|
-
checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499"
|
|
3527
|
-
|
|
3528
3468
|
[[package]]
|
|
3529
3469
|
name = "windows_x86_64_gnullvm"
|
|
3530
3470
|
version = "0.52.6"
|
|
3531
3471
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3532
3472
|
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
|
|
3533
3473
|
|
|
3534
|
-
[[package]]
|
|
3535
|
-
name = "windows_x86_64_gnullvm"
|
|
3536
|
-
version = "0.53.1"
|
|
3537
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3538
|
-
checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1"
|
|
3539
|
-
|
|
3540
3474
|
[[package]]
|
|
3541
3475
|
name = "windows_x86_64_msvc"
|
|
3542
3476
|
version = "0.52.6"
|
|
3543
3477
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3544
3478
|
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
|
|
3545
3479
|
|
|
3546
|
-
[[package]]
|
|
3547
|
-
name = "windows_x86_64_msvc"
|
|
3548
|
-
version = "0.53.1"
|
|
3549
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3550
|
-
checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650"
|
|
3551
|
-
|
|
3552
3480
|
[[package]]
|
|
3553
3481
|
name = "winnow"
|
|
3554
3482
|
version = "1.0.4"
|
|
@@ -3569,9 +3497,9 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc"
|
|
|
3569
3497
|
|
|
3570
3498
|
[[package]]
|
|
3571
3499
|
name = "yoke"
|
|
3572
|
-
version = "0.8.
|
|
3500
|
+
version = "0.8.4"
|
|
3573
3501
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3574
|
-
checksum = "
|
|
3502
|
+
checksum = "417ef3fcf6c300b7dbd25c85531a746931c02ad536f3cf4786ed1e88223340b3"
|
|
3575
3503
|
dependencies = [
|
|
3576
3504
|
"stable_deref_trait",
|
|
3577
3505
|
"yoke-derive",
|
|
@@ -3651,9 +3579,9 @@ dependencies = [
|
|
|
3651
3579
|
|
|
3652
3580
|
[[package]]
|
|
3653
3581
|
name = "zerovec"
|
|
3654
|
-
version = "0.11.
|
|
3582
|
+
version = "0.11.9"
|
|
3655
3583
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3656
|
-
checksum = "
|
|
3584
|
+
checksum = "f58a2799cfe9a1670c7ea8edbd52ef8edb93cb37a7f83bf31ba9e35d9dae6a40"
|
|
3657
3585
|
dependencies = [
|
|
3658
3586
|
"serde",
|
|
3659
3587
|
"yoke",
|
|
@@ -3663,9 +3591,9 @@ dependencies = [
|
|
|
3663
3591
|
|
|
3664
3592
|
[[package]]
|
|
3665
3593
|
name = "zerovec-derive"
|
|
3666
|
-
version = "0.11.
|
|
3594
|
+
version = "0.11.7"
|
|
3667
3595
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
3668
|
-
checksum = "
|
|
3596
|
+
checksum = "c3743ddbf47738d929cd1ae2e199d40d0162979dfe31aef8ae646d2bf00bf97a"
|
|
3669
3597
|
dependencies = [
|
|
3670
3598
|
"proc-macro2",
|
|
3671
3599
|
"quote",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:b3f271455dce968c83cbdf03e1934902e2ad21295928a2c5f148e7dddc67ac2c
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify
|
|
5
5
|
|
|
6
6
|
[package]
|
|
7
7
|
name = "crawlberg-rb"
|
|
8
|
-
version = "1.12.
|
|
8
|
+
version = "1.12.2"
|
|
9
9
|
edition = "2024"
|
|
10
10
|
authors = ["Na'aman Hirschfeld <naaman@xberg.io>", "Tobias Perlstein <tobias@xberg.io>"]
|
|
11
11
|
license = "MIT"
|
|
@@ -23,7 +23,7 @@ path = "../src/lib.rs"
|
|
|
23
23
|
crate-type = ["cdylib"]
|
|
24
24
|
|
|
25
25
|
[dependencies]
|
|
26
|
-
crawlberg = { version = "1.12.
|
|
26
|
+
crawlberg = { version = "1.12.2", features = ["interact", "browser-chromiumoxide"] }
|
|
27
27
|
futures = "0.3"
|
|
28
28
|
magnus = "0.9"
|
|
29
29
|
rb-sys = ">=0.9.130, <0.10"
|
data/ext/crawlberg_rb/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef. DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:5766b3fb05a187f88eec0ae0ee3c5e32d6bede7f1a3bc38b4305587073983bbd
|
|
3
3
|
// Re-generate with: alef generate
|
|
4
4
|
#![allow(dead_code, unused_imports, unused_variables)]
|
|
5
5
|
#![allow(
|
|
@@ -845,6 +845,7 @@ pub struct BrowserConfig {
|
|
|
845
845
|
chrome_args: Vec<String>,
|
|
846
846
|
scroll_containers: bool,
|
|
847
847
|
dom_quiet_window: u64,
|
|
848
|
+
dom_quiet_cap: u64,
|
|
848
849
|
}
|
|
849
850
|
|
|
850
851
|
unsafe impl IntoValueFromNative for BrowserConfig {}
|
|
@@ -896,6 +897,7 @@ impl std::fmt::Debug for BrowserConfig {
|
|
|
896
897
|
debug.field("chrome_args", &"<redacted>");
|
|
897
898
|
debug.field("scroll_containers", &self.scroll_containers);
|
|
898
899
|
debug.field("dom_quiet_window", &self.dom_quiet_window);
|
|
900
|
+
debug.field("dom_quiet_cap", &self.dom_quiet_cap);
|
|
899
901
|
debug.finish()
|
|
900
902
|
}
|
|
901
903
|
}
|
|
@@ -1092,6 +1094,15 @@ impl BrowserConfig {
|
|
|
1092
1094
|
})?,
|
|
1093
1095
|
None => 150,
|
|
1094
1096
|
},
|
|
1097
|
+
dom_quiet_cap: match kwargs.get(ruby.to_symbol("dom_quiet_cap")) {
|
|
1098
|
+
Some(v) => u64::try_convert(v).map_err(|e| {
|
|
1099
|
+
magnus::Error::new(
|
|
1100
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
1101
|
+
format!("invalid value for `dom_quiet_cap`: {}", e),
|
|
1102
|
+
)
|
|
1103
|
+
})?,
|
|
1104
|
+
None => 4000,
|
|
1105
|
+
},
|
|
1095
1106
|
})
|
|
1096
1107
|
}
|
|
1097
1108
|
|
|
@@ -1170,6 +1181,10 @@ impl BrowserConfig {
|
|
|
1170
1181
|
fn dom_quiet_window(&self) -> u64 {
|
|
1171
1182
|
self.dom_quiet_window.clone()
|
|
1172
1183
|
}
|
|
1184
|
+
|
|
1185
|
+
fn dom_quiet_cap(&self) -> u64 {
|
|
1186
|
+
self.dom_quiet_cap.clone()
|
|
1187
|
+
}
|
|
1173
1188
|
}
|
|
1174
1189
|
|
|
1175
1190
|
#[derive(Clone, Debug, serde::Serialize)]
|
|
@@ -1474,6 +1489,10 @@ pub struct ContentConfig {
|
|
|
1474
1489
|
compact_tables: bool,
|
|
1475
1490
|
keep_inline_images_in: Vec<String>,
|
|
1476
1491
|
keep_hidden: bool,
|
|
1492
|
+
expand_abbreviations: bool,
|
|
1493
|
+
escape_misc: bool,
|
|
1494
|
+
escape_asterisks: bool,
|
|
1495
|
+
include_icon_labels: bool,
|
|
1477
1496
|
}
|
|
1478
1497
|
|
|
1479
1498
|
unsafe impl IntoValueFromNative for ContentConfig {}
|
|
@@ -1705,6 +1724,42 @@ impl ContentConfig {
|
|
|
1705
1724
|
})?,
|
|
1706
1725
|
None => false,
|
|
1707
1726
|
},
|
|
1727
|
+
expand_abbreviations: match kwargs.get(ruby.to_symbol("expand_abbreviations")) {
|
|
1728
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
1729
|
+
magnus::Error::new(
|
|
1730
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
1731
|
+
format!("invalid value for `expand_abbreviations`: {}", e),
|
|
1732
|
+
)
|
|
1733
|
+
})?,
|
|
1734
|
+
None => true,
|
|
1735
|
+
},
|
|
1736
|
+
escape_misc: match kwargs.get(ruby.to_symbol("escape_misc")) {
|
|
1737
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
1738
|
+
magnus::Error::new(
|
|
1739
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
1740
|
+
format!("invalid value for `escape_misc`: {}", e),
|
|
1741
|
+
)
|
|
1742
|
+
})?,
|
|
1743
|
+
None => false,
|
|
1744
|
+
},
|
|
1745
|
+
escape_asterisks: match kwargs.get(ruby.to_symbol("escape_asterisks")) {
|
|
1746
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
1747
|
+
magnus::Error::new(
|
|
1748
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
1749
|
+
format!("invalid value for `escape_asterisks`: {}", e),
|
|
1750
|
+
)
|
|
1751
|
+
})?,
|
|
1752
|
+
None => false,
|
|
1753
|
+
},
|
|
1754
|
+
include_icon_labels: match kwargs.get(ruby.to_symbol("include_icon_labels")) {
|
|
1755
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
1756
|
+
magnus::Error::new(
|
|
1757
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
1758
|
+
format!("invalid value for `include_icon_labels`: {}", e),
|
|
1759
|
+
)
|
|
1760
|
+
})?,
|
|
1761
|
+
None => true,
|
|
1762
|
+
},
|
|
1708
1763
|
})
|
|
1709
1764
|
}
|
|
1710
1765
|
|
|
@@ -1787,6 +1842,22 @@ impl ContentConfig {
|
|
|
1787
1842
|
fn keep_hidden(&self) -> bool {
|
|
1788
1843
|
self.keep_hidden
|
|
1789
1844
|
}
|
|
1845
|
+
|
|
1846
|
+
fn expand_abbreviations(&self) -> bool {
|
|
1847
|
+
self.expand_abbreviations
|
|
1848
|
+
}
|
|
1849
|
+
|
|
1850
|
+
fn escape_misc(&self) -> bool {
|
|
1851
|
+
self.escape_misc
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
fn escape_asterisks(&self) -> bool {
|
|
1855
|
+
self.escape_asterisks
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
fn include_icon_labels(&self) -> bool {
|
|
1859
|
+
self.include_icon_labels
|
|
1860
|
+
}
|
|
1790
1861
|
}
|
|
1791
1862
|
|
|
1792
1863
|
#[derive(Clone, serde::Serialize, serde::Deserialize)]
|
|
@@ -1967,6 +2038,7 @@ pub struct CrawlConfig {
|
|
|
1967
2038
|
ssrf: SsrfPolicy,
|
|
1968
2039
|
ssrf_deny_private_explicit: Option<bool>,
|
|
1969
2040
|
danger_accept_invalid_certs: bool,
|
|
2041
|
+
subdomain_header_allowlist: Vec<String>,
|
|
1970
2042
|
}
|
|
1971
2043
|
|
|
1972
2044
|
unsafe impl IntoValueFromNative for CrawlConfig {}
|
|
@@ -2055,6 +2127,7 @@ impl std::fmt::Debug for CrawlConfig {
|
|
|
2055
2127
|
debug.field("ssrf", &self.ssrf);
|
|
2056
2128
|
debug.field("ssrf_deny_private_explicit", &self.ssrf_deny_private_explicit);
|
|
2057
2129
|
debug.field("danger_accept_invalid_certs", &self.danger_accept_invalid_certs);
|
|
2130
|
+
debug.field("subdomain_header_allowlist", &self.subdomain_header_allowlist);
|
|
2058
2131
|
debug.finish()
|
|
2059
2132
|
}
|
|
2060
2133
|
}
|
|
@@ -2590,6 +2663,15 @@ impl CrawlConfig {
|
|
|
2590
2663
|
})?,
|
|
2591
2664
|
None => false,
|
|
2592
2665
|
},
|
|
2666
|
+
subdomain_header_allowlist: match kwargs.get(ruby.to_symbol("subdomain_header_allowlist")) {
|
|
2667
|
+
Some(v) => <Vec<String>>::try_convert(v).map_err(|e| {
|
|
2668
|
+
magnus::Error::new(
|
|
2669
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
2670
|
+
format!("invalid value for `subdomain_header_allowlist`: {}", e),
|
|
2671
|
+
)
|
|
2672
|
+
})?,
|
|
2673
|
+
None => Default::default(),
|
|
2674
|
+
},
|
|
2593
2675
|
})
|
|
2594
2676
|
}
|
|
2595
2677
|
|
|
@@ -2817,6 +2899,10 @@ impl CrawlConfig {
|
|
|
2817
2899
|
self.danger_accept_invalid_certs
|
|
2818
2900
|
}
|
|
2819
2901
|
|
|
2902
|
+
fn subdomain_header_allowlist(&self) -> Vec<String> {
|
|
2903
|
+
self.subdomain_header_allowlist.clone()
|
|
2904
|
+
}
|
|
2905
|
+
|
|
2820
2906
|
fn validate(&self) -> Result<(), Error> {
|
|
2821
2907
|
#[allow(clippy::needless_update)]
|
|
2822
2908
|
let core_self = crawlberg::CrawlConfig {
|
|
@@ -2937,14 +3023,11 @@ impl CrawlConfig {
|
|
|
2937
3023
|
|
|
2938
3024
|
danger_accept_invalid_certs: self.danger_accept_invalid_certs,
|
|
2939
3025
|
|
|
3026
|
+
subdomain_header_allowlist: self.subdomain_header_allowlist.clone(),
|
|
3027
|
+
|
|
2940
3028
|
..Default::default()
|
|
2941
3029
|
};
|
|
2942
|
-
let result = core_self.validate().map_err(
|
|
2943
|
-
magnus::Error::new(
|
|
2944
|
-
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
2945
|
-
e.to_string(),
|
|
2946
|
-
)
|
|
2947
|
-
})?;
|
|
3030
|
+
let result = core_self.validate().map_err(alef_magnus_err)?;
|
|
2948
3031
|
Ok(result)
|
|
2949
3032
|
}
|
|
2950
3033
|
}
|
|
@@ -2995,12 +3078,7 @@ impl CrawlEngineHandle {
|
|
|
2995
3078
|
);
|
|
2996
3079
|
let stream = runtime
|
|
2997
3080
|
.block_on(async { inner.crawl_stream(core_req).await })
|
|
2998
|
-
.map_err(
|
|
2999
|
-
magnus::Error::new(
|
|
3000
|
-
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
3001
|
-
e.to_string(),
|
|
3002
|
-
)
|
|
3003
|
-
})?;
|
|
3081
|
+
.map_err(alef_magnus_err)?;
|
|
3004
3082
|
let iterator = CrawlStreamIterator {
|
|
3005
3083
|
inner: Arc::new(tokio::sync::Mutex::new(Some(stream))),
|
|
3006
3084
|
runtime,
|
|
@@ -3040,12 +3118,7 @@ impl CrawlEngineHandle {
|
|
|
3040
3118
|
);
|
|
3041
3119
|
let stream = runtime
|
|
3042
3120
|
.block_on(async { inner.batch_crawl_stream(core_req).await })
|
|
3043
|
-
.map_err(
|
|
3044
|
-
magnus::Error::new(
|
|
3045
|
-
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
3046
|
-
e.to_string(),
|
|
3047
|
-
)
|
|
3048
|
-
})?;
|
|
3121
|
+
.map_err(alef_magnus_err)?;
|
|
3049
3122
|
let iterator = BatchCrawlStreamIterator {
|
|
3050
3123
|
inner: Arc::new(tokio::sync::Mutex::new(Some(stream))),
|
|
3051
3124
|
runtime,
|
|
@@ -7776,6 +7849,8 @@ pub enum PageAction {
|
|
|
7776
7849
|
selector: Option<String>,
|
|
7777
7850
|
},
|
|
7778
7851
|
Screenshot {
|
|
7852
|
+
#[serde(rename = "fullPage")]
|
|
7853
|
+
#[serde(alias = "full_page")]
|
|
7779
7854
|
full_page: Option<bool>,
|
|
7780
7855
|
},
|
|
7781
7856
|
#[serde(rename = "executeJs")]
|
|
@@ -7899,11 +7974,11 @@ fn batch_crawl(engine: CrawlEngineHandle, urls: Vec<String>) -> Result<BatchCraw
|
|
|
7899
7974
|
.enable_all()
|
|
7900
7975
|
.build()
|
|
7901
7976
|
.map_err(|e| e.to_string())?;
|
|
7902
|
-
rt.block_on(async { crawlberg::batch_crawl(&engine.inner, urls).await })
|
|
7903
|
-
.map_err(|e| e.to_string())
|
|
7977
|
+
Ok(rt.block_on(async { crawlberg::batch_crawl(&engine.inner, urls).await }))
|
|
7904
7978
|
});
|
|
7905
7979
|
let result = async_result
|
|
7906
7980
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
7981
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
7907
7982
|
Ok(result.into())
|
|
7908
7983
|
}
|
|
7909
7984
|
|
|
@@ -7913,11 +7988,11 @@ fn batch_crawl_async(engine: CrawlEngineHandle, urls: Vec<String>) -> Result<Bat
|
|
|
7913
7988
|
.enable_all()
|
|
7914
7989
|
.build()
|
|
7915
7990
|
.map_err(|e| e.to_string())?;
|
|
7916
|
-
rt.block_on(async { crawlberg::batch_crawl(&engine.inner, urls).await })
|
|
7917
|
-
.map_err(|e| e.to_string())
|
|
7991
|
+
Ok(rt.block_on(async { crawlberg::batch_crawl(&engine.inner, urls).await }))
|
|
7918
7992
|
});
|
|
7919
7993
|
let result = async_result
|
|
7920
7994
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
7995
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
7921
7996
|
Ok(result.into())
|
|
7922
7997
|
}
|
|
7923
7998
|
|
|
@@ -7927,11 +8002,11 @@ fn batch_scrape(engine: CrawlEngineHandle, urls: Vec<String>) -> Result<BatchScr
|
|
|
7927
8002
|
.enable_all()
|
|
7928
8003
|
.build()
|
|
7929
8004
|
.map_err(|e| e.to_string())?;
|
|
7930
|
-
rt.block_on(async { crawlberg::batch_scrape(&engine.inner, urls).await })
|
|
7931
|
-
.map_err(|e| e.to_string())
|
|
8005
|
+
Ok(rt.block_on(async { crawlberg::batch_scrape(&engine.inner, urls).await }))
|
|
7932
8006
|
});
|
|
7933
8007
|
let result = async_result
|
|
7934
8008
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8009
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
7935
8010
|
Ok(result.into())
|
|
7936
8011
|
}
|
|
7937
8012
|
|
|
@@ -7941,11 +8016,11 @@ fn batch_scrape_async(engine: CrawlEngineHandle, urls: Vec<String>) -> Result<Ba
|
|
|
7941
8016
|
.enable_all()
|
|
7942
8017
|
.build()
|
|
7943
8018
|
.map_err(|e| e.to_string())?;
|
|
7944
|
-
rt.block_on(async { crawlberg::batch_scrape(&engine.inner, urls).await })
|
|
7945
|
-
.map_err(|e| e.to_string())
|
|
8019
|
+
Ok(rt.block_on(async { crawlberg::batch_scrape(&engine.inner, urls).await }))
|
|
7946
8020
|
});
|
|
7947
8021
|
let result = async_result
|
|
7948
8022
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8023
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
7949
8024
|
Ok(result.into())
|
|
7950
8025
|
}
|
|
7951
8026
|
|
|
@@ -7955,11 +8030,11 @@ fn crawl(engine: CrawlEngineHandle, url: String) -> Result<CrawlResult, Error> {
|
|
|
7955
8030
|
.enable_all()
|
|
7956
8031
|
.build()
|
|
7957
8032
|
.map_err(|e| e.to_string())?;
|
|
7958
|
-
rt.block_on(async { crawlberg::crawl(&engine.inner, &url).await })
|
|
7959
|
-
.map_err(|e| e.to_string())
|
|
8033
|
+
Ok(rt.block_on(async { crawlberg::crawl(&engine.inner, &url).await }))
|
|
7960
8034
|
});
|
|
7961
8035
|
let result = async_result
|
|
7962
8036
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8037
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
7963
8038
|
Ok(result.into())
|
|
7964
8039
|
}
|
|
7965
8040
|
|
|
@@ -7969,11 +8044,11 @@ fn crawl_async(engine: CrawlEngineHandle, url: String) -> Result<CrawlResult, Er
|
|
|
7969
8044
|
.enable_all()
|
|
7970
8045
|
.build()
|
|
7971
8046
|
.map_err(|e| e.to_string())?;
|
|
7972
|
-
rt.block_on(async { crawlberg::crawl(&engine.inner, &url).await })
|
|
7973
|
-
.map_err(|e| e.to_string())
|
|
8047
|
+
Ok(rt.block_on(async { crawlberg::crawl(&engine.inner, &url).await }))
|
|
7974
8048
|
});
|
|
7975
8049
|
let result = async_result
|
|
7976
8050
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8051
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
7977
8052
|
Ok(result.into())
|
|
7978
8053
|
}
|
|
7979
8054
|
|
|
@@ -7990,12 +8065,7 @@ fn create_engine(args: &[magnus::Value]) -> Result<CrawlEngineHandle, Error> {
|
|
|
7990
8065
|
}
|
|
7991
8066
|
_ => None,
|
|
7992
8067
|
};
|
|
7993
|
-
let result = crawlberg::create_engine(config.map(Into::into)).map_err(
|
|
7994
|
-
magnus::Error::new(
|
|
7995
|
-
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
7996
|
-
e.to_string(),
|
|
7997
|
-
)
|
|
7998
|
-
})?;
|
|
8068
|
+
let result = crawlberg::create_engine(config.map(Into::into)).map_err(alef_magnus_err)?;
|
|
7999
8069
|
Ok(CrawlEngineHandle {
|
|
8000
8070
|
inner: Arc::new(result),
|
|
8001
8071
|
})
|
|
@@ -8012,11 +8082,11 @@ fn interact(engine: CrawlEngineHandle, url: String, actions: Vec<PageAction>) ->
|
|
|
8012
8082
|
.enable_all()
|
|
8013
8083
|
.build()
|
|
8014
8084
|
.map_err(|e| e.to_string())?;
|
|
8015
|
-
rt.block_on(async { crawlberg::interact(&engine.inner, &url, actions_core).await })
|
|
8016
|
-
.map_err(|e| e.to_string())
|
|
8085
|
+
Ok(rt.block_on(async { crawlberg::interact(&engine.inner, &url, actions_core).await }))
|
|
8017
8086
|
});
|
|
8018
8087
|
let result = async_result
|
|
8019
8088
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8089
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
8020
8090
|
Ok(result.into())
|
|
8021
8091
|
}
|
|
8022
8092
|
|
|
@@ -8031,11 +8101,11 @@ fn interact_async(
|
|
|
8031
8101
|
.enable_all()
|
|
8032
8102
|
.build()
|
|
8033
8103
|
.map_err(|e| e.to_string())?;
|
|
8034
|
-
rt.block_on(async { crawlberg::interact(&engine.inner, &url, actions_core).await })
|
|
8035
|
-
.map_err(|e| e.to_string())
|
|
8104
|
+
Ok(rt.block_on(async { crawlberg::interact(&engine.inner, &url, actions_core).await }))
|
|
8036
8105
|
});
|
|
8037
8106
|
let result = async_result
|
|
8038
8107
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8108
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
8039
8109
|
Ok(result.into())
|
|
8040
8110
|
}
|
|
8041
8111
|
|
|
@@ -8045,11 +8115,11 @@ fn map_urls(engine: CrawlEngineHandle, url: String) -> Result<MapResult, Error>
|
|
|
8045
8115
|
.enable_all()
|
|
8046
8116
|
.build()
|
|
8047
8117
|
.map_err(|e| e.to_string())?;
|
|
8048
|
-
rt.block_on(async { crawlberg::map_urls(&engine.inner, &url).await })
|
|
8049
|
-
.map_err(|e| e.to_string())
|
|
8118
|
+
Ok(rt.block_on(async { crawlberg::map_urls(&engine.inner, &url).await }))
|
|
8050
8119
|
});
|
|
8051
8120
|
let result = async_result
|
|
8052
8121
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8122
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
8053
8123
|
Ok(result.into())
|
|
8054
8124
|
}
|
|
8055
8125
|
|
|
@@ -8059,11 +8129,11 @@ fn map_urls_async(engine: CrawlEngineHandle, url: String) -> Result<MapResult, E
|
|
|
8059
8129
|
.enable_all()
|
|
8060
8130
|
.build()
|
|
8061
8131
|
.map_err(|e| e.to_string())?;
|
|
8062
|
-
rt.block_on(async { crawlberg::map_urls(&engine.inner, &url).await })
|
|
8063
|
-
.map_err(|e| e.to_string())
|
|
8132
|
+
Ok(rt.block_on(async { crawlberg::map_urls(&engine.inner, &url).await }))
|
|
8064
8133
|
});
|
|
8065
8134
|
let result = async_result
|
|
8066
8135
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8136
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
8067
8137
|
Ok(result.into())
|
|
8068
8138
|
}
|
|
8069
8139
|
|
|
@@ -8073,11 +8143,11 @@ fn scrape(engine: CrawlEngineHandle, url: String) -> Result<ScrapeResult, Error>
|
|
|
8073
8143
|
.enable_all()
|
|
8074
8144
|
.build()
|
|
8075
8145
|
.map_err(|e| e.to_string())?;
|
|
8076
|
-
rt.block_on(async { crawlberg::scrape(&engine.inner, &url).await })
|
|
8077
|
-
.map_err(|e| e.to_string())
|
|
8146
|
+
Ok(rt.block_on(async { crawlberg::scrape(&engine.inner, &url).await }))
|
|
8078
8147
|
});
|
|
8079
8148
|
let result = async_result
|
|
8080
8149
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8150
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
8081
8151
|
Ok(result.into())
|
|
8082
8152
|
}
|
|
8083
8153
|
|
|
@@ -8087,11 +8157,11 @@ fn scrape_async(engine: CrawlEngineHandle, url: String) -> Result<ScrapeResult,
|
|
|
8087
8157
|
.enable_all()
|
|
8088
8158
|
.build()
|
|
8089
8159
|
.map_err(|e| e.to_string())?;
|
|
8090
|
-
rt.block_on(async { crawlberg::scrape(&engine.inner, &url).await })
|
|
8091
|
-
.map_err(|e| e.to_string())
|
|
8160
|
+
Ok(rt.block_on(async { crawlberg::scrape(&engine.inner, &url).await }))
|
|
8092
8161
|
});
|
|
8093
8162
|
let result = async_result
|
|
8094
8163
|
.map_err(|message| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_runtime_error(), message))?;
|
|
8164
|
+
let result = result.map_err(alef_magnus_err)?;
|
|
8095
8165
|
Ok(result.into())
|
|
8096
8166
|
}
|
|
8097
8167
|
|
|
@@ -8302,6 +8372,7 @@ impl From<BrowserConfig> for crawlberg::BrowserConfig {
|
|
|
8302
8372
|
chrome_args: val.chrome_args.into_iter().collect(),
|
|
8303
8373
|
scroll_containers: val.scroll_containers,
|
|
8304
8374
|
dom_quiet_window: std::time::Duration::from_millis(val.dom_quiet_window),
|
|
8375
|
+
dom_quiet_cap: std::time::Duration::from_millis(val.dom_quiet_cap),
|
|
8305
8376
|
..Default::default()
|
|
8306
8377
|
}
|
|
8307
8378
|
}
|
|
@@ -8330,6 +8401,7 @@ impl From<crawlberg::BrowserConfig> for BrowserConfig {
|
|
|
8330
8401
|
chrome_args: val.chrome_args.into_iter().collect(),
|
|
8331
8402
|
scroll_containers: val.scroll_containers,
|
|
8332
8403
|
dom_quiet_window: val.dom_quiet_window.as_millis() as u64,
|
|
8404
|
+
dom_quiet_cap: val.dom_quiet_cap.as_millis() as u64,
|
|
8333
8405
|
}
|
|
8334
8406
|
}
|
|
8335
8407
|
}
|
|
@@ -8426,6 +8498,10 @@ impl From<ContentConfig> for crawlberg::ContentConfig {
|
|
|
8426
8498
|
compact_tables: val.compact_tables,
|
|
8427
8499
|
keep_inline_images_in: val.keep_inline_images_in.into_iter().collect(),
|
|
8428
8500
|
keep_hidden: val.keep_hidden,
|
|
8501
|
+
expand_abbreviations: val.expand_abbreviations,
|
|
8502
|
+
escape_misc: val.escape_misc,
|
|
8503
|
+
escape_asterisks: val.escape_asterisks,
|
|
8504
|
+
include_icon_labels: val.include_icon_labels,
|
|
8429
8505
|
..Default::default()
|
|
8430
8506
|
}
|
|
8431
8507
|
}
|
|
@@ -8454,6 +8530,10 @@ impl From<crawlberg::ContentConfig> for ContentConfig {
|
|
|
8454
8530
|
compact_tables: val.compact_tables,
|
|
8455
8531
|
keep_inline_images_in: val.keep_inline_images_in.into_iter().collect(),
|
|
8456
8532
|
keep_hidden: val.keep_hidden,
|
|
8533
|
+
expand_abbreviations: val.expand_abbreviations,
|
|
8534
|
+
escape_misc: val.escape_misc,
|
|
8535
|
+
escape_asterisks: val.escape_asterisks,
|
|
8536
|
+
include_icon_labels: val.include_icon_labels,
|
|
8457
8537
|
}
|
|
8458
8538
|
}
|
|
8459
8539
|
}
|
|
@@ -8548,6 +8628,7 @@ impl From<CrawlConfig> for crawlberg::CrawlConfig {
|
|
|
8548
8628
|
ssrf: val.ssrf.into(),
|
|
8549
8629
|
ssrf_deny_private_explicit: val.ssrf_deny_private_explicit,
|
|
8550
8630
|
danger_accept_invalid_certs: val.danger_accept_invalid_certs,
|
|
8631
|
+
subdomain_header_allowlist: val.subdomain_header_allowlist.into_iter().collect(),
|
|
8551
8632
|
..Default::default()
|
|
8552
8633
|
}
|
|
8553
8634
|
}
|
|
@@ -8617,6 +8698,7 @@ impl From<crawlberg::CrawlConfig> for CrawlConfig {
|
|
|
8617
8698
|
ssrf: val.ssrf.into(),
|
|
8618
8699
|
ssrf_deny_private_explicit: val.ssrf_deny_private_explicit,
|
|
8619
8700
|
danger_accept_invalid_certs: val.danger_accept_invalid_certs,
|
|
8701
|
+
subdomain_header_allowlist: val.subdomain_header_allowlist.into_iter().collect(),
|
|
8620
8702
|
}
|
|
8621
8703
|
}
|
|
8622
8704
|
}
|
|
@@ -9765,18 +9847,92 @@ impl From<crawlberg::ScrollDirection> for ScrollDirection {
|
|
|
9765
9847
|
}
|
|
9766
9848
|
}
|
|
9767
9849
|
|
|
9768
|
-
/// Convert a
|
|
9850
|
+
/// Convert the error a core call returned into the typed Ruby exception of its family. An error
|
|
9851
|
+
/// of a type with no converter becomes a `RuntimeError` with the message.
|
|
9852
|
+
#[allow(dead_code)]
|
|
9853
|
+
fn alef_magnus_err<E: std::fmt::Display + 'static>(e: E) -> magnus::Error {
|
|
9854
|
+
let message = e.to_string();
|
|
9855
|
+
#[allow(unused_variables)]
|
|
9856
|
+
let any: Box<dyn std::any::Any> = Box::new(e);
|
|
9857
|
+
let any = match any.downcast::<crawlberg::CrawlError>() {
|
|
9858
|
+
Ok(typed) => return crawl_error_to_magnus_err(*typed),
|
|
9859
|
+
Err(any) => any,
|
|
9860
|
+
};
|
|
9861
|
+
let any = match any.downcast::<crawlberg::SsrfError>() {
|
|
9862
|
+
Ok(typed) => return ssrf_error_to_magnus_err(*typed),
|
|
9863
|
+
Err(any) => any,
|
|
9864
|
+
};
|
|
9865
|
+
let _ = any;
|
|
9866
|
+
magnus::Error::new(
|
|
9867
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_runtime_error(),
|
|
9868
|
+
message,
|
|
9869
|
+
)
|
|
9870
|
+
}
|
|
9871
|
+
|
|
9872
|
+
/// Convert a `crawlberg::CrawlError` error to a typed Ruby exception.
|
|
9769
9873
|
#[allow(dead_code)]
|
|
9770
9874
|
fn crawl_error_to_magnus_err(e: crawlberg::CrawlError) -> magnus::Error {
|
|
9771
|
-
|
|
9772
|
-
|
|
9875
|
+
use magnus::prelude::*;
|
|
9876
|
+
let message = e.to_string();
|
|
9877
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
9878
|
+
#[allow(unreachable_patterns)]
|
|
9879
|
+
let class_name = match &e {
|
|
9880
|
+
crawlberg::CrawlError::NotFound { .. } => "NotFoundError",
|
|
9881
|
+
crawlberg::CrawlError::Unauthorized { .. } => "UnauthorizedError",
|
|
9882
|
+
crawlberg::CrawlError::Forbidden { .. } => "ForbiddenError",
|
|
9883
|
+
crawlberg::CrawlError::WafBlocked { .. } => "WafBlockedError",
|
|
9884
|
+
crawlberg::CrawlError::Timeout { .. } => "CrawlTimeoutError",
|
|
9885
|
+
crawlberg::CrawlError::RateLimited { .. } => "RateLimitedError",
|
|
9886
|
+
crawlberg::CrawlError::ServerError { .. } => "ServerError",
|
|
9887
|
+
crawlberg::CrawlError::BadGateway { .. } => "BadGatewayError",
|
|
9888
|
+
crawlberg::CrawlError::Gone { .. } => "GoneError",
|
|
9889
|
+
crawlberg::CrawlError::Connection { .. } => "CrawlConnectionError",
|
|
9890
|
+
crawlberg::CrawlError::Dns { .. } => "DnsError",
|
|
9891
|
+
crawlberg::CrawlError::Ssl { .. } => "SslError",
|
|
9892
|
+
crawlberg::CrawlError::DataLoss { .. } => "DataLossError",
|
|
9893
|
+
crawlberg::CrawlError::ConversionFailed { .. } => "ConversionFailedError",
|
|
9894
|
+
crawlberg::CrawlError::BrowserError { .. } => "BrowserError",
|
|
9895
|
+
crawlberg::CrawlError::BrowserTimeout { .. } => "BrowserTimeoutError",
|
|
9896
|
+
crawlberg::CrawlError::InvalidConfig { .. } => "InvalidConfigError",
|
|
9897
|
+
crawlberg::CrawlError::Unsupported { .. } => "UnsupportedError",
|
|
9898
|
+
crawlberg::CrawlError::TooManyRedirects { .. } => "TooManyRedirectsError",
|
|
9899
|
+
crawlberg::CrawlError::SsrfPolicyViolation { .. } => "SsrfPolicyViolationError",
|
|
9900
|
+
crawlberg::CrawlError::Other { .. } => "OtherError",
|
|
9901
|
+
_ => "CrawlError",
|
|
9902
|
+
};
|
|
9903
|
+
let build = || -> Result<magnus::Error, magnus::Error> {
|
|
9904
|
+
let module = ruby.define_module("Crawlberg")?;
|
|
9905
|
+
let class: magnus::ExceptionClass = module.const_get(class_name)?;
|
|
9906
|
+
let exception = class.new_instance((message.as_str(),))?;
|
|
9907
|
+
Ok(magnus::Error::from(exception))
|
|
9908
|
+
};
|
|
9909
|
+
build().unwrap_or_else(|_| magnus::Error::new(ruby.exception_runtime_error(), message))
|
|
9773
9910
|
}
|
|
9774
9911
|
|
|
9775
|
-
/// Convert a `crawlberg::SsrfError` error to a
|
|
9912
|
+
/// Convert a `crawlberg::SsrfError` error to a typed Ruby exception.
|
|
9776
9913
|
#[allow(dead_code)]
|
|
9777
9914
|
fn ssrf_error_to_magnus_err(e: crawlberg::SsrfError) -> magnus::Error {
|
|
9778
|
-
|
|
9779
|
-
|
|
9915
|
+
use magnus::prelude::*;
|
|
9916
|
+
let message = e.to_string();
|
|
9917
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
9918
|
+
#[allow(unreachable_patterns)]
|
|
9919
|
+
let class_name = match &e {
|
|
9920
|
+
crawlberg::SsrfError::DeniedByPolicy { .. } => "DeniedByPolicyError",
|
|
9921
|
+
crawlberg::SsrfError::NotOnAllowlist => "NotOnAllowlistError",
|
|
9922
|
+
crawlberg::SsrfError::InvalidCidr(..) => "InvalidCidrError",
|
|
9923
|
+
crawlberg::SsrfError::DnsResolutionFailed(..) => "DnsResolutionFailedError",
|
|
9924
|
+
crawlberg::SsrfError::InvalidUrl(..) => "InvalidUrlError",
|
|
9925
|
+
crawlberg::SsrfError::DisallowedScheme(..) => "DisallowedSchemeError",
|
|
9926
|
+
crawlberg::SsrfError::TooManyRedirects => "TooManyRedirectsError",
|
|
9927
|
+
_ => "SsrfError",
|
|
9928
|
+
};
|
|
9929
|
+
let build = || -> Result<magnus::Error, magnus::Error> {
|
|
9930
|
+
let module = ruby.define_module("Crawlberg")?;
|
|
9931
|
+
let class: magnus::ExceptionClass = module.const_get(class_name)?;
|
|
9932
|
+
let exception = class.new_instance((message.as_str(),))?;
|
|
9933
|
+
Ok(magnus::Error::from(exception))
|
|
9934
|
+
};
|
|
9935
|
+
build().unwrap_or_else(|_| magnus::Error::new(ruby.exception_runtime_error(), message))
|
|
9780
9936
|
}
|
|
9781
9937
|
|
|
9782
9938
|
#[derive(Clone)]
|
|
@@ -9824,7 +9980,7 @@ impl CrawlStreamIterator {
|
|
|
9824
9980
|
let binding: CrawlEvent = chunk.into();
|
|
9825
9981
|
Ok(binding.into_value_with(&ruby))
|
|
9826
9982
|
}
|
|
9827
|
-
Some(Err(e)) => Err(
|
|
9983
|
+
Some(Err(e)) => Err(alef_magnus_err(e)),
|
|
9828
9984
|
None => {
|
|
9829
9985
|
// Drop the stream to release any resources.
|
|
9830
9986
|
let inner = self.inner.clone();
|
|
@@ -9906,7 +10062,7 @@ impl BatchCrawlStreamIterator {
|
|
|
9906
10062
|
let binding: CrawlEvent = chunk.into();
|
|
9907
10063
|
Ok(binding.into_value_with(&ruby))
|
|
9908
10064
|
}
|
|
9909
|
-
Some(Err(e)) => Err(
|
|
10065
|
+
Some(Err(e)) => Err(alef_magnus_err(e)),
|
|
9910
10066
|
None => {
|
|
9911
10067
|
// Drop the stream to release any resources.
|
|
9912
10068
|
let inner = self.inner.clone();
|
|
@@ -10075,6 +10231,8 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
10075
10231
|
|
|
10076
10232
|
class.define_method("dom_quiet_window", method!(BrowserConfig::dom_quiet_window, 0))?;
|
|
10077
10233
|
|
|
10234
|
+
class.define_method("dom_quiet_cap", method!(BrowserConfig::dom_quiet_cap, 0))?;
|
|
10235
|
+
|
|
10078
10236
|
let class = module.define_class("BrowserExtras", ruby.class_object())?;
|
|
10079
10237
|
|
|
10080
10238
|
class.define_singleton_method("new", function!(BrowserExtras::new, -1))?;
|
|
@@ -10155,6 +10313,14 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
10155
10313
|
|
|
10156
10314
|
class.define_method("keep_hidden", method!(ContentConfig::keep_hidden, 0))?;
|
|
10157
10315
|
|
|
10316
|
+
class.define_method("expand_abbreviations", method!(ContentConfig::expand_abbreviations, 0))?;
|
|
10317
|
+
|
|
10318
|
+
class.define_method("escape_misc", method!(ContentConfig::escape_misc, 0))?;
|
|
10319
|
+
|
|
10320
|
+
class.define_method("escape_asterisks", method!(ContentConfig::escape_asterisks, 0))?;
|
|
10321
|
+
|
|
10322
|
+
class.define_method("include_icon_labels", method!(ContentConfig::include_icon_labels, 0))?;
|
|
10323
|
+
|
|
10158
10324
|
let class = module.define_class("CookieInfo", ruby.class_object())?;
|
|
10159
10325
|
|
|
10160
10326
|
class.define_singleton_method("new", function!(CookieInfo::new, -1))?;
|
|
@@ -10304,6 +10470,11 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
10304
10470
|
method!(CrawlConfig::danger_accept_invalid_certs, 0),
|
|
10305
10471
|
)?;
|
|
10306
10472
|
|
|
10473
|
+
class.define_method(
|
|
10474
|
+
"subdomain_header_allowlist",
|
|
10475
|
+
method!(CrawlConfig::subdomain_header_allowlist, 0),
|
|
10476
|
+
)?;
|
|
10477
|
+
|
|
10307
10478
|
class.define_method("validate", method!(CrawlConfig::validate, 0))?;
|
|
10308
10479
|
|
|
10309
10480
|
let class = module.define_class("CrawlEngineHandle", ruby.class_object())?;
|
|
@@ -10819,5 +10990,35 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
10819
10990
|
|
|
10820
10991
|
module.define_module_function("batch_crawl_stream", function!(batch_crawl_stream, 2))?;
|
|
10821
10992
|
|
|
10993
|
+
let crawl_error_class = module.define_error("CrawlError", ruby.exception_standard_error())?;
|
|
10994
|
+
let not_found_error_class = module.define_error("NotFoundError", crawl_error_class)?;
|
|
10995
|
+
let unauthorized_error_class = module.define_error("UnauthorizedError", crawl_error_class)?;
|
|
10996
|
+
let forbidden_error_class = module.define_error("ForbiddenError", crawl_error_class)?;
|
|
10997
|
+
let waf_blocked_error_class = module.define_error("WafBlockedError", crawl_error_class)?;
|
|
10998
|
+
let crawl_timeout_error_class = module.define_error("CrawlTimeoutError", crawl_error_class)?;
|
|
10999
|
+
let rate_limited_error_class = module.define_error("RateLimitedError", crawl_error_class)?;
|
|
11000
|
+
let server_error_class = module.define_error("ServerError", crawl_error_class)?;
|
|
11001
|
+
let bad_gateway_error_class = module.define_error("BadGatewayError", crawl_error_class)?;
|
|
11002
|
+
let gone_error_class = module.define_error("GoneError", crawl_error_class)?;
|
|
11003
|
+
let crawl_connection_error_class = module.define_error("CrawlConnectionError", crawl_error_class)?;
|
|
11004
|
+
let dns_error_class = module.define_error("DnsError", crawl_error_class)?;
|
|
11005
|
+
let ssl_error_class = module.define_error("SslError", crawl_error_class)?;
|
|
11006
|
+
let data_loss_error_class = module.define_error("DataLossError", crawl_error_class)?;
|
|
11007
|
+
let conversion_failed_error_class = module.define_error("ConversionFailedError", crawl_error_class)?;
|
|
11008
|
+
let browser_error_class = module.define_error("BrowserError", crawl_error_class)?;
|
|
11009
|
+
let browser_timeout_error_class = module.define_error("BrowserTimeoutError", crawl_error_class)?;
|
|
11010
|
+
let invalid_config_error_class = module.define_error("InvalidConfigError", crawl_error_class)?;
|
|
11011
|
+
let unsupported_error_class = module.define_error("UnsupportedError", crawl_error_class)?;
|
|
11012
|
+
let ssrf_policy_violation_error_class = module.define_error("SsrfPolicyViolationError", crawl_error_class)?;
|
|
11013
|
+
let other_error_class = module.define_error("OtherError", crawl_error_class)?;
|
|
11014
|
+
let ssrf_error_class = module.define_error("SsrfError", crawl_error_class)?;
|
|
11015
|
+
let denied_by_policy_error_class = module.define_error("DeniedByPolicyError", ssrf_error_class)?;
|
|
11016
|
+
let not_on_allowlist_error_class = module.define_error("NotOnAllowlistError", ssrf_error_class)?;
|
|
11017
|
+
let invalid_cidr_error_class = module.define_error("InvalidCidrError", ssrf_error_class)?;
|
|
11018
|
+
let dns_resolution_failed_error_class = module.define_error("DnsResolutionFailedError", ssrf_error_class)?;
|
|
11019
|
+
let invalid_url_error_class = module.define_error("InvalidUrlError", ssrf_error_class)?;
|
|
11020
|
+
let disallowed_scheme_error_class = module.define_error("DisallowedSchemeError", ssrf_error_class)?;
|
|
11021
|
+
let too_many_redirects_error_class = module.define_error("TooManyRedirectsError", ssrf_error_class)?;
|
|
11022
|
+
|
|
10822
11023
|
Ok(())
|
|
10823
11024
|
}
|
data/lib/crawlberg/version.rb
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:b402d1b3bc989de04db5241785f4bc16c0b5e0f76714438d3687648c64d8c10f
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify
|
|
5
5
|
# frozen_string_literal: true
|
|
6
6
|
|
|
7
7
|
module Crawlberg
|
|
8
8
|
## The version string for this package.
|
|
9
|
-
VERSION = "1.12.
|
|
9
|
+
VERSION = "1.12.2"
|
|
10
10
|
end
|
data/sig/types.rbs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
# alef:hash:
|
|
2
|
+
# alef:hash:9aca68325287aae22a855afd34597e3d8bd90c6b7774f3b305591fde4fb051cd
|
|
3
3
|
# To regenerate: alef generate
|
|
4
4
|
# To verify freshness: alef verify
|
|
5
5
|
|
|
@@ -89,8 +89,9 @@ def initialize: (?results: Array[BatchScrapeResult], ?total_count: Integer, ?com
|
|
|
89
89
|
attr_reader chrome_args: Array[String]
|
|
90
90
|
attr_reader scroll_containers: bool
|
|
91
91
|
attr_reader dom_quiet_window: Integer
|
|
92
|
+
attr_reader dom_quiet_cap: Integer
|
|
92
93
|
|
|
93
|
-
def initialize: (?mode: enum_BrowserMode, ?backend: enum_BrowserBackend, ?endpoint: String, ?timeout: Integer, ?overall_timeout: Integer, ?shutdown_timeout: Integer, ?wait: enum_BrowserWait, ?wait_selector: String, ?extra_wait: Integer, ?proxy: ProxyConfig, ?block_url_patterns: Array[String], ?eval_script: String, ?robots_user_agent: String, ?capture_network_events: bool, ?session_affinity: bool, ?chrome_path: String, ?chrome_args: Array[String], ?scroll_containers: bool, ?dom_quiet_window: Integer) -> void
|
|
94
|
+
def initialize: (?mode: enum_BrowserMode, ?backend: enum_BrowserBackend, ?endpoint: String, ?timeout: Integer, ?overall_timeout: Integer, ?shutdown_timeout: Integer, ?wait: enum_BrowserWait, ?wait_selector: String, ?extra_wait: Integer, ?proxy: ProxyConfig, ?block_url_patterns: Array[String], ?eval_script: String, ?robots_user_agent: String, ?capture_network_events: bool, ?session_affinity: bool, ?chrome_path: String, ?chrome_args: Array[String], ?scroll_containers: bool, ?dom_quiet_window: Integer, ?dom_quiet_cap: Integer) -> void
|
|
94
95
|
end
|
|
95
96
|
|
|
96
97
|
class BrowserExtras
|
|
@@ -137,8 +138,12 @@ def initialize: (?content: String, ?references: Array[CitationReference]) -> voi
|
|
|
137
138
|
attr_reader compact_tables: bool
|
|
138
139
|
attr_reader keep_inline_images_in: Array[String]
|
|
139
140
|
attr_reader keep_hidden: bool
|
|
141
|
+
attr_reader expand_abbreviations: bool
|
|
142
|
+
attr_reader escape_misc: bool
|
|
143
|
+
attr_reader escape_asterisks: bool
|
|
144
|
+
attr_reader include_icon_labels: bool
|
|
140
145
|
|
|
141
|
-
def initialize: (?output_format: String, ?preprocessing_preset: String, ?remove_navigation: bool, ?remove_forms: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?exclude_selectors: Array[String], ?skip_images: bool, ?max_depth: Integer, ?wrap: bool, ?wrap_width: Integer, ?include_document_structure: bool, ?extract_metadata: bool, ?strip_newlines: bool, ?bullets: String, ?list_indent_width: Integer, ?strong_em_symbol: String, ?compact_tables: bool, ?keep_inline_images_in: Array[String], ?keep_hidden: bool) -> void
|
|
146
|
+
def initialize: (?output_format: String, ?preprocessing_preset: String, ?remove_navigation: bool, ?remove_forms: bool, ?strip_tags: Array[String], ?preserve_tags: Array[String], ?exclude_selectors: Array[String], ?skip_images: bool, ?max_depth: Integer, ?wrap: bool, ?wrap_width: Integer, ?include_document_structure: bool, ?extract_metadata: bool, ?strip_newlines: bool, ?bullets: String, ?list_indent_width: Integer, ?strong_em_symbol: String, ?compact_tables: bool, ?keep_inline_images_in: Array[String], ?keep_hidden: bool, ?expand_abbreviations: bool, ?escape_misc: bool, ?escape_asterisks: bool, ?include_icon_labels: bool) -> void
|
|
142
147
|
end
|
|
143
148
|
|
|
144
149
|
class CookieInfo
|
|
@@ -207,8 +212,9 @@ def initialize: (?output_format: String, ?preprocessing_preset: String, ?remove_
|
|
|
207
212
|
attr_reader ssrf: SsrfPolicy
|
|
208
213
|
attr_reader ssrf_deny_private_explicit: bool?
|
|
209
214
|
attr_reader danger_accept_invalid_certs: bool
|
|
215
|
+
attr_reader subdomain_header_allowlist: Array[String]
|
|
210
216
|
|
|
211
|
-
def initialize: (?max_depth: Integer, ?max_pages: Integer, ?max_links_per_page: Integer, ?max_concurrent: Integer, ?crawl_strategy: enum_CrawlStrategyKind, ?content_filter: enum_ContentFilterKind, ?bm25_query: String, ?bm25_threshold: Float, ?respect_robots_txt: bool, ?soft_http_errors: bool, ?user_agent: String, ?stay_on_domain: bool, ?allow_subdomains: bool, ?include_paths: Array[String], ?exclude_paths: Array[String], ?path_patterns_match_query: bool, ?path_patterns_match_url: bool, ?dedup_include_query: bool, ?strip_tracking_params: bool, ?tracking_params: Array[String], ?custom_headers: Hash[String, String], ?request_timeout: Integer, ?rate_limit_ms: Integer, ?max_redirects: Integer, ?retry_count: Integer, ?retry_codes: Array[Integer], ?retry_initial_delay_ms: Integer, ?retry_max_delay_ms: Integer, ?rate_limit_jitter_ratio: Float, ?cookies_enabled: bool, ?auth: AuthConfig, ?max_body_size: Integer, ?remove_tags: Array[String], ?content: ContentConfig, ?map_limit: Integer, ?map_search: String, ?download_assets: bool, ?asset_types: Array[enum_AssetCategory], ?max_asset_size: Integer, ?browser: BrowserConfig, ?proxy: ProxyConfig, ?user_agents: Array[String], ?capture_screenshot: bool, ?follow_document_urls: bool, ?document_url_depth: Integer, ?download_documents: bool, ?document_max_size: Integer, ?document_mime_types: Array[String], ?document_output_dir: String, ?document_content_encoding: enum_DocumentContentEncoding, ?warc_output: String, ?browser_profile: String, ?save_browser_profile: bool, ?ssrf: SsrfPolicy, ?ssrf_deny_private_explicit: bool, ?danger_accept_invalid_certs: bool) -> void
|
|
217
|
+
def initialize: (?max_depth: Integer, ?max_pages: Integer, ?max_links_per_page: Integer, ?max_concurrent: Integer, ?crawl_strategy: enum_CrawlStrategyKind, ?content_filter: enum_ContentFilterKind, ?bm25_query: String, ?bm25_threshold: Float, ?respect_robots_txt: bool, ?soft_http_errors: bool, ?user_agent: String, ?stay_on_domain: bool, ?allow_subdomains: bool, ?include_paths: Array[String], ?exclude_paths: Array[String], ?path_patterns_match_query: bool, ?path_patterns_match_url: bool, ?dedup_include_query: bool, ?strip_tracking_params: bool, ?tracking_params: Array[String], ?custom_headers: Hash[String, String], ?request_timeout: Integer, ?rate_limit_ms: Integer, ?max_redirects: Integer, ?retry_count: Integer, ?retry_codes: Array[Integer], ?retry_initial_delay_ms: Integer, ?retry_max_delay_ms: Integer, ?rate_limit_jitter_ratio: Float, ?cookies_enabled: bool, ?auth: AuthConfig, ?max_body_size: Integer, ?remove_tags: Array[String], ?content: ContentConfig, ?map_limit: Integer, ?map_search: String, ?download_assets: bool, ?asset_types: Array[enum_AssetCategory], ?max_asset_size: Integer, ?browser: BrowserConfig, ?proxy: ProxyConfig, ?user_agents: Array[String], ?capture_screenshot: bool, ?follow_document_urls: bool, ?document_url_depth: Integer, ?download_documents: bool, ?document_max_size: Integer, ?document_mime_types: Array[String], ?document_output_dir: String, ?document_content_encoding: enum_DocumentContentEncoding, ?warc_output: String, ?browser_profile: String, ?save_browser_profile: bool, ?ssrf: SsrfPolicy, ?ssrf_deny_private_explicit: bool, ?danger_accept_invalid_certs: bool, ?subdomain_header_allowlist: Array[String]) -> void
|
|
212
218
|
def validate: () -> void
|
|
213
219
|
end
|
|
214
220
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: crawlberg
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.12.
|
|
4
|
+
version: 1.12.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Na'aman Hirschfeld
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2026-10-
|
|
12
|
+
date: 2026-10-27 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: rb_sys
|
|
@@ -18,9 +18,6 @@ dependencies:
|
|
|
18
18
|
- - ">="
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
20
|
version: 0.9.130
|
|
21
|
-
- - "<"
|
|
22
|
-
- !ruby/object:Gem::Version
|
|
23
|
-
version: '0.10'
|
|
24
21
|
type: :runtime
|
|
25
22
|
prerelease: false
|
|
26
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -28,9 +25,6 @@ dependencies:
|
|
|
28
25
|
- - ">="
|
|
29
26
|
- !ruby/object:Gem::Version
|
|
30
27
|
version: 0.9.130
|
|
31
|
-
- - "<"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '0.10'
|
|
34
28
|
- !ruby/object:Gem::Dependency
|
|
35
29
|
name: sorbet-runtime
|
|
36
30
|
requirement: !ruby/object:Gem::Requirement
|