Check-in [6ceec39cdd]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | yaydl 0.6.0 (yes, that was quick): Added support for Vidoza, updated ureq to version 2.1. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk | release-0.6.0 |
Files: | files | file ages | folders |
SHA3-256: |
6ceec39cdd773ada612c13379a332b92 |
User & Date: | Cthulhux 2021-04-03 22:50:30 |
Context
2021-04-03
| ||
22:55 | crates.io won't let me add all the tags - updated to 0.6.1, keeping the list short. Leaf check-in: 2e69c78ac7 user: Cthulhux tags: trunk, release-0.6.1 | |
22:50 | yaydl 0.6.0 (yes, that was quick): Added support for Vidoza, updated ureq to version 2.1. check-in: 6ceec39cdd user: Cthulhux tags: trunk, release-0.6.0 | |
21:57 | yaydl 0.5.0: We now support VIVO.sx. check-in: c1584fbad6 user: Cthulhux tags: trunk, release-0.5.0 | |
Changes
Changes to Cargo.lock.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 ... 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 ... 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 ... 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 ... 404 405 406 407 408 409 410 411 412 413 414 415 416 417 ... 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 ... 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 ... 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 ... 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 ... 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 ... 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 ... 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 ... 928 929 930 931 932 933 934 935 936 937 938 939 940 941 ... 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 .... 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 .... 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 .... 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 .... 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 |
[[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "byteorder" version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] ................................................................................ [[package]] name = "convert_case" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation" version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "core-foundation-sys" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "cssparser" version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" dependencies = [ "cssparser-macros", ................................................................................ [[package]] name = "encode_unicode" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ "foreign-types-shared", ] [[package]] name = "foreign-types-shared" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", ................................................................................ name = "getrandom" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ "cfg-if", "libc", "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "ghost" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a5bcf1bbeab73aa4cf2fde60a846858dc036163c7c33bec309f8d17de785479" ................................................................................ ] [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ................................................................................ [[package]] name = "memchr" version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "native-tls" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" dependencies = [ "lazy_static", "libc", "log", "openssl", "openssl-probe", "openssl-sys", "schannel", "security-framework", "security-framework-sys", "tempfile", ] [[package]] name = "new_debug_unreachable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] ................................................................................ [[package]] name = "once_cell" version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "openssl" version = "0.10.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577" dependencies = [ "bitflags", "cfg-if", "foreign-types", "libc", "once_cell", "openssl-sys", ] [[package]] name = "openssl-probe" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" version = "0.9.61" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f" dependencies = [ "autocfg", "cc", "libc", "pkg-config", "vcpkg", ] [[package]] name = "os_str_bytes" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" [[package]] ................................................................................ [[package]] name = "phf_generator" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ "phf_shared", "rand 0.7.3", ] [[package]] name = "phf_macros" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" ................................................................................ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" dependencies = [ "siphasher", ] [[package]] name = "pkg-config" version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "ppv-lite86" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] ................................................................................ [[package]] name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", "rand_pcg", ] [[package]] name = "rand" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ "libc", "rand_chacha 0.3.0", "rand_core 0.6.2", "rand_hc 0.3.0", ] [[package]] name = "rand_chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", "rand_core 0.5.1", ] [[package]] name = "rand_chacha" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", "rand_core 0.6.2", ] [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ "getrandom 0.1.16", ] [[package]] name = "rand_core" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ "getrandom 0.2.2", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ "rand_core 0.5.1", ] [[package]] name = "rand_hc" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ "rand_core 0.6.2", ] [[package]] name = "rand_pcg" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ "rand_core 0.5.1", ] [[package]] name = "redox_syscall" version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" dependencies = [ "bitflags", ] [[package]] name = "regex" version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" ................................................................................ [[package]] name = "regex-syntax" version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] name = "remove_dir_all" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ "winapi", ] [[package]] name = "ryu" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "schannel" version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", "winapi", ] [[package]] name = "scraper" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e02aa790c80c2e494130dec6a522033b6a23603ffc06360e9fe6c611ea2c12" dependencies = [ "cssparser", ................................................................................ "matches", "selectors", "smallvec", "tendril", ] [[package]] name = "security-framework" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" dependencies = [ "bitflags", "core-foundation", "core-foundation-sys", "libc", "security-framework-sys", ] [[package]] name = "security-framework-sys" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" dependencies = [ "core-foundation-sys", "libc", ] [[package]] name = "selectors" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" ................................................................................ [[package]] name = "smallvec" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] ................................................................................ checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] [[package]] name = "tempfile" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ "cfg-if", "libc", "rand 0.8.3", "redox_syscall", "remove_dir_all", "winapi", ] [[package]] name = "tendril" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9ef557cb397a4f0a5a3a628f06515f78563f2209e64d47055d9dc6052bf5e33" dependencies = [ "futf", ................................................................................ [[package]] name = "unicode-xid" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "ureq" version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" dependencies = [ "base64", "chunked_transfer", "log", "native-tls", "once_cell", "qstring", "url", ] [[package]] name = "url" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" ................................................................................ [[package]] name = "utf-8" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "vcpkg" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] ................................................................................ [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ ................................................................................ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "yaydl" version = "0.5.0" dependencies = [ "anyhow", "cienli", "clap", "indicatif", "inventory", "qstring", |
> > > > > > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < < > > > > > > > > > < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < | | | | < < < < < < < < < < < < | < < < < < < < < < < | < < < < < < < < < | < < < < < < < < < | < < < < < < < < < | | | > > > > > > > > > > > > > > > > > > > < < < < < < < < < < | | | | | < < < < < < < < < < < < < > > > > > > < < < < < < < < < < < < < < > > > > > > | < > < < > > > < < < < < < | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | |
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 ... 134 135 136 137 138 139 140 141 142 143 144 145 146 147 ... 210 211 212 213 214 215 216 217 218 219 220 221 222 223 ... 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 ... 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 ... 434 435 436 437 438 439 440 441 442 443 444 445 446 447 ... 458 459 460 461 462 463 464 465 466 467 468 469 470 471 ... 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 ... 524 525 526 527 528 529 530 531 532 533 534 535 536 537 ... 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 ... 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 ... 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 ... 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 ... 845 846 847 848 849 850 851 852 853 854 855 856 857 858 ... 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 ... 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 .... 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 .... 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
[[package]] name = "bitflags" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bumpalo" version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63396b8a4b9de3f4fdfb320ab6080762242f66a8ef174c49d8e19b674db4cdbe" [[package]] name = "byteorder" version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] ................................................................................ [[package]] name = "convert_case" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "cssparser" version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" dependencies = [ "cssparser-macros", ................................................................................ [[package]] name = "encode_unicode" version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "form_urlencoded" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", ................................................................................ name = "getrandom" version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if", "libc", "wasi", ] [[package]] name = "ghost" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a5bcf1bbeab73aa4cf2fde60a846858dc036163c7c33bec309f8d17de785479" ................................................................................ ] [[package]] name = "itoa" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "js-sys" version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d99f9e3e84b8f67f846ef5b4cbbc3b1c29f6c759fcbce6f01aa0e73d932a24c" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" ................................................................................ [[package]] name = "memchr" version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] name = "new_debug_unreachable" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" [[package]] ................................................................................ [[package]] name = "once_cell" version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "os_str_bytes" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afb2e1c3ee07430c2cf76151675e583e0f19985fa6efae47d6848a3e2c824f85" [[package]] ................................................................................ [[package]] name = "phf_generator" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" dependencies = [ "phf_shared", "rand", ] [[package]] name = "phf_macros" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" ................................................................................ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" dependencies = [ "siphasher", ] [[package]] name = "ppv-lite86" version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] ................................................................................ [[package]] name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom", "libc", "rand_chacha", "rand_core", "rand_hc", "rand_pcg", ] [[package]] name = "rand_chacha" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", "rand_core", ] [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ "getrandom", ] [[package]] name = "rand_hc" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ "rand_core", ] [[package]] name = "rand_pcg" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" dependencies = [ "rand_core", ] [[package]] name = "regex" version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19" ................................................................................ [[package]] name = "regex-syntax" version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" [[package]] name = "ring" version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", "once_cell", "spin", "untrusted", "web-sys", "winapi", ] [[package]] name = "rustls" version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" dependencies = [ "base64", "log", "ring", "sct", "webpki", ] [[package]] name = "ryu" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" [[package]] name = "scraper" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e02aa790c80c2e494130dec6a522033b6a23603ffc06360e9fe6c611ea2c12" dependencies = [ "cssparser", ................................................................................ "matches", "selectors", "smallvec", "tendril", ] [[package]] name = "sct" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" dependencies = [ "ring", "untrusted", ] [[package]] name = "selectors" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" ................................................................................ [[package]] name = "smallvec" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "spin" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] ................................................................................ checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] [[package]] name = "tendril" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9ef557cb397a4f0a5a3a628f06515f78563f2209e64d47055d9dc6052bf5e33" dependencies = [ "futf", ................................................................................ [[package]] name = "unicode-xid" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "untrusted" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fbeb1aabb07378cf0e084971a74f24241273304653184f54cdce113c0d7df1b" dependencies = [ "base64", "chunked_transfer", "log", "once_cell", "rustls", "url", "webpki", "webpki-roots", ] [[package]] name = "url" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ccd964113622c8e9322cfac19eb1004a07e636c545f325da085d5cdde6f1f8b" ................................................................................ [[package]] name = "utf-8" version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7" [[package]] name = "vec_map" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] ................................................................................ [[package]] name = "wasi" version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasm-bindgen" version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83240549659d187488f91f33c0f8547cbfef0b2088bc470c116d1d260ef623d9" dependencies = [ "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae70622411ca953215ca6d06d3ebeb1e915f0f6613e3b495122878d7ebec7dae" dependencies = [ "bumpalo", "lazy_static", "log", "proc-macro2", "quote", "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e734d91443f177bfdb41969de821e15c516931c3c3db3d318fa1b68975d0f6f" dependencies = [ "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53739ff08c8a68b0fdbcd54c372b8ab800b1449ab3c9d706503bc7dd1621b2c" dependencies = [ "proc-macro2", "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" version = "0.2.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9a543ae66aa233d14bb765ed9af4a33e81b8b58d1584cf1b47ff8cd0b9e4489" [[package]] name = "web-sys" version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] name = "webpki" version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ "ring", "untrusted", ] [[package]] name = "webpki-roots" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ "webpki", ] [[package]] name = "winapi" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ ................................................................................ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "yaydl" version = "0.6.0" dependencies = [ "anyhow", "cienli", "clap", "indicatif", "inventory", "qstring", |
Changes to Cargo.toml.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[package] name = "yaydl" description = "yet another youtube (and more) down loader" version = "0.5.0" authors = ["Cthulhux <git@tuxproject.de>"] edition = "2018" license = "CDDL-1.0" repository = "https://code.rosaelefanten.org/yaydl" categories = ["command-line-utilities"] keywords = ["youtube", "vimeo", "voe", "vivo", "watchmdh"] [dependencies] anyhow = "1.0" cienli = "0.1.1" clap = "3.0.0-beta.2" indicatif = "0.15" inventory = "0.1" qstring = "0.7" regex = "1.4" scraper = "0.12" serde_json = "1.0" ureq = { version = "1.5", default_features = false, features = ["native-tls"] } url = "2.2.0" urlencoding = "1.1" [profile.release] lto = true |
| | | | | |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
[package] name = "yaydl" description = "yet another youtube (and more) down loader" version = "0.6.0" authors = ["Cthulhux <git@tuxproject.de>"] edition = "2018" license = "CDDL-1.0" repository = "https://code.rosaelefanten.org/yaydl" categories = ["command-line-utilities"] keywords = ["youtube", "vimeo", "voe", "vidoza", "vivo", "watchmdh"] [dependencies] anyhow = "1.0" cienli = "0.1" clap = "3.0.0-beta.2" indicatif = "0.15" inventory = "0.1" qstring = "0.7" regex = "1.4" scraper = "0.12" serde_json = "1.0" ureq = "2.1" url = "2.2" urlencoding = "1.1" [profile.release] lto = true |
Changes to README.md.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
## Currently supported sites * YouTube.com * Vimeo.com * VOE.sx * WatchMDH.to * VIVO.sx There is an easy way to add more supported sites, see below for details. ## Non-features The list of features is deliberately kept short: |
> |
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
## Currently supported sites
* YouTube.com
* Vimeo.com
* VOE.sx
* WatchMDH.to
* VIVO.sx
* Vidoza.net
There is an easy way to add more supported sites, see below for details.
## Non-features
The list of features is deliberately kept short:
|
Changes to src/handlers.rs.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
* file and include the contents of the LICENSE file from this * distribution. */ // Yet Another Youtube Down Loader // - handlers.rs file - mod vimeo; mod vivo; mod voe; mod watchmdh; mod youtube; // Add your own modules here. |
> |
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
* file and include the contents of the LICENSE file from this
* distribution.
*/
// Yet Another Youtube Down Loader
// - handlers.rs file -
mod vidoza;
mod vimeo;
mod vivo;
mod voe;
mod watchmdh;
mod youtube;
// Add your own modules here.
|
Added src/handlers/vidoza.rs.
> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
/* * The contents of this file are subject to the terms of the * Common Development and Distribution License, Version 1.0 only * (the "License"). You may not use this file except in compliance * with the License. * * See the file LICENSE in this distribution for details. * A copy of the CDDL is also available via the Internet at * http://www.opensource.org/licenses/cddl1.txt * * When distributing Covered Code, include this CDDL HEADER in each * file and include the contents of the LICENSE file from this * distribution. */ // Yet Another Youtube Down Loader // - Vidoza handler - use crate::definitions::SiteDefinition; use anyhow::Result; use regex::Regex; use scraper::{Html, Selector}; static mut VIDEO_INFO: String = String::new(); unsafe fn get_video_info(url: &str) -> Result<Html> { if VIDEO_INFO.is_empty() { // We need to fetch the video information first. // It will contain the whole body for now. let req = ureq::get(&url).call()?; let body = req.into_string()?; VIDEO_INFO = body; } // Return it: let d = Html::parse_document(&VIDEO_INFO); Ok(d) } // Implement the site definition: struct VidozaHandler; impl SiteDefinition for VidozaHandler { fn can_handle_url<'a>(&'a self, url: &'a str) -> bool { Regex::new(r"vidoza.net/.+").unwrap().is_match(url) } fn find_video_title<'a>(&'a self, url: &'a str) -> Result<String> { unsafe { let video_info = get_video_info(url)?; // Currently, there only is one <H1> on Vidoza. Good for us. let h1_selector = Selector::parse("h1").unwrap(); let text = video_info.select(&h1_selector).next().unwrap(); let result = text.text().collect(); Ok(result) } } fn find_video_direct_url<'a>(&'a self, url: &'a str, _onlyaudio: bool) -> Result<String> { unsafe { let video_info = get_video_info(url)?; let url_selector = Selector::parse("source").unwrap(); let url_elem = video_info.select(&url_selector).next().unwrap(); let url_contents = url_elem.value().attr("src").unwrap(); Ok(url_contents.to_string()) } } fn does_video_exist<'a>(&'a self, url: &'a str) -> Result<bool> { unsafe { let _video_info = get_video_info(url); Ok(!VIDEO_INFO.is_empty()) } } fn display_name<'a>(&'a self) -> String { "Vidoza".to_string() } fn find_video_file_extension<'a>(&'a self, _url: &'a str, _onlyaudio: bool) -> Result<String> { Ok("mp4".to_string()) } } // Push the site definition to the list of known handlers: inventory::submit! { &VidozaHandler as &dyn SiteDefinition } |
Changes to src/handlers/vimeo.rs.
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
static mut VIDEO_TITLE: String = String::new();
unsafe fn get_video_info(url: &str) -> Result<Value> {
if VIDEO_INFO.is_empty() {
// We need to fetch the video information first.
// Those are hidden behing a config file defined in the page source code.
// Search for: window.vimeo.clip_page_config.player = {"config_url":"(.+?)"
let req = ureq::get(url).call();
let body = req.into_string()?;
let re =
Regex::new("window.vimeo.clip_page_config.player = .\"config_url\":\"(?P<URL>.+?)\"")
.unwrap();
let search = re.captures(&body).unwrap();
// While we're grepping the source code: Vimeo also hides
................................................................................
let video_info_url = search
.name("URL")
.map_or("", |u| u.as_str())
.replace("\\", "");
// The "config_url" body is a JSON structure.
// Grab and store it:
let config_req = ureq::get(&video_info_url).call();
let config_body = config_req.into_string()?;
VIDEO_INFO = config_body;
}
// Return it:
let v: Value = serde_json::from_str(&VIDEO_INFO)?;
Ok(v)
|
|
|
|
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
..
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
static mut VIDEO_TITLE: String = String::new(); unsafe fn get_video_info(url: &str) -> Result<Value> { if VIDEO_INFO.is_empty() { // We need to fetch the video information first. // Those are hidden behing a config file defined in the page source code. // Search for: window.vimeo.clip_page_config.player = {"config_url":"(.+?)" let req = ureq::get(url).call()?; let body = req.into_string()?; let re = Regex::new("window.vimeo.clip_page_config.player = .\"config_url\":\"(?P<URL>.+?)\"") .unwrap(); let search = re.captures(&body).unwrap(); // While we're grepping the source code: Vimeo also hides ................................................................................ let video_info_url = search .name("URL") .map_or("", |u| u.as_str()) .replace("\\", ""); // The "config_url" body is a JSON structure. // Grab and store it: let config_req = ureq::get(&video_info_url).call()?; let config_body = config_req.into_string()?; VIDEO_INFO = config_body; } // Return it: let v: Value = serde_json::from_str(&VIDEO_INFO)?; Ok(v) |
Changes to src/handlers/vivo.rs.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
static mut VIDEO_INFO: String = String::new(); unsafe fn get_video_info(url: &str) -> Result<Html> { if VIDEO_INFO.is_empty() { // We need to fetch the video information first. // It will contain the whole body for now. let req = ureq::get(&url).call(); let body = req.into_string()?; VIDEO_INFO = body; } // Return it: let d = Html::parse_document(&VIDEO_INFO); |
| |
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
static mut VIDEO_INFO: String = String::new();
unsafe fn get_video_info(url: &str) -> Result<Html> {
if VIDEO_INFO.is_empty() {
// We need to fetch the video information first.
// It will contain the whole body for now.
let req = ureq::get(&url).call()?;
let body = req.into_string()?;
VIDEO_INFO = body;
}
// Return it:
let d = Html::parse_document(&VIDEO_INFO);
|
Changes to src/handlers/voe.rs.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
static mut VIDEO_INFO: String = String::new(); unsafe fn get_video_info(url: &str) -> Result<Html> { if VIDEO_INFO.is_empty() { // We need to fetch the video information first. // It will contain the whole body for now. let req = ureq::get(&url).call(); let body = req.into_string()?; VIDEO_INFO = body; } // Return it: let d = Html::parse_document(&VIDEO_INFO); |
| |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
static mut VIDEO_INFO: String = String::new();
unsafe fn get_video_info(url: &str) -> Result<Html> {
if VIDEO_INFO.is_empty() {
// We need to fetch the video information first.
// It will contain the whole body for now.
let req = ureq::get(&url).call()?;
let body = req.into_string()?;
VIDEO_INFO = body;
}
// Return it:
let d = Html::parse_document(&VIDEO_INFO);
|
Changes to src/handlers/watchmdh.rs.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
static mut VIDEO_INFO: String = String::new(); unsafe fn get_video_info(url: &str) -> Result<Html> { if VIDEO_INFO.is_empty() { // We need to fetch the video information first. // It will contain the whole body for now. let req = ureq::get(&url).call(); let body = req.into_string()?; VIDEO_INFO = body; } // Return it: let d = Html::parse_document(&VIDEO_INFO); |
| |
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
static mut VIDEO_INFO: String = String::new();
unsafe fn get_video_info(url: &str) -> Result<Html> {
if VIDEO_INFO.is_empty() {
// We need to fetch the video information first.
// It will contain the whole body for now.
let req = ureq::get(&url).call()?;
let body = req.into_string()?;
VIDEO_INFO = body;
}
// Return it:
let d = Html::parse_document(&VIDEO_INFO);
|
Changes to src/handlers/youtube.rs.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
unsafe fn get_video_info(id: &str) -> Result<Value> { if VIDEO_INFO.is_empty() { // We need to fetch the video information first. let video_url = format!( "https://www.youtube.com/get_video_info?video_id={}&el=embedded&ps=default", id ); let req = ureq::get(&video_url).call(); let body = req.into_string()?; // Try to find the encoded JSON object in the response. let qs = QString::from(body.as_str()); let json = qs.get("player_response").unwrap_or(""); VIDEO_INFO = json.replace("+", " "); |
| |
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
unsafe fn get_video_info(id: &str) -> Result<Value> {
if VIDEO_INFO.is_empty() {
// We need to fetch the video information first.
let video_url = format!(
"https://www.youtube.com/get_video_info?video_id={}&el=embedded&ps=default",
id
);
let req = ureq::get(&video_url).call()?;
let body = req.into_string()?;
// Try to find the encoded JSON object in the response.
let qs = QString::from(body.as_str());
let json = qs.get("player_response").unwrap_or("");
VIDEO_INFO = json.replace("+", " ");
|
Changes to src/main.rs.
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
..
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
n }) } } fn download(url: &str, filename: &str) -> Result<()> { let url = Url::parse(url)?; let resp = ureq::get(url.as_str()).call(); // Find the video size: let total_size = { if resp.ok() { resp.header("Content-Length") .unwrap_or("0") .parse::<u64>()? } else { return Err(anyhow::Error::msg(format!( "Couldn't download URL: {}. Error: {:?}", url, resp.status(), ))); } }; let mut request = ureq::get(url.as_str()); // Display a progress bar: let pb = ProgressBar::new(total_size); pb.set_style(ProgressStyle::default_bar() .template("{spinner:.green} [{elapsed_precise}] [{bar:40.green/blue}] {bytes}/{total_bytes} ({eta})") ................................................................................ // Override the range: request = ureq::get(url.as_str()) .set("Range", &format!("bytes={}-", size)) .to_owned(); pb.inc(size); } let resp = request.call(); let mut source = DownloadProgress { progress_bar: pb, inner: resp.into_reader(), }; let mut dest = fs::OpenOptions::new() .create(true) |
|
|
<
|
|
|
<
<
<
<
<
<
<
<
|
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
..
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
n }) } } fn download(url: &str, filename: &str) -> Result<()> { let url = Url::parse(url)?; let resp = ureq::get(url.as_str()).call()?; // Find the video size: let total_size = resp .header("Content-Length") .unwrap_or("0") .parse::<u64>()?; let mut request = ureq::get(url.as_str()); // Display a progress bar: let pb = ProgressBar::new(total_size); pb.set_style(ProgressStyle::default_bar() .template("{spinner:.green} [{elapsed_precise}] [{bar:40.green/blue}] {bytes}/{total_bytes} ({eta})") ................................................................................ // Override the range: request = ureq::get(url.as_str()) .set("Range", &format!("bytes={}-", size)) .to_owned(); pb.inc(size); } let resp = request.call()?; let mut source = DownloadProgress { progress_bar: pb, inner: resp.into_reader(), }; let mut dest = fs::OpenOptions::new() .create(true) |