├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── assets └── folder.png └── src ├── main.rs ├── simple.rs └── verbose.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /downloads -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "addr2line" 7 | version = "0.24.1" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" 10 | dependencies = [ 11 | "gimli", 12 | ] 13 | 14 | [[package]] 15 | name = "adler2" 16 | version = "2.0.0" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" 19 | 20 | [[package]] 21 | name = "anstream" 22 | version = "0.6.15" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" 25 | dependencies = [ 26 | "anstyle", 27 | "anstyle-parse", 28 | "anstyle-query", 29 | "anstyle-wincon", 30 | "colorchoice", 31 | "is_terminal_polyfill", 32 | "utf8parse", 33 | ] 34 | 35 | [[package]] 36 | name = "anstyle" 37 | version = "1.0.8" 38 | source = "registry+https://github.com/rust-lang/crates.io-index" 39 | checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" 40 | 41 | [[package]] 42 | name = "anstyle-parse" 43 | version = "0.2.5" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" 46 | dependencies = [ 47 | "utf8parse", 48 | ] 49 | 50 | [[package]] 51 | name = "anstyle-query" 52 | version = "1.1.1" 53 | source = "registry+https://github.com/rust-lang/crates.io-index" 54 | checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" 55 | dependencies = [ 56 | "windows-sys 0.52.0", 57 | ] 58 | 59 | [[package]] 60 | name = "anstyle-wincon" 61 | version = "3.0.4" 62 | source = "registry+https://github.com/rust-lang/crates.io-index" 63 | checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" 64 | dependencies = [ 65 | "anstyle", 66 | "windows-sys 0.52.0", 67 | ] 68 | 69 | [[package]] 70 | name = "atomic-waker" 71 | version = "1.1.2" 72 | source = "registry+https://github.com/rust-lang/crates.io-index" 73 | checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" 74 | 75 | [[package]] 76 | name = "autocfg" 77 | version = "1.3.0" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 80 | 81 | [[package]] 82 | name = "backtrace" 83 | version = "0.3.74" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" 86 | dependencies = [ 87 | "addr2line", 88 | "cfg-if", 89 | "libc", 90 | "miniz_oxide", 91 | "object", 92 | "rustc-demangle", 93 | "windows-targets", 94 | ] 95 | 96 | [[package]] 97 | name = "base64" 98 | version = "0.22.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 101 | 102 | [[package]] 103 | name = "bitflags" 104 | version = "2.6.0" 105 | source = "registry+https://github.com/rust-lang/crates.io-index" 106 | checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" 107 | 108 | [[package]] 109 | name = "bumpalo" 110 | version = "3.16.0" 111 | source = "registry+https://github.com/rust-lang/crates.io-index" 112 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 113 | 114 | [[package]] 115 | name = "byteorder" 116 | version = "1.5.0" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 119 | 120 | [[package]] 121 | name = "bytes" 122 | version = "1.7.2" 123 | source = "registry+https://github.com/rust-lang/crates.io-index" 124 | checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" 125 | 126 | [[package]] 127 | name = "cc" 128 | version = "1.1.21" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" 131 | dependencies = [ 132 | "shlex", 133 | ] 134 | 135 | [[package]] 136 | name = "cfg-if" 137 | version = "1.0.0" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 140 | 141 | [[package]] 142 | name = "clap" 143 | version = "4.5.18" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" 146 | dependencies = [ 147 | "clap_builder", 148 | "clap_derive", 149 | ] 150 | 151 | [[package]] 152 | name = "clap_builder" 153 | version = "4.5.18" 154 | source = "registry+https://github.com/rust-lang/crates.io-index" 155 | checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" 156 | dependencies = [ 157 | "anstream", 158 | "anstyle", 159 | "clap_lex", 160 | "strsim", 161 | ] 162 | 163 | [[package]] 164 | name = "clap_derive" 165 | version = "4.5.18" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" 168 | dependencies = [ 169 | "heck", 170 | "proc-macro2", 171 | "quote", 172 | "syn", 173 | ] 174 | 175 | [[package]] 176 | name = "clap_lex" 177 | version = "0.7.2" 178 | source = "registry+https://github.com/rust-lang/crates.io-index" 179 | checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" 180 | 181 | [[package]] 182 | name = "colorchoice" 183 | version = "1.0.2" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" 186 | 187 | [[package]] 188 | name = "core-foundation" 189 | version = "0.9.4" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" 192 | dependencies = [ 193 | "core-foundation-sys", 194 | "libc", 195 | ] 196 | 197 | [[package]] 198 | name = "core-foundation-sys" 199 | version = "0.8.7" 200 | source = "registry+https://github.com/rust-lang/crates.io-index" 201 | checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" 202 | 203 | [[package]] 204 | name = "crossbeam-deque" 205 | version = "0.8.5" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 208 | dependencies = [ 209 | "crossbeam-epoch", 210 | "crossbeam-utils", 211 | ] 212 | 213 | [[package]] 214 | name = "crossbeam-epoch" 215 | version = "0.9.18" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 218 | dependencies = [ 219 | "crossbeam-utils", 220 | ] 221 | 222 | [[package]] 223 | name = "crossbeam-utils" 224 | version = "0.8.20" 225 | source = "registry+https://github.com/rust-lang/crates.io-index" 226 | checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" 227 | 228 | [[package]] 229 | name = "either" 230 | version = "1.13.0" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" 233 | 234 | [[package]] 235 | name = "encoding_rs" 236 | version = "0.8.34" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" 239 | dependencies = [ 240 | "cfg-if", 241 | ] 242 | 243 | [[package]] 244 | name = "equivalent" 245 | version = "1.0.1" 246 | source = "registry+https://github.com/rust-lang/crates.io-index" 247 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 248 | 249 | [[package]] 250 | name = "errno" 251 | version = "0.3.9" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" 254 | dependencies = [ 255 | "libc", 256 | "windows-sys 0.52.0", 257 | ] 258 | 259 | [[package]] 260 | name = "fastrand" 261 | version = "2.1.1" 262 | source = "registry+https://github.com/rust-lang/crates.io-index" 263 | checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" 264 | 265 | [[package]] 266 | name = "file-format" 267 | version = "0.25.0" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "9ffe3a660c3a1b10e96f304a9413d673b2118d62e4520f7ddf4a4faccfe8b9b9" 270 | 271 | [[package]] 272 | name = "fnv" 273 | version = "1.0.7" 274 | source = "registry+https://github.com/rust-lang/crates.io-index" 275 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 276 | 277 | [[package]] 278 | name = "foreign-types" 279 | version = "0.3.2" 280 | source = "registry+https://github.com/rust-lang/crates.io-index" 281 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 282 | dependencies = [ 283 | "foreign-types-shared", 284 | ] 285 | 286 | [[package]] 287 | name = "foreign-types-shared" 288 | version = "0.1.1" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 291 | 292 | [[package]] 293 | name = "form_urlencoded" 294 | version = "1.2.1" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 297 | dependencies = [ 298 | "percent-encoding", 299 | ] 300 | 301 | [[package]] 302 | name = "futures" 303 | version = "0.3.30" 304 | source = "registry+https://github.com/rust-lang/crates.io-index" 305 | checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" 306 | dependencies = [ 307 | "futures-channel", 308 | "futures-core", 309 | "futures-executor", 310 | "futures-io", 311 | "futures-sink", 312 | "futures-task", 313 | "futures-util", 314 | ] 315 | 316 | [[package]] 317 | name = "futures-channel" 318 | version = "0.3.30" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" 321 | dependencies = [ 322 | "futures-core", 323 | "futures-sink", 324 | ] 325 | 326 | [[package]] 327 | name = "futures-core" 328 | version = "0.3.30" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" 331 | 332 | [[package]] 333 | name = "futures-executor" 334 | version = "0.3.30" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" 337 | dependencies = [ 338 | "futures-core", 339 | "futures-task", 340 | "futures-util", 341 | ] 342 | 343 | [[package]] 344 | name = "futures-io" 345 | version = "0.3.30" 346 | source = "registry+https://github.com/rust-lang/crates.io-index" 347 | checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" 348 | 349 | [[package]] 350 | name = "futures-macro" 351 | version = "0.3.30" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" 354 | dependencies = [ 355 | "proc-macro2", 356 | "quote", 357 | "syn", 358 | ] 359 | 360 | [[package]] 361 | name = "futures-sink" 362 | version = "0.3.30" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" 365 | 366 | [[package]] 367 | name = "futures-task" 368 | version = "0.3.30" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" 371 | 372 | [[package]] 373 | name = "futures-util" 374 | version = "0.3.30" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" 377 | dependencies = [ 378 | "futures-channel", 379 | "futures-core", 380 | "futures-io", 381 | "futures-macro", 382 | "futures-sink", 383 | "futures-task", 384 | "memchr", 385 | "pin-project-lite", 386 | "pin-utils", 387 | "slab", 388 | ] 389 | 390 | [[package]] 391 | name = "getrandom" 392 | version = "0.2.15" 393 | source = "registry+https://github.com/rust-lang/crates.io-index" 394 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 395 | dependencies = [ 396 | "cfg-if", 397 | "libc", 398 | "wasi", 399 | ] 400 | 401 | [[package]] 402 | name = "gimli" 403 | version = "0.31.0" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" 406 | 407 | [[package]] 408 | name = "h2" 409 | version = "0.4.6" 410 | source = "registry+https://github.com/rust-lang/crates.io-index" 411 | checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" 412 | dependencies = [ 413 | "atomic-waker", 414 | "bytes", 415 | "fnv", 416 | "futures-core", 417 | "futures-sink", 418 | "http", 419 | "indexmap", 420 | "slab", 421 | "tokio", 422 | "tokio-util", 423 | "tracing", 424 | ] 425 | 426 | [[package]] 427 | name = "hashbrown" 428 | version = "0.14.5" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 431 | 432 | [[package]] 433 | name = "heck" 434 | version = "0.5.0" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 437 | 438 | [[package]] 439 | name = "hermit-abi" 440 | version = "0.3.9" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" 443 | 444 | [[package]] 445 | name = "http" 446 | version = "1.1.0" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 449 | dependencies = [ 450 | "bytes", 451 | "fnv", 452 | "itoa", 453 | ] 454 | 455 | [[package]] 456 | name = "http-body" 457 | version = "1.0.1" 458 | source = "registry+https://github.com/rust-lang/crates.io-index" 459 | checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" 460 | dependencies = [ 461 | "bytes", 462 | "http", 463 | ] 464 | 465 | [[package]] 466 | name = "http-body-util" 467 | version = "0.1.2" 468 | source = "registry+https://github.com/rust-lang/crates.io-index" 469 | checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" 470 | dependencies = [ 471 | "bytes", 472 | "futures-util", 473 | "http", 474 | "http-body", 475 | "pin-project-lite", 476 | ] 477 | 478 | [[package]] 479 | name = "httparse" 480 | version = "1.9.4" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" 483 | 484 | [[package]] 485 | name = "hyper" 486 | version = "1.4.1" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" 489 | dependencies = [ 490 | "bytes", 491 | "futures-channel", 492 | "futures-util", 493 | "h2", 494 | "http", 495 | "http-body", 496 | "httparse", 497 | "itoa", 498 | "pin-project-lite", 499 | "smallvec", 500 | "tokio", 501 | "want", 502 | ] 503 | 504 | [[package]] 505 | name = "hyper-rustls" 506 | version = "0.27.3" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" 509 | dependencies = [ 510 | "futures-util", 511 | "http", 512 | "hyper", 513 | "hyper-util", 514 | "rustls", 515 | "rustls-pki-types", 516 | "tokio", 517 | "tokio-rustls", 518 | "tower-service", 519 | "webpki-roots", 520 | ] 521 | 522 | [[package]] 523 | name = "hyper-tls" 524 | version = "0.6.0" 525 | source = "registry+https://github.com/rust-lang/crates.io-index" 526 | checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" 527 | dependencies = [ 528 | "bytes", 529 | "http-body-util", 530 | "hyper", 531 | "hyper-util", 532 | "native-tls", 533 | "tokio", 534 | "tokio-native-tls", 535 | "tower-service", 536 | ] 537 | 538 | [[package]] 539 | name = "hyper-util" 540 | version = "0.1.9" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" 543 | dependencies = [ 544 | "bytes", 545 | "futures-channel", 546 | "futures-util", 547 | "http", 548 | "http-body", 549 | "hyper", 550 | "pin-project-lite", 551 | "socket2", 552 | "tokio", 553 | "tower-service", 554 | "tracing", 555 | ] 556 | 557 | [[package]] 558 | name = "idna" 559 | version = "0.5.0" 560 | source = "registry+https://github.com/rust-lang/crates.io-index" 561 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 562 | dependencies = [ 563 | "unicode-bidi", 564 | "unicode-normalization", 565 | ] 566 | 567 | [[package]] 568 | name = "indexmap" 569 | version = "2.5.0" 570 | source = "registry+https://github.com/rust-lang/crates.io-index" 571 | checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" 572 | dependencies = [ 573 | "equivalent", 574 | "hashbrown", 575 | ] 576 | 577 | [[package]] 578 | name = "ipnet" 579 | version = "2.10.0" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" 582 | 583 | [[package]] 584 | name = "is_terminal_polyfill" 585 | version = "1.70.1" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" 588 | 589 | [[package]] 590 | name = "itoa" 591 | version = "1.0.11" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 594 | 595 | [[package]] 596 | name = "js-sys" 597 | version = "0.3.70" 598 | source = "registry+https://github.com/rust-lang/crates.io-index" 599 | checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" 600 | dependencies = [ 601 | "wasm-bindgen", 602 | ] 603 | 604 | [[package]] 605 | name = "libc" 606 | version = "0.2.159" 607 | source = "registry+https://github.com/rust-lang/crates.io-index" 608 | checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" 609 | 610 | [[package]] 611 | name = "linux-raw-sys" 612 | version = "0.4.14" 613 | source = "registry+https://github.com/rust-lang/crates.io-index" 614 | checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" 615 | 616 | [[package]] 617 | name = "lock_api" 618 | version = "0.4.12" 619 | source = "registry+https://github.com/rust-lang/crates.io-index" 620 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 621 | dependencies = [ 622 | "autocfg", 623 | "scopeguard", 624 | ] 625 | 626 | [[package]] 627 | name = "log" 628 | version = "0.4.22" 629 | source = "registry+https://github.com/rust-lang/crates.io-index" 630 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 631 | 632 | [[package]] 633 | name = "memchr" 634 | version = "2.7.4" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" 637 | 638 | [[package]] 639 | name = "mime" 640 | version = "0.3.17" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 643 | 644 | [[package]] 645 | name = "miniz_oxide" 646 | version = "0.8.0" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" 649 | dependencies = [ 650 | "adler2", 651 | ] 652 | 653 | [[package]] 654 | name = "mio" 655 | version = "1.0.2" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" 658 | dependencies = [ 659 | "hermit-abi", 660 | "libc", 661 | "wasi", 662 | "windows-sys 0.52.0", 663 | ] 664 | 665 | [[package]] 666 | name = "mkbsd-rs" 667 | version = "0.1.0" 668 | dependencies = [ 669 | "clap", 670 | "file-format", 671 | "futures", 672 | "rayon", 673 | "reqwest", 674 | "serde", 675 | "serde_json", 676 | "tokio", 677 | "url", 678 | ] 679 | 680 | [[package]] 681 | name = "native-tls" 682 | version = "0.2.12" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" 685 | dependencies = [ 686 | "libc", 687 | "log", 688 | "openssl", 689 | "openssl-probe", 690 | "openssl-sys", 691 | "schannel", 692 | "security-framework", 693 | "security-framework-sys", 694 | "tempfile", 695 | ] 696 | 697 | [[package]] 698 | name = "object" 699 | version = "0.36.4" 700 | source = "registry+https://github.com/rust-lang/crates.io-index" 701 | checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" 702 | dependencies = [ 703 | "memchr", 704 | ] 705 | 706 | [[package]] 707 | name = "once_cell" 708 | version = "1.19.0" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 711 | 712 | [[package]] 713 | name = "openssl" 714 | version = "0.10.66" 715 | source = "registry+https://github.com/rust-lang/crates.io-index" 716 | checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" 717 | dependencies = [ 718 | "bitflags", 719 | "cfg-if", 720 | "foreign-types", 721 | "libc", 722 | "once_cell", 723 | "openssl-macros", 724 | "openssl-sys", 725 | ] 726 | 727 | [[package]] 728 | name = "openssl-macros" 729 | version = "0.1.1" 730 | source = "registry+https://github.com/rust-lang/crates.io-index" 731 | checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" 732 | dependencies = [ 733 | "proc-macro2", 734 | "quote", 735 | "syn", 736 | ] 737 | 738 | [[package]] 739 | name = "openssl-probe" 740 | version = "0.1.5" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 743 | 744 | [[package]] 745 | name = "openssl-sys" 746 | version = "0.9.103" 747 | source = "registry+https://github.com/rust-lang/crates.io-index" 748 | checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" 749 | dependencies = [ 750 | "cc", 751 | "libc", 752 | "pkg-config", 753 | "vcpkg", 754 | ] 755 | 756 | [[package]] 757 | name = "parking_lot" 758 | version = "0.12.3" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 761 | dependencies = [ 762 | "lock_api", 763 | "parking_lot_core", 764 | ] 765 | 766 | [[package]] 767 | name = "parking_lot_core" 768 | version = "0.9.10" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 771 | dependencies = [ 772 | "cfg-if", 773 | "libc", 774 | "redox_syscall", 775 | "smallvec", 776 | "windows-targets", 777 | ] 778 | 779 | [[package]] 780 | name = "percent-encoding" 781 | version = "2.3.1" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 784 | 785 | [[package]] 786 | name = "pin-project-lite" 787 | version = "0.2.14" 788 | source = "registry+https://github.com/rust-lang/crates.io-index" 789 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 790 | 791 | [[package]] 792 | name = "pin-utils" 793 | version = "0.1.0" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 796 | 797 | [[package]] 798 | name = "pkg-config" 799 | version = "0.3.31" 800 | source = "registry+https://github.com/rust-lang/crates.io-index" 801 | checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" 802 | 803 | [[package]] 804 | name = "ppv-lite86" 805 | version = "0.2.20" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 808 | dependencies = [ 809 | "zerocopy", 810 | ] 811 | 812 | [[package]] 813 | name = "proc-macro2" 814 | version = "1.0.86" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" 817 | dependencies = [ 818 | "unicode-ident", 819 | ] 820 | 821 | [[package]] 822 | name = "quinn" 823 | version = "0.11.5" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" 826 | dependencies = [ 827 | "bytes", 828 | "pin-project-lite", 829 | "quinn-proto", 830 | "quinn-udp", 831 | "rustc-hash", 832 | "rustls", 833 | "socket2", 834 | "thiserror", 835 | "tokio", 836 | "tracing", 837 | ] 838 | 839 | [[package]] 840 | name = "quinn-proto" 841 | version = "0.11.8" 842 | source = "registry+https://github.com/rust-lang/crates.io-index" 843 | checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" 844 | dependencies = [ 845 | "bytes", 846 | "rand", 847 | "ring", 848 | "rustc-hash", 849 | "rustls", 850 | "slab", 851 | "thiserror", 852 | "tinyvec", 853 | "tracing", 854 | ] 855 | 856 | [[package]] 857 | name = "quinn-udp" 858 | version = "0.5.5" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" 861 | dependencies = [ 862 | "libc", 863 | "once_cell", 864 | "socket2", 865 | "tracing", 866 | "windows-sys 0.59.0", 867 | ] 868 | 869 | [[package]] 870 | name = "quote" 871 | version = "1.0.37" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" 874 | dependencies = [ 875 | "proc-macro2", 876 | ] 877 | 878 | [[package]] 879 | name = "rand" 880 | version = "0.8.5" 881 | source = "registry+https://github.com/rust-lang/crates.io-index" 882 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 883 | dependencies = [ 884 | "libc", 885 | "rand_chacha", 886 | "rand_core", 887 | ] 888 | 889 | [[package]] 890 | name = "rand_chacha" 891 | version = "0.3.1" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 894 | dependencies = [ 895 | "ppv-lite86", 896 | "rand_core", 897 | ] 898 | 899 | [[package]] 900 | name = "rand_core" 901 | version = "0.6.4" 902 | source = "registry+https://github.com/rust-lang/crates.io-index" 903 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 904 | dependencies = [ 905 | "getrandom", 906 | ] 907 | 908 | [[package]] 909 | name = "rayon" 910 | version = "1.10.0" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 913 | dependencies = [ 914 | "either", 915 | "rayon-core", 916 | ] 917 | 918 | [[package]] 919 | name = "rayon-core" 920 | version = "1.12.1" 921 | source = "registry+https://github.com/rust-lang/crates.io-index" 922 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 923 | dependencies = [ 924 | "crossbeam-deque", 925 | "crossbeam-utils", 926 | ] 927 | 928 | [[package]] 929 | name = "redox_syscall" 930 | version = "0.5.6" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" 933 | dependencies = [ 934 | "bitflags", 935 | ] 936 | 937 | [[package]] 938 | name = "reqwest" 939 | version = "0.12.7" 940 | source = "registry+https://github.com/rust-lang/crates.io-index" 941 | checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" 942 | dependencies = [ 943 | "base64", 944 | "bytes", 945 | "encoding_rs", 946 | "futures-core", 947 | "futures-util", 948 | "h2", 949 | "http", 950 | "http-body", 951 | "http-body-util", 952 | "hyper", 953 | "hyper-rustls", 954 | "hyper-tls", 955 | "hyper-util", 956 | "ipnet", 957 | "js-sys", 958 | "log", 959 | "mime", 960 | "native-tls", 961 | "once_cell", 962 | "percent-encoding", 963 | "pin-project-lite", 964 | "quinn", 965 | "rustls", 966 | "rustls-pemfile", 967 | "rustls-pki-types", 968 | "serde", 969 | "serde_json", 970 | "serde_urlencoded", 971 | "sync_wrapper", 972 | "system-configuration", 973 | "tokio", 974 | "tokio-native-tls", 975 | "tokio-rustls", 976 | "tower-service", 977 | "url", 978 | "wasm-bindgen", 979 | "wasm-bindgen-futures", 980 | "web-sys", 981 | "webpki-roots", 982 | "windows-registry", 983 | ] 984 | 985 | [[package]] 986 | name = "ring" 987 | version = "0.17.8" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" 990 | dependencies = [ 991 | "cc", 992 | "cfg-if", 993 | "getrandom", 994 | "libc", 995 | "spin", 996 | "untrusted", 997 | "windows-sys 0.52.0", 998 | ] 999 | 1000 | [[package]] 1001 | name = "rustc-demangle" 1002 | version = "0.1.24" 1003 | source = "registry+https://github.com/rust-lang/crates.io-index" 1004 | checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" 1005 | 1006 | [[package]] 1007 | name = "rustc-hash" 1008 | version = "2.0.0" 1009 | source = "registry+https://github.com/rust-lang/crates.io-index" 1010 | checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" 1011 | 1012 | [[package]] 1013 | name = "rustix" 1014 | version = "0.38.37" 1015 | source = "registry+https://github.com/rust-lang/crates.io-index" 1016 | checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" 1017 | dependencies = [ 1018 | "bitflags", 1019 | "errno", 1020 | "libc", 1021 | "linux-raw-sys", 1022 | "windows-sys 0.52.0", 1023 | ] 1024 | 1025 | [[package]] 1026 | name = "rustls" 1027 | version = "0.23.13" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" 1030 | dependencies = [ 1031 | "once_cell", 1032 | "ring", 1033 | "rustls-pki-types", 1034 | "rustls-webpki", 1035 | "subtle", 1036 | "zeroize", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "rustls-pemfile" 1041 | version = "2.1.3" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" 1044 | dependencies = [ 1045 | "base64", 1046 | "rustls-pki-types", 1047 | ] 1048 | 1049 | [[package]] 1050 | name = "rustls-pki-types" 1051 | version = "1.8.0" 1052 | source = "registry+https://github.com/rust-lang/crates.io-index" 1053 | checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" 1054 | 1055 | [[package]] 1056 | name = "rustls-webpki" 1057 | version = "0.102.8" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" 1060 | dependencies = [ 1061 | "ring", 1062 | "rustls-pki-types", 1063 | "untrusted", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "ryu" 1068 | version = "1.0.18" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 1071 | 1072 | [[package]] 1073 | name = "schannel" 1074 | version = "0.1.24" 1075 | source = "registry+https://github.com/rust-lang/crates.io-index" 1076 | checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" 1077 | dependencies = [ 1078 | "windows-sys 0.59.0", 1079 | ] 1080 | 1081 | [[package]] 1082 | name = "scopeguard" 1083 | version = "1.2.0" 1084 | source = "registry+https://github.com/rust-lang/crates.io-index" 1085 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1086 | 1087 | [[package]] 1088 | name = "security-framework" 1089 | version = "2.11.1" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" 1092 | dependencies = [ 1093 | "bitflags", 1094 | "core-foundation", 1095 | "core-foundation-sys", 1096 | "libc", 1097 | "security-framework-sys", 1098 | ] 1099 | 1100 | [[package]] 1101 | name = "security-framework-sys" 1102 | version = "2.12.0" 1103 | source = "registry+https://github.com/rust-lang/crates.io-index" 1104 | checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" 1105 | dependencies = [ 1106 | "core-foundation-sys", 1107 | "libc", 1108 | ] 1109 | 1110 | [[package]] 1111 | name = "serde" 1112 | version = "1.0.210" 1113 | source = "registry+https://github.com/rust-lang/crates.io-index" 1114 | checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" 1115 | dependencies = [ 1116 | "serde_derive", 1117 | ] 1118 | 1119 | [[package]] 1120 | name = "serde_derive" 1121 | version = "1.0.210" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" 1124 | dependencies = [ 1125 | "proc-macro2", 1126 | "quote", 1127 | "syn", 1128 | ] 1129 | 1130 | [[package]] 1131 | name = "serde_json" 1132 | version = "1.0.128" 1133 | source = "registry+https://github.com/rust-lang/crates.io-index" 1134 | checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" 1135 | dependencies = [ 1136 | "itoa", 1137 | "memchr", 1138 | "ryu", 1139 | "serde", 1140 | ] 1141 | 1142 | [[package]] 1143 | name = "serde_urlencoded" 1144 | version = "0.7.1" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1147 | dependencies = [ 1148 | "form_urlencoded", 1149 | "itoa", 1150 | "ryu", 1151 | "serde", 1152 | ] 1153 | 1154 | [[package]] 1155 | name = "shlex" 1156 | version = "1.3.0" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" 1159 | 1160 | [[package]] 1161 | name = "signal-hook-registry" 1162 | version = "1.4.2" 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" 1164 | checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" 1165 | dependencies = [ 1166 | "libc", 1167 | ] 1168 | 1169 | [[package]] 1170 | name = "slab" 1171 | version = "0.4.9" 1172 | source = "registry+https://github.com/rust-lang/crates.io-index" 1173 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1174 | dependencies = [ 1175 | "autocfg", 1176 | ] 1177 | 1178 | [[package]] 1179 | name = "smallvec" 1180 | version = "1.13.2" 1181 | source = "registry+https://github.com/rust-lang/crates.io-index" 1182 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1183 | 1184 | [[package]] 1185 | name = "socket2" 1186 | version = "0.5.7" 1187 | source = "registry+https://github.com/rust-lang/crates.io-index" 1188 | checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" 1189 | dependencies = [ 1190 | "libc", 1191 | "windows-sys 0.52.0", 1192 | ] 1193 | 1194 | [[package]] 1195 | name = "spin" 1196 | version = "0.9.8" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1199 | 1200 | [[package]] 1201 | name = "strsim" 1202 | version = "0.11.1" 1203 | source = "registry+https://github.com/rust-lang/crates.io-index" 1204 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 1205 | 1206 | [[package]] 1207 | name = "subtle" 1208 | version = "2.6.1" 1209 | source = "registry+https://github.com/rust-lang/crates.io-index" 1210 | checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" 1211 | 1212 | [[package]] 1213 | name = "syn" 1214 | version = "2.0.77" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" 1217 | dependencies = [ 1218 | "proc-macro2", 1219 | "quote", 1220 | "unicode-ident", 1221 | ] 1222 | 1223 | [[package]] 1224 | name = "sync_wrapper" 1225 | version = "1.0.1" 1226 | source = "registry+https://github.com/rust-lang/crates.io-index" 1227 | checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" 1228 | dependencies = [ 1229 | "futures-core", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "system-configuration" 1234 | version = "0.6.1" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" 1237 | dependencies = [ 1238 | "bitflags", 1239 | "core-foundation", 1240 | "system-configuration-sys", 1241 | ] 1242 | 1243 | [[package]] 1244 | name = "system-configuration-sys" 1245 | version = "0.6.0" 1246 | source = "registry+https://github.com/rust-lang/crates.io-index" 1247 | checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" 1248 | dependencies = [ 1249 | "core-foundation-sys", 1250 | "libc", 1251 | ] 1252 | 1253 | [[package]] 1254 | name = "tempfile" 1255 | version = "3.12.0" 1256 | source = "registry+https://github.com/rust-lang/crates.io-index" 1257 | checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" 1258 | dependencies = [ 1259 | "cfg-if", 1260 | "fastrand", 1261 | "once_cell", 1262 | "rustix", 1263 | "windows-sys 0.59.0", 1264 | ] 1265 | 1266 | [[package]] 1267 | name = "thiserror" 1268 | version = "1.0.64" 1269 | source = "registry+https://github.com/rust-lang/crates.io-index" 1270 | checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" 1271 | dependencies = [ 1272 | "thiserror-impl", 1273 | ] 1274 | 1275 | [[package]] 1276 | name = "thiserror-impl" 1277 | version = "1.0.64" 1278 | source = "registry+https://github.com/rust-lang/crates.io-index" 1279 | checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" 1280 | dependencies = [ 1281 | "proc-macro2", 1282 | "quote", 1283 | "syn", 1284 | ] 1285 | 1286 | [[package]] 1287 | name = "tinyvec" 1288 | version = "1.8.0" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" 1291 | dependencies = [ 1292 | "tinyvec_macros", 1293 | ] 1294 | 1295 | [[package]] 1296 | name = "tinyvec_macros" 1297 | version = "0.1.1" 1298 | source = "registry+https://github.com/rust-lang/crates.io-index" 1299 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1300 | 1301 | [[package]] 1302 | name = "tokio" 1303 | version = "1.40.0" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" 1306 | dependencies = [ 1307 | "backtrace", 1308 | "bytes", 1309 | "libc", 1310 | "mio", 1311 | "parking_lot", 1312 | "pin-project-lite", 1313 | "signal-hook-registry", 1314 | "socket2", 1315 | "tokio-macros", 1316 | "windows-sys 0.52.0", 1317 | ] 1318 | 1319 | [[package]] 1320 | name = "tokio-macros" 1321 | version = "2.4.0" 1322 | source = "registry+https://github.com/rust-lang/crates.io-index" 1323 | checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" 1324 | dependencies = [ 1325 | "proc-macro2", 1326 | "quote", 1327 | "syn", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "tokio-native-tls" 1332 | version = "0.3.1" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" 1335 | dependencies = [ 1336 | "native-tls", 1337 | "tokio", 1338 | ] 1339 | 1340 | [[package]] 1341 | name = "tokio-rustls" 1342 | version = "0.26.0" 1343 | source = "registry+https://github.com/rust-lang/crates.io-index" 1344 | checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" 1345 | dependencies = [ 1346 | "rustls", 1347 | "rustls-pki-types", 1348 | "tokio", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "tokio-util" 1353 | version = "0.7.12" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" 1356 | dependencies = [ 1357 | "bytes", 1358 | "futures-core", 1359 | "futures-sink", 1360 | "pin-project-lite", 1361 | "tokio", 1362 | ] 1363 | 1364 | [[package]] 1365 | name = "tower-service" 1366 | version = "0.3.3" 1367 | source = "registry+https://github.com/rust-lang/crates.io-index" 1368 | checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" 1369 | 1370 | [[package]] 1371 | name = "tracing" 1372 | version = "0.1.40" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1375 | dependencies = [ 1376 | "pin-project-lite", 1377 | "tracing-core", 1378 | ] 1379 | 1380 | [[package]] 1381 | name = "tracing-core" 1382 | version = "0.1.32" 1383 | source = "registry+https://github.com/rust-lang/crates.io-index" 1384 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1385 | dependencies = [ 1386 | "once_cell", 1387 | ] 1388 | 1389 | [[package]] 1390 | name = "try-lock" 1391 | version = "0.2.5" 1392 | source = "registry+https://github.com/rust-lang/crates.io-index" 1393 | checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" 1394 | 1395 | [[package]] 1396 | name = "unicode-bidi" 1397 | version = "0.3.15" 1398 | source = "registry+https://github.com/rust-lang/crates.io-index" 1399 | checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 1400 | 1401 | [[package]] 1402 | name = "unicode-ident" 1403 | version = "1.0.13" 1404 | source = "registry+https://github.com/rust-lang/crates.io-index" 1405 | checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" 1406 | 1407 | [[package]] 1408 | name = "unicode-normalization" 1409 | version = "0.1.24" 1410 | source = "registry+https://github.com/rust-lang/crates.io-index" 1411 | checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" 1412 | dependencies = [ 1413 | "tinyvec", 1414 | ] 1415 | 1416 | [[package]] 1417 | name = "untrusted" 1418 | version = "0.9.0" 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" 1420 | checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" 1421 | 1422 | [[package]] 1423 | name = "url" 1424 | version = "2.5.2" 1425 | source = "registry+https://github.com/rust-lang/crates.io-index" 1426 | checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" 1427 | dependencies = [ 1428 | "form_urlencoded", 1429 | "idna", 1430 | "percent-encoding", 1431 | "serde", 1432 | ] 1433 | 1434 | [[package]] 1435 | name = "utf8parse" 1436 | version = "0.2.2" 1437 | source = "registry+https://github.com/rust-lang/crates.io-index" 1438 | checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" 1439 | 1440 | [[package]] 1441 | name = "vcpkg" 1442 | version = "0.2.15" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1445 | 1446 | [[package]] 1447 | name = "want" 1448 | version = "0.3.1" 1449 | source = "registry+https://github.com/rust-lang/crates.io-index" 1450 | checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" 1451 | dependencies = [ 1452 | "try-lock", 1453 | ] 1454 | 1455 | [[package]] 1456 | name = "wasi" 1457 | version = "0.11.0+wasi-snapshot-preview1" 1458 | source = "registry+https://github.com/rust-lang/crates.io-index" 1459 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1460 | 1461 | [[package]] 1462 | name = "wasm-bindgen" 1463 | version = "0.2.93" 1464 | source = "registry+https://github.com/rust-lang/crates.io-index" 1465 | checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" 1466 | dependencies = [ 1467 | "cfg-if", 1468 | "once_cell", 1469 | "wasm-bindgen-macro", 1470 | ] 1471 | 1472 | [[package]] 1473 | name = "wasm-bindgen-backend" 1474 | version = "0.2.93" 1475 | source = "registry+https://github.com/rust-lang/crates.io-index" 1476 | checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" 1477 | dependencies = [ 1478 | "bumpalo", 1479 | "log", 1480 | "once_cell", 1481 | "proc-macro2", 1482 | "quote", 1483 | "syn", 1484 | "wasm-bindgen-shared", 1485 | ] 1486 | 1487 | [[package]] 1488 | name = "wasm-bindgen-futures" 1489 | version = "0.4.43" 1490 | source = "registry+https://github.com/rust-lang/crates.io-index" 1491 | checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" 1492 | dependencies = [ 1493 | "cfg-if", 1494 | "js-sys", 1495 | "wasm-bindgen", 1496 | "web-sys", 1497 | ] 1498 | 1499 | [[package]] 1500 | name = "wasm-bindgen-macro" 1501 | version = "0.2.93" 1502 | source = "registry+https://github.com/rust-lang/crates.io-index" 1503 | checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" 1504 | dependencies = [ 1505 | "quote", 1506 | "wasm-bindgen-macro-support", 1507 | ] 1508 | 1509 | [[package]] 1510 | name = "wasm-bindgen-macro-support" 1511 | version = "0.2.93" 1512 | source = "registry+https://github.com/rust-lang/crates.io-index" 1513 | checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" 1514 | dependencies = [ 1515 | "proc-macro2", 1516 | "quote", 1517 | "syn", 1518 | "wasm-bindgen-backend", 1519 | "wasm-bindgen-shared", 1520 | ] 1521 | 1522 | [[package]] 1523 | name = "wasm-bindgen-shared" 1524 | version = "0.2.93" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" 1527 | 1528 | [[package]] 1529 | name = "web-sys" 1530 | version = "0.3.70" 1531 | source = "registry+https://github.com/rust-lang/crates.io-index" 1532 | checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" 1533 | dependencies = [ 1534 | "js-sys", 1535 | "wasm-bindgen", 1536 | ] 1537 | 1538 | [[package]] 1539 | name = "webpki-roots" 1540 | version = "0.26.6" 1541 | source = "registry+https://github.com/rust-lang/crates.io-index" 1542 | checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" 1543 | dependencies = [ 1544 | "rustls-pki-types", 1545 | ] 1546 | 1547 | [[package]] 1548 | name = "windows-registry" 1549 | version = "0.2.0" 1550 | source = "registry+https://github.com/rust-lang/crates.io-index" 1551 | checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" 1552 | dependencies = [ 1553 | "windows-result", 1554 | "windows-strings", 1555 | "windows-targets", 1556 | ] 1557 | 1558 | [[package]] 1559 | name = "windows-result" 1560 | version = "0.2.0" 1561 | source = "registry+https://github.com/rust-lang/crates.io-index" 1562 | checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" 1563 | dependencies = [ 1564 | "windows-targets", 1565 | ] 1566 | 1567 | [[package]] 1568 | name = "windows-strings" 1569 | version = "0.1.0" 1570 | source = "registry+https://github.com/rust-lang/crates.io-index" 1571 | checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" 1572 | dependencies = [ 1573 | "windows-result", 1574 | "windows-targets", 1575 | ] 1576 | 1577 | [[package]] 1578 | name = "windows-sys" 1579 | version = "0.52.0" 1580 | source = "registry+https://github.com/rust-lang/crates.io-index" 1581 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1582 | dependencies = [ 1583 | "windows-targets", 1584 | ] 1585 | 1586 | [[package]] 1587 | name = "windows-sys" 1588 | version = "0.59.0" 1589 | source = "registry+https://github.com/rust-lang/crates.io-index" 1590 | checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" 1591 | dependencies = [ 1592 | "windows-targets", 1593 | ] 1594 | 1595 | [[package]] 1596 | name = "windows-targets" 1597 | version = "0.52.6" 1598 | source = "registry+https://github.com/rust-lang/crates.io-index" 1599 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1600 | dependencies = [ 1601 | "windows_aarch64_gnullvm", 1602 | "windows_aarch64_msvc", 1603 | "windows_i686_gnu", 1604 | "windows_i686_gnullvm", 1605 | "windows_i686_msvc", 1606 | "windows_x86_64_gnu", 1607 | "windows_x86_64_gnullvm", 1608 | "windows_x86_64_msvc", 1609 | ] 1610 | 1611 | [[package]] 1612 | name = "windows_aarch64_gnullvm" 1613 | version = "0.52.6" 1614 | source = "registry+https://github.com/rust-lang/crates.io-index" 1615 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1616 | 1617 | [[package]] 1618 | name = "windows_aarch64_msvc" 1619 | version = "0.52.6" 1620 | source = "registry+https://github.com/rust-lang/crates.io-index" 1621 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1622 | 1623 | [[package]] 1624 | name = "windows_i686_gnu" 1625 | version = "0.52.6" 1626 | source = "registry+https://github.com/rust-lang/crates.io-index" 1627 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1628 | 1629 | [[package]] 1630 | name = "windows_i686_gnullvm" 1631 | version = "0.52.6" 1632 | source = "registry+https://github.com/rust-lang/crates.io-index" 1633 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1634 | 1635 | [[package]] 1636 | name = "windows_i686_msvc" 1637 | version = "0.52.6" 1638 | source = "registry+https://github.com/rust-lang/crates.io-index" 1639 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1640 | 1641 | [[package]] 1642 | name = "windows_x86_64_gnu" 1643 | version = "0.52.6" 1644 | source = "registry+https://github.com/rust-lang/crates.io-index" 1645 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1646 | 1647 | [[package]] 1648 | name = "windows_x86_64_gnullvm" 1649 | version = "0.52.6" 1650 | source = "registry+https://github.com/rust-lang/crates.io-index" 1651 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1652 | 1653 | [[package]] 1654 | name = "windows_x86_64_msvc" 1655 | version = "0.52.6" 1656 | source = "registry+https://github.com/rust-lang/crates.io-index" 1657 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1658 | 1659 | [[package]] 1660 | name = "zerocopy" 1661 | version = "0.7.35" 1662 | source = "registry+https://github.com/rust-lang/crates.io-index" 1663 | checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" 1664 | dependencies = [ 1665 | "byteorder", 1666 | "zerocopy-derive", 1667 | ] 1668 | 1669 | [[package]] 1670 | name = "zerocopy-derive" 1671 | version = "0.7.35" 1672 | source = "registry+https://github.com/rust-lang/crates.io-index" 1673 | checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" 1674 | dependencies = [ 1675 | "proc-macro2", 1676 | "quote", 1677 | "syn", 1678 | ] 1679 | 1680 | [[package]] 1681 | name = "zeroize" 1682 | version = "1.8.1" 1683 | source = "registry+https://github.com/rust-lang/crates.io-index" 1684 | checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" 1685 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "mkbsd-rs" 3 | version = "0.1.0" 4 | edition = "2021" 5 | license = "Unlicense" 6 | 7 | [dependencies] 8 | clap = { version = "4.5.18", features = ["derive", "env"] } 9 | file-format = "0.25.0" 10 | futures = "0.3.30" 11 | rayon = "1.10.0" 12 | reqwest = { version = "0.12.7", features = ["rustls-tls", "json"] } 13 | serde = { version = "1.0.210", features = ["derive"] } 14 | serde_json = "1.0.128" 15 | tokio = { version = "1.40.0", features = ["full"] } 16 | url = { version = "2.5.2", features = ["serde"] } 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mkbsd-rs 2 | 3 | A port of [mkbsd](https://github.com/nadimkobeissi/mkbsd) in (Multi-threaded) Rust 4 | 5 | Rip Mark-ass Brownlee's wallpapers at blazingly fast speeds! 🚀 6 | 7 | This Rust program makes use of [tokio](https://tokio.rs/) to parallelize the process of downloading all the wallpapers from the Panels API, allowing all wallpapers 8 | to be downloaded simultaneously. 9 | 10 | This version attempts to parse the full spec JSON from the API and downloads _every_ single image, in every single gallery, in every single form factor, essentially doing a full 11 | rip of the entire backend storage from [imgix](https://imgix.com) 12 | 13 | Here's an output of the full rip: 14 | 15 | ![image](./assets/folder.png) 16 | 17 | This program has two backends for downloading files: 18 | 19 | - The original verbose mode, which downloads all the images using the "API" bucket which includes every pre-cropped form factor. This uses a lot of storage so be warned. 20 | - The "simple" mode, which crawls the CDN manifests and downloads the original images from there. 21 | 22 | By default, the simple mode will be selected to save storage. 23 | 24 | ## Why? 25 | 26 | 1. the original code isn't fast enough for me I have a 1GbE connection 27 | 2. This thing is embarrassingly parallel 28 | 3. I love free shit 29 | 4. My 1GbE plan is cheaper than this app 30 | 5. spamming imgix is funny 31 | 32 | ## Aren't you stealing from artists? 33 | 34 | yea, but so is piracy in general. if you really like what you see just pay for it, see `LICENSE` for my full opinion 35 | 36 | ## Usage 37 | 38 | 1. [Get Rust](https://rustup.rs) 39 | 2. Clone this project and enter the project directory 40 | 3. `cargo run --release` 41 | 4. Wait 42 | 43 | All the images should appear in the `downloads` directory. 44 | 45 | For more options, refer to the help page in the command (`--help`) 46 | 47 | ## License 48 | 49 | Do whatever the fuck you want. 50 | -------------------------------------------------------------------------------- /assets/folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/korewaChino/mkbsd-rs/332a7a1fc33e81b0eaf2cced7a1d6aa082913b3b/assets/folder.png -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | //! mkbsd-rs 2 | //! 3 | //! A parallelized and even more complete version of the mkbsd tool, written in Rust. 4 | //! 5 | //! This tool is designed to download all the wallpapers from MKBHD's Panels GCP storage bucket 6 | //! 7 | //! There seems to be a standardized layout for the images, so we are going to iterate through all the repos and rip everything 8 | 9 | use clap::{Parser, ValueEnum}; 10 | 11 | mod simple; 12 | mod verbose; 13 | 14 | const DATE: &str = "20240916"; 15 | // const API_URL: &str = "https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s"; 16 | // const SPEC_URL: &str = "https://storage.googleapis.com/panels-api/data/20240916/spec.json"; 17 | const DOWNLOADS_DIR: &str = "downloads"; 18 | 19 | // update: There are even more wallpapers and an API spec here 20 | // https://storage.googleapis.com/panels-api/data/20240916/spec.json 21 | 22 | // The API spec is basically this: 23 | // media: { 24 | // root: "", 25 | // p: ["", "", ...], 26 | // b: ["", "", ...] 27 | // } 28 | // 29 | // to get all the images, we basically iterate and concat p and b in this format: 30 | // 31 | // -

- 32 | // 33 | // rinse and repeat for ALL the repos in the GCP bucket until we have absolutely everything 34 | // 35 | // todo: an API for the metadata and search for the images would be nice since they do have data in there 36 | 37 | #[derive(ValueEnum, Clone, Debug, Default)] 38 | enum OperatingMode { 39 | /// The original mode, which downloads all the wallpapers 40 | /// in every crop and resolution available from the API 41 | /// 42 | /// This mode is heavy on the API, network and storage 43 | /// but will give you pre-cropped wallpapers for every form factor 44 | Verbose, 45 | /// A simplified mode that only downloads the wallpapers 46 | /// in its original form by using the CDN bucket 47 | /// 48 | /// This mode simply downloads the original wallpapers, 49 | /// recommended for those who just want the raw images 50 | /// so they can crop them themselves. 51 | #[default] 52 | Simple, 53 | } 54 | 55 | #[derive(clap::Parser)] 56 | struct Cli { 57 | /// The operating mode (backend) to use 58 | #[clap(short, long)] 59 | #[clap(value_enum)] 60 | #[arg(default_value_t)] 61 | mode: OperatingMode, 62 | 63 | /// Dry run mode, will not download anything 64 | #[clap(short, long, env = "DRY_RUN")] 65 | dry_run: bool, 66 | 67 | /// Skip preview images (may save space) 68 | /// 69 | /// With the verbose/complete mode, this will skip 70 | /// all images that are not in the "dhd" form factor 71 | #[clap(short = 'F', long, default_value = "false")] 72 | filter_previews: bool, 73 | } 74 | 75 | impl Cli { 76 | pub async fn download(&self) -> Result<(), Box> { 77 | // set dry run mode 78 | if self.dry_run { 79 | std::env::set_var("DRY_RUN", "true"); 80 | } 81 | 82 | if self.filter_previews { 83 | std::env::set_var("FILTER_PREVIEWS", "true"); 84 | } 85 | 86 | match self.mode { 87 | OperatingMode::Verbose => verbose::download_verbose().await, 88 | OperatingMode::Simple => simple::download_simple().await, 89 | } 90 | } 91 | } 92 | 93 | #[tokio::main] 94 | async fn main() -> Result<(), Box> { 95 | // println!("Hello, world!"); 96 | 97 | let cli = Cli::parse(); 98 | 99 | cli.download().await?; 100 | 101 | Ok(()) 102 | } 103 | -------------------------------------------------------------------------------- /src/simple.rs: -------------------------------------------------------------------------------- 1 | use std::path::Path; 2 | use std::sync::Arc; 3 | 4 | use crate::DOWNLOADS_DIR; 5 | use serde::Deserialize; 6 | use serde_json::Value; 7 | use tokio::sync::Semaphore; 8 | const DATE: &str = "20240730"; 9 | // https://storage.googleapis.com/panels-cdn/data/20240730/all.json 10 | const CDN_URL: &str = "https://storage.googleapis.com/panels-cdn/data"; 11 | 12 | #[derive(Deserialize, Debug)] 13 | struct Cdn { 14 | #[serde(flatten)] 15 | inner: serde_json::Value, 16 | } 17 | 18 | pub async fn download(url: &url::Url) -> Result<(), Box> { 19 | // get the last two segments of the path 20 | 21 | let path = url.path_segments().unwrap().collect::>(); 22 | 23 | let filename = path[path.len() - 2..].join("/"); 24 | 25 | let file_path = Path::new(DOWNLOADS_DIR).join(&filename); 26 | 27 | let dir = file_path.parent().unwrap(); 28 | 29 | println!("Downloading {} to {}", url, filename); 30 | 31 | let dry_run = std::env::var("DRY_RUN").unwrap_or_else(|_| "false".to_string()) == "true"; 32 | 33 | if dry_run { 34 | println!("Dry run: Downloading {} to {}", url, filename); 35 | } else { 36 | tokio::fs::create_dir_all(dir).await?; 37 | let res = reqwest::get(url.clone()).await?; 38 | let bytes = res.bytes().await?; 39 | println!( 40 | "Downloaded {} bytes ({})", 41 | bytes.len(), 42 | &file_path.display() 43 | ); 44 | tokio::fs::write(&file_path, &bytes).await?; 45 | } 46 | 47 | Ok(()) 48 | } 49 | 50 | pub async fn download_simple() -> Result<(), Box> { 51 | let spec = Cdn::fetch().await?; 52 | // println!("{:#?}", spec); 53 | // 54 | println!("Finding urls..."); 55 | 56 | let urls = spec 57 | .find_urls() 58 | .into_iter() 59 | .filter_map(|url| url::Url::parse(&url).ok()) 60 | .filter(|url| { 61 | !std::env::var("FILTER_PREVIEWS") 62 | .map(|val| val == "true") 63 | .unwrap_or(false) 64 | || !url.path().contains("_preview") 65 | }) 66 | .collect::>(); 67 | 68 | download_urls(urls).await; 69 | 70 | // println!("{:#?}", urls); 71 | Ok(()) 72 | } 73 | 74 | async fn download_urls(urls: Vec) { 75 | let semaphore = Arc::new(Semaphore::new(10)); // Limit concurrent downloads to 10 76 | let mut handles = vec![]; 77 | 78 | for image in urls { 79 | let permit = semaphore.clone().acquire_owned().await.unwrap(); 80 | let handle = tokio::spawn(async move { 81 | let res = download(&image).await; 82 | drop(permit); // Release the permit 83 | if let Err(e) = res { 84 | eprintln!("Error downloading image: {:?}", e); 85 | } 86 | }); 87 | handles.push(handle); 88 | } 89 | for handle in handles { 90 | handle.await.unwrap(); 91 | } 92 | } 93 | 94 | impl Cdn { 95 | pub async fn fetch() -> Result { 96 | let res = reqwest::get(format!("{CDN_URL}/{DATE}/all.json")).await?; 97 | // println!("{:#?}", res); 98 | let spec = res.json::().await?; 99 | 100 | // println!("{:#?}", spec); 101 | Ok(spec) 102 | } 103 | 104 | pub fn find_urls(&self) -> Vec { 105 | // find any key called "url" in the json recursively 106 | let mut urls = vec![]; 107 | extract_urls(&self.inner, &mut urls); 108 | urls 109 | } 110 | } 111 | 112 | fn extract_urls(element: &Value, urls: &mut Vec) { 113 | match element { 114 | Value::Object(map) => { 115 | map.iter().for_each(|(key, value)| { 116 | if key == "url" { 117 | if let Some(url) = value.as_str() { 118 | urls.push(url.to_string()); 119 | } 120 | } else { 121 | extract_urls(value, urls); 122 | } 123 | }); 124 | } 125 | Value::Array(arr) => { 126 | arr.iter().for_each(|item| extract_urls(item, urls)); 127 | } 128 | _ => {} 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /src/verbose.rs: -------------------------------------------------------------------------------- 1 | use serde::Deserialize; 2 | use std::collections::HashMap; 3 | const SPEC_URL: &str = "https://storage.googleapis.com/panels-api/data"; 4 | use crate::{DATE, DOWNLOADS_DIR}; 5 | use std::sync::Arc; 6 | use tokio::sync::Semaphore; 7 | 8 | pub async fn download_verbose() -> Result<(), Box> { 9 | let spec = Spec::fetch().await?; 10 | let repos = spec.media.iterate_all(); 11 | println!("{:#?}", repos); 12 | 13 | println!("Iterating through repos..."); 14 | 15 | let repos_iter = repos.iter().map(|repo| Repo::new(repo)).collect::>(); 16 | 17 | let repos_iter = futures::future::join_all(repos_iter) 18 | .await 19 | .into_iter() 20 | .filter_map(Result::ok) 21 | .collect::>(); 22 | 23 | let filter_previews = 24 | std::env::var("FILTER_PREVIEWS").unwrap_or_else(|_| "false".to_string()) == "true"; 25 | 26 | let images: Vec<_> = repos_iter 27 | .iter() 28 | .flat_map(|repo| { 29 | repo.data.iter().flat_map(move |(id, image)| { 30 | image.image.iter().filter_map(move |(form_factor, url)| { 31 | if !filter_previews || form_factor == "dhd" { 32 | Some(ImageDownload { 33 | id: id.clone(), 34 | repo_id: repo.repo.clone(), 35 | form_factor: form_factor.clone(), 36 | url: url.clone(), 37 | }) 38 | } else { 39 | None 40 | } 41 | }) 42 | }) 43 | }) 44 | .collect(); 45 | 46 | // println!("{:#?}", images); 47 | 48 | download_images_flat(images).await; 49 | 50 | Ok(()) 51 | } 52 | 53 | #[derive(Deserialize, Debug)] 54 | pub struct Spec { 55 | // content: String, 56 | // search: String, 57 | pub media: PanelMedia, 58 | } 59 | 60 | impl Spec { 61 | pub async fn fetch() -> Result { 62 | let res = reqwest::get(format!("{SPEC_URL}/{DATE}/spec.json")).await?; 63 | let spec = res.json::().await?; 64 | Ok(spec) 65 | } 66 | } 67 | 68 | #[derive(Deserialize, Debug)] 69 | pub struct PanelMedia { 70 | pub root: String, 71 | pub p: Vec, 72 | pub b: Vec, 73 | } 74 | 75 | impl PanelMedia { 76 | pub fn iterate_all(&self) -> Vec { 77 | self.p 78 | .iter() 79 | .flat_map(|p| { 80 | self.b 81 | .iter() 82 | .map(move |b| format!("{root}-{p}-{b}", root = self.root, p = p, b = b)) 83 | }) 84 | .collect() 85 | } 86 | } 87 | 88 | #[derive(Deserialize, Debug)] 89 | pub struct Repo { 90 | #[serde(skip_deserializing)] 91 | repo: String, 92 | data: HashMap, 93 | } 94 | 95 | impl Repo { 96 | pub async fn new(repo: &str) -> Result { 97 | println!("Fetching repo {}", repo); 98 | let res = reqwest::get(repo.to_string()).await?; 99 | 100 | let repo_url_parsed = url::Url::parse(repo).unwrap(); 101 | let repo = repo_url_parsed.path_segments().unwrap().last().unwrap(); 102 | 103 | // println!("Got response: {:#?}", res); 104 | 105 | let panels = res.json::().await?; 106 | Ok(Self { 107 | repo: repo.to_string(), 108 | data: panels.data, 109 | }) 110 | } 111 | } 112 | 113 | // The image is basically this: 114 | // { 115 | // "": { 116 | // "

": "" 117 | // } 118 | // } 119 | // 120 | // so we are going to just make use of maps to serialize this 121 | #[derive(Deserialize, Debug)] 122 | #[serde(tag = "id")] 123 | pub struct Image { 124 | #[serde(flatten)] 125 | // every field is a form factor 126 | image: HashMap, 127 | } 128 | 129 | #[derive(Debug)] 130 | struct ImageDownload { 131 | pub id: String, 132 | pub repo_id: String, 133 | pub form_factor: String, 134 | pub url: String, 135 | } 136 | 137 | impl ImageDownload { 138 | pub async fn download(&self) -> Result<(), Box> { 139 | println!( 140 | "Downloading image for repo {}, form factor {} from {}", 141 | self.repo_id, self.form_factor, self.url 142 | ); 143 | let repo_id = &self.repo_id; 144 | let repo_dir = format!("{DOWNLOADS_DIR}/{repo_id}"); 145 | let dry_run = std::env::var("DRY_RUN").unwrap_or_else(|_| "false".to_string()) == "true"; 146 | 147 | if !dry_run { 148 | tokio::fs::create_dir_all(&repo_dir).await?; 149 | let res = reqwest::get(&self.url).await?; 150 | let bytes = res.bytes().await?; 151 | let fmt = file_format::FileFormat::from_bytes(&bytes); 152 | let ext = fmt.extension(); 153 | let filename = format!( 154 | "{repo_dir}/{id}-{form_factor}.{ext}", 155 | id = self.id, 156 | form_factor = self.form_factor 157 | ); 158 | println!("Downloaded {} bytes ({})", bytes.len(), &filename); 159 | tokio::fs::write(filename, bytes).await?; 160 | } else { 161 | println!( 162 | "Dry run: would download image for repo {}, form factor {} from {}", 163 | self.repo_id, self.form_factor, self.url 164 | ); 165 | } 166 | Ok(()) 167 | } 168 | } 169 | 170 | async fn download_images_flat(img: Vec) { 171 | // use all threads from the CPU 172 | // let thread_count = core:: 173 | let semaphore = Arc::new(Semaphore::new(10)); // Limit concurrent downloads to 10 174 | let mut handles = vec![]; 175 | 176 | for image in img { 177 | let permit = semaphore.clone().acquire_owned().await.unwrap(); 178 | let handle = tokio::spawn(async move { 179 | let res = image.download().await; 180 | drop(permit); // Release the permit 181 | if let Err(e) = res { 182 | eprintln!("Error downloading image: {:?}", e); 183 | } 184 | }); 185 | handles.push(handle); 186 | } 187 | 188 | for handle in handles { 189 | handle.await.unwrap(); 190 | } 191 | } 192 | --------------------------------------------------------------------------------