diff options
Diffstat (limited to '')
-rw-r--r-- | Cargo.lock | 119 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | NEWS.md | 35 | ||||
-rw-r--r-- | crates/yt/src/download/progress_hook.rs | 2 | ||||
-rw-r--r-- | crates/yt/src/select/cmds/add.rs | 12 | ||||
-rw-r--r-- | crates/yt/src/select/mod.rs | 29 | ||||
-rw-r--r-- | crates/yt/src/storage/subscriptions.rs | 6 | ||||
-rw-r--r-- | crates/yt/src/storage/video_database/set/mod.rs | 10 | ||||
-rw-r--r-- | crates/yt/src/subscribe/mod.rs | 29 | ||||
-rw-r--r-- | crates/yt_dlp/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/yt_dlp/src/lib.rs | 1 | ||||
-rw-r--r-- | crates/yt_dlp/src/options.rs | 8 | ||||
-rw-r--r-- | crates/yt_dlp/src/package_hacks/mod.rs | 11 | ||||
-rw-r--r-- | crates/yt_dlp/src/package_hacks/urllib3.rs | 35 | ||||
-rw-r--r-- | crates/yt_dlp/src/package_hacks/urllib3_polyfill.py | 13 | ||||
-rw-r--r-- | flake.lock | 6 | ||||
-rw-r--r-- | flake.nix | 5 | ||||
-rw-r--r-- | nix/package.nix | 7 |
18 files changed, 227 insertions, 105 deletions
diff --git a/Cargo.lock b/Cargo.lock index f3492e9..51c6c6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,18 +151,18 @@ dependencies = [ [[package]] name = "atomic" -version = "0.6.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89cbf775b137e9b968e67227ef7f775587cde3fd31b0d8599dbd0f598a48340" +checksum = "8d818003e740b63afc82337e3160717f4f63078720a810b7b903e70a5d1d2994" dependencies = [ "bytemuck", ] [[package]] name = "autocfg" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -288,7 +288,7 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" dependencies = [ "serde", ] @@ -800,12 +800,12 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.13" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "778e2ac28f6c47af28e4907f13ffd1e1ddbd400980a9abd7c8df189bf578a5ad" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.59.0", ] [[package]] @@ -1517,9 +1517,9 @@ checksum = "0864a00c8d019e36216b69c2c4ce50b83b7bd966add3cf5ba554ec44f8bebcf5" [[package]] name = "libc" -version = "0.2.174" +version = "0.2.173" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" +checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" [[package]] name = "libffi" @@ -1558,7 +1558,7 @@ checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libmpv2" -version = "1.6.1" +version = "1.7.1" dependencies = [ "crossbeam", "libmpv2-sys", @@ -1568,7 +1568,7 @@ dependencies = [ [[package]] name = "libmpv2-sys" -version = "1.6.1" +version = "1.7.1" dependencies = [ "bindgen", ] @@ -1646,9 +1646,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lz4_flex" -version = "0.11.5" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a" +checksum = "2c592ad9fbc1b7838633b3ae55ce69b17d01150c72fcef229fbb819d39ee51ee" dependencies = [ "twox-hash", ] @@ -1928,19 +1928,18 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a973b4e44ce6cad84ce69d797acf9a044532e4184c4f267913d1b546a0727b7a" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" dependencies = [ "num_enum_derive", - "rustversion", ] [[package]] name = "num_enum_derive" -version = "0.7.4" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e878c846a8abae00dd069496dbe8751b16ac1c3d6bd2a7283a938e8228f90d" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", @@ -2207,9 +2206,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.35" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" dependencies = [ "proc-macro2", "syn", @@ -2244,9 +2243,9 @@ dependencies = [ [[package]] name = "r-efi" -version = "5.3.0" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" [[package]] name = "radium" @@ -2485,7 +2484,7 @@ dependencies = [ [[package]] name = "rustpython" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "cfg-if", "dirs-next", @@ -2504,7 +2503,7 @@ dependencies = [ [[package]] name = "rustpython-codegen" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "ahash", "bitflags 2.9.1", @@ -2529,7 +2528,7 @@ dependencies = [ [[package]] name = "rustpython-common" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "ascii", "bitflags 2.9.1", @@ -2558,7 +2557,7 @@ dependencies = [ [[package]] name = "rustpython-compiler" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "ruff_python_ast", "ruff_python_parser", @@ -2573,7 +2572,7 @@ dependencies = [ [[package]] name = "rustpython-compiler-core" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "bitflags 2.9.1", "itertools 0.14.0", @@ -2587,7 +2586,7 @@ dependencies = [ [[package]] name = "rustpython-compiler-source" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "ruff_source_file", "ruff_text_size", @@ -2596,7 +2595,7 @@ dependencies = [ [[package]] name = "rustpython-derive" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "proc-macro2", "rustpython-compiler", @@ -2607,7 +2606,7 @@ dependencies = [ [[package]] name = "rustpython-derive-impl" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "itertools 0.14.0", "maplit", @@ -2631,7 +2630,7 @@ dependencies = [ [[package]] name = "rustpython-literal" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "hexf-parse", "is-macro", @@ -2644,7 +2643,7 @@ dependencies = [ [[package]] name = "rustpython-pylib" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "glob", "rustpython-compiler-core", @@ -2654,7 +2653,7 @@ dependencies = [ [[package]] name = "rustpython-sre_engine" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "bitflags 2.9.1", "num_enum", @@ -2665,7 +2664,7 @@ dependencies = [ [[package]] name = "rustpython-stdlib" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "adler32", "ahash", @@ -2727,6 +2726,7 @@ dependencies = [ "unic-ucd-bidi", "unic-ucd-category", "unic-ucd-ident", + "unicode-bidi-mirroring", "unicode-casing", "unicode_names2", "uuid", @@ -2739,7 +2739,7 @@ dependencies = [ [[package]] name = "rustpython-vm" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "ahash", "ascii", @@ -2815,7 +2815,7 @@ dependencies = [ [[package]] name = "rustpython-wtf8" version = "0.4.0" -source = "git+https://github.com/RustPython/RustPython.git?rev=c968fe0f#c968fe0fd9d7466dc9d5d97e973b82ba35e516d8" +source = "git+https://github.com/RustPython/RustPython.git?rev=6a992d4f#6a992d4fa2ef4f15f362b54c43aa225c3b552374" dependencies = [ "ascii", "bstr", @@ -3341,9 +3341,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.104" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -3426,7 +3426,7 @@ dependencies = [ [[package]] name = "termsize" -version = "1.6.1" +version = "1.7.1" dependencies = [ "libc", "winapi", @@ -3627,9 +3627,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.30" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81383ab64e72a7a8b8e13130c49e3dab29def6d0c7d76a03087b3cf71c5c6903" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -3784,6 +3784,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" [[package]] +name = "unicode-bidi-mirroring" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" + +[[package]] name = "unicode-casing" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3870,7 +3876,7 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uu_fmt" -version = "1.6.1" +version = "1.7.1" dependencies = [ "unicode-width", ] @@ -4017,9 +4023,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.33" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +checksum = "41b5576b9a81633f3e8df296ce0063042a73507636cbe956c61133dd7034ab22" dependencies = [ "bytemuck", "safe_arch", @@ -4168,15 +4174,6 @@ dependencies = [ ] [[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.2", -] - -[[package]] name = "windows-targets" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -4448,11 +4445,11 @@ dependencies = [ [[package]] name = "yt" -version = "1.6.1" +version = "1.7.1" dependencies = [ "anyhow", "blake3", - "bytes 1.6.1", + "bytes 1.7.1", "chrono", "chrono-humanize", "clap", @@ -4481,7 +4478,7 @@ dependencies = [ [[package]] name = "yt_dlp" -version = "1.6.1" +version = "1.7.1" dependencies = [ "curl", "indexmap", @@ -4495,18 +4492,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.26" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.26" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 56a90fd..963a877 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ members = [ [workspace.package] edition = "2024" -version = "1.6.1" +version = "1.7.1" rust-version = "1.85.0" authors = ["Benedikt Peetz <benedikt.peetz@b-peetz.de>"] repository = "https://git.vhack.eu/soispha/clients/yt" diff --git a/NEWS.md b/NEWS.md index 44142e4..a0715aa 100644 --- a/NEWS.md +++ b/NEWS.md @@ -14,6 +14,41 @@ If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines. - - - +## [v1.7.1](https://git.foss-syndicate.org/soispha/clients/yt/compare/69d1f92c9ff5e76c0c2b91641962f9e21afe2ded..v1.7.1) - 2025-06-28 +#### Bug Fixes +- **(yt/download/progress_hook)** Remove superfluous apostrophes - ([92e3367](https://git.foss-syndicate.org/soispha/clients/yt/commit/92e3367fbc93b67b2db9d7296630d299294e4c13)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt/select/cmds/add)** Use the correct names for the download type - ([cd03c0b](https://git.foss-syndicate.org/soispha/clients/yt/commit/cd03c0b9501c596c3abcd41e07105a3def20e2dd)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt/select/cmds/add)** Don't print the title as value, cast it first - ([247dabc](https://git.foss-syndicate.org/soispha/clients/yt/commit/247dabc7905d9deecc86ac11404b5665042c60f1)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt/select/split)** Also use persist the selection file - ([72d33c1](https://git.foss-syndicate.org/soispha/clients/yt/commit/72d33c13a8a715a5a12d804464d887c2376701ad)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt/subscribe)** Don't hard-error on failed subscribe, if it was not specified - ([c5ad75c](https://git.foss-syndicate.org/soispha/clients/yt/commit/c5ad75c9176990da906c9ef3086e8efe25037fd9)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt/{subscribe,storage/subscriptions})** Fix more instances of the capitalize Playlist type - ([2cee354](https://git.foss-syndicate.org/soispha/clients/yt/commit/2cee35477e4e4e2b3b6aeb094217e0419bdcaed4)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt_dlp)** Polyfill missing rustpython features used in urllib3 - ([8c65652](https://git.foss-syndicate.org/soispha/clients/yt/commit/8c6565295986b704f36a9174d05deacc6925b7e4)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +#### Build system +- **(nix/package)** Update the git hashes after the update - ([f74251b](https://git.foss-syndicate.org/soispha/clients/yt/commit/f74251b5191963b979a23fa16555712aa83817ba)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(nix/package)** Add all required files to the src allow list - ([09d5c9c](https://git.foss-syndicate.org/soispha/clients/yt/commit/09d5c9c93c786a309328564d74c58e8be1dcfa5b)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **({flake,Cargo}.lock)** Update - ([033b0d3](https://git.foss-syndicate.org/soispha/clients/yt/commit/033b0d3ce9eef96827a3f33e4aa5f108e98e4878)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **({nix,flake})** Add missing buildInputs - ([bc1f78f](https://git.foss-syndicate.org/soispha/clients/yt/commit/bc1f78fde9aa45a3d53a36bbfab11178f6f8f684)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +#### Miscellaneous Chores +- **(yt/storage/video_database/set)** Apply some of clippy's suggestions - ([d451984](https://git.foss-syndicate.org/soispha/clients/yt/commit/d451984d34c74190340cc82d203565c7e4747908)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt_dlp/package_hacks)** Add missing license headers - ([c3a8c10](https://git.foss-syndicate.org/soispha/clients/yt/commit/c3a8c104515b47597f8b72eeabc7dcd266ec0316)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +#### Revert +- "build(treewide): Update" - ([69d1f92](https://git.foss-syndicate.org/soispha/clients/yt/commit/69d1f92c9ff5e76c0c2b91641962f9e21afe2ded)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) + +- - - + +## [v1.7.0](https://git.foss-syndicate.org/soispha/clients/yt/compare/382eae56dc3ecaed91b9fd8db1c830d5dec49e44..v1.7.0) - 2025-06-24 +#### Bug Fixes +- **(yt/update/grouped)** Don't drop the verbosity level - ([28d4c61](https://git.foss-syndicate.org/soispha/clients/yt/commit/28d4c61bb0b3b6b20d57a0dd970af83265bb0ad2)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt_dlp/post_processors/dearrow)** Don't try to access the drained vec - ([9b4f09c](https://git.foss-syndicate.org/soispha/clients/yt/commit/9b4f09cf736e68bdbd246dca17d7a3c6b8eba3ea)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +#### Build system +- **(treewide)** Update - ([e6aa91c](https://git.foss-syndicate.org/soispha/clients/yt/commit/e6aa91c56ca51a8593b9a58ec5746741888db7f9)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt_dlp/Cargo.toml)** Pin git dependencies - ([772f169](https://git.foss-syndicate.org/soispha/clients/yt/commit/772f16902d75e3d6ae211b9ef3977316708698c4)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +#### Features +- **(yt/cli)** Also add completion for subscription names - ([382eae5](https://git.foss-syndicate.org/soispha/clients/yt/commit/382eae56dc3ecaed91b9fd8db1c830d5dec49e44)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) +- **(yt/version)** Add the (rust)python version again - ([84175a0](https://git.foss-syndicate.org/soispha/clients/yt/commit/84175a03a71918497aa0c8ee3444736d771cccff)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) + +- - - + ## [v1.6.1](https://git.foss-syndicate.org/soispha/clients/yt/compare/3f6ef87fc31581215cb00d56462b35e07b7a1f28..v1.6.1) - 2025-06-17 #### Bug Fixes - **(package)** Set the PYTHONPATH ourselves - ([ea77b89](https://git.foss-syndicate.org/soispha/clients/yt/commit/ea77b898e5dfb2a7900a87a1bb73167a6e1a140c)) - [@bpeetz](https://git.foss-syndicate.org/bpeetz) diff --git a/crates/yt/src/download/progress_hook.rs b/crates/yt/src/download/progress_hook.rs index c507165..ad754b0 100644 --- a/crates/yt/src/download/progress_hook.rs +++ b/crates/yt/src/download/progress_hook.rs @@ -168,7 +168,7 @@ pub fn progress_hook( move_to_col(1); eprint!( - "'{}' [{}/{} at {}] -> [{} of {}{} {}] ", + "{} [{}/{} at {}] -> [{} of {}{} {}] ", c!("34;1", get_title()), c!("33;1", MaybeDuration::from_secs_f64(elapsed)), c!("33;1", MaybeDuration::from_secs_f64(eta)), diff --git a/crates/yt/src/select/cmds/add.rs b/crates/yt/src/select/cmds/add.rs index 2fff298..2c9a323 100644 --- a/crates/yt/src/select/cmds/add.rs +++ b/crates/yt/src/select/cmds/add.rs @@ -48,6 +48,7 @@ pub(super) async fn add( let hashes = get_all_hashes(app) .await .context("Failed to fetch all video hashes")?; + let extractor_hash = blake3::hash(json_get!(entry, "id", as_str).as_bytes()); if hashes.contains(&extractor_hash) { error!( @@ -61,9 +62,10 @@ pub(super) async fn add( .get("url") .map_or("<Unknown video Url>".to_owned(), ToString::to_string) ))?, - entry - .get("title") - .map_or(String::new(), |title| format!(" ('{title}')")) + entry.get("title").map_or(String::new(), |title| format!( + " (\"{}\")", + json_cast!(title, as_str) + )) ); return Ok(()); } @@ -88,7 +90,7 @@ pub(super) async fn add( .with_context(|| format!("Failed to fetch entry for url: '{url}'"))?; match entry.get("_type").map(|val| json_cast!(val, as_str)) { - Some("Video") => { + Some("video") => { add_entry(app, entry).await?; if start.is_some() || stop.is_some() { warn!( @@ -96,7 +98,7 @@ pub(super) async fn add( ); } } - Some("Playlist") => { + Some("playlist") => { if let Some(entries) = entry.get("entries") { let entries = json_cast!(entries, as_array); let start = start.unwrap_or(0); diff --git a/crates/yt/src/select/mod.rs b/crates/yt/src/select/mod.rs index 135bd76..2478b76 100644 --- a/crates/yt/src/select/mod.rs +++ b/crates/yt/src/select/mod.rs @@ -12,8 +12,8 @@ use std::{ collections::HashMap, env::{self}, - fs::{self, File}, - io::{BufRead, BufReader, BufWriter, Write}, + fs::{self, File, OpenOptions}, + io::{BufRead, BufReader, BufWriter, Read, Seek, Write}, iter, path::Path, string::String, @@ -134,12 +134,25 @@ pub async fn select_split( paths.sort(); - let mut processed = 0; + let mut persistent_file = OpenOptions::new() + .read(true) + .write(true) + .truncate(true) + .open(&app.config.paths.last_selection_path) + .context("Failed to open persistent selection file")?; + for path in paths { - let read_file = File::open(path)?; - processed = process_file(app, &read_file, processed).await?; + let mut read_file = File::open(path)?; + + let mut buffer = vec![]; + read_file.read_to_end(&mut buffer)?; + persistent_file.write_all(&buffer)?; } + persistent_file.rewind()?; + + let processed = process_file(app, &persistent_file).await?; + info!("Processed {processed} records."); temp_dir.close().context("Failed to close the temp dir")?; Ok(()) @@ -167,7 +180,7 @@ pub async fn select_file(app: &App, done: bool, use_last_selection: bool) -> Res fs::copy(temp_file.path(), &app.config.paths.last_selection_path) .context("Failed to persist selection file")?; - let processed = process_file(app, &read_file, 0).await?; + let processed = process_file(app, &read_file).await?; info!("Processed {processed} records."); Ok(()) @@ -220,10 +233,10 @@ async fn write_videos_to_file(app: &App, file: &File, videos: &[Video]) -> Resul Ok(()) } -async fn process_file(app: &App, file: &File, processed: i64) -> Result<i64> { +async fn process_file(app: &App, file: &File) -> Result<i64> { let reader = BufReader::new(file); - let mut line_number = -processed; + let mut line_number = 0; for line in reader.lines() { let line = line.context("Failed to read a line")?; diff --git a/crates/yt/src/storage/subscriptions.rs b/crates/yt/src/storage/subscriptions.rs index 1ab0d72..0e8ae85 100644 --- a/crates/yt/src/storage/subscriptions.rs +++ b/crates/yt/src/storage/subscriptions.rs @@ -17,7 +17,7 @@ use anyhow::Result; use log::debug; use sqlx::query; use url::Url; -use yt_dlp::options::YoutubeDLOptions; +use yt_dlp::{json_cast, options::YoutubeDLOptions}; use crate::{app::App, unreachable::Unreachable}; @@ -48,9 +48,9 @@ pub async fn check_url(url: Url) -> Result<bool> { let info = yt_dlp.extract_info(&url, false, false)?; - debug!("{:#?}", info); + debug!("{info:#?}"); - Ok(info.get("_type") == Some(&serde_json::Value::String("Playlist".to_owned()))) + Ok(info.get("_type").map(|v| json_cast!(v, as_str)) == Some("playlist")) } #[derive(Default, Debug)] diff --git a/crates/yt/src/storage/video_database/set/mod.rs b/crates/yt/src/storage/video_database/set/mod.rs index 8c1be4a..1b19011 100644 --- a/crates/yt/src/storage/video_database/set/mod.rs +++ b/crates/yt/src/storage/video_database/set/mod.rs @@ -92,10 +92,7 @@ pub async fn video_status( let now = Utc::now().timestamp(); - debug!( - "Running status change: {:#?} -> {:#?}...", - old_marker, new_status, - ); + debug!("Running status change: {old_marker:#?} -> {new_status:#?}...",); let new_status = new_status.as_db_integer(); let new_priority = new_priority.as_db_integer(); @@ -121,10 +118,7 @@ pub async fn video_status( let now = Utc::now().timestamp(); - debug!( - "Running status change: {:#?} -> {:#?}...", - old_marker, new_status, - ); + debug!("Running status change: {old_marker:#?} -> {new_status:#?}...",); let new_status = new_status.as_db_integer(); query!( diff --git a/crates/yt/src/subscribe/mod.rs b/crates/yt/src/subscribe/mod.rs index a965ac0..66797e8 100644 --- a/crates/yt/src/subscribe/mod.rs +++ b/crates/yt/src/subscribe/mod.rs @@ -13,10 +13,10 @@ use std::str::FromStr; use anyhow::{Context, Result, bail}; use futures::FutureExt; -use log::warn; +use log::{error, warn}; use tokio::io::{AsyncBufRead, AsyncBufReadExt}; use url::Url; -use yt_dlp::{json_get, options::YoutubeDLOptions}; +use yt_dlp::{json_cast, json_get, options::YoutubeDLOptions}; use crate::{ app::App, @@ -121,17 +121,26 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()> out?; } else { - actual_subscribe(app, None, url.join("videos/").unreachable("See above.")) + let _ = actual_subscribe(app, None, url.join("videos/").unreachable("See above.")) .await - .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Videos}"))?; + .map_err(|err| { + error!("Failed to subscribe to the '{}' variant: {err}", "{Videos}"); + }); - actual_subscribe(app, None, url.join("streams/").unreachable("See above.")) + let _ = actual_subscribe(app, None, url.join("streams/").unreachable("See above.")) .await - .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Streams}"))?; - - actual_subscribe(app, None, url.join("shorts/").unreachable("See above.")) + .map_err(|err| { + error!( + "Failed to subscribe to the '{}' variant: {err}", + "{Streams}" + ); + }); + + let _ = actual_subscribe(app, None, url.join("shorts/").unreachable("See above.")) .await - .with_context(|| format!("Failed to subscribe to the '{}' variant", "{Shorts}"))?; + .map_err(|err| { + error!("Failed to subscribe to the '{}' variant: {err}", "{Shorts}"); + }); } } else { actual_subscribe(app, name, url).await?; @@ -157,7 +166,7 @@ async fn actual_subscribe(app: &App, name: Option<String>, url: Url) -> Result<( let info = yt_dlp.extract_info(&url, false, false)?; - if info.get("_type") == Some(&serde_json::Value::String("Playlist".to_owned())) { + if info.get("_type").map(|v| json_cast!(v, as_str)) == Some("playlist") { json_get!(info, "title", as_str).to_owned() } else { bail!("The url ('{}') does not represent a playlist!", &url) diff --git a/crates/yt_dlp/Cargo.toml b/crates/yt_dlp/Cargo.toml index b8791a0..3632b23 100644 --- a/crates/yt_dlp/Cargo.toml +++ b/crates/yt_dlp/Cargo.toml @@ -25,7 +25,7 @@ publish = true curl = "0.4.48" indexmap = { version = "2.9.0", default-features = false } log.workspace = true -rustpython = { git = "https://github.com/RustPython/RustPython.git", rev = "c968fe0f", features = [ +rustpython = { git = "https://github.com/RustPython/RustPython.git", rev = "6a992d4f", features = [ "threading", "stdlib", "stdio", diff --git a/crates/yt_dlp/src/lib.rs b/crates/yt_dlp/src/lib.rs index c412704..a03e444 100644 --- a/crates/yt_dlp/src/lib.rs +++ b/crates/yt_dlp/src/lib.rs @@ -33,6 +33,7 @@ pub mod progress_hook; pub mod python_error; mod logging; +mod package_hacks; #[macro_export] macro_rules! json_get { diff --git a/crates/yt_dlp/src/options.rs b/crates/yt_dlp/src/options.rs index 182b8a1..dc3c154 100644 --- a/crates/yt_dlp/src/options.rs +++ b/crates/yt_dlp/src/options.rs @@ -22,7 +22,8 @@ use rustpython::{ }; use crate::{ - YoutubeDL, json_loads, logging::setup_logging, post_processors, python_error::process_exception, + YoutubeDL, json_loads, logging::setup_logging, package_hacks, post_processors, + python_error::process_exception, }; /// Wrap your function with [`mk_python_function`]. @@ -138,6 +139,11 @@ impl YoutubeDL { let output_options = options.options.clone(); let (yt_dlp_module, youtube_dl_class) = match interpreter.enter(|vm| { + { + // Add missing (and required) values to the stdlib + package_hacks::urllib3::apply_hacks(vm)?; + } + let yt_dlp_module = vm.import("yt_dlp", 0)?; let class = yt_dlp_module.get_attr("YoutubeDL", vm)?; diff --git a/crates/yt_dlp/src/package_hacks/mod.rs b/crates/yt_dlp/src/package_hacks/mod.rs new file mode 100644 index 0000000..53fe323 --- /dev/null +++ b/crates/yt_dlp/src/package_hacks/mod.rs @@ -0,0 +1,11 @@ +// yt - A fully featured command line YouTube client +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of Yt. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +pub(super) mod urllib3; diff --git a/crates/yt_dlp/src/package_hacks/urllib3.rs b/crates/yt_dlp/src/package_hacks/urllib3.rs new file mode 100644 index 0000000..28ae37a --- /dev/null +++ b/crates/yt_dlp/src/package_hacks/urllib3.rs @@ -0,0 +1,35 @@ +// yt - A fully featured command line YouTube client +// +// Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +// SPDX-License-Identifier: GPL-3.0-or-later +// +// This file is part of Yt. +// +// You should have received a copy of the License along with this program. +// If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +use rustpython::vm::{PyResult, VirtualMachine}; + +// NOTE(@bpeetz): Remove this, once rust-python supports these features. <2025-06-27> +pub(crate) fn apply_hacks(vm: &VirtualMachine) -> PyResult<()> { + { + // Urllib3 tries to import this value, regardless if it is set. + let ssl_module = vm.import("ssl", 0)?; + ssl_module.set_attr("VERIFY_X509_STRICT", vm.ctx.new_int(0x20), vm)?; + } + + { + // Urllib3 tries to set the SSLContext.verify_flags value, regardless if it exists or not. + // So we need to provide a polyfill. + + let scope = vm.new_scope_with_builtins(); + + vm.run_code_string( + scope, + include_str!("urllib3_polyfill.py"), + "<embedded urllib3 polyfill workaround code>".to_owned(), + )?; + } + + Ok(()) +} diff --git a/crates/yt_dlp/src/package_hacks/urllib3_polyfill.py b/crates/yt_dlp/src/package_hacks/urllib3_polyfill.py new file mode 100644 index 0000000..610fd99 --- /dev/null +++ b/crates/yt_dlp/src/package_hacks/urllib3_polyfill.py @@ -0,0 +1,13 @@ +# yt - A fully featured command line YouTube client +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of Yt. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. + +import ssl + +ssl.SSLContext.verify_flags = 0 diff --git a/flake.lock b/flake.lock index 5e500b5..6ebd85f 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1750752886, - "narHash": "sha256-pP1ZBxEo44HbLDyXVPPK8BQO882eGKpW9zzXliGFA/8=", + "lastModified": 1751009538, + "narHash": "sha256-H5v0MWj6OuuX0ct9INuwJj5kLDA0jKozmUcd5XfR9a4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "83685a4ccd44d2d4c09f2e5f7773d2f3f2156121", + "rev": "ce34f10e7180bdae28e8a3b0ab2f8c0ad4383506", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index c90fca4..770105e 100644 --- a/flake.nix +++ b/flake.nix @@ -33,6 +33,8 @@ mpv-unwrapped.dev libffi openssl + zlib + curl.dev ]; nativeBuildInputs = with pkgs; [ @@ -101,9 +103,8 @@ pkgs.sqlite-interactive # yt_dlp - pkgs.yt-dlp pkgs.python3Packages.yt-dlp - pkgs.python3 + pkgs.python3Packages.chardet pkgs.jq pkgs.ffmpeg diff --git a/nix/package.nix b/nix/package.nix index f4d6eac..1c7d836 100644 --- a/nix/package.nix +++ b/nix/package.nix @@ -18,6 +18,8 @@ ffmpeg, openssl, libffi, + zlib, + curl, # NativeBuildInputs makeWrapper, llvmPackages_latest, @@ -47,6 +49,7 @@ rustPlatform.buildRustPackage (finalAttrs: { "mkdb.sh" "help.str" "raw_error_warning.txt" + "urllib3_polyfill.py" ]) || (lib.strings.hasSuffix ".rs" (builtins.baseNameOf name)) || (lib.strings.hasSuffix ".h" (builtins.baseNameOf name)) @@ -66,6 +69,8 @@ rustPlatform.buildRustPackage (finalAttrs: { ffmpeg openssl libffi + zlib + curl.dev ]; checkInputs = [ @@ -105,7 +110,7 @@ rustPlatform.buildRustPackage (finalAttrs: { lockFile = ../Cargo.lock; outputHashes = { "ruff_python_ast-0.0.0" = "sha256-/CVpNBOBpvQhz7X80nUHC2x7ZxxCJH8O0WAABJKEriA="; - "rustpython-0.4.0" = "sha256-hsWqLRiqA0pUNFkHPwvu+Myh5a3p/VXotkPq5ZexqaQ="; + "rustpython-0.4.0" = "sha256-VRWmqwbuaxvI4cR3wWQZlYiiMAiRbqpKcsNpI7T+AP8="; "rustpython-doc-0.3.0" = "sha256-34ERuLFKzUD9Xmf1zlafe42GLWZfUlw17ejf/NN6yH4="; }; }; |