-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jdownloader2: init at 2.0 #136998
jdownloader2: init at 2.0 #136998
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! Builds and runs for me :-)
pkgs/top-level/all-packages.nix
Outdated
@@ -25471,6 +25471,8 @@ with pkgs; | |||
|
|||
dupd = callPackage ../tools/misc/dupd { }; | |||
|
|||
jdownloader2 = callPackage ../applications/networking/jdownloader2 {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: one more space here will be nice.
jdownloader2 = callPackage ../applications/networking/jdownloader2 {}; | |
jdownloader2 = callPackage ../applications/networking/jdownloader2 { }; |
I tried to this built this, and it builds fine but jdownloader just shows a white, blank screen. |
@bobby285271 I've implemented your suggestions, it should be ready now. |
The meta set is incorrect. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow the contributing guide when doing your commits.
version = "2.0"; | ||
|
||
src = fetchurl { | ||
url = "http://installer.jdownloader.org/JDownloader.jar"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
url = "http://installer.jdownloader.org/JDownloader.jar"; | |
url = "https://installer.jdownloader.org/JDownloader.jar"; |
Please upload this to web.archive.org.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://web.archive.org/web/2020*/https://installer.jdownloader.org/JDownloader.jar seems like its already there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then please update the URL with that link.
wrapper = writeScript "jdownloader2.sh" '' | ||
#! ${stdenv.shell} | ||
PATH=${lib.makeBinPath [ jre coreutils ]} | ||
|
||
JDDIR=''${XDG_DATA_HOME:-$HOME/.local/share}/jdownloader | ||
JDJAR=''${JDDIR}/JDownloader.jar | ||
dir=`dirname "$0"` | ||
|
||
if [ ! -f ''${JDJAR} ]; then | ||
install -Dm755 $dir/JDownloader.jar ''${JDJAR} | ||
fi | ||
|
||
${jre}/bin/java -jar ''${JDDIR}/JDownloader.jar "''${@}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use makeWrapper instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not find a way, even with help from NixOS discord channel. The problem is that JDDIR value must remain unchanged/unsubstituted, so that bash can do the substitution on runtime.
Once you're done with writing the expression could you rebase so we only have 2 commits, $package init and maintainers |
OK, but wouldnt squash merge do more or less the same thing? |
Might be, im not very good with git. |
c0e513c
to
9a0f404
Compare
9a0f404
to
ad58647
Compare
ad58647
to
29d4a33
Compare
nitpick: rename to |
name = "JDownloader 2"; | ||
exec = wrapper; | ||
icon = "jdownloader"; | ||
comment = "Free, open-source download management tool."; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho, "FOSS" is not relevant here. i would just say "Download manager"
(you can download all kinds of files with jd, also youtube videos ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took that from the official website, the FOSS refers to JDownloader not the stuff you can download, I think. Sure thing, I can change that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the package name, I can change that as well. For quite some time there were jdownloader and jdownloader2, the jdownloader is obsolete by now, but few people still use the jdownloader2 name as you can see on the repology https://repology.org/projects/?search=jdownloader
wrapper = writeScript "jdownloader" '' | ||
#! ${stdenv.shell} | ||
PATH=${lib.makeBinPath [ jre coreutils ]} | ||
JDJAR=''${XDG_DATA_HOME:-$HOME/.local/share}/jdownloader/JDownloader.jar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personally, i am NOT happy with auto-updates. should be "default off, enable on demand"
also, should be built from source. there is a mirror at https://github.com/mirror/jdownloader
the official repo is password-protected
that "source" contains 250 MByte build artifacts ( wontfix*.jar
files) and 50 MByte sources (*.java
files in src/)
ideally, we would download only the src/ folder, like github-downloader (via stackoverflow)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So to begin with, JDownloader supports many websites via its plugin system, and those are always autoupdated. Main app does not update automatically, only checks for updates, here is more info
https://support.jdownloader.org/Knowledgebase/Article/View/updates-update-behavior
I did not try to build from source, and I'm not sure if it is possible without access to the main repo, for example they use proprietary libraries, and I believe there are closed source parts as well (kinda like VSCode). That would require some tinkering, as for ex. AUR packages are using the bootstrapper as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an issue from the mirror about missing dependencies from password-protected official repo. mirror/jdownloader#47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an issue from the mirror about missing dependencies
the svn repos listed in https://jdownloader.org/knowledge/wiki/development/get-started are public, the issue is only a request to mirror these repos
they use proprietary libraries, and I believe there are closed source parts as well
im afraid yes ... im trying to build from source with headless eclipse, but at the end of the day, there will still be some binary blobs (*.jar
files with closed source), so jdownloader has license unfree
→ use containers for better security?
pyload is missing : /
$ nix-shell -p pyload
error: pyload has been removed from nixpkgs, as it was unmaintained.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
→ use containers for better security?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
x11docker
https://github.com/jlesage/docker-jdownloader-2 has invented this wheel already : )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at the end of the day, there will still be some binary blobs (
*.jar
files with closed source), so jdownloader has licenseunfree
yepp
Compiling 4610 source files to /build/jdownloader/bin
/build/jdownloader/src/jd/plugins/AccountInfo.java:267: error: cannot find symbol
final long serverTime = br.getCurrentServerTime(-1);
^
symbol: method getCurrentServerTime(int)
location: variable br of type Browser
jdownloader requires closed sources:
JDClosed
JDownloaderServerOptions
UpdateClientV2
JDownloaderUpdater
per jdownloader/build/newBuild/build.xml
i want to patch the myjdownloaderclient ...
in headless mode, jdownloader requires a valid account for myjdownloader
jd ignores json config
i have not-yet found a way to use a self-hosted api server, or to disable this completely ...
so much for "untrusted" software
relevant configkey is serverhost (default api.jdownloader.org
) in cfg/org.jdownloader.api.myjdownloader.MyJDownloaderSettings.json
but jd always says
|---------------------------Headless Information-------------------------------
| MyJDownloader
| Your 'My JDownloader' logins are not correct.
| Please check username/email and password!
| Enter y -> Enter Logins
| Enter n -> Exit JDownloader
so im back to binary patching ... or pyLoad
binary patching - its simple, its fun
let jd update, to download jar files
get Core.jar from approot
open recaf
open Core.jar
classes > org > jd > api > myjd > myjdcontroller
Ctrl+F for: boolean isAlwaysConnectRequired
DEFINE PUBLIC FINAL isAlwaysConnectRequired()Z
A:
LINE A 105
-INVOKESTATIC org/appwork/utils/Application.isHeadless()Z
-IRETURN
+EXPR return false;
B:
Ctrl+S, file > export > export to Core.patched.jar
in jd approot, replace Core.jar with Core.patched.jar
now, jd starts in headless mode, without requiring myjd login
Just thought I'd mention I have one here that I'm using:
|
Drafted until news. |
I marked this as stale due to inactivity. → More info |
Closed |
Quick update. I've been in contact with upstream, and they're adding a build-time option to enable using XDG_* and friends, and are going to provide an endpoint to query the stable SVN revisions for updating. Will report back once I hear more. |
using jdownloader practically needs autoupdate, as it breaks often the elephant in the room is <property name="dep.jdc" value="../JDClosed" /> which is a known wontfix
→ im running jd in docker #41321 (comment) |
Perhaps.
That's why they're providing an endpoint to get
The continue to do so by all means. But for "casual" users like myself, who don't download from "hostile" sites very often, the open-source version is fine. |
wait, there is an open-source version? when i try to compile jd without
|
Yup, I've got a (slightly outdated) one here: https://github.com/vs49688/nix-repo/tree/master/pkgs/jdownloader Once upstream's finished with their changes, I planned to submit it here for inclusion. I think the main difference is that I'm using |
still lots of room to hide malicious binaries. this is not "open source" dependencies should be fetched from maven (or similar) other binaries:
similar:
|
Baby steps. Upstream's been receptive to changes so far, I don't want to demand too much of them at once. |
did you try pyload? |
Yup, they're going to make it search $PATH for ffmpeg and friends, so these can just be rm'd for our purposes.
I've never heard of it, I'll have a look. |
Motivation for this change
JDownloader is a popular file downloader. Nix package downloads only bootstraping file and creates a wrapper for it. Inspired by JDownloader flatpak. Unfortunately there is no way to package it "the nix way" due to how the app is designed (mandatory selfupdate + writes configs/logs in its dir, and no way to change that). The upside is that this package should not require any updates.
Resolves: #41321 and #76568
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)