Commit 28aabc54e0

28aabc54e0cad7414f98b1ff5320485f6ced5ba9

parent: af02c2d314

Unsigned

siriusmart <siriusmart@tuta.io> · 2025-07-31 12:40 UTC

added rustypipe support

Layout: unified · split

Cargo.lock +1312 −13
@@ -2,18 +2,51 @@
22# It is not intended for manual editing.
33version = 4
44
5[[package]]
6name = "addr2line"
7version = "0.24.2"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1"
10dependencies = [
11 "gimli",
12]
13
514[[package]]
615name = "adler2"
716version = "2.0.0"
817source = "registry+https://github.com/rust-lang/crates.io-index"
918checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
1019
20[[package]]
21name = "aho-corasick"
22version = "1.1.3"
23source = "registry+https://github.com/rust-lang/crates.io-index"
24checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
25dependencies = [
26 "memchr",
27]
28
1129[[package]]
1230name = "aligned-vec"
1331version = "0.5.0"
1432source = "registry+https://github.com/rust-lang/crates.io-index"
1533checksum = "4aa90d7ce82d4be67b64039a3d588d38dbcc6736577de4a847025ce5b0c468d1"
1634
35[[package]]
36name = "alloc-no-stdlib"
37version = "2.0.4"
38source = "registry+https://github.com/rust-lang/crates.io-index"
39checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"
40
41[[package]]
42name = "alloc-stdlib"
43version = "0.2.2"
44source = "registry+https://github.com/rust-lang/crates.io-index"
45checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
46dependencies = [
47 "alloc-no-stdlib",
48]
49
1750[[package]]
1851name = "allocator-api2"
1952version = "0.2.21"
@@ -73,6 +106,20 @@ version = "0.7.6"
73106source = "registry+https://github.com/rust-lang/crates.io-index"
74107checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
75108
109[[package]]
110name = "async-compression"
111version = "0.4.27"
112source = "registry+https://github.com/rust-lang/crates.io-index"
113checksum = "ddb939d66e4ae03cee6091612804ba446b12878410cfa17f785f4dd67d4014e8"
114dependencies = [
115 "brotli",
116 "flate2",
117 "futures-core",
118 "memchr",
119 "pin-project-lite",
120 "tokio",
121]
122
76123[[package]]
77124name = "autocfg"
78125version = "1.4.0"
@@ -102,12 +149,42 @@ dependencies = [
102149 "arrayvec",
103150]
104151
152[[package]]
153name = "backtrace"
154version = "0.3.75"
155source = "registry+https://github.com/rust-lang/crates.io-index"
156checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002"
157dependencies = [
158 "addr2line",
159 "cfg-if",
160 "libc",
161 "miniz_oxide",
162 "object",
163 "rustc-demangle",
164 "windows-targets",
165]
166
105167[[package]]
106168name = "base64"
107169version = "0.22.1"
108170source = "registry+https://github.com/rust-lang/crates.io-index"
109171checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
110172
173[[package]]
174name = "bit-set"
175version = "0.8.0"
176source = "registry+https://github.com/rust-lang/crates.io-index"
177checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3"
178dependencies = [
179 "bit-vec",
180]
181
182[[package]]
183name = "bit-vec"
184version = "0.8.0"
185source = "registry+https://github.com/rust-lang/crates.io-index"
186checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7"
187
111188[[package]]
112189name = "bit_field"
113190version = "0.10.2"
@@ -141,6 +218,36 @@ version = "0.1.6"
141218source = "registry+https://github.com/rust-lang/crates.io-index"
142219checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
143220
221[[package]]
222name = "block-buffer"
223version = "0.10.4"
224source = "registry+https://github.com/rust-lang/crates.io-index"
225checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
226dependencies = [
227 "generic-array",
228]
229
230[[package]]
231name = "brotli"
232version = "8.0.1"
233source = "registry+https://github.com/rust-lang/crates.io-index"
234checksum = "9991eea70ea4f293524138648e41ee89b0b2b12ddef3b255effa43c8056e0e0d"
235dependencies = [
236 "alloc-no-stdlib",
237 "alloc-stdlib",
238 "brotli-decompressor",
239]
240
241[[package]]
242name = "brotli-decompressor"
243version = "5.0.0"
244source = "registry+https://github.com/rust-lang/crates.io-index"
245checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03"
246dependencies = [
247 "alloc-no-stdlib",
248 "alloc-stdlib",
249]
250
144251[[package]]
145252name = "built"
146253version = "0.7.7"
@@ -165,6 +272,12 @@ version = "0.1.0"
165272source = "registry+https://github.com/rust-lang/crates.io-index"
166273checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
167274
275[[package]]
276name = "bytes"
277version = "1.10.1"
278source = "registry+https://github.com/rust-lang/crates.io-index"
279checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
280
168281[[package]]
169282name = "cassowary"
170283version = "0.3.0"
@@ -216,6 +329,7 @@ dependencies = [
216329 "android-tzdata",
217330 "iana-time-zone",
218331 "num-traits",
332 "serde",
219333 "windows-link",
220334]
221335
@@ -299,6 +413,15 @@ version = "0.8.7"
299413source = "registry+https://github.com/rust-lang/crates.io-index"
300414checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
301415
416[[package]]
417name = "cpufeatures"
418version = "0.2.17"
419source = "registry+https://github.com/rust-lang/crates.io-index"
420checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280"
421dependencies = [
422 "libc",
423]
424
302425[[package]]
303426name = "crc32fast"
304427version = "1.4.2"
@@ -383,6 +506,16 @@ version = "0.2.3"
383506source = "registry+https://github.com/rust-lang/crates.io-index"
384507checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
385508
509[[package]]
510name = "crypto-common"
511version = "0.1.6"
512source = "registry+https://github.com/rust-lang/crates.io-index"
513checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
514dependencies = [
515 "generic-array",
516 "typenum",
517]
518
386519[[package]]
387520name = "darling"
388521version = "0.20.11"
@@ -418,6 +551,22 @@ dependencies = [
418551 "syn",
419552]
420553
554[[package]]
555name = "data-encoding"
556version = "2.9.0"
557source = "registry+https://github.com/rust-lang/crates.io-index"
558checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
559
560[[package]]
561name = "deranged"
562version = "0.4.0"
563source = "registry+https://github.com/rust-lang/crates.io-index"
564checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
565dependencies = [
566 "powerfmt",
567 "serde",
568]
569
421570[[package]]
422571name = "derive_more"
423572version = "2.0.1"
@@ -439,6 +588,27 @@ dependencies = [
439588 "syn",
440589]
441590
591[[package]]
592name = "digest"
593version = "0.10.7"
594source = "registry+https://github.com/rust-lang/crates.io-index"
595checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
596dependencies = [
597 "block-buffer",
598 "crypto-common",
599]
600
601[[package]]
602name = "displaydoc"
603version = "0.2.5"
604source = "registry+https://github.com/rust-lang/crates.io-index"
605checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
606dependencies = [
607 "proc-macro2",
608 "quote",
609 "syn",
610]
611
442612[[package]]
443613name = "document-features"
444614version = "0.2.11"
@@ -497,6 +667,17 @@ dependencies = [
497667 "zune-inflate",
498668]
499669
670[[package]]
671name = "fancy-regex"
672version = "0.14.0"
673source = "registry+https://github.com/rust-lang/crates.io-index"
674checksum = "6e24cb5a94bcae1e5408b0effca5cd7172ea3c5755049c5f3af4cd283a165298"
675dependencies = [
676 "bit-set",
677 "regex-automata",
678 "regex-syntax",
679]
680
500681[[package]]
501682name = "fastrand"
502683version = "2.3.0"
@@ -549,6 +730,114 @@ version = "0.1.1"
549730source = "registry+https://github.com/rust-lang/crates.io-index"
550731checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
551732
733[[package]]
734name = "form_urlencoded"
735version = "1.2.1"
736source = "registry+https://github.com/rust-lang/crates.io-index"
737checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456"
738dependencies = [
739 "percent-encoding",
740]
741
742[[package]]
743name = "futures"
744version = "0.3.31"
745source = "registry+https://github.com/rust-lang/crates.io-index"
746checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876"
747dependencies = [
748 "futures-channel",
749 "futures-core",
750 "futures-executor",
751 "futures-io",
752 "futures-sink",
753 "futures-task",
754 "futures-util",
755]
756
757[[package]]
758name = "futures-channel"
759version = "0.3.31"
760source = "registry+https://github.com/rust-lang/crates.io-index"
761checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10"
762dependencies = [
763 "futures-core",
764 "futures-sink",
765]
766
767[[package]]
768name = "futures-core"
769version = "0.3.31"
770source = "registry+https://github.com/rust-lang/crates.io-index"
771checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e"
772
773[[package]]
774name = "futures-executor"
775version = "0.3.31"
776source = "registry+https://github.com/rust-lang/crates.io-index"
777checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f"
778dependencies = [
779 "futures-core",
780 "futures-task",
781 "futures-util",
782]
783
784[[package]]
785name = "futures-io"
786version = "0.3.31"
787source = "registry+https://github.com/rust-lang/crates.io-index"
788checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6"
789
790[[package]]
791name = "futures-macro"
792version = "0.3.31"
793source = "registry+https://github.com/rust-lang/crates.io-index"
794checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
795dependencies = [
796 "proc-macro2",
797 "quote",
798 "syn",
799]
800
801[[package]]
802name = "futures-sink"
803version = "0.3.31"
804source = "registry+https://github.com/rust-lang/crates.io-index"
805checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7"
806
807[[package]]
808name = "futures-task"
809version = "0.3.31"
810source = "registry+https://github.com/rust-lang/crates.io-index"
811checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988"
812
813[[package]]
814name = "futures-util"
815version = "0.3.31"
816source = "registry+https://github.com/rust-lang/crates.io-index"
817checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81"
818dependencies = [
819 "futures-channel",
820 "futures-core",
821 "futures-io",
822 "futures-macro",
823 "futures-sink",
824 "futures-task",
825 "memchr",
826 "pin-project-lite",
827 "pin-utils",
828 "slab",
829]
830
831[[package]]
832name = "generic-array"
833version = "0.14.7"
834source = "registry+https://github.com/rust-lang/crates.io-index"
835checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
836dependencies = [
837 "typenum",
838 "version_check",
839]
840
552841[[package]]
553842name = "getrandom"
554843version = "0.2.16"
@@ -582,6 +871,12 @@ dependencies = [
582871 "weezl",
583872]
584873
874[[package]]
875name = "gimli"
876version = "0.31.1"
877source = "registry+https://github.com/rust-lang/crates.io-index"
878checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
879
585880[[package]]
586881name = "half"
587882version = "2.6.0"
@@ -609,6 +904,12 @@ version = "0.5.0"
609904source = "registry+https://github.com/rust-lang/crates.io-index"
610905checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
611906
907[[package]]
908name = "hex"
909version = "0.4.3"
910source = "registry+https://github.com/rust-lang/crates.io-index"
911checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
912
612913[[package]]
613914name = "home"
614915version = "0.5.11"
@@ -618,6 +919,40 @@ dependencies = [
618919 "windows-sys 0.59.0",
619920]
620921
922[[package]]
923name = "http"
924version = "1.3.1"
925source = "registry+https://github.com/rust-lang/crates.io-index"
926checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565"
927dependencies = [
928 "bytes",
929 "fnv",
930 "itoa",
931]
932
933[[package]]
934name = "http-body"
935version = "1.0.1"
936source = "registry+https://github.com/rust-lang/crates.io-index"
937checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184"
938dependencies = [
939 "bytes",
940 "http",
941]
942
943[[package]]
944name = "http-body-util"
945version = "0.1.3"
946source = "registry+https://github.com/rust-lang/crates.io-index"
947checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a"
948dependencies = [
949 "bytes",
950 "futures-core",
951 "http",
952 "http-body",
953 "pin-project-lite",
954]
955
621956[[package]]
622957name = "http_req"
623958version = "0.12.0"
@@ -628,6 +963,71 @@ dependencies = [
628963 "unicase",
629964]
630965
966[[package]]
967name = "httparse"
968version = "1.10.1"
969source = "registry+https://github.com/rust-lang/crates.io-index"
970checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87"
971
972[[package]]
973name = "hyper"
974version = "1.6.0"
975source = "registry+https://github.com/rust-lang/crates.io-index"
976checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80"
977dependencies = [
978 "bytes",
979 "futures-channel",
980 "futures-util",
981 "http",
982 "http-body",
983 "httparse",
984 "itoa",
985 "pin-project-lite",
986 "smallvec",
987 "tokio",
988 "want",
989]
990
991[[package]]
992name = "hyper-tls"
993version = "0.6.0"
994source = "registry+https://github.com/rust-lang/crates.io-index"
995checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0"
996dependencies = [
997 "bytes",
998 "http-body-util",
999 "hyper",
1000 "hyper-util",
1001 "native-tls",
1002 "tokio",
1003 "tokio-native-tls",
1004 "tower-service",
1005]
1006
1007[[package]]
1008name = "hyper-util"
1009version = "0.1.16"
1010source = "registry+https://github.com/rust-lang/crates.io-index"
1011checksum = "8d9b05277c7e8da2c93a568989bb6207bef0112e8d17df7a6eda4a3cf143bc5e"
1012dependencies = [
1013 "base64",
1014 "bytes",
1015 "futures-channel",
1016 "futures-core",
1017 "futures-util",
1018 "http",
1019 "http-body",
1020 "hyper",
1021 "ipnet",
1022 "libc",
1023 "percent-encoding",
1024 "pin-project-lite",
1025 "socket2",
1026 "tokio",
1027 "tower-service",
1028 "tracing",
1029]
1030
6311031[[package]]
6321032name = "iana-time-zone"
6331033version = "0.1.63"
@@ -640,7 +1040,7 @@ dependencies = [
6401040 "js-sys",
6411041 "log",
6421042 "wasm-bindgen",
643 "windows-core",
1043 "windows-core 0.61.0",
6441044]
6451045
6461046[[package]]
@@ -652,12 +1052,119 @@ dependencies = [
6521052 "cc",
6531053]
6541054
1055[[package]]
1056name = "icu_collections"
1057version = "2.0.0"
1058source = "registry+https://github.com/rust-lang/crates.io-index"
1059checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47"
1060dependencies = [
1061 "displaydoc",
1062 "potential_utf",
1063 "yoke",
1064 "zerofrom",
1065 "zerovec",
1066]
1067
1068[[package]]
1069name = "icu_locale_core"
1070version = "2.0.0"
1071source = "registry+https://github.com/rust-lang/crates.io-index"
1072checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a"
1073dependencies = [
1074 "displaydoc",
1075 "litemap",
1076 "tinystr",
1077 "writeable",
1078 "zerovec",
1079]
1080
1081[[package]]
1082name = "icu_normalizer"
1083version = "2.0.0"
1084source = "registry+https://github.com/rust-lang/crates.io-index"
1085checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979"
1086dependencies = [
1087 "displaydoc",
1088 "icu_collections",
1089 "icu_normalizer_data",
1090 "icu_properties",
1091 "icu_provider",
1092 "smallvec",
1093 "zerovec",
1094]
1095
1096[[package]]
1097name = "icu_normalizer_data"
1098version = "2.0.0"
1099source = "registry+https://github.com/rust-lang/crates.io-index"
1100checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3"
1101
1102[[package]]
1103name = "icu_properties"
1104version = "2.0.1"
1105source = "registry+https://github.com/rust-lang/crates.io-index"
1106checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b"
1107dependencies = [
1108 "displaydoc",
1109 "icu_collections",
1110 "icu_locale_core",
1111 "icu_properties_data",
1112 "icu_provider",
1113 "potential_utf",
1114 "zerotrie",
1115 "zerovec",
1116]
1117
1118[[package]]
1119name = "icu_properties_data"
1120version = "2.0.1"
1121source = "registry+https://github.com/rust-lang/crates.io-index"
1122checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632"
1123
1124[[package]]
1125name = "icu_provider"
1126version = "2.0.0"
1127source = "registry+https://github.com/rust-lang/crates.io-index"
1128checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af"
1129dependencies = [
1130 "displaydoc",
1131 "icu_locale_core",
1132 "stable_deref_trait",
1133 "tinystr",
1134 "writeable",
1135 "yoke",
1136 "zerofrom",
1137 "zerotrie",
1138 "zerovec",
1139]
1140
6551141[[package]]
6561142name = "ident_case"
6571143version = "1.0.1"
6581144source = "registry+https://github.com/rust-lang/crates.io-index"
6591145checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
6601146
1147[[package]]
1148name = "idna"
1149version = "1.0.3"
1150source = "registry+https://github.com/rust-lang/crates.io-index"
1151checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e"
1152dependencies = [
1153 "idna_adapter",
1154 "smallvec",
1155 "utf8_iter",
1156]
1157
1158[[package]]
1159name = "idna_adapter"
1160version = "1.2.1"
1161source = "registry+https://github.com/rust-lang/crates.io-index"
1162checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344"
1163dependencies = [
1164 "icu_normalizer",
1165 "icu_properties",
1166]
1167
6611168[[package]]
6621169name = "image"
6631170version = "0.25.6"
@@ -748,10 +1255,37 @@ dependencies = [
7481255]
7491256
7501257[[package]]
751name = "itertools"
752version = "0.12.1"
1258name = "io-uring"
1259version = "0.7.9"
7531260source = "registry+https://github.com/rust-lang/crates.io-index"
754checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
1261checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4"
1262dependencies = [
1263 "bitflags 2.9.0",
1264 "cfg-if",
1265 "libc",
1266]
1267
1268[[package]]
1269name = "ipnet"
1270version = "2.11.0"
1271source = "registry+https://github.com/rust-lang/crates.io-index"
1272checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130"
1273
1274[[package]]
1275name = "iri-string"
1276version = "0.7.8"
1277source = "registry+https://github.com/rust-lang/crates.io-index"
1278checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2"
1279dependencies = [
1280 "memchr",
1281 "serde",
1282]
1283
1284[[package]]
1285name = "itertools"
1286version = "0.12.1"
1287source = "registry+https://github.com/rust-lang/crates.io-index"
1288checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
7551289dependencies = [
7561290 "either",
7571291]
@@ -852,12 +1386,28 @@ version = "0.9.4"
8521386source = "registry+https://github.com/rust-lang/crates.io-index"
8531387checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
8541388
1389[[package]]
1390name = "litemap"
1391version = "0.8.0"
1392source = "registry+https://github.com/rust-lang/crates.io-index"
1393checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956"
1394
8551395[[package]]
8561396name = "litrs"
8571397version = "0.4.1"
8581398source = "registry+https://github.com/rust-lang/crates.io-index"
8591399checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5"
8601400
1401[[package]]
1402name = "localzone"
1403version = "0.3.1"
1404source = "registry+https://github.com/rust-lang/crates.io-index"
1405checksum = "718530aa7b3842752f82224791ea1db5e6b7260513b8ab45706937dbf54f7b4d"
1406dependencies = [
1407 "js-sys",
1408 "windows",
1409]
1410
8611411[[package]]
8621412name = "lock_api"
8631413version = "0.4.12"
@@ -999,6 +1549,12 @@ dependencies = [
9991549 "num-traits",
10001550]
10011551
1552[[package]]
1553name = "num-conv"
1554version = "0.1.0"
1555source = "registry+https://github.com/rust-lang/crates.io-index"
1556checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9"
1557
10021558[[package]]
10031559name = "num-derive"
10041560version = "0.4.2"
@@ -1039,6 +1595,15 @@ dependencies = [
10391595 "autocfg",
10401596]
10411597
1598[[package]]
1599name = "num_threads"
1600version = "0.1.7"
1601source = "registry+https://github.com/rust-lang/crates.io-index"
1602checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9"
1603dependencies = [
1604 "libc",
1605]
1606
10421607[[package]]
10431608name = "objc"
10441609version = "0.2.7"
@@ -1068,6 +1633,15 @@ dependencies = [
10681633 "objc",
10691634]
10701635
1636[[package]]
1637name = "object"
1638version = "0.36.7"
1639source = "registry+https://github.com/rust-lang/crates.io-index"
1640checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87"
1641dependencies = [
1642 "memchr",
1643]
1644
10711645[[package]]
10721646name = "once_cell"
10731647version = "1.21.3"
@@ -1147,6 +1721,42 @@ version = "1.0.15"
11471721source = "registry+https://github.com/rust-lang/crates.io-index"
11481722checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
11491723
1724[[package]]
1725name = "percent-encoding"
1726version = "2.3.1"
1727source = "registry+https://github.com/rust-lang/crates.io-index"
1728checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e"
1729
1730[[package]]
1731name = "phf"
1732version = "0.11.3"
1733source = "registry+https://github.com/rust-lang/crates.io-index"
1734checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078"
1735dependencies = [
1736 "phf_shared",
1737]
1738
1739[[package]]
1740name = "phf_shared"
1741version = "0.11.3"
1742source = "registry+https://github.com/rust-lang/crates.io-index"
1743checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
1744dependencies = [
1745 "siphasher",
1746]
1747
1748[[package]]
1749name = "pin-project-lite"
1750version = "0.2.16"
1751source = "registry+https://github.com/rust-lang/crates.io-index"
1752checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b"
1753
1754[[package]]
1755name = "pin-utils"
1756version = "0.1.0"
1757source = "registry+https://github.com/rust-lang/crates.io-index"
1758checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
1759
11501760[[package]]
11511761name = "pkg-config"
11521762version = "0.3.32"
@@ -1166,6 +1776,21 @@ dependencies = [
11661776 "miniz_oxide",
11671777]
11681778
1779[[package]]
1780name = "potential_utf"
1781version = "0.1.2"
1782source = "registry+https://github.com/rust-lang/crates.io-index"
1783checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585"
1784dependencies = [
1785 "zerovec",
1786]
1787
1788[[package]]
1789name = "powerfmt"
1790version = "0.2.0"
1791source = "registry+https://github.com/rust-lang/crates.io-index"
1792checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
1793
11691794[[package]]
11701795name = "ppv-lite86"
11711796version = "0.2.21"
@@ -1240,8 +1865,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12401865checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
12411866dependencies = [
12421867 "libc",
1243 "rand_chacha",
1244 "rand_core",
1868 "rand_chacha 0.3.1",
1869 "rand_core 0.6.4",
1870]
1871
1872[[package]]
1873name = "rand"
1874version = "0.9.2"
1875source = "registry+https://github.com/rust-lang/crates.io-index"
1876checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1"
1877dependencies = [
1878 "rand_chacha 0.9.0",
1879 "rand_core 0.9.3",
12451880]
12461881
12471882[[package]]
@@ -1251,7 +1886,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
12511886checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
12521887dependencies = [
12531888 "ppv-lite86",
1254 "rand_core",
1889 "rand_core 0.6.4",
1890]
1891
1892[[package]]
1893name = "rand_chacha"
1894version = "0.9.0"
1895source = "registry+https://github.com/rust-lang/crates.io-index"
1896checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
1897dependencies = [
1898 "ppv-lite86",
1899 "rand_core 0.9.3",
12551900]
12561901
12571902[[package]]
@@ -1263,6 +1908,15 @@ dependencies = [
12631908 "getrandom 0.2.16",
12641909]
12651910
1911[[package]]
1912name = "rand_core"
1913version = "0.9.3"
1914source = "registry+https://github.com/rust-lang/crates.io-index"
1915checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38"
1916dependencies = [
1917 "getrandom 0.3.3",
1918]
1919
12661920[[package]]
12671921name = "ratatui"
12681922version = "0.29.0"
@@ -1311,11 +1965,11 @@ dependencies = [
13111965 "once_cell",
13121966 "paste",
13131967 "profiling",
1314 "rand",
1315 "rand_chacha",
1968 "rand 0.8.5",
1969 "rand_chacha 0.3.1",
13161970 "simd_helpers",
13171971 "system-deps",
1318 "thiserror",
1972 "thiserror 1.0.69",
13191973 "v_frame",
13201974 "wasm-bindgen",
13211975]
@@ -1353,6 +2007,84 @@ dependencies = [
13532007 "bitflags 2.9.0",
13542008]
13552009
2010[[package]]
2011name = "regex"
2012version = "1.11.1"
2013source = "registry+https://github.com/rust-lang/crates.io-index"
2014checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
2015dependencies = [
2016 "aho-corasick",
2017 "memchr",
2018 "regex-automata",
2019 "regex-syntax",
2020]
2021
2022[[package]]
2023name = "regex-automata"
2024version = "0.4.9"
2025source = "registry+https://github.com/rust-lang/crates.io-index"
2026checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
2027dependencies = [
2028 "aho-corasick",
2029 "memchr",
2030 "regex-syntax",
2031]
2032
2033[[package]]
2034name = "regex-syntax"
2035version = "0.8.5"
2036source = "registry+https://github.com/rust-lang/crates.io-index"
2037checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
2038
2039[[package]]
2040name = "reqwest"
2041version = "0.12.22"
2042source = "registry+https://github.com/rust-lang/crates.io-index"
2043checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
2044dependencies = [
2045 "async-compression",
2046 "base64",
2047 "bytes",
2048 "futures-core",
2049 "futures-util",
2050 "http",
2051 "http-body",
2052 "http-body-util",
2053 "hyper",
2054 "hyper-tls",
2055 "hyper-util",
2056 "js-sys",
2057 "log",
2058 "native-tls",
2059 "percent-encoding",
2060 "pin-project-lite",
2061 "rustls-pki-types",
2062 "serde",
2063 "serde_json",
2064 "serde_urlencoded",
2065 "sync_wrapper",
2066 "tokio",
2067 "tokio-native-tls",
2068 "tokio-util",
2069 "tower",
2070 "tower-http",
2071 "tower-service",
2072 "url",
2073 "wasm-bindgen",
2074 "wasm-bindgen-futures",
2075 "web-sys",
2076]
2077
2078[[package]]
2079name = "ress"
2080version = "0.11.7"
2081source = "registry+https://github.com/rust-lang/crates.io-index"
2082checksum = "0d77111a94ef694bb2fe9867a93e21007e2151943c9a48b2ed72734bde41875a"
2083dependencies = [
2084 "log",
2085 "unicode-xid",
2086]
2087
13562088[[package]]
13572089name = "rgb"
13582090version = "0.8.50"
@@ -1362,6 +2094,39 @@ dependencies = [
13622094 "bytemuck",
13632095]
13642096
2097[[package]]
2098name = "rquickjs"
2099version = "0.9.0"
2100source = "registry+https://github.com/rust-lang/crates.io-index"
2101checksum = "5c5227859c4dfc83f428e58f9569bf439e628c8d139020e7faff437e6f5abaa0"
2102dependencies = [
2103 "rquickjs-core",
2104]
2105
2106[[package]]
2107name = "rquickjs-core"
2108version = "0.9.0"
2109source = "registry+https://github.com/rust-lang/crates.io-index"
2110checksum = "e82e0ca83028ad5b533b53b96c395bbaab905a5774de4aaf1004eeacafa3d85d"
2111dependencies = [
2112 "rquickjs-sys",
2113]
2114
2115[[package]]
2116name = "rquickjs-sys"
2117version = "0.9.0"
2118source = "registry+https://github.com/rust-lang/crates.io-index"
2119checksum = "7fed0097b0b4fbb2a87f6dd3b995a7c64ca56de30007eb7e867dfdfc78324ba5"
2120dependencies = [
2121 "cc",
2122]
2123
2124[[package]]
2125name = "rustc-demangle"
2126version = "0.1.26"
2127source = "registry+https://github.com/rust-lang/crates.io-index"
2128checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace"
2129
13652130[[package]]
13662131name = "rustix"
13672132version = "0.38.44"
@@ -1388,12 +2153,50 @@ dependencies = [
13882153 "windows-sys 0.59.0",
13892154]
13902155
2156[[package]]
2157name = "rustls-pki-types"
2158version = "1.12.0"
2159source = "registry+https://github.com/rust-lang/crates.io-index"
2160checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79"
2161dependencies = [
2162 "zeroize",
2163]
2164
13912165[[package]]
13922166name = "rustversion"
13932167version = "1.0.20"
13942168source = "registry+https://github.com/rust-lang/crates.io-index"
13952169checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2"
13962170
2171[[package]]
2172name = "rustypipe"
2173version = "0.11.4"
2174source = "registry+https://github.com/rust-lang/crates.io-index"
2175checksum = "3bf8d7c42ac7860a078f63f90d6513dd3833585337e65b5fca9f74ddba2d59ef"
2176dependencies = [
2177 "data-encoding",
2178 "fancy-regex",
2179 "localzone",
2180 "once_cell",
2181 "phf",
2182 "rand 0.9.2",
2183 "regex",
2184 "reqwest",
2185 "ress",
2186 "rquickjs",
2187 "serde",
2188 "serde_json",
2189 "serde_plain",
2190 "serde_with",
2191 "sha1",
2192 "thiserror 2.0.12",
2193 "time",
2194 "tokio",
2195 "tracing",
2196 "url",
2197 "urlencoding",
2198]
2199
13972200[[package]]
13982201name = "ryu"
13992202version = "1.0.20"
@@ -1470,6 +2273,15 @@ dependencies = [
14702273 "serde",
14712274]
14722275
2276[[package]]
2277name = "serde_plain"
2278version = "1.0.2"
2279source = "registry+https://github.com/rust-lang/crates.io-index"
2280checksum = "9ce1fc6db65a611022b23a0dec6975d63fb80a302cb3388835ff02c097258d50"
2281dependencies = [
2282 "serde",
2283]
2284
14732285[[package]]
14742286name = "serde_spanned"
14752287version = "0.6.8"
@@ -1479,6 +2291,46 @@ dependencies = [
14792291 "serde",
14802292]
14812293
2294[[package]]
2295name = "serde_urlencoded"
2296version = "0.7.1"
2297source = "registry+https://github.com/rust-lang/crates.io-index"
2298checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
2299dependencies = [
2300 "form_urlencoded",
2301 "itoa",
2302 "ryu",
2303 "serde",
2304]
2305
2306[[package]]
2307name = "serde_with"
2308version = "3.14.0"
2309source = "registry+https://github.com/rust-lang/crates.io-index"
2310checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5"
2311dependencies = [
2312 "base64",
2313 "chrono",
2314 "hex",
2315 "serde",
2316 "serde_derive",
2317 "serde_json",
2318 "serde_with_macros",
2319 "time",
2320]
2321
2322[[package]]
2323name = "serde_with_macros"
2324version = "3.14.0"
2325source = "registry+https://github.com/rust-lang/crates.io-index"
2326checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f"
2327dependencies = [
2328 "darling",
2329 "proc-macro2",
2330 "quote",
2331 "syn",
2332]
2333
14822334[[package]]
14832335name = "serde_yaml_ng"
14842336version = "0.10.0"
@@ -1492,6 +2344,17 @@ dependencies = [
14922344 "unsafe-libyaml",
14932345]
14942346
2347[[package]]
2348name = "sha1"
2349version = "0.10.6"
2350source = "registry+https://github.com/rust-lang/crates.io-index"
2351checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
2352dependencies = [
2353 "cfg-if",
2354 "cpufeatures",
2355 "digest",
2356]
2357
14952358[[package]]
14962359name = "shlex"
14972360version = "1.3.0"
@@ -1543,6 +2406,12 @@ dependencies = [
15432406 "quote",
15442407]
15452408
2409[[package]]
2410name = "siphasher"
2411version = "1.0.1"
2412source = "registry+https://github.com/rust-lang/crates.io-index"
2413checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
2414
15462415[[package]]
15472416name = "sixel-rs"
15482417version = "0.3.3"
@@ -1561,12 +2430,34 @@ dependencies = [
15612430 "make-cmd",
15622431]
15632432
2433[[package]]
2434name = "slab"
2435version = "0.4.10"
2436source = "registry+https://github.com/rust-lang/crates.io-index"
2437checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d"
2438
15642439[[package]]
15652440name = "smallvec"
15662441version = "1.15.0"
15672442source = "registry+https://github.com/rust-lang/crates.io-index"
15682443checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
15692444
2445[[package]]
2446name = "socket2"
2447version = "0.6.0"
2448source = "registry+https://github.com/rust-lang/crates.io-index"
2449checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807"
2450dependencies = [
2451 "libc",
2452 "windows-sys 0.59.0",
2453]
2454
2455[[package]]
2456name = "stable_deref_trait"
2457version = "1.2.0"
2458source = "registry+https://github.com/rust-lang/crates.io-index"
2459checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
2460
15702461[[package]]
15712462name = "static_assertions"
15722463version = "1.1.0"
@@ -1612,6 +2503,26 @@ dependencies = [
16122503 "unicode-ident",
16132504]
16142505
2506[[package]]
2507name = "sync_wrapper"
2508version = "1.0.2"
2509source = "registry+https://github.com/rust-lang/crates.io-index"
2510checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263"
2511dependencies = [
2512 "futures-core",
2513]
2514
2515[[package]]
2516name = "synstructure"
2517version = "0.13.2"
2518source = "registry+https://github.com/rust-lang/crates.io-index"
2519checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
2520dependencies = [
2521 "proc-macro2",
2522 "quote",
2523 "syn",
2524]
2525
16152526[[package]]
16162527name = "system-deps"
16172528version = "6.2.2"
@@ -1659,7 +2570,16 @@ version = "1.0.69"
16592570source = "registry+https://github.com/rust-lang/crates.io-index"
16602571checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
16612572dependencies = [
1662 "thiserror-impl",
2573 "thiserror-impl 1.0.69",
2574]
2575
2576[[package]]
2577name = "thiserror"
2578version = "2.0.12"
2579source = "registry+https://github.com/rust-lang/crates.io-index"
2580checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708"
2581dependencies = [
2582 "thiserror-impl 2.0.12",
16632583]
16642584
16652585[[package]]
@@ -1673,6 +2593,17 @@ dependencies = [
16732593 "syn",
16742594]
16752595
2596[[package]]
2597name = "thiserror-impl"
2598version = "2.0.12"
2599source = "registry+https://github.com/rust-lang/crates.io-index"
2600checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d"
2601dependencies = [
2602 "proc-macro2",
2603 "quote",
2604 "syn",
2605]
2606
16762607[[package]]
16772608name = "tiff"
16782609version = "0.9.1"
@@ -1684,6 +2615,102 @@ dependencies = [
16842615 "weezl",
16852616]
16862617
2618[[package]]
2619name = "time"
2620version = "0.3.41"
2621source = "registry+https://github.com/rust-lang/crates.io-index"
2622checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40"
2623dependencies = [
2624 "deranged",
2625 "itoa",
2626 "libc",
2627 "num-conv",
2628 "num_threads",
2629 "powerfmt",
2630 "serde",
2631 "time-core",
2632 "time-macros",
2633]
2634
2635[[package]]
2636name = "time-core"
2637version = "0.1.4"
2638source = "registry+https://github.com/rust-lang/crates.io-index"
2639checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c"
2640
2641[[package]]
2642name = "time-macros"
2643version = "0.2.22"
2644source = "registry+https://github.com/rust-lang/crates.io-index"
2645checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49"
2646dependencies = [
2647 "num-conv",
2648 "time-core",
2649]
2650
2651[[package]]
2652name = "tinystr"
2653version = "0.8.1"
2654source = "registry+https://github.com/rust-lang/crates.io-index"
2655checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b"
2656dependencies = [
2657 "displaydoc",
2658 "zerovec",
2659]
2660
2661[[package]]
2662name = "tokio"
2663version = "1.47.0"
2664source = "registry+https://github.com/rust-lang/crates.io-index"
2665checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35"
2666dependencies = [
2667 "backtrace",
2668 "bytes",
2669 "io-uring",
2670 "libc",
2671 "mio",
2672 "pin-project-lite",
2673 "signal-hook-registry",
2674 "slab",
2675 "socket2",
2676 "tokio-macros",
2677 "windows-sys 0.59.0",
2678]
2679
2680[[package]]
2681name = "tokio-macros"
2682version = "2.5.0"
2683source = "registry+https://github.com/rust-lang/crates.io-index"
2684checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8"
2685dependencies = [
2686 "proc-macro2",
2687 "quote",
2688 "syn",
2689]
2690
2691[[package]]
2692name = "tokio-native-tls"
2693version = "0.3.1"
2694source = "registry+https://github.com/rust-lang/crates.io-index"
2695checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2"
2696dependencies = [
2697 "native-tls",
2698 "tokio",
2699]
2700
2701[[package]]
2702name = "tokio-util"
2703version = "0.7.15"
2704source = "registry+https://github.com/rust-lang/crates.io-index"
2705checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df"
2706dependencies = [
2707 "bytes",
2708 "futures-core",
2709 "futures-sink",
2710 "pin-project-lite",
2711 "tokio",
2712]
2713
16872714[[package]]
16882715name = "toml"
16892716version = "0.8.22"
@@ -1718,12 +2745,95 @@ dependencies = [
17182745 "winnow",
17192746]
17202747
2748[[package]]
2749name = "tower"
2750version = "0.5.2"
2751source = "registry+https://github.com/rust-lang/crates.io-index"
2752checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9"
2753dependencies = [
2754 "futures-core",
2755 "futures-util",
2756 "pin-project-lite",
2757 "sync_wrapper",
2758 "tokio",
2759 "tower-layer",
2760 "tower-service",
2761]
2762
2763[[package]]
2764name = "tower-http"
2765version = "0.6.6"
2766source = "registry+https://github.com/rust-lang/crates.io-index"
2767checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2"
2768dependencies = [
2769 "bitflags 2.9.0",
2770 "bytes",
2771 "futures-util",
2772 "http",
2773 "http-body",
2774 "iri-string",
2775 "pin-project-lite",
2776 "tower",
2777 "tower-layer",
2778 "tower-service",
2779]
2780
2781[[package]]
2782name = "tower-layer"
2783version = "0.3.3"
2784source = "registry+https://github.com/rust-lang/crates.io-index"
2785checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e"
2786
2787[[package]]
2788name = "tower-service"
2789version = "0.3.3"
2790source = "registry+https://github.com/rust-lang/crates.io-index"
2791checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
2792
2793[[package]]
2794name = "tracing"
2795version = "0.1.41"
2796source = "registry+https://github.com/rust-lang/crates.io-index"
2797checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
2798dependencies = [
2799 "log",
2800 "pin-project-lite",
2801 "tracing-attributes",
2802 "tracing-core",
2803]
2804
2805[[package]]
2806name = "tracing-attributes"
2807version = "0.1.30"
2808source = "registry+https://github.com/rust-lang/crates.io-index"
2809checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903"
2810dependencies = [
2811 "proc-macro2",
2812 "quote",
2813 "syn",
2814]
2815
2816[[package]]
2817name = "tracing-core"
2818version = "0.1.34"
2819source = "registry+https://github.com/rust-lang/crates.io-index"
2820checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
2821dependencies = [
2822 "once_cell",
2823]
2824
17212825[[package]]
17222826name = "traitobject"
17232827version = "0.1.1"
17242828source = "registry+https://github.com/rust-lang/crates.io-index"
17252829checksum = "04a79e25382e2e852e8da874249358d382ebaf259d0d34e75d8db16a7efabbc7"
17262830
2831[[package]]
2832name = "try-lock"
2833version = "0.2.5"
2834source = "registry+https://github.com/rust-lang/crates.io-index"
2835checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
2836
17272837[[package]]
17282838name = "tui-additions"
17292839version = "0.4.1"
@@ -1746,6 +2856,12 @@ dependencies = [
17462856 "unsafe-any",
17472857]
17482858
2859[[package]]
2860name = "typenum"
2861version = "1.18.0"
2862source = "registry+https://github.com/rust-lang/crates.io-index"
2863checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f"
2864
17492865[[package]]
17502866name = "unicase"
17512867version = "2.8.1"
@@ -1787,6 +2903,12 @@ version = "0.2.0"
17872903source = "registry+https://github.com/rust-lang/crates.io-index"
17882904checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
17892905
2906[[package]]
2907name = "unicode-xid"
2908version = "0.2.6"
2909source = "registry+https://github.com/rust-lang/crates.io-index"
2910checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853"
2911
17902912[[package]]
17912913name = "unsafe-any"
17922914version = "0.4.2"
@@ -1802,12 +2924,29 @@ version = "0.2.11"
18022924source = "registry+https://github.com/rust-lang/crates.io-index"
18032925checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
18042926
2927[[package]]
2928name = "url"
2929version = "2.5.4"
2930source = "registry+https://github.com/rust-lang/crates.io-index"
2931checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60"
2932dependencies = [
2933 "form_urlencoded",
2934 "idna",
2935 "percent-encoding",
2936]
2937
18052938[[package]]
18062939name = "urlencoding"
18072940version = "2.1.3"
18082941source = "registry+https://github.com/rust-lang/crates.io-index"
18092942checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
18102943
2944[[package]]
2945name = "utf8_iter"
2946version = "1.0.4"
2947source = "registry+https://github.com/rust-lang/crates.io-index"
2948checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be"
2949
18112950[[package]]
18122951name = "v_frame"
18132952version = "0.3.8"
@@ -1831,6 +2970,12 @@ version = "0.2.0"
18312970source = "registry+https://github.com/rust-lang/crates.io-index"
18322971checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b"
18332972
2973[[package]]
2974name = "version_check"
2975version = "0.9.5"
2976source = "registry+https://github.com/rust-lang/crates.io-index"
2977checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
2978
18342979[[package]]
18352980name = "viuer"
18362981version = "0.9.1"
@@ -1848,6 +2993,15 @@ dependencies = [
18482993 "termcolor",
18492994]
18502995
2996[[package]]
2997name = "want"
2998version = "0.3.1"
2999source = "registry+https://github.com/rust-lang/crates.io-index"
3000checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e"
3001dependencies = [
3002 "try-lock",
3003]
3004
18513005[[package]]
18523006name = "wasi"
18533007version = "0.11.0+wasi-snapshot-preview1"
@@ -1889,6 +3043,19 @@ dependencies = [
18893043 "wasm-bindgen-shared",
18903044]
18913045
3046[[package]]
3047name = "wasm-bindgen-futures"
3048version = "0.4.50"
3049source = "registry+https://github.com/rust-lang/crates.io-index"
3050checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61"
3051dependencies = [
3052 "cfg-if",
3053 "js-sys",
3054 "once_cell",
3055 "wasm-bindgen",
3056 "web-sys",
3057]
3058
18923059[[package]]
18933060name = "wasm-bindgen-macro"
18943061version = "0.2.100"
@@ -1921,6 +3088,16 @@ dependencies = [
19213088 "unicode-ident",
19223089]
19233090
3091[[package]]
3092name = "web-sys"
3093version = "0.3.77"
3094source = "registry+https://github.com/rust-lang/crates.io-index"
3095checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2"
3096dependencies = [
3097 "js-sys",
3098 "wasm-bindgen",
3099]
3100
19243101[[package]]
19253102name = "weezl"
19263103version = "0.1.8"
@@ -1958,6 +3135,26 @@ version = "0.4.0"
19583135source = "registry+https://github.com/rust-lang/crates.io-index"
19593136checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
19603137
3138[[package]]
3139name = "windows"
3140version = "0.54.0"
3141source = "registry+https://github.com/rust-lang/crates.io-index"
3142checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49"
3143dependencies = [
3144 "windows-core 0.54.0",
3145 "windows-targets",
3146]
3147
3148[[package]]
3149name = "windows-core"
3150version = "0.54.0"
3151source = "registry+https://github.com/rust-lang/crates.io-index"
3152checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65"
3153dependencies = [
3154 "windows-result 0.1.2",
3155 "windows-targets",
3156]
3157
19613158[[package]]
19623159name = "windows-core"
19633160version = "0.61.0"
@@ -1967,7 +3164,7 @@ dependencies = [
19673164 "windows-implement",
19683165 "windows-interface",
19693166 "windows-link",
1970 "windows-result",
3167 "windows-result 0.3.2",
19713168 "windows-strings",
19723169]
19733170
@@ -1999,6 +3196,15 @@ version = "0.1.1"
19993196source = "registry+https://github.com/rust-lang/crates.io-index"
20003197checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
20013198
3199[[package]]
3200name = "windows-result"
3201version = "0.1.2"
3202source = "registry+https://github.com/rust-lang/crates.io-index"
3203checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
3204dependencies = [
3205 "windows-targets",
3206]
3207
20023208[[package]]
20033209name = "windows-result"
20043210version = "0.3.2"
@@ -2117,6 +3323,12 @@ dependencies = [
21173323 "bitflags 2.9.0",
21183324]
21193325
3326[[package]]
3327name = "writeable"
3328version = "0.6.1"
3329source = "registry+https://github.com/rust-lang/crates.io-index"
3330checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
3331
21203332[[package]]
21213333name = "x11-clipboard"
21223334version = "0.3.3"
@@ -2136,21 +3348,48 @@ dependencies = [
21363348 "log",
21373349]
21383350
3351[[package]]
3352name = "yoke"
3353version = "0.8.0"
3354source = "registry+https://github.com/rust-lang/crates.io-index"
3355checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc"
3356dependencies = [
3357 "serde",
3358 "stable_deref_trait",
3359 "yoke-derive",
3360 "zerofrom",
3361]
3362
3363[[package]]
3364name = "yoke-derive"
3365version = "0.8.0"
3366source = "registry+https://github.com/rust-lang/crates.io-index"
3367checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6"
3368dependencies = [
3369 "proc-macro2",
3370 "quote",
3371 "syn",
3372 "synstructure",
3373]
3374
21393375[[package]]
21403376name = "youtube-tui"
2141version = "0.8.3"
3377version = "0.9.0"
21423378dependencies = [
21433379 "chrono",
21443380 "clipboard",
21453381 "crossterm 0.29.0",
21463382 "dyn-clone",
3383 "futures",
21473384 "home",
21483385 "invidious",
21493386 "libmpv-sirno",
21503387 "ratatui",
3388 "rustypipe",
21513389 "serde",
21523390 "serde_json",
21533391 "serde_yaml_ng",
3392 "tokio",
21543393 "tui-additions",
21553394 "typemap",
21563395 "unicode-segmentation",
@@ -2178,6 +3417,66 @@ dependencies = [
21783417 "syn",
21793418]
21803419
3420[[package]]
3421name = "zerofrom"
3422version = "0.1.6"
3423source = "registry+https://github.com/rust-lang/crates.io-index"
3424checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
3425dependencies = [
3426 "zerofrom-derive",
3427]
3428
3429[[package]]
3430name = "zerofrom-derive"
3431version = "0.1.6"
3432source = "registry+https://github.com/rust-lang/crates.io-index"
3433checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
3434dependencies = [
3435 "proc-macro2",
3436 "quote",
3437 "syn",
3438 "synstructure",
3439]
3440
3441[[package]]
3442name = "zeroize"
3443version = "1.8.1"
3444source = "registry+https://github.com/rust-lang/crates.io-index"
3445checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde"
3446
3447[[package]]
3448name = "zerotrie"
3449version = "0.2.2"
3450source = "registry+https://github.com/rust-lang/crates.io-index"
3451checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595"
3452dependencies = [
3453 "displaydoc",
3454 "yoke",
3455 "zerofrom",
3456]
3457
3458[[package]]
3459name = "zerovec"
3460version = "0.11.2"
3461source = "registry+https://github.com/rust-lang/crates.io-index"
3462checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428"
3463dependencies = [
3464 "yoke",
3465 "zerofrom",
3466 "zerovec-derive",
3467]
3468
3469[[package]]
3470name = "zerovec-derive"
3471version = "0.11.1"
3472source = "registry+https://github.com/rust-lang/crates.io-index"
3473checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f"
3474dependencies = [
3475 "proc-macro2",
3476 "quote",
3477 "syn",
3478]
3479
21813480[[package]]
21823481name = "zune-core"
21833482version = "0.4.12"
Cargo.toml +5 −1
@@ -1,6 +1,6 @@
11[package]
22name = "youtube-tui"
3version = "0.8.3"
3version = "0.9.0"
44authors = ["Siriusmart <siriusmart@tuta.io>"]
55edition = "2021"
66description = "An aesthetically pleasing YouTube TUI written in Rust"
@@ -40,6 +40,10 @@ ratatui = {version = "0.29", default-features = false, features = ["serde"]}
4040unicode-segmentation = "1"
4141libmpv-sirno = { version = "2.0.2-fork.1", optional = true }
4242
43rustypipe = "0.11"
44futures = { version = "0.3", features = [ "executor" ] }
45tokio = { version = "1", features = [ "rt" ]}
46
4347# libmpv = { path = "libmpv-rs", optional = true, version = "2" }
4448# tui-additions = {path = "../Rust/tui-additions", default-features = false, features = ["framework", "widgets"]}
4549# invidious = {path = "../Rust/invidious-rs"}
src/config/main.rs +50 −1
@@ -1,4 +1,10 @@
1use crate::global::traits::ConfigTrait;
1use crate::{
2 global::{
3 structs::{InvidiousClient, RustyPipeWrapper},
4 traits::{ConfigTrait, SearchProviderTrait},
5 },
6 MAIN_CONFIG,
7};
28use serde::{Deserialize, Serialize};
39use std::collections::HashMap;
410use typemap::Key;
@@ -31,6 +37,10 @@ pub struct MainConfig {
3137 pub image_index: usize,
3238 #[serde(default = "provider_default")]
3339 pub provider: Provider,
40 #[serde(default = "search_provider_default")]
41 pub search_provider: SearchProvider,
42 #[serde(default = "api_key_default")]
43 pub api_key: String,
3444 #[serde(default = "shell_default")]
3545 pub shell: String,
3646 #[serde(default = "legacy_input_handling_default")]
@@ -58,6 +68,8 @@ impl Default for MainConfig {
5868 limits: Limits::default(),
5969 syncing: sync_config_default(),
6070 provider: provider_default(),
71 search_provider: search_provider_default(),
72 api_key: api_key_default(),
6173 shell: shell_default(),
6274 legacy_input_handling: legacy_input_handling_default(),
6375
@@ -135,6 +147,35 @@ pub enum Provider {
135147 Invidious,
136148}
137149
150#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Hash)]
151pub enum SearchProvider {
152 Invidious,
153 RustyPipe,
154}
155
156impl SearchProvider {
157 pub fn create(&self) -> Box<dyn SearchProviderTrait> {
158 match self {
159 Self::Invidious => Box::new(InvidiousClient::new(
160 unsafe { MAIN_CONFIG.get() }
161 .unwrap()
162 .invidious_instance
163 .clone(),
164 )),
165 Self::RustyPipe => Box::new(RustyPipeWrapper::default()),
166 }
167 }
168}
169
170impl SearchProvider {
171 pub fn as_str(&self) -> &str {
172 match self {
173 Self::Invidious => "Invidious",
174 Self::RustyPipe => "RustyPipe",
175 }
176 }
177}
178
138179#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Eq)]
139180pub enum WriteConfig {
140181 Must,
@@ -188,6 +229,10 @@ const fn provider_default() -> Provider {
188229 Provider::YouTube
189230}
190231
232const fn search_provider_default() -> SearchProvider {
233 SearchProvider::RustyPipe
234}
235
191236const fn search_history_default() -> usize {
192237 75
193238}
@@ -232,6 +277,10 @@ fn shell_default() -> String {
232277 String::from("sh")
233278}
234279
280fn api_key_default() -> String {
281 String::from("YOUR API KEY HERE")
282}
283
235284const fn download_images_default() -> bool {
236285 true
237286}
src/global/functions/run_command.rs +6 −24
@@ -328,13 +328,6 @@ pub fn run_single_command(
328328 }
329329 };
330330
331 let client = framework
332 .data
333 .global
334 .get::<InvidiousClient>()
335 .unwrap()
336 .clone();
337
338331 *framework.data.global.get_mut::<Message>().unwrap() =
339332 Message::Message(String::from("Syncing..."));
340333 terminal.draw(|frame| framework.render(frame)).unwrap();
@@ -346,16 +339,11 @@ pub fn run_single_command(
346339
347340 let subscriptions = framework.data.global.get_mut::<Subscriptions>().unwrap();
348341
349 let message = match subscriptions.sync_one(
350 &id,
351 &client,
352 image_index,
353 download_thumbnails,
354 &syncing,
355 ) {
356 Ok(()) => Message::Success(String::from("Channel synced")),
357 Err(e) => Message::Error(format!("Sync failed: {e}")),
358 };
342 let message =
343 match subscriptions.sync_one(&id, image_index, download_thumbnails, &syncing) {
344 Ok(()) => Message::Success(String::from("Channel synced")),
345 Err(e) => Message::Error(format!("Sync failed: {e}")),
346 };
359347
360348 if framework.data.state.get::<Page>().unwrap() == &Page::Feed {
361349 let tasks = framework.data.state.get_mut::<Tasks>().unwrap();
@@ -434,12 +422,6 @@ pub fn run_single_command(
434422 Message::Message(String::from("Syncing..."));
435423 terminal.draw(|frame| framework.render(frame)).unwrap();
436424
437 let client = framework
438 .data
439 .global
440 .get::<InvidiousClient>()
441 .unwrap()
442 .clone();
443425 let mainconfig = framework.data.global.get::<MainConfig>().unwrap();
444426 let image_index = mainconfig.image_index;
445427 let download_thumbnails = mainconfig.images.display();
@@ -450,7 +432,7 @@ pub fn run_single_command(
450432 .global
451433 .get_mut::<Subscriptions>()
452434 .unwrap()
453 .sync(&client, image_index, download_thumbnails, syncing);
435 .sync(image_index, download_thumbnails, syncing);
454436
455437 let message = Message::Success(format!(
456438 "Subscriptions synced: {success} success{} | {failed} fail | {cached} cached",
src/global/functions/singleitem_load.rs +9 −14
@@ -1,13 +1,12 @@
1use crate::{config::MainConfig, global::functions::download_all_images, global::structs::Item};
2use invidious::{ClientSync, ClientSyncTrait};
1use crate::{
2 config::MainConfig,
3 global::{functions::download_all_images, structs::Item, traits::SearchProviderWrapper},
4};
35use std::error::Error;
46
5pub fn load_playlist(
6 client: &ClientSync,
7 id: &str,
8 mainconfig: &MainConfig,
9) -> Result<Item, Box<dyn Error>> {
10 let playlist = Item::from_full_playlist(client.playlist(id, None)?, mainconfig.image_index);
7pub fn load_playlist(id: &str, mainconfig: &MainConfig) -> Result<Item, Box<dyn Error>> {
8 let playlist =
9 Item::from_full_playlist(SearchProviderWrapper::playlist(id)?, mainconfig.image_index);
1110 let videos = &playlist.fullplaylist()?.videos;
1211
1312 if mainconfig.images.display() {
@@ -21,12 +20,8 @@ pub fn load_playlist(
2120 Ok(playlist)
2221}
2322
24pub fn load_video(
25 client: &ClientSync,
26 id: &str,
27 mainconfig: &MainConfig,
28) -> Result<Item, Box<dyn Error>> {
29 let video = Item::from_full_video(client.video(id, None)?, mainconfig.image_index);
23pub fn load_video(id: &str, mainconfig: &MainConfig) -> Result<Item, Box<dyn Error>> {
24 let video = Item::from_full_video(SearchProviderWrapper::video(id)?, mainconfig.image_index);
3025 if mainconfig.images.display() {
3126 download_all_images(vec![(&video).into()]);
3227 }
src/global/structs/invidiousclient.rs +94 −4
@@ -1,5 +1,6 @@
1use invidious::ClientSync;
2use typemap::Key;
1use invidious::{ClientSync, ClientSyncTrait};
2
3use crate::global::traits::SearchProviderTrait;
34
45// used in `data.global`
56/// Holds the invidious client
@@ -12,6 +13,95 @@ impl InvidiousClient {
1213 }
1314}
1415
15impl Key for InvidiousClient {
16 type Value = Self;
16impl SearchProviderTrait for InvidiousClient {
17 fn supports_video(&self) -> bool {
18 true
19 }
20
21 fn video(&self, id: &str) -> Result<invidious::video::Video, Box<dyn std::error::Error>> {
22 self.0.video(id, None).map_err(|e| e.into())
23 }
24
25 fn supports_search(&self) -> bool {
26 true
27 }
28
29 fn search(
30 &self,
31 filters: &crate::config::Search,
32 ) -> Result<Vec<invidious::hidden::SearchItem>, Box<dyn std::error::Error>> {
33 self.0
34 .search(Some(&filters.to_string()))
35 .map(|res| res.items)
36 .map_err(|e| e.into())
37 }
38
39 fn supports_channel(&self) -> bool {
40 true
41 }
42
43 fn channel(&self, id: &str) -> Result<invidious::channel::Channel, Box<dyn std::error::Error>> {
44 self.0.channel(id, None).map_err(|e| e.into())
45 }
46
47 fn supports_popular(&self) -> bool {
48 true
49 }
50
51 fn popular(&self) -> Result<Vec<invidious::hidden::PopularItem>, Box<dyn std::error::Error>> {
52 self.0
53 .popular(None)
54 .map(|res| res.items)
55 .map_err(|e| e.into())
56 }
57
58 fn supports_trending(&self) -> bool {
59 true
60 }
61
62 fn trending(&self) -> Result<Vec<invidious::CommonVideo>, Box<dyn std::error::Error>> {
63 self.0
64 .trending(None)
65 .map(|res| res.videos)
66 .map_err(|e| e.into())
67 }
68
69 fn supports_playlist(&self) -> bool {
70 true
71 }
72
73 fn playlist(
74 &self,
75 id: &str,
76 ) -> Result<invidious::universal::Playlist, Box<dyn std::error::Error>> {
77 self.0.playlist(id, None).map_err(|e| e.into())
78 }
79
80 fn supports_channel_videos(&self) -> bool {
81 true
82 }
83
84 fn channel_videos(
85 &self,
86 id: &str,
87 ) -> Result<Vec<invidious::CommonVideo>, Box<dyn std::error::Error>> {
88 self.0
89 .channel_videos(id, None)
90 .map(|res| res.videos)
91 .map_err(|e| e.into())
92 }
93
94 fn supports_channel_playlists(&self) -> bool {
95 true
96 }
97
98 fn channel_playlists(
99 &self,
100 id: &str,
101 ) -> Result<Vec<invidious::CommonPlaylist>, Box<dyn std::error::Error>> {
102 self.0
103 .channel_playlists(id, None)
104 .map(|res| res.playlists)
105 .map_err(|e| e.into())
106 }
17107}
src/global/structs/item.rs +47 −6
@@ -299,7 +299,13 @@ impl Item {
299299 Self::MiniVideo(MiniVideoItem {
300300 title: original.title,
301301 id: original.id,
302 thumbnail_url: original.thumbnails[image_index].url.clone(),
302 thumbnail_url: if original.thumbnails.is_empty() {
303 String::new()
304 } else {
305 original.thumbnails[image_index.min(original.thumbnails.len() - 1)]
306 .url
307 .clone()
308 },
303309 length: secs_display_string(original.length),
304310 views: Some(viewcount_text(original.views)),
305311 channel: original.author,
@@ -331,7 +337,18 @@ impl Item {
331337 Self::MiniChannel(MiniChannelItem {
332338 name: original.name,
333339 id: original.id,
334 thumbnail_url: format!("https://{}", original.thumbnails[image_index].url),
340 thumbnail_url: if !original.thumbnails.is_empty() {
341 let url = original.thumbnails[image_index.min(original.thumbnails.len() - 1)]
342 .url
343 .clone();
344 if url.starts_with("https://") {
345 url
346 } else {
347 format!("https://{url}")
348 }
349 } else {
350 "".to_string()
351 },
335352 video_count: original.video_count,
336353 sub_count: original.subscribers,
337354 sub_count_text: viewcount_text(original.subscribers as u64),
@@ -344,7 +361,13 @@ impl Item {
344361 Self::MiniVideo(MiniVideoItem {
345362 title: original.title,
346363 id: original.id,
347 thumbnail_url: original.thumbnails[image_index].url.clone(),
364 thumbnail_url: if !original.thumbnails.is_empty() {
365 original.thumbnails[image_index.min(original.thumbnails.len() - 1)]
366 .url
367 .clone()
368 } else {
369 "".to_string()
370 },
348371 length: secs_display_string(original.length),
349372 views: Some(viewcount_text(original.views)),
350373 channel: original.author,
@@ -373,7 +396,13 @@ impl Item {
373396 Self::FullVideo(FullVideoItem {
374397 title: original.title,
375398 id: original.id,
376 thumbnail_url: original.thumbnails[image_index].url.clone(),
399 thumbnail_url: if !original.thumbnails.is_empty() {
400 original.thumbnails[image_index.min(original.thumbnails.len() - 1)]
401 .url
402 .clone()
403 } else {
404 "".to_string()
405 },
377406 length: secs_display_string(original.length),
378407 views: viewcount_text(original.views),
379408 channel: original.author,
@@ -414,7 +443,13 @@ impl Item {
414443 Self::MiniVideo(MiniVideoItem {
415444 title: original.title,
416445 id: original.id,
417 thumbnail_url: original.thumbnails[image_index].url.clone(),
446 thumbnail_url: if !original.thumbnails.is_empty() {
447 original.thumbnails[image_index.min(original.thumbnails.len() - 1)]
448 .url
449 .clone()
450 } else {
451 "".to_string()
452 },
418453 length: secs_display_string(original.length),
419454 views: None,
420455 channel: original.author,
@@ -430,7 +465,13 @@ impl Item {
430465 Self::FullChannel(FullChannelItem {
431466 name: original.name,
432467 id: original.id,
433 thumbnail_url: original.thumbnails[image_index].url.clone(),
468 thumbnail_url: if !original.thumbnails.is_empty() {
469 original.thumbnails[image_index.min(original.thumbnails.len() - 1)]
470 .url
471 .clone()
472 } else {
473 "".to_string()
474 },
434475 sub_count: original.subscribers,
435476 sub_count_text: viewcount_text(original.subscribers as u64),
436477 total_views: viewcount_text(original.total_views),
src/global/structs/mod.rs +2
@@ -9,6 +9,7 @@ mod message;
99#[cfg(feature = "mpv")]
1010mod mpv;
1111mod page;
12mod rustypipe;
1213mod state_env;
1314mod status;
1415mod subscriptions;
@@ -24,6 +25,7 @@ pub use message::*;
2425#[cfg(feature = "mpv")]
2526pub use mpv::*;
2627pub use page::*;
28pub use rustypipe::*;
2729pub use state_env::*;
2830pub use status::*;
2931pub use subscriptions::*;
src/global/structs/rustypipe.rs added +432
@@ -0,0 +1,432 @@
1use invidious::{
2 channel::Channel, hidden::SearchItem, universal::Playlist, video::Video, CommonChannel,
3 CommonImage, CommonPlaylist, CommonThumbnail, CommonVideo,
4};
5use rustypipe::{
6 client::RustyPipe,
7 model::{
8 richtext::{ToHtml, ToPlaintext},
9 ChannelItem, PlaylistItem, Thumbnail, VideoItem, YouTubeItem,
10 },
11 param::search_filter::{ItemType, Length, Order, SearchFilter, UploadDate},
12};
13
14use crate::{
15 config::{SearchFilterDate, SearchFilterDuration, SearchFilterSort, SearchFilterType},
16 global::{functions::viewcount_text, traits::SearchProviderTrait},
17 RUNTIME,
18};
19
20#[derive(Clone)]
21pub struct RustyPipeWrapper(RustyPipe);
22
23impl Default for RustyPipeWrapper {
24 fn default() -> Self {
25 Self(
26 RustyPipe::builder()
27 .storage_dir(home::home_dir().unwrap().join(".local/share/rustypipe"))
28 .build()
29 .unwrap(),
30 )
31 }
32}
33
34fn thumbnail_convert(thumb: Thumbnail) -> CommonThumbnail {
35 CommonThumbnail {
36 quality: "unknown".to_string(),
37 url: thumb.url,
38 width: thumb.width,
39 height: thumb.height,
40 }
41}
42
43fn image_convert(thumb: Thumbnail) -> CommonImage {
44 CommonImage {
45 url: thumb.url,
46 width: thumb.width,
47 height: thumb.height,
48 }
49}
50
51fn video_item_convert(video: VideoItem) -> CommonVideo {
52 invidious::CommonVideo {
53 title: video.name,
54 id: video.id,
55 author: video
56 .channel
57 .clone()
58 .map(|c| c.name)
59 .unwrap_or("Unknown channel".to_string()),
60 author_id: video
61 .channel
62 .clone()
63 .map(|c| c.id)
64 .unwrap_or("Unknown channel id".to_string()),
65 author_url: video
66 .channel
67 .map(|c| format!("https://www.youtube.com/channel/{}", c.id))
68 .unwrap_or("Unknown channel id".to_string()),
69 thumbnails: video.thumbnail.into_iter().map(thumbnail_convert).collect(),
70 description: video.short_description.clone().unwrap_or_default(),
71 description_html: video.short_description.unwrap_or_default(),
72 views: video.view_count.unwrap_or_default(),
73 length: video.duration.unwrap_or_default(),
74 published: video
75 .publish_date
76 .map(|t| t.unix_timestamp() as u64)
77 .unwrap_or_default(),
78 published_text: video
79 .publish_date_txt
80 .unwrap_or("Unknown publish date".to_string()),
81 premiere_timestamp: 0,
82 live: video.is_live,
83 premium: false,
84 upcoming: video.is_upcoming,
85 }
86}
87
88fn playlist_item_convert(playlist: PlaylistItem) -> CommonPlaylist {
89 invidious::CommonPlaylist {
90 title: playlist.name,
91 id: playlist.id,
92 thumbnail: playlist
93 .thumbnail
94 .into_iter()
95 .map(|item| item.url)
96 .collect(),
97 author: playlist
98 .channel
99 .clone()
100 .map(|c| c.name)
101 .unwrap_or("Unknown channel".to_string()),
102 author_id: playlist
103 .channel
104 .clone()
105 .map(|c| c.id)
106 .unwrap_or("Unknown channel id".to_string()),
107 author_verified: playlist
108 .channel
109 .map(|c| c.verification.verified())
110 .unwrap_or_default(),
111 video_count: playlist.video_count.unwrap_or_default() as i32,
112 videos: Vec::new(),
113 }
114}
115
116fn channel_item_convert(channel: ChannelItem) -> CommonChannel {
117 invidious::CommonChannel {
118 name: channel.name,
119 url: format!("https://www.youtube.com/channel/{}", channel.id),
120 id: channel.id,
121 verified: channel.verification.verified(),
122 thumbnails: channel.avatar.into_iter().map(image_convert).collect(),
123 auto_generated: false,
124 subscribers: channel.subscriber_count.unwrap_or_default() as u32,
125 video_count: 0,
126 description: channel.short_description.clone(),
127 description_html: channel.short_description,
128 }
129}
130
131impl SearchProviderTrait for RustyPipeWrapper {
132 fn supports_video(&self) -> bool {
133 true
134 }
135
136 fn video(&self, id: &str) -> Result<invidious::video::Video, Box<dyn std::error::Error>> {
137 let query = self.0.query();
138 let (player, details) = RUNTIME
139 .get()
140 .unwrap()
141 .block_on(async { futures::join!(query.player(id), query.video_details(id)) });
142
143 let player = player?;
144 let details = details?;
145
146 Ok(Video {
147 r#type: "video".to_string(),
148 title: player
149 .details
150 .name
151 .unwrap_or("<Unable to fetch video name>".to_string()),
152 id: player.details.id,
153 thumbnails: player
154 .details
155 .thumbnail
156 .iter()
157 .cloned()
158 .map(thumbnail_convert)
159 .collect(),
160 storyboards: Vec::new(),
161 description: details.description.to_plaintext(),
162 description_html: details.description.to_html(),
163 published: details
164 .publish_date
165 .map(|time| time.to_utc().unix_timestamp() as u64)
166 .unwrap_or_default(),
167 published_text: details
168 .publish_date_txt
169 .unwrap_or("Unknown publish date".to_string()),
170 keywords: player.details.keywords,
171 views: details.view_count,
172 likes: details.like_count.unwrap_or_default(),
173 dislikes: 0, // TODO
174 paid: false,
175 premium: false,
176 family_friendly: false,
177 allowed_regions: Vec::new(),
178 genre: String::from("Unknown genre"),
179 genre_url: None,
180 author: details.channel.name,
181 author_id: details.channel.id.clone(),
182 author_url: format!("https://www.youtube.com/channel/{}", details.channel.id),
183 author_thumbnails: details
184 .channel
185 .avatar
186 .iter()
187 .cloned()
188 .map(image_convert)
189 .collect(),
190 sub_count_text: viewcount_text(details.channel.subscriber_count.unwrap_or(0)),
191 length: player.details.duration,
192 allow_ratings: true,
193 rating: 0_f32,
194 listed: true,
195 live: player.details.is_live,
196 upcoming: false,
197 premiere_timestamp: 0,
198 dash: "No dash".to_string(),
199 adaptive_formats: Vec::new(), // TODO
200 format_streams: Vec::new(), // TODO
201 captions: Vec::new(), // TODO
202 recommended_videos: Vec::new(), // TODO
203 })
204 }
205
206 fn supports_search(&self) -> bool {
207 true
208 }
209
210 fn search(
211 &self,
212 filters: &crate::config::Search,
213 ) -> Result<Vec<invidious::hidden::SearchItem>, Box<dyn std::error::Error>> {
214 let date = match filters.filters.date {
215 SearchFilterDate::None => None,
216 SearchFilterDate::Hour => Some(UploadDate::Hour),
217 SearchFilterDate::Day => Some(UploadDate::Day),
218 SearchFilterDate::Week => Some(UploadDate::Week),
219 SearchFilterDate::Month => Some(UploadDate::Month),
220 SearchFilterDate::Year => Some(UploadDate::Year),
221 };
222
223 let sort = match filters.filters.sort {
224 SearchFilterSort::Relevance => None,
225 SearchFilterSort::Date => Some(Order::Date),
226 SearchFilterSort::Views => Some(Order::Views),
227 SearchFilterSort::Rating => Some(Order::Rating),
228 };
229
230 let duration = match filters.filters.duration {
231 SearchFilterDuration::None => None,
232 SearchFilterDuration::Long => Some(Length::Long),
233 SearchFilterDuration::Short => Some(Length::Short),
234 SearchFilterDuration::Medium => Some(Length::Medium),
235 };
236
237 let r#type = match filters.filters.r#type {
238 SearchFilterType::All => None,
239 SearchFilterType::Video => Some(ItemType::Video),
240 SearchFilterType::Playlist => Some(ItemType::Playlist),
241 SearchFilterType::Channel => Some(ItemType::Channel),
242 };
243
244 let res = RUNTIME.get().unwrap().block_on(
245 self.0.query().search_filter(
246 filters.query.clone(),
247 &SearchFilter::new()
248 .date_opt(date)
249 .sort_opt(sort)
250 .length_opt(duration)
251 .item_type_opt(r#type),
252 ),
253 )?;
254
255 Ok(res
256 .items
257 .items
258 .into_iter()
259 .map(|item: YouTubeItem| match item {
260 YouTubeItem::Video(video) => SearchItem::Video(video_item_convert(video)),
261 YouTubeItem::Playlist(playlist) => {
262 SearchItem::Playlist(playlist_item_convert(playlist))
263 }
264 YouTubeItem::Channel(channel) => SearchItem::Channel(channel_item_convert(channel)),
265 })
266 .collect())
267 }
268
269 fn supports_channel(&self) -> bool {
270 true
271 }
272
273 fn channel(&self, id: &str) -> Result<invidious::channel::Channel, Box<dyn std::error::Error>> {
274 let q = self.0.query();
275 let (info, artist) = RUNTIME
276 .get()
277 .unwrap()
278 .block_on(async { futures::join!(q.channel_info(id), q.music_artist(id, false)) });
279
280 let info = info?;
281 let artist = artist?;
282
283 Ok(Channel {
284 name: artist.name,
285 id: info.id,
286 url: info.url,
287 banners: Vec::new(), // TODO?
288 thumbnails: artist.header_image.into_iter().map(image_convert).collect(),
289 subscribers: info.subscriber_count.unwrap_or_default() as u32,
290 total_views: info.view_count.unwrap_or_default(),
291 joined: info
292 .create_date
293 .map(|d| d.with_hms(0, 0, 0).unwrap().as_utc().unix_timestamp())
294 .unwrap_or_default() as u64,
295 auto_generated: false,
296 family_friendly: false,
297 description: info.description.clone(),
298 description_html: info.description,
299 allowed_regions: Vec::new(), // TODO
300 lastest_videos: Vec::new(),
301 related_channels: Vec::new(),
302 })
303 }
304
305 fn supports_popular(&self) -> bool {
306 false
307 }
308
309 fn popular(&self) -> Result<Vec<invidious::hidden::PopularItem>, Box<dyn std::error::Error>> {
310 unimplemented!("not supported")
311 }
312
313 fn supports_trending(&self) -> bool {
314 true
315 }
316
317 fn trending(&self) -> Result<Vec<invidious::CommonVideo>, Box<dyn std::error::Error>> {
318 let res = RUNTIME.get().unwrap().block_on(self.0.query().trending())?;
319
320 Ok(res.into_iter().map(video_item_convert).collect())
321 }
322
323 fn supports_playlist(&self) -> bool {
324 true
325 }
326
327 fn playlist(
328 &self,
329 id: &str,
330 ) -> Result<invidious::universal::Playlist, Box<dyn std::error::Error>> {
331 let res = RUNTIME
332 .get()
333 .unwrap()
334 .block_on(self.0.query().playlist(id))?;
335
336 Ok(Playlist {
337 title: res.name,
338 id: res.id,
339 thumbnail: res.thumbnail.into_iter().map(|t| t.url).collect(),
340 author: res
341 .channel
342 .clone()
343 .map(|c| c.name)
344 .unwrap_or("Unknown channel".to_string()),
345 author_id: res
346 .channel
347 .clone()
348 .map(|c| c.id)
349 .unwrap_or("Unknown channel".to_string()),
350 author_thumbnails: Vec::new(), // TODO why?
351 description: res
352 .description
353 .clone()
354 .map(|t| t.to_plaintext())
355 .unwrap_or_default(),
356 description_html: res.description.map(|t| t.to_html()).unwrap_or_default(),
357 video_count: res.video_count as u32,
358 views: 0,
359 updated: res
360 .last_update
361 .map(|d| d.with_hms(0, 0, 0).unwrap().as_utc().unix_timestamp())
362 .unwrap_or_default() as u64,
363 listed: true,
364 videos: res
365 .videos
366 .items
367 .into_iter()
368 .map(|item| invidious::hidden::PlaylistItem {
369 title: item.name,
370 id: item.id,
371 author: res
372 .channel
373 .clone()
374 .map(|c| c.name)
375 .unwrap_or("Unknown channel".to_string()),
376 author_id: res
377 .channel
378 .clone()
379 .map(|c| c.id)
380 .unwrap_or("Unknown channel id".to_string()),
381 author_url: res
382 .channel
383 .clone()
384 .map(|c| format!("https://www.youtube.com/channel/{}", c.id))
385 .unwrap_or("Unknown channel id".to_string()),
386 thumbnails: item.thumbnail.into_iter().map(thumbnail_convert).collect(),
387 index: 0,
388 length: res.video_count as u32,
389 })
390 .collect(),
391 })
392 }
393
394 fn supports_channel_videos(&self) -> bool {
395 true
396 }
397
398 fn channel_videos(&self, id: &str) -> Result<Vec<CommonVideo>, Box<dyn std::error::Error>> {
399 let res = RUNTIME
400 .get()
401 .unwrap()
402 .block_on(self.0.query().channel_videos(id))?;
403
404 Ok(res
405 .content
406 .items
407 .into_iter()
408 .map(video_item_convert)
409 .collect())
410 }
411
412 fn supports_channel_playlists(&self) -> bool {
413 true
414 }
415
416 fn channel_playlists(
417 &self,
418 id: &str,
419 ) -> Result<Vec<CommonPlaylist>, Box<dyn std::error::Error>> {
420 let res = RUNTIME
421 .get()
422 .unwrap()
423 .block_on(self.0.query().channel_playlists(id))?;
424
425 Ok(res
426 .content
427 .items
428 .into_iter()
429 .map(playlist_item_convert)
430 .collect())
431 }
432}
src/global/structs/subscriptions.rs +4 −18
@@ -3,12 +3,11 @@ use crate::{
33 config::SyncConfig,
44 global::{
55 functions::{download_all_images, DownloadRequest},
6 traits::{Collection, CollectionItem},
6 traits::{Collection, CollectionItem, SearchProviderWrapper},
77 },
88};
99use chrono::Utc;
1010use home::home_dir;
11use invidious::ClientSyncTrait;
1211use serde::*;
1312use std::{
1413 error::Error,
@@ -32,7 +31,6 @@ impl Subscriptions {
3231 /// Res<(success, failed)>
3332 pub fn sync(
3433 &mut self,
35 client: &InvidiousClient,
3634 image_index: usize,
3735 download_thumbnails: bool,
3836 syncconfig: SyncConfig,
@@ -55,14 +53,12 @@ impl Subscriptions {
5553 return;
5654 }
5755 let tx = tx.clone();
58 let client = client.clone();
5956 let success = success.clone();
6057 let failed = failed.clone();
6158 let empty = empty.clone();
6259 thread::spawn(move || {
6360 let res = sync_one(
6461 &item.channel.id,
65 &client,
6662 image_index,
6763 download_thumbnails,
6864 syncconfig.sync_channel_info
@@ -114,7 +110,6 @@ impl Subscriptions {
114110 pub fn sync_one(
115111 &mut self,
116112 id: &str,
117 client: &InvidiousClient,
118113 image_index: usize,
119114 download_thumbnails: bool,
120115 syncconfig: &SyncConfig,
@@ -124,7 +119,6 @@ impl Subscriptions {
124119 Some(item) => {
125120 let (videos, channel) = sync_one(
126121 id,
127 client,
128122 image_index,
129123 download_thumbnails,
130124 syncconfig.sync_channel_info
@@ -141,8 +135,7 @@ impl Subscriptions {
141135 }
142136 }
143137 None => {
144 let (videos, channel) =
145 sync_one(id, client, image_index, download_thumbnails, true)?;
138 let (videos, channel) = sync_one(id, image_index, download_thumbnails, true)?;
146139 self.0.push(SubItem {
147140 channel: channel.unwrap(),
148141 videos,
@@ -186,7 +179,6 @@ impl Subscriptions {
186179
187180fn sync_one(
188181 id: &str,
189 client: &InvidiousClient,
190182 image_index: usize,
191183 download_thumbnails: bool,
192184 sync_channel_info: bool,
@@ -194,22 +186,16 @@ fn sync_one(
194186 let (tx, rx) = mpsc::channel();
195187
196188 if sync_channel_info {
197 let client2 = client.clone();
198189 let id2 = id.to_string();
199190 thread::spawn(move || {
200191 tx.send(
201 client2
202 .0
203 .channel(&id2, None)
192 SearchProviderWrapper::channel(&id2)
204193 .map(|channel| Item::from_full_channel(channel, image_index).into_fullchannel())
205194 .ok(),
206195 )
207196 });
208197 }
209 let mut videos = client
210 .0
211 .channel_videos(id, None)?
212 .videos
198 let mut videos = SearchProviderWrapper::channel_videos(id)?
213199 .into_iter()
214200 .map(|video| {
215201 Item::from_common_video(video, image_index)
src/global/traits/mod.rs +2
@@ -2,9 +2,11 @@
22mod asurlstring;
33mod collection;
44mod configtrait;
5mod search_provider;
56mod searchfilteritem;
67
78pub use asurlstring::*;
89pub use collection::*;
910pub use configtrait::*;
11pub use search_provider::*;
1012pub use searchfilteritem::*;
src/global/traits/search_provider.rs added +161
@@ -0,0 +1,161 @@
1use std::{
2 collections::HashMap,
3 error::Error,
4 fmt::{Debug, Display},
5 sync::OnceLock,
6};
7
8use dyn_clone::DynClone;
9use invidious::{
10 channel::Channel,
11 hidden::{PopularItem, SearchItem},
12 universal::Playlist,
13 video::Video,
14 CommonPlaylist, CommonVideo,
15};
16
17use crate::{
18 config::{Search, SearchProvider},
19 MAIN_CONFIG,
20};
21
22pub trait SearchProviderTrait: DynClone + Send {
23 fn supports_channel(&self) -> bool;
24 fn channel(&self, id: &str) -> Result<Channel, Box<dyn Error>>;
25
26 fn supports_channel_videos(&self) -> bool;
27 fn channel_videos(&self, id: &str) -> Result<Vec<CommonVideo>, Box<dyn Error>>;
28
29 fn supports_channel_playlists(&self) -> bool;
30 fn channel_playlists(&self, id: &str) -> Result<Vec<CommonPlaylist>, Box<dyn Error>>;
31
32 fn supports_trending(&self) -> bool;
33 fn trending(&self) -> Result<Vec<CommonVideo>, Box<dyn Error>>;
34
35 fn supports_popular(&self) -> bool;
36 fn popular(&self) -> Result<Vec<PopularItem>, Box<dyn Error>>;
37
38 fn supports_search(&self) -> bool;
39 fn search(&self, filters: &Search) -> Result<Vec<SearchItem>, Box<dyn Error>>;
40
41 fn supports_video(&self) -> bool;
42 fn video(&self, id: &str) -> Result<Video, Box<dyn Error>>;
43
44 fn supports_playlist(&self) -> bool;
45 fn playlist(&self, id: &str) -> Result<Playlist, Box<dyn Error>>;
46}
47
48dyn_clone::clone_trait_object!(SearchProviderTrait);
49
50#[derive(Default, Clone)]
51pub struct SearchProviderWrapper(HashMap<SearchProvider, Box<dyn SearchProviderTrait>>);
52
53struct UnsupportedError(pub &'static str);
54
55impl Display for UnsupportedError {
56 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
57 f.write_fmt(format_args!(
58 "Operation `{}` is not supported by {}",
59 self.0,
60 unsafe { MAIN_CONFIG.get().unwrap() }
61 .search_provider
62 .as_str()
63 ))
64 }
65}
66
67impl Debug for UnsupportedError {
68 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
69 f.write_fmt(format_args!("{self}"))
70 }
71}
72
73impl Error for UnsupportedError {}
74
75static mut SEARCH_PROVIDER: OnceLock<SearchProviderWrapper> = OnceLock::new();
76
77impl SearchProviderWrapper {
78 pub fn init() {
79 unsafe {
80 if SEARCH_PROVIDER.get().is_some() {
81 *SEARCH_PROVIDER.get_mut().unwrap() = Self::default()
82 } else {
83 let _ = SEARCH_PROVIDER.set(Self::default());
84 }
85 }
86 }
87
88 #[allow(clippy::borrowed_box)]
89 fn get() -> &'static Box<dyn SearchProviderTrait> {
90 let provider = &unsafe { MAIN_CONFIG.get() }.unwrap().search_provider;
91 unsafe { SEARCH_PROVIDER.get_mut() }
92 .unwrap()
93 .0
94 .entry(*provider)
95 .or_insert(provider.create())
96 }
97
98 pub fn channel(id: &str) -> Result<Channel, Box<dyn Error>> {
99 let provider = Self::get();
100 if !provider.supports_channel() {
101 return Err(UnsupportedError("channel").into());
102 }
103 provider.channel(id)
104 }
105
106 pub fn channel_videos(id: &str) -> Result<Vec<CommonVideo>, Box<dyn Error>> {
107 let provider = Self::get();
108 if !provider.supports_channel_videos() {
109 return Err(UnsupportedError("channel_videos").into());
110 }
111 provider.channel_videos(id)
112 }
113
114 pub fn channel_playlists(id: &str) -> Result<Vec<CommonPlaylist>, Box<dyn Error>> {
115 let provider = Self::get();
116 if !provider.supports_channel_playlists() {
117 return Err(UnsupportedError("channel_playlists").into());
118 }
119 provider.channel_playlists(id)
120 }
121
122 pub fn trending() -> Result<Vec<CommonVideo>, Box<dyn Error>> {
123 let provider = Self::get();
124 if !provider.supports_trending() {
125 return Err(UnsupportedError("trending").into());
126 }
127 provider.trending()
128 }
129
130 pub fn popular() -> Result<Vec<PopularItem>, Box<dyn Error>> {
131 let provider = Self::get();
132 if !provider.supports_popular() {
133 return Err(UnsupportedError("popular").into());
134 }
135 provider.popular()
136 }
137
138 pub fn search(filters: &Search) -> Result<Vec<SearchItem>, Box<dyn Error>> {
139 let provider = Self::get();
140 if !provider.supports_search() {
141 return Err(UnsupportedError("search").into());
142 }
143 provider.search(filters)
144 }
145
146 pub fn video(id: &str) -> Result<Video, Box<dyn Error>> {
147 let provider = Self::get();
148 if !provider.supports_video() {
149 return Err(UnsupportedError("video").into());
150 }
151 provider.video(id)
152 }
153
154 pub fn playlist(id: &str) -> Result<Playlist, Box<dyn Error>> {
155 let provider = Self::get();
156 if !provider.supports_playlist() {
157 return Err(UnsupportedError("playlist").into());
158 }
159 provider.playlist(id)
160 }
161}
src/init.rs +20 −4
@@ -8,9 +8,14 @@ use std::{
88 error::Error,
99 fs::{self},
1010 io::Stdout,
11 sync::OnceLock,
1112};
13use tokio::runtime::{Builder, Runtime};
1214use tui_additions::framework::{Framework, FrameworkClean};
1315
16pub static mut MAIN_CONFIG: OnceLock<MainConfig> = OnceLock::new();
17pub static RUNTIME: OnceLock<Runtime> = OnceLock::new();
18
1419/// app to run before the app starts
1520// init tasks:
1621// - create folders like `~/.config/youtube-tui/` and `~/.cache/youtube-tui/thumbnails/`
@@ -22,6 +27,9 @@ pub fn init(
2227 command: Option<&str>,
2328) -> Result<(), Box<dyn Error>> {
2429 let home_dir = home_dir().unwrap();
30 RUNTIME
31 .set(Builder::new_current_thread().enable_all().build().unwrap())
32 .unwrap();
2533
2634 // creating files
2735 [
@@ -112,10 +120,18 @@ pub fn load_configs(framework: &mut FrameworkClean) -> Result<(), Box<dyn Error>
112120 // inserting data
113121 let main_config = *MainConfig::load(WriteConfig::Try)?;
114122
115 framework
116 .data
117 .global
118 .insert::<InvidiousClient>(InvidiousClient::new(main_config.invidious_instance.clone()));
123 SearchProviderWrapper::init();
124
125 unsafe {
126 if MAIN_CONFIG.get().is_some() {
127 *MAIN_CONFIG.get_mut().unwrap() = main_config.clone()
128 } else {
129 let _ = MAIN_CONFIG.set(main_config.clone());
130 }
131 }
132
133 SearchProviderWrapper::init();
134
119135 framework
120136 .data
121137 .global
src/items/channeldisplay.rs +4 −25
@@ -1,9 +1,8 @@
11use super::ItemInfo;
22use crate::{
33 config::*,
4 global::{functions::*, structs::*},
4 global::{functions::*, structs::*, traits::SearchProviderWrapper},
55};
6use invidious::ClientSyncTrait;
76use ratatui::{
87 layout::{Constraint, Rect},
98 style::Style,
@@ -504,13 +503,7 @@ impl FrameworkItem for ChannelDisplay {
504503 match page.r#type {
505504 ChannelDisplayPageType::Main => {
506505 let channel = Item::from_full_channel(
507 framework
508 .data
509 .global
510 .get::<InvidiousClient>()
511 .unwrap()
512 .0
513 .channel(&page.id, None)?,
506 SearchProviderWrapper::channel(&page.id)?,
514507 mainconfig.image_index,
515508 );
516509 if mainconfig.images.display() {
@@ -536,14 +529,7 @@ impl FrameworkItem for ChannelDisplay {
536529 }
537530 }
538531 ChannelDisplayPageType::Videos => {
539 let videos = framework
540 .data
541 .global
542 .get::<InvidiousClient>()
543 .unwrap()
544 .0
545 .channel_videos(&page.id, None)?
546 .videos
532 let videos = SearchProviderWrapper::channel_videos(&page.id)?
547533 .into_iter()
548534 .map(|video| Item::from_common_video(video, mainconfig.image_index))
549535 .collect::<Vec<_>>();
@@ -566,14 +552,7 @@ impl FrameworkItem for ChannelDisplay {
566552 };
567553 }
568554 ChannelDisplayPageType::Playlists => {
569 let playlists = framework
570 .data
571 .global
572 .get::<InvidiousClient>()
573 .unwrap()
574 .0
575 .channel_playlists(&page.id, None)?
576 .playlists
555 let playlists = SearchProviderWrapper::channel_playlists(&page.id)?
577556 .into_iter()
578557 .map(Item::from_common_playlist)
579558 .collect::<Vec<_>>();
src/items/itemlist.rs +11 −14
@@ -2,11 +2,10 @@ use std::error::Error;
22
33use crate::{
44 config::*,
5 global::{functions::*, structs::*},
5 global::{functions::*, structs::*, traits::SearchProviderWrapper},
66 items::ItemInfo,
77};
88use home::home_dir;
9use invidious::ClientSyncTrait;
109use ratatui::{
1110 layout::{Constraint, Rect},
1211 style::Style,
@@ -180,8 +179,13 @@ impl ItemList {
180179 | Item::FullPlaylist(FullPlaylistItem { id, .. }) => {
181180 Some(Page::SingleItem(SingleItemPage::Playlist(id.clone())))
182181 }
183 Item::MiniChannel(MiniChannelItem { id: _id, .. })
184 | Item::FullChannel(FullChannelItem { id: _id, .. }) => todo!(),
182 Item::MiniChannel(MiniChannelItem { id, .. })
183 | Item::FullChannel(FullChannelItem { id, .. }) => {
184 Some(Page::ChannelDisplay(ChannelDisplayPage {
185 id: id.to_string(),
186 r#type: ChannelDisplayPageType::Main,
187 }))
188 }
185189 // Item::Unknown(_) => {
186190 // *framework.data.global.get_mut::<Message>().unwrap() =
187191 // Message::Message(String::from("Unknown item"));
@@ -335,22 +339,17 @@ impl FrameworkItem for ItemList {
335339 .get::<MainConfig>()
336340 .unwrap()
337341 .image_index;
338 let client = &framework.data.global.get::<InvidiousClient>().unwrap().0;
339342
340343 // fetch the items using the invidious api
341344 match page {
342345 Page::MainMenu(MainMenuPage::Trending) => {
343 self.items = client
344 .trending(None)?
345 .videos
346 self.items = SearchProviderWrapper::trending()?
346347 .into_iter()
347348 .map(|item| Item::from_common_video(item, image_index))
348349 .collect();
349350 }
350351 Page::MainMenu(MainMenuPage::Popular) => {
351 self.items = client
352 .popular(None)?
353 .items
352 self.items = SearchProviderWrapper::popular()?
354353 .into_iter()
355354 .map(|item| Item::from_popular_item(item, image_index))
356355 .collect();
@@ -366,9 +365,7 @@ impl FrameworkItem for ItemList {
366365 self.items = history.0.clone().into_iter().rev().collect();
367366 }
368367 Page::Search(search) => {
369 self.items = client
370 .search(Some(&search.to_string()))?
371 .items
368 self.items = SearchProviderWrapper::search(search)?
372369 .into_iter()
373370 .map(|item| Item::from_search_item(item, image_index))
374371 .collect();
src/items/singleitem.rs +2 −10
@@ -666,11 +666,7 @@ impl FrameworkItem for SingleItem {
666666 let video = if path.exists() {
667667 serde_json::from_str(&fs::read_to_string(path)?)?
668668 } else {
669 load_video(
670 &framework.data.global.get::<InvidiousClient>().unwrap().0,
671 id,
672 mainconfig,
673 )?
669 load_video(id, mainconfig)?
674670 };
675671 (
676672 video,
@@ -689,11 +685,7 @@ impl FrameworkItem for SingleItem {
689685 let playlist = if path.exists() {
690686 serde_json::from_str(&fs::read_to_string(path)?)?
691687 } else {
692 load_playlist(
693 &framework.data.global.get::<InvidiousClient>().unwrap().0,
694 id,
695 mainconfig,
696 )?
688 load_playlist(id, mainconfig)?
697689 };
698690 let r#type = SingleItemType::Playlist(
699691 SinglePlaylistItem::new(
src/lib.rs +1
@@ -1,3 +1,4 @@
1#![allow(static_mut_refs)]
12pub mod config;
23pub mod global;
34pub mod items;