Host Grabber is a web extension to find and download media files from a web page.
It was originally designed for Mozilla Firefox. It is somehow the successor of Image Host Grabber, with some differences thought:
- It is not restricted to images.
- It does not check for MIME types.
- It is a little more strict in terms of what can be specified in hosts.xml files (no function).
- It has much more less options, for the moment. It is not planned to restore all the options that existed before.
Screenshots
Install on Firefox
You can install it from addons.mozilla.org.
From the version 0.7, a side-panel shows up the first time.
You can close it without worrying about it. By default, Firefox opens the side-panel
of every newly-installed extension that has one.
Install on Chrome / Chromium
This extension is in alpha version for Chrome / Chromium.
The debug panel is only available on Firefox.
This extension is NOT available on the Chrome store.
The reason is that the developper does not accept to pay fees to Google to distribute the extension. It is not the amount of money (5$) but a matter of principle. This extension is free, it is not acceptable to pay Google to distribute it.
To install the extension on Chrome, download
the last release,
open a new tab in Chrome in and type chrome://extensions
in the address bar,
followed by Enter.
Then, drag and drop the ZIP file in the tab.
That’s it.
-
Once this extension has been installed or upgraded, it is necessary to restart Chrome, or to reload all the existing tabs (with the F5 key) that would need it. Unlike Firefox, Chrome does not reinject some scripts in already-loaded pages.
-
In order to use this extension in good conditions with Chrome, it is necessary to update the download preferences. All the files should be saved in the same folder, and Chrome should not ask for the download location. A bug was reported to the Chrome team. Feel free to vote for it, it may speed up its resolution.
Usage
Simply browse a web page and right-click anywhere.
Then, click Host Grabber > Extract and Download.
Host Grabber will then analyze the source code, explore its content and finds download links. Once this step is complete, downloading starts. The analysis is performed against a dictionary that defines what and how to find download links.
It is also possible to download direct image links and download images from a selection on the page.
Browser Permissions
This extension needs to introspect the source code of the current web page to find files to download. By doing so, it could also access private information (such as usernames). It could, but it does not. The extension is only executed in your web browser and does not any of your data. For the record, Image Host Grabber used to work the same way. The only difference is that Firefox and Chrome now tell users what permissions a web extension requires.
You can find more information about permissions on the following pages:
Preferences
Here is a short description of the preferences.
- Catalog URL: the default dictionary is hosted here.
You can define your own one if you want and specify it through the extension preferences. - Automatically update the dictionary: true to download the dictionary every time firefox starts. Otherwise, the catalog is cached locally and this local copy must be updated manually from the options page.
- Hide downloads that successfully completed: this option hides from the extension’s download view all the downloads that were successful. Those with failures will remain visible.
- Remove successful downloads from Firefox’s download view: this option removes from Firefox’s download view all the downloads that were successful. Those with failures will remain visible.
- Open the download view when pages are analyzed: this option seems quite explicit. The default behavior is to open the view. It can be disabled with this option.
- Prefix file names with a counter: prefix all the file names with a counter, which guarantees file ordering will be the same as the download order.
- Limit the number of simultaneous downloads: this option allows to limit the number of parallel downloads started by HG ++. Notice that by default, Firefox already limits the number of active connections towards a same server (by default, this value is 6).
- Cache download links during sessions: this option prevents a same file from being downloaded several times during a same session. The cache can be cleared or even disabled.
- Download directory: by default, everything is downloaded in the same directory. But it is also possible to dispatch files in sub-directories (by domain, date, title or even custom pattern).
Custom Sub-Directory Paths
Here are the available tags if you want to customize the download directory. You can mix these tags with constant values to build path.
Tag | Description |
---|---|
%year% |
Replaced by the current year (4 digits). |
%month% |
Replaced by the current month (2 digits). |
%day% |
Replaced by the current day (2 digits). |
%hour% |
Replaced by the current hour (2 digits). |
%minute% |
Replaced by the current minutes (2 digits). |
%domain% |
Replaced by the page’s URL domain. |
%title% |
Replaced by the page’s title. |
Example of custom pattern for a sub-directory: firefox/%year%-%month%/
The resulting name or path will always be truncated to not exceed 160 characters.
Notice
This web site is not about managing a centralized list of hosts. You can fork the original list, add your own hosts and contribute them through a pull request.
As the author of the extension, I will upgrade the web extension itself.
However, I do not intend nor want to manage everybody’s list. So, it is highly possible that
a better list of hosts appears somewhere else.
Hosts Definitions
This page explains the various strategies available to find media files to download on a web page.
Debugging
In Firefox, there is a debugging panel to create, edit and test dictionary rules. You can access it with a right-click menu and by selecting Host Grabber > Show Debug Panel.
This panel remains open, no matter what tab is selected.
Once a rule is defined, it can be tested by browsing any web page. By clicking the
Extract Links button, the page is analyzed with this single rule. Links are extracted,
and displayed in a separate view, but nothing is downloaded. This is only to help writing dictionary items.
Reuse by Other Web Extensions
The first use case for this extension is to be invoked by a user through a menu or a shortcut. However, it may also be used by other web extensions through an API. They can indeed send a request to HG ++ so that it explores a given URL and downloads media files from it.
Here is a sample code showing how to invoke HG ++ from your own extension.
Notice that IG ++ does not return any response, it only explores the URL,
opens its downloads view and retrieves the media files it found.
browser.runtime.sendMessage(
'{1a70f086-e7b8-43da-8171-e3e5c532ad4f}',
{
req: 'explore-page',
page: 'The URL of the page to explore.'
}
);
Bugs, Feature Requests…
No bugs or feature request can be reported for the hosts.xml file.
For the extension itself, you can submit them here.
Links
- Source code
- Download from addons.mozilla.org
- Release notes
- Chat on Gitter
- Original hosts.xml file on Github