Fix yt-dlp JavaScript runtime by installing deno #283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As of yt-dlp version 2025.11.12 an external JavaScript runtime is now required for full YouTube support. We have been having occasional issues with videos being downloaded in a lower resolution than was available, at least since October. Missing the JS runtime is a likely cause of this and the problem will only get worse with time.
yt-dlp recommends that
denois used as the JavaScript runtime.denocan be installed withnpmor via a shell script. I opted for the former approach since that would allow for a declarative and idempotent way of ensuringdenois present.nodecan be used with an option override, but only the CLI option for this is documented and I couldn't find any code examples of anyone doing this. The yt-dlp team recommends against usingnodeinstead ofdenoif at all possible.Changes
nodev24 LTS andnpmfrom the NodeSource Debian repositorynodein the base Debian repository is v18 and cannot be used since it is no longer supported and the installation ofdenowith an unsupported version could potentially break in the near futurenpmand thepuppet/nodejsmodule to installdenousingnpmDeployment
There are a couple of new puppet modules that need to be installed for the manifest to apply successfully. There is no
Puppetfilein this repository for me to add modules in, so I assume that has to be done some other way.These are the modules that need to be added:
puppet/nodejsis needed to install node and npm, which is needed to install denopuppetlabs/aptis an indirect dependency ofpuppet/nodejsthat's needed to add a new apt repositoryConfirmation
You can confirm the runtime is being detected by running the following command on the instances:
If you see
[debug] JS runtimes: deno-2.6.4in the output (or any other version) then it's setup correctly. I tested this in a Debian Bookworm container and it picked it up as expected for me.