Skip to content
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

Request: Restore download option or equivalent? #207

Open
JimmXinu opened this issue Oct 23, 2021 · 9 comments
Open

Request: Restore download option or equivalent? #207

JimmXinu opened this issue Oct 23, 2021 · 9 comments
Labels
enhancement New feature or request wontfix This will not be worked on
Milestone

Comments

@JimmXinu
Copy link

Can we get the download option or an equivalent back? I use it with FanFicFare to download small cover images for stories.

Environment

  • FlareSolverr version: v2.0.0
  • Last working FlareSolverr version: v1.2.9
  • Operating system: Win10
  • Are you using Docker: no
  • FlareSolverr User-Agent (see log traces or / endpoint):
  • Are you using a proxy or VPN? no
  • Are you using Captcha Solver: no
  • If using captcha solver, which one:
  • URL to test this issue:

Description

download option was removed, can't download images in v2.0.0.

Example: https://www.fanfiction.net/image/6721098/180/

Logged Error Messages

N/A

Screenshots

N/A

@ghost
Copy link

ghost commented Oct 23, 2021

I also use this for downloading the raw HTML bytes for a page (without modification) to better handle some pages that have a mix of charsets in the page (eg where some content in the page is UTF8 and some is from windows-1252. Would be very useful to see it come back,

@ngosang ngosang added the enhancement New feature or request label Oct 24, 2021
@ngosang
Copy link
Member

ngosang commented Oct 24, 2021

I remove this feature since is not working with Puppeter + Firefox. There are 2 options:

  • Request the main page with FlareSolverr. It will bypass Cloudflare and return the User-Agent and the cf_clearence cookie. You make your own code to make the download request.
  • Implement this feature in FlareSolverr using the same logic but performing the download with NodeJS HTTP client.

@JimmXinu
Copy link
Author

I would suggest the second option is better:

  1. Restoring the download option is more backward compatible.
  2. Doing it in FlareSolverr is cleaner for clients, which means you have fewer users asking for help when they(we) do it wrong. :-)

@Philipp5796
Copy link

This feature was removed, because it wasn't working with Puppeter + Firefox.
Since FlareSolverr v3 now uses Chrome, is this still valid, or can this feature added again? @ngosang

@ngosang ngosang added this to the 3.2.0 milestone Mar 31, 2023
@ngosang
Copy link
Member

ngosang commented Mar 31, 2023

I will revisit this in the next release.
FlareSolverr v1 used Puppeter + Chrome and now we are using Selenium + Chrome. I don't know if it's supported yet.

@362227

This comment was marked as spam.

@acg5159
Copy link

acg5159 commented Oct 15, 2023

Just seeing if this is possible now, I see a couple of stack overflow responses which seem like you can adjust the arguments you pass to chrome. They will tell chrome to auto download files of a certain type (image/jpg, etc.) instead of attempting to load them in a browser tab.

https://stackoverflow.com/questions/32205245/need-the-chrome-equivalent-of-these-firefox-browser-profile-settings-in-seleni

Could we pass these, and then when the file is downloaded in the docker image, send the file either trough a curl response as binary data or maybe have it download to some mounted docker location?

@maliayas
Copy link

Is there at least a workaround until the feature gets implemented? I want to download jpeg files but no way.

@ilike2burnthing
Copy link
Contributor

Per @acg5159's link above, you could try adding the following after L138 in utils.py, changing the file types and download directory as you want:

    options.add_argument("browser.download.folderList=2")
    options.add_argument("browser.helperApps.neverAsk.saveToDisk=image/png")
    options.add_argument("browser.download.dir=C:\\Users\\Public\\Downloads")

As my home internet is currently being a dick, that is untested.

Failing that, you could use a script to make the initial request with FlareSolverr, return the cookie, and then use the cookie for future curl requests in the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

7 participants