add jdownloader (official bootstrap JAR via Scoop Java): manifest, daily hash updater, install script, README

This commit is contained in:
Jonas8272 committed 2026-11-23 06:24:49 +00:00
1 parent a1dbe5e10a
commit 53b4e13857
6 files changed
+192

No files matched your search

@@ -0,0 +1,28 @@
name: autoupdate-jdownloader
on:
schedule:
- cron: '53 5 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
container:
image: data.forgejo.org/oci/node:20-bookworm
steps:
- name: Install tools
run: apt-get update -qq && apt-get install -y -qq jq
- uses: actions/checkout@v4
- name: Update manifest
run: tr -d '\r' < scripts/update-jdownloader.sh | bash
- name: Commit and push
run: |
git config user.name "autoupdate"
git config user.email "[email protected]"
if ! git diff --quiet; then
git commit -am "jdownloader: update to $(jq -r .version bucket/jdownloader.json)"
git push
fi
+18
View File
@@ -204,6 +204,24 @@ irm https://codefloe.com/Jonas8272/scoop-bucket/raw/branch/master/installations/
> **Note:** For other versions check out [gandli's](https://github.com/gandli/scoop-vmware) bucket > **Note:** For other versions check out [gandli's](https://github.com/gandli/scoop-vmware) bucket
## Installing jdownloader
JDownloader 2: a download manager that grabs files and links from many sites.
```powershell
scoop install Jonas8272/jdownloader
```
Or set up everything and install it with one script:
```powershell
irm https://codefloe.com/Jonas8272/scoop-bucket/raw/branch/master/installations/install-jdownloader.ps1 | iex
```
> **Note:** This uses JDownloader's official JAR file, so it needs Java. Scoop installs `java/temurin-jre` for you from the official `java` bucket (the scripts add that bucket if it is missing). The first time you start JDownloader, it downloads the rest of the app from its own servers.
> **Note:** JDownloader updates itself. The bucket re-checks the official JAR every day and updates the manifest when the file changes, so `scoop update` only fetches the small bootstrap file again.
## Updating ## Updating
Update Scoop and its bucket manifests: Update Scoop and its bucket manifests:
+15
View File
@@ -0,0 +1,15 @@
{
"version": "0.0.0",
"description": "JDownloader 2 download manager (official bootstrap JAR; it downloads the app on first run)",
"homepage": "https://jdownloader.org/",
"license": "Freeware",
"depends": "java/temurin-jre",
"url": "https://installer.jdownloader.org/JDownloader.jar",
"hash": "0000000000000000000000000000000000000000000000000000000000000000",
"pre_install": "Set-Content -Path \"$dir\\JDownloader.cmd\" -Value '@echo off', 'start \"\" javaw -jar \"%~dp0JDownloader.jar\"' -Encoding Ascii",
"bin": "JDownloader.cmd",
"shortcuts": [
["JDownloader.cmd", "JDownloader 2"]
],
"persist": "cfg"
}
+8
View File
@@ -115,6 +115,14 @@ if (-not $manifests) {
throw "No app manifests found in $bucketDir." throw "No app manifests found in $bucketDir."
} }
# Some apps (for example jdownloader) depend on packages from the official 'java' bucket
$needsJava = $manifests | Where-Object { (Get-Content -Path $_.FullName -Raw) -match '"depends"\s*:\s*"java/' }
if ($needsJava -and -not (scoop bucket list | Where-Object { $_.Name -eq 'java' })) {
Write-Host "Adding the 'java' bucket..." -ForegroundColor Cyan
scoop bucket add java
if ($LASTEXITCODE -ne 0) { throw "Failed to add the 'java' bucket." }
}
# 5. Install them ------------------------------------------------------------ # 5. Install them ------------------------------------------------------------
$isAdmin = Test-Admin $isAdmin = Test-Admin
$results = @() $results = @()
+97
View File
@@ -0,0 +1,97 @@
<#
.SYNOPSIS
Installs JDownloader from the Jonas8272 bucket. Sets up Scoop, git and the
bucket first if they are missing.
.DESCRIPTION
JDownloader is installed from its official JAR file, so it needs Java. Scoop
installs java/temurin-jre for you from the official 'java' bucket, which this
script adds if it is missing. The first time you start JDownloader it
downloads the rest of the app from its own servers.
.EXAMPLE
irm https://codefloe.com/Jonas8272/scoop-bucket/raw/branch/master/installations/install-jdownloader.ps1 | iex
.NOTES
Run in a normal (non-admin) PowerShell window if Scoop is not installed yet.
#>
$ErrorActionPreference = 'Stop'
$App = 'jdownloader'
$BucketName = 'Jonas8272'
$BucketUrl = 'https://codefloe.com/Jonas8272/scoop-bucket'
function Test-Command($name) {
return [bool](Get-Command $name -ErrorAction SilentlyContinue)
}
function Test-Admin {
$id = [Security.Principal.WindowsIdentity]::GetCurrent()
$principal = New-Object Security.Principal.WindowsPrincipal($id)
return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}
$scoopRoot = if ($env:SCOOP) { $env:SCOOP } else { Join-Path $env:USERPROFILE 'scoop' }
# 1. Scoop -------------------------------------------------------------------
if (-not (Test-Command 'scoop')) {
Write-Host 'Scoop not found. Installing Scoop...' -ForegroundColor Cyan
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
if (Test-Admin) {
Invoke-Expression "& {$(Invoke-RestMethod -Uri 'https://get.scoop.sh')} -RunAsAdmin"
} else {
Invoke-RestMethod -Uri 'https://get.scoop.sh' | Invoke-Expression
}
# Make scoop available in this session without reopening PowerShell
$env:PATH = "$scoopRoot\shims;$env:PATH"
if (-not (Test-Command 'scoop')) {
throw 'Scoop was installed but is not on PATH. Open a new PowerShell window and run this script again.'
}
} else {
Write-Host 'Scoop is already installed.' -ForegroundColor Green
}
# 2. git (needed to add buckets) ----------------------------------------------
if (-not (Test-Command 'git')) {
Write-Host 'git not found. Installing git through Scoop...' -ForegroundColor Cyan
scoop install git
if ($LASTEXITCODE -ne 0) { throw 'Failed to install git through Scoop.' }
$env:PATH = "$scoopRoot\shims;$env:PATH"
} else {
Write-Host 'git is already installed.' -ForegroundColor Green
}
# 3. Bucket ------------------------------------------------------------------
$existing = scoop bucket list | Where-Object {
$_.Name -eq $BucketName -or $_.Source -like '*Jonas8272/scoop-bucket*'
} | Select-Object -First 1
if ($existing) {
$BucketName = $existing.Name
Write-Host "Bucket '$BucketName' is already added. Updating it..." -ForegroundColor Green
scoop update
} else {
Write-Host "Adding bucket '$BucketName'..." -ForegroundColor Cyan
scoop bucket add $BucketName $BucketUrl
if ($LASTEXITCODE -ne 0) { throw "Failed to add bucket '$BucketName'." }
}
# 4. The official 'java' bucket (jdownloader depends on java/temurin-jre) ------
$javaBucket = scoop bucket list | Where-Object { $_.Name -eq 'java' } | Select-Object -First 1
if (-not $javaBucket) {
Write-Host "Adding the 'java' bucket..." -ForegroundColor Cyan
scoop bucket add java
if ($LASTEXITCODE -ne 0) { throw "Failed to add the 'java' bucket." }
}
# 5. The app -----------------------------------------------------------------
Write-Host ''
Write-Host "Installing $App..." -ForegroundColor Cyan
scoop install "$BucketName/$App"
if ($LASTEXITCODE -ne 0) { throw "Failed to install $App." }
Write-Host ''
Write-Host "Done. $App is installed." -ForegroundColor Green
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
M=bucket/jdownloader.json
URL=https://installer.jdownloader.org/JDownloader.jar
# Download the official bootstrap JAR and hash it.
curl -fsSL -o /tmp/JDownloader.jar "$URL"
[ "$(head -c2 /tmp/JDownloader.jar)" = "PK" ] || { echo "download is not a jar" >&2; exit 1; }
hash=$(sha256sum /tmp/JDownloader.jar | cut -d' ' -f1)
cur_hash=$(jq -r .hash "$M")
if [ "$hash" = "$cur_hash" ]; then
echo "up to date ($hash)"
exit 0
fi
# Version = date and time the file was last modified (falls back to now).
lm=$(curl -fsSI "$URL" | tr -d '\r' | grep -i '^last-modified:' | head -1 | cut -d' ' -f2- || true)
ver=$(date -u -d "${lm:-now}" +%Y.%m.%d.%H%M 2>/dev/null || date -u +%Y.%m.%d.%H%M)
cur=$(jq -r .version "$M")
jq --indent 4 --arg v "$ver" --arg h "$hash" '.version=$v | .hash=$h' \
"$M" > "$M.tmp" && mv "$M.tmp" "$M"
echo "updated $cur -> $ver"