Repository navigation
Conversation
Mynacol
left a comment
There was a problem hiding this comment.
Some review comments I made while reading the PR code.
| }: | ||
|
|
||
| let | ||
| # Nix does not coerce booleans to strings, unlike integers. |
| # Since 0.10.0 the add-on can use a system-provided yt-dlp ("system" | ||
| # source) through `importlib.import_module("yt_dlp")`. Expose the | ||
| # packaged one via the add-on's `lib` directory, which is added to | ||
| # Kodi's PYTHONPATH (see `passthru.pythonPath`), like script.module.* | ||
| # add-ons do. | ||
| mkdir -p lib | ||
| ln -s ${ytdlp}/${kodi.pythonPackages.python.sitePackages}/yt_dlp lib/ | ||
|
|
||
| # yt-dlp's JS-challenge solver scripts (used by its "deno" provider) are | ||
| # shipped in the yt-dlp-ejs python package; expose them as well so that | ||
| # no solver script is downloaded at runtime. | ||
| ln -s ${kodi.pythonPackages.yt-dlp-ejs}/${kodi.pythonPackages.python.sitePackages}/yt_dlp_ejs lib/ |
There was a problem hiding this comment.
Do we have to use symlinks for this? Can't we just add this into buildInputs, dependencies or similar and the nixpkgs infrastructure makes it available to this python?
There was a problem hiding this comment.
I'm not really sure, see the comment below for details. from my window, we must, but I'd like to know your point of view.
| # Patch the default values of the given add-on settings. | ||
| ${lib.concatMapAttrsStringSep "\n" ( | ||
| id: value: | ||
| "sed -i '/<setting[^>]*id=\"${id}\"/,/<\\/setting>/ s#<default>[^<]*</default>#<default>${settingValueToString value}</default>#' resources/settings.xml" |
There was a problem hiding this comment.
Use a xml modification program like yq-go to avoid having to regex your way through structured formats.
There was a problem hiding this comment.
you're right, thanks, it's done :)
| ''; | ||
|
|
||
| passthru = { | ||
| pythonPath = "lib"; |
There was a problem hiding this comment.
This might not be needed anymore based on my earlier suggestions.
There was a problem hiding this comment.
depends on your 2nd comment, see below for details
sendtokodi v0.10.0 re-architected the add-on around yt-dlp and added a "system" yt-dlp source: the add-on can import a distribution-provided yt_dlp. Wire the packaged yt-dlp into it: - expose it (and its solver scripts, yt-dlp-ejs) as lib/yt_dlp / lib/yt_dlp_ejs with passthru.pythonPath = "lib"; - default ytdlp_source to "system" and deno_autodownload to false: with the packaged yt-dlp nothing is downloaded at runtime; - drop use-yt-dlp-only.patch; add a nix-update updateScript. Assisted-by: Hermes Agent (DeepSeek V4.1 Flash)
8182d36 to
005ab77
Compare
|
Thanks for the review — and sorry for the slow reply.
In other words, every route we could find ends with the module living inside an add-on's own file tree — which is why For context, the symlink itself is not new here: #420504 introduced it for this add-on in 0.9.924, on
We may well be wrong about the symlink and Disclosure (automation/AI policy): this reply was prepared with the assistance of an LLM tool — Hermes Agent, primary model |
Note: this PR replaces #570301, which could not be re-opened — the amend adding the
Assisted-by:trailer (required by the AI policy) rewrote the head, and GitHub permanently refuses to re-open a closed PR whose branch was force-pushed. The revision is unchanged (identical tree); the full context is in #570301.Apologies for the initial submission not following the PR template. Thanks @RossSmyth and @aanderse for the guidance — the description below now follows the template, and the guidelines (incl. the automation/AI policy) have been reviewed.
sendtokodi v0.10.0 re-architected the add-on around yt-dlp and added a
systemyt-dlp source: instead of vendoring yt-dlp, the add-on can now import a distribution-providedyt_dlp. This PR wires the packaged yt-dlp into that source.The packaged 0.9.924 predates this rework: its patches no longer apply and it can no longer resolve many sites.
Changes
use-yt-dlp-only.patch.systemsource: expose the packaged yt-dlp and its challenge-solver scripts (yt-dlp-ejs) aslib/yt_dlp/lib/yt_dlp_ejswithpassthru.pythonPath = "lib"(thescript.module.*mechanism).ytdlp_source = "system"anddeno_autodownload = falseso the defaults work with no runtime downloads (the packaged yt-dlp carries the solver scripts and a baked-in Deno path, see yt-dlp: make deno available to python dependents #466381). Both are plainsettingsvalues, easy to flip if you prefer the upstream defaults.passthru.updateScriptvia nix-update (addonUpdateScriptdoes not apply: the add-on is not distributed through mirrors.kodi.tv).Testing (x86_64-linux)
kodiPackages.sendtokodibuilds;lib/yt_dlp/lib/yt_dlp_ejspoint at the packaged yt-dlp / solver.kodi.withPackages (p: [ p.sendtokodi p.inputstream-adaptive ]), headless end-to-end (no Deno onPATH; the packaged yt-dlp provides its own Deno): resolves with the packaged yt-dlp —Using system yt-dlp 2026.08.19— and plays (DASH 1080p, streams 137+140), with no runtime downloads.kodiPackages.inputstream-adaptivealongside.yt-dlp source: system; Deno auto-update off, "Installed Deno version: not installed"), and playback works end-to-end with audio, including a full play-through to end-of-stream.nixpkgs-review pr 570301(x86_64-linux): 1 package built —kodiPackages.sendtokodi(evaluated via kodiPackages.sendtokodi: 0.9.924 -> 0.10.0 #570301's CI eval; same tree as this PR).References
systemsource: sendtokodi PR #185 / PR #186 (by @zibaone).PATH#466014 rejected).Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/. (Kodi add-on: no such binary files; runtime was exercised by the end-to-end tests above.)Automation/AI disclosure
Per the automation/AI policy: this change — package file, commit message and this description — was developed with the assistance of an LLM-based tool (Hermes Agent, primary model
deepseek-v4.1-flash). It was reviewed, tested and is submitted by me (@zibaone), who is responsible for it and can answer questions about it. Testing was scripted (headless Kodi, driven over JSON-RPC) and reproducible; scripts available on request. The commit carries anAssisted-by:trailer.