marklieberman / downloadstar

Download all items in a webpage that match a pattern
GNU General Public License v3.0
90 stars 16 forks source link

Competition is good #9

Closed nmaier closed 6 years ago

nmaier commented 7 years ago

Not really a bug, but this seems the fastest way to reach you...

Just so you know, I started doing my own "DTA Lite" web-extension, which probably will become the officially endorsed by us replacement to DTA for Firefox.

It's not public in any form yet, tho. I like that decided to do something, and maybe your creation will outdo mine, or we can compete and learn from each others solutions or collaborate in other ways.

Best wishes Nils

progress
marklieberman commented 7 years ago

Hey, I appreciate you reaching out to me like this and I'm glad to hear you are working on DTA Lite. I'd love to contribute and am very interested to see how you overcome some of the WE limitations I've encountered. (How are you dealing with the lack of APIs like downloads.onDeterminingFilename for example?)

Unfortunately development of DS has mostly stalled before it really began. I had a house fire this month and am dealing with insurance to replace my desktop computer and other possessions, but insurance moves slow. What little free time I have is mostly spent dealing with Foxy Gestures. From that screenshot it looks like you've already surpassed DS.

I imagine that due to the limited APIs and the fact that I was basically trying to reproduce DTA, our extensions would end up being quite similar anyway. So perhaps its better that you are taking up the mantle of DTA again.

nmaier commented 7 years ago

How are you dealing with the lack of APIs like downloads.onDeterminingFilename for example?

Right now, not at all, rather unfortunately. Hitting the server with a request before the actual download would be an option, however that creates a ton of problems with links that are only valid once and also of course would add a lot of overhead anyway. I hope the API will eventually be implemented, or that I'll be able to roll my own download engine (using blobs, IDBMutableFile/DOM FileSystem and pass the result to the downloads API as a blob:), I haven't explored this in depth yet tho.

marklieberman commented 7 years ago

The lack of onDeterminingFilename is a real thorn in the side of this type of addon. Firefox's built in conflict handling strategies are "overwite" and "uniqify". There's no way to cancel if a file already exists. There's no way to know if a file already exists at all. There's no callback on conflict.

With DTA, I'd often grab a bunch of files from a page, come back later when it updated, and grab some more. I'd tell DTA to skip existing files.

In DS, I just have the code remember the last 1000 downloaded target filenames. It's an absolutely terrible strategy for many reasons: 1) false positives on script downloads like .php with content disposition headers, 2) false positives when the file has been removed from disk and you want it again, 3) how much history is enough 1000?, 5000?, and 4) download history is being retained when you may not want it to.

On Bugzilla, they claim that to support onDeterminingFilename would require a significant refactor of their internals. I think its pretty critical to have this API to make download addons anything more than a curiosity.

ssokolow commented 6 years ago

That sort of "cancel if already exists" behaviour is so critical to me that, at present, I'm operating on the assumption that the only viable way to have enhanced downloading once 52 ESR is gone is to integrate an external download manager.

jrie commented 6 years ago

To cancel a download or take another action, if the download exists, to my understanding, would require to check, by addon/extension the local hard drive for existing filenames. Or the browser does ask for this permission explicitly. And this, likely, would end up in a mess.

I'm not aware of the internals of such a feature so. It's pure guesswork.

But I would assume, it has some risks, in general... so any addon could check if any or a particular file would be present. Leading to security problems.

ssokolow commented 6 years ago

Another thought. Have you guys considered implementing an optional native messaging helper to do the heavy lifting? (ie. Do an end-run around the downloads API as a whole and just write a simple little binary which takes a raw HTTP request definition and a path and plumbs the response from the former to a file handle opened from the latter.)

If installation experience is a concern, I helped the author of withExEditor to find a way to package withExEditorHost (Node.js-based) into single-file executables which he then set Travis-CI to build for a bunch of different targets and withExEditorHost has a --setup option that sets up the native messaging config automatically.

If I can make time, I hope to write something similar in Rust to enable the successor to TiddlyFox to save to locations outside the downloads folder. (At the moment, I still have to catch back up to my schedule enough to resume my plans to put together a nice InnoSetup- or NSIS-based installer for withExEditorHost's Windows releases to spite the situation webext has left us in.)

marklieberman commented 6 years ago

@ssokolow DownloadStar will always work as a standalone addon. I wouldn't be opposed to having a native client as an opt-in type feature, but its not a feature I am personally interested in implementing. I think if going the native client route, it would be easier to add DS type functionality to one of the existing download manager addons rather than vice versa.

ssokolow commented 6 years ago

What other extensions are you thinking of? AMO's search has been supremely unhelpful and, even for Download Star, I only found it by googling for Reddit answers to the question of a DTA replacement that's usable sooner than DTA Lite.

marklieberman commented 6 years ago

@ssokolow I don't use them myself, but i'm given to understand that IDM, jDownloader, etc. all work using native messaging clients.

ssokolow commented 6 years ago

Ahh. Those.

JDownloader a heavy Java application, not fully open-source, and I only run it in a sandbox as a way to batch-download from "Please wait 60 seconds" file lockers.

IDM is Windows-only and 30-day trialware to boot.

Do you know of anything which would work with KGet, FatRat, GWGET, uGet, Aria, SteadyFlow, wxDownload Fast, or Xtreme Download Manager? (I've been doing my research)

(Heck, the main need I have for something like Download Star or DTA Lite is scraping the page for links and sharing the browser's cookies with the download manager when submitting a new URL.)

marklieberman commented 6 years ago

@ssokolow XDM seems to have a connector addon. Otherwise, I am not very familiar with other download managers.

ssokolow commented 6 years ago

Thanks. It's not ideal in a lot of ways (XDM is also a Java application, has an ugly UI that's trying to fit in on Windows 10, and I don't see any mention of batch download-scraping functionality) but it's another option at least.

marklieberman commented 6 years ago

Closing in an effort to tidy up issues.