jlesage / docker-jdownloader-2

Docker container for JDownloader 2
MIT License
769 stars 71 forks source link

Internet browser for JDownloader #3

Open clx81 opened 7 years ago

clx81 commented 7 years ago

Hello, To solve some captcha, JD needs access to a web browser, ie. Turbobit. It shoud'be nice to integrate a light browser inside the container. I will try to do it. Many thanks for your nice work. Paul

jlesage commented 7 years ago

Thanks for the suggestion. I will look at this!

rix1337 commented 7 years ago

Just for debugging: For most captchas the integrated phantomjs should do the work.

If I remember correctly, a real browser is only needed for exotic captchas, or if something goes wrong. Would be a good fallback, though!

jlesage commented 7 years ago

Do you have any example of a download link that would require a real browser?

rix1337 commented 7 years ago

Not anymore, sadly. @clx81 since you brought it up: any example?

jlesage commented 7 years ago

For reference, this link has more information about captchas that need browser: https://support.jdownloader.org/Knowledgebase/Article/View/42/14/jd-opens-my-browser-to-display-captchas

clx81 commented 7 years ago

Hello Jocelyn, This link need browser : http://turbobit.net/ozmzsk9hxi2c.html

rix1337 commented 7 years ago

To add further, some settings might need tweaking:

In the advanced settings:

GeneralSettings: Browser Command Line CommandLine to open a link in a browser. Use %s as wildcard for the url

is currently set to ["/usr/bin/firefox","%s"] on my setup.

Then, there is: BrowserCaptchaSolver: Browser Commandline Example: [ "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe", "-app=%s" ] also set to ["/usr/bin/firefox","%s"]

No idea, if firefox is the way to go here? There seems to be a chromium package for alpine!

jlesage commented 7 years ago

In this scenario, a full web browser is not required... Ideally, I would like to find and use a light-weight browser that support the captchas. A browser like firefox or chromium would double (if not more) the size of the container image!

clx81 commented 7 years ago

There is Dillo running on Alpine, but I don't know if it can do the job !

jlesage commented 7 years ago

Tried, but doesn't properly display captchas (at least the SweetCaptcha one).

clx81 commented 7 years ago

I agree that Firefox will increase the container image but if you run JD2 for a few days with some downloads the memory size increased up to 900 Mb. We see that also when running it out of docker (verified on Debian 8)

jlesage commented 7 years ago

You talk about the RAM or disk space?

clx81 commented 7 years ago

I talk about the RAM, I think that JD2 don't flush the RAM until reboot.

mapleshadow commented 6 years ago

Please support built-in browser, otherwise it can not pass captcha. At present, you can use the Android client, the normal input captcha. But that's not the perfect way.

rix1337 commented 6 years ago

My setup is highly automated and can even solve recaptcha v2 with the integrated shadowjs. Am using 9kw.eu for this. This is working fine as-is. No browser required...

mapleshadow commented 6 years ago

@rix1337 Thank you very much.

rix1337 commented 6 years ago

@jlesage Thank you for the frequent updates!

grundscm commented 6 years ago

Hello, it is possible to implement a firefox inside container? I tried it without any success. Thanks a lot

jlesage commented 6 years ago

You can install it by executing add-pkg firefox-esr in the container. But like others said a web browser should not be required.

grundscm commented 6 years ago

Hello jlesage, thank you for your support. If i use the jdownloader with firefox the container always crash at a link paste. I use these settings in the jdownloader. GeneralSettings: Browser Command Line -> ["/usr/bin/firefox","%s"] BrowserCaptchaSolver: Browser Commandline -> ["/usr/bin/firefox","%s"]

I know the solution without any browser from "rix1337" works well.
I think my idea is an all in one isolated container.

BR

jlesage commented 6 years ago

I remember having similar issue when I evaluated the possibility of integrating a browser. I think there is some incompatibility between JDownloader, which needs glibc, and Firefox, which is compiled with musl.

rix1337 commented 6 years ago

another info: if you dont want to user solver services (9kw, etc.) you can enable "solve by app/myjdownloader".

This works for all captcha types and does not require a browser aswell.

You just need a phone or desktop browser at hand when a captcha appears.

grundscm commented 6 years ago

@rix1337 Thanks for the additional info! Maybe there is another browser easier to implement in the container? I think "Copy/Paste"(mobile phone use) would be easier if i have both in one container.

rix1337 commented 6 years ago

none that I know of.. maybe try the captcha through myjdownloader option for now.

diyfr commented 6 years ago

You have PhantomJs Question: can not directly paste a link, we must go through the clipboard button at the top right ?

Hi @jlesage i writed a dockercompose here using your docker image behind an proxy (traefik) and added Minio for access to downloaded files

Draic commented 6 years ago

The standard firefox in this docker is version 47, but the jdownloader captcha addon requires 48

jlesage commented 6 years ago

Sorry what do you mean exactly? Firefox is not part of the container image...

Draic commented 6 years ago

oh my fault, sorry. This is the wrong docker :D. mixed two nearly identical ones. ignore me

SubrataM3 commented 5 years ago

Hi @jlesage I have tried installing firefox-esr package on the image but its working strangely. If i log into the shell and run firefox command i get firefox window on my browser and the browsing works without any issue. But if try to open firefox clicking any link on jdownloader different kind of error arises.

Example error 1: [Parent 6507] WARNING: pipe error (38): Connection reset by peer: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.9.0esr/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 322

Example error 2:

Gdk-Message: 18:44:46.182: firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

[Child 5799] ###!!! ABORT: Aborting on channel error.: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.9.0esr/ip.cpp, line 2152
[Child 5799] ###!!! ABORT: Aborting on channel error.: file /home/buildozer/aports/community/firefox-esr/src/firefox-52.9.0esr/ip.cpp, line 2152

I am not sure whats going on here. I think it will be really helpful if you can add a seperate image with firefox for those who don't care about the image size.

Thanks.

jlesage commented 5 years ago

Try to create the container with the following parameter: --shm-size 2g This is usually required to properly runs firefox.

calvinbui commented 5 years ago

i had profile permission issues or SSL issues with Firefox, Dillo and Midori. Chromium worked for me. In Advanced Settings i put:

GeneralSettings: Browser Command Line -> ["/usr/bin/chromium-browser", "--no-sandbox", "%s"]
BrowserCaptchaSolver: Browser Commandline -> ["/usr/bin/chromium-browser", "--no-sandbox", "%s"]
drod3763 commented 4 years ago

I am running into a similar issue regarding browsers when trying to use my real-debrid account. It creates a popup for Oauth which won't open anything for the obvious reasons. Is there a workaround for this?

Screen Shot 2020-05-06 at 11 18 11 AM

trulow commented 3 years ago

Any updates or workarounds to this issue? I can't get realdebrid to authenticate because I keep getting an oauth error

PavelD commented 3 years ago

Any updates or workarounds to this issue? I can't get realdebrid to authenticate because I keep getting an oauth error

I spend some time to finalize it so here are my steps:

I created simple docker file like that:

FROM jlesage/jdownloader-2

RUN apk add chromium

That's all for the installation itself.

For configuration is had to tweak a few thinks.

I had to define the container_name in docker compose file to avoid report of locked profile. To avoid chromium crashes i add shm_size: 2gb as proposed @jlesage.

Then in the `Advanced Settings i changed configuration according to @calvinbui post. (not sure what is doing the --no-sandbox, it's reported by current versions of chromium, but it's still working).

As well i install the extension to chromium after the fist run. The chromium profile stays is the mounted folder so it is necessary to do it only once.

After this change the size of the docker image has changed from 224MB to 501MB but solving captcha in browser is working.

Hope this brief description will help.

UPDATE:

Here is my complete docker-compose.yml file. pad/jd2:current is my name of image generated by docker file for the step 1.

version: '3'
services:
  jd2:
    image: pad/jd2:current
    container_name: jd2
    ports:
      - "5800:5800"
      - "5900:5900"
    volumes:
      - "/docker/appdata/jd2:/config:rw"
      - "/docker/data/jd2:/output:rw"
    environment:
      KEEP_APP_RUNNING: 1
    shm_size: 2gb
    restart: unless-stopped
trulow commented 3 years ago

For anyone who is also looking to add real debrid to their installation but can't due to the issues with oauth. I was able to solve it by using this method provided by jdownloader

How to copy your account settings into a headless JD installation:

  1. Add all of your desired accounts to a JD installation with GUI (alternatively, copy the account database from your headless installation into your GUI installation, see steps below).
  2. Define your desired account settings.
  3. Close your headless JDownloader.
  4. Copy your account database from [Your GUI-JD install dir]/cfg/org.jdownloader.settings.AccountSettings.accounts.ejs to your headless installation. ⁃ Click on Help>About>Installation Directory to find your install directory Your Account settings should now be applied to your headless installation.

https://support.jdownloader.org/Knowledgebase/Article/View/headless-settings

In my case, I copied the org.jdownloader.settings.AccountSettings.accounts.ejs file to the config/cfg which was defined in the docker run command via "-v /home/USER/jd/config/:/config:rw \"

jlesage commented 3 years ago

Accounts can also be added via MyJDownloader (https://my.jdownloader.org). So this is probably the easiest way to add a read-debrid account.