Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Minor improvements to documentation files #3061

Merged
merged 6 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ title: Command-line interface

## Introduction

Starting 4.0.0 version, Grabber can be totally run through the command line.
Starting 4.0.0 version, Grabber can be run through the command line.


## Compilation

There is two ways to use the command line.
There are two ways to use the command line.

When compiling Grabber, just uncomment "CONFIG += use\_cli" to set the CLI to be the default behavior. The downside is that running it in GUI mode with the "-g" or "--gui" command will pop up a console too if not run from a terminal already.

Expand All @@ -19,7 +19,7 @@ If you keep it commented or just use the precompiled version, Grabber will start

## Commands

In this part I'll consider that you are using the precompiled version, which has "CONFIG += use\_cli" commented.
In this part, I'll consider that you are using the precompiled version, which has "CONFIG += use\_cli" commented.

### Help
You can find help with the "-?", "-h", or "--help" commands.
Expand Down Expand Up @@ -111,11 +111,11 @@ http://simg2.gelbooru.com/images/2077/eea3d1e72f2f33521ccf68874b408d38.png
```

#### Images per page
You can use the "-i" or "--perpage" option to choose how many images per page the program should return. Default value is 20.
You can use the "-i" or "--perpage" option to choose how many images per page the program should return. The default value is 20.

You can use the "-m" or "--max" option to choose how many images you want to return. By default, the program returns everything it finds on the requested pages.

Mixed together, they can allow to get multiple pages for a single request. For example, "-i 2 -m 10" will return the same result as "-i 10", but will use 5 requests to do so.
Mixed together, they can allow you to get multiple pages for a single request. For example, "-i 2 -m 10" will return the same result as "-i 10", but will use 5 requests to do so.
```
./grabber -c -t "inugami_kira" -s "danbooru.donmai.us" -i 10 --return-images
http://danbooru.donmai.us/data/3fccf5d7c6a0fe066cb0c6d3d584dba4.jpg
Expand Down Expand Up @@ -169,7 +169,7 @@ You can use the "--tf" or "--tags-format" to change the format tags are returned

Available replacements are "%tag", "%count", "%type" and "%stype".

Default value is "%tag\t%count\t%type"
The default value is "%tag\t%count\t%type"
```
./grabber -c -s "danbooru.donmai.us" -i 100 --tags-format "%stype %tag (%count)" --tags-min 10 --return-pure-tags
1 emererre (10)
Expand All @@ -186,4 +186,4 @@ Note that this is long and very constraining for the server. So please don't ove
It can take a while (250 pages of 500ko each), so you might want to turn debugging on to see the current download status.
```bash
./grabber -c -s "danbooru.donmai.us" -i 1000 -m 250000 --tags-format "%tag" --tags-min 10 --return-pure-tags > tags.txt
```
```
44 changes: 22 additions & 22 deletions docs/docs/filename.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ title: Filename

## Introduction

If you want to download lots of images at the same time and have each of them be downloaded in a different location or having a different filename, you have to first tell the program which filename format to use.
If you want to download lots of images at the same time and have each of them be downloaded in a different location or have a different filename, you have to first tell the program which filename format to use.

The program has many tokens to use to ensure different and unique filenames, you can find an exhaustive list [below](#available-tokens).

The most basic tokens are `md5` (an image unique identifier across all websites), `id` (an image unique identifier on a given website) and `ext` (the image's extension). Each token should be written between percent signs (`%`) to differentiate it from plain text. So if you want to use the `md5` token in your filename, you have to write `%md5%`.
The most basic tokens are `md5` (an image unique identifier across all websites), `id` (an image unique identifier on a given website), and `ext` (the image's extension). Each token should be written between percent signs (`%`) to differentiate it from plain text. So if you want to use the `md5` token in your filename, you have to write `%md5%`.

### Examples

Expand Down Expand Up @@ -62,7 +62,7 @@ Note that here, each slash (`/`) corresponds to a different directory:
* `rating`: `safe`, `questionable`, `explicit`, or `unknown`.
* `score`
* `md5`: the file's MD5 hash. If not returned by the server, it is generated automatically.
* `id`: unique image id per board.
* `id`: unique image ID per board.
* `website`: the website's URL (without HTTP and trailing slash).
* `websitename`: the website name as set in the sources' settings.
* `height`: the image's height.
Expand All @@ -72,19 +72,19 @@ Note that here, each slash (`/`) corresponds to a different directory:
* `authorid`: the ID of the author of the image.
* `date`: the date the image was posted on the server, using the format "MM-dd-yyyy HH.mm".
* `all`: all tags.
* `allo`: do not use this unless you know what you're doing. It is the same as `%all%`, but without the removal of forbidden characters and any other kind treatment (using it as a filename may cause some images to not save).
* `source`: the source of this file, usually an URL.
* `allo`: do not use this unless you know what you're doing. It is the same as `%all%`, but without the removal of forbidden characters and any other kind of treatment (using it as a filename may cause some images to not save).
* `source`: the source of this file, usually a URL.
* `sources`: all sources for this file, usually a list of URLs.
* `url_file`: the URL of that file.
* `url_original`: the URL of that file's original.
* `url_sample`: the URL of that file's sample.
* `url_thumbnail`: the URL of that file's thumbnail.
* `url_page`: the URL of the details page of that file.
* `count`: counts the current image downloaded during a batch download. Useful to have unique counters per batches.
* `num`: counter that goes up for every file with the same name. Useful to prevent overwriting already existing files.
* `count`: counts the current image downloaded during a batch download. Useful to have unique counters per batch.
* `num`: a counter that goes up for every file with the same name. Useful to prevent overwriting already existing files.
* `position`: the position of the image in the results list or gallery (starts at 1).
* `old_directory`: when renaming, store the local path for the current file. (useful to rename images, without changing directory structure).
* `old_filename`: when renaming, store the local filename for the current file. (useful to move images, but keeping their local names) Beware, this token keep the extension of the file, therefore, should not be used with %ext%.
* `old_filename`: when renaming, store the local filename for the current file. (useful to move images, but keeping their local names) Beware, this token contains the extension of the file, therefore, should not be used with %ext%.

### Gallery tokens

Expand All @@ -99,7 +99,7 @@ Images can access information on the gallery by using the `gallery.` prefix. Man
### Introduction
Most tokens can have options. To add options to a token, just add `:` after its name, followed by the option name and its value (separated by a `=`). Multiple options can be set, separating them by `,`.

When a same option is set multiple times, only the latest one is taken into account.
When the same option is set multiple times, only the latest one is taken into account.

The value can be omitted for boolean options. In this case, `option_name` will be equivalent to `option_name=true`. Useful to set multiple flags.

Expand Down Expand Up @@ -131,7 +131,7 @@ fate/stay_night
```

#### Underscores (bool)
If the "replace spaces by underscores" setting is not enabled globally, you can enable for a given token using this option.
If the "replace spaces by underscores" setting is not enabled globally, you can enable it for a given token using this option.

Example:
```
Expand All @@ -143,7 +143,7 @@ fate_stay_night
```

#### Spaces (bool)
If the "replace spaces by underscores" setting is enabled globally, you can disable for a given token using this option.
If the "replace spaces by underscores" setting is enabled globally, you can disable it for a given token using this option.

Example:
```
Expand Down Expand Up @@ -324,9 +324,9 @@ Beware of not using any character forbidden by your operating system in the form
| AP | use AM/PM display. AP will be replaced by either "AM" or "PM". |
| ap | use am/pm display. ap will be replaced by either "am" or "pm". |

All other input characters will be ignored. Any sequence of characters that are enclosed in singlequotes will be treated as text and not be used as an expression. Two consecutive singlequotes `''` are replaced by a singlequote in the output.
All other input characters will be ignored. Any sequence of characters that are enclosed in single quotes will be treated as text and not be used as an expression. Two consecutive single quotes `''` are replaced by a single quote in the output.

Some examples, assumed that the date is 21 May 2001 at 14:13:09:
Some examples assumed that the date is 21 May 2001 at 14:13:09:

| Format | Result |
| --------------- | ------------- |
Expand Down Expand Up @@ -386,7 +386,7 @@ You can use conditionals in your filename, using strict inequality signs (`<` an

!!! note

There is currently issues with conditionals inside other conditionals, so it is advised to not imbricate conditionals in your filename.
There are currently issues with conditionals inside other conditionals, so it is advised to not imbricate conditionals in your filename.

### Simple conditionals
#### Token conditionals
Expand Down Expand Up @@ -428,7 +428,7 @@ If, for some obscure reason, it has both:
image - image contains the tag solo group is one of the image tags %md5%.%ext%
```

If, it does not have solo nor group:
If, it does not have solo or group:
cvyl marked this conversation as resolved.
Show resolved Hide resolved
```
image - %md5%.%ext%
```
Expand Down Expand Up @@ -460,7 +460,7 @@ If you do not need an "else" part, you can omit it and use the simpler `<if?then
```
If the tag is present in the image, the condition will be replaced by "yes". Otherwise, it will simply be skipped.

The condition part can use either tags or tokens, same as simple conditionals, combined with `&` (for "and"), `|` (for "or"), and `!` (for inversion). Complex conditions can also use parentheses (`(` and `)`).
The condition part can use either tags or tokens, the same as simple conditionals, combined with `&` (for "and"), `|` (for "or"), and `!` (for inversion). Complex conditions can also use parentheses (`(` and `)`).
```
<"tag" | !%artist%?tag or no artist:otherwise>
```
Expand All @@ -470,19 +470,19 @@ You can escape special characters (`?`, `!`...) by prefixing them with `^`. For
Note that while double quotes are optional for tags, it's recommended to use them, especially in complex conditions or for tags containing special characters.

## JavaScript
You can also use JavaScript in your filenames. To do so, you can either use the field in the filename window, that you can open clicking the "..." button near the filename field, or by adding "javascript:" before your script.
You can also use JavaScript in your filenames. To do so, you can either use the field in the filename window, which you can open by clicking the "..." button near the filename field, or by adding "javascript:" before your script.

For example, if your script is "md5 + '.' + ext", your filename will be "javascript:md5 + '.' + ext".

## Similar tags
Sometimes, you have similar tags in your image, which can be problematic for your filename. For example, if you have an image tagged as both "pokemon" and "pokemon_bw", you might get "crossover" when using `%copyright%`, or "pokemon pokemon_bw", which can become annoying for organization.
Sometimes, you have similar tags in your image, which can be problematic for your filename. For example, if you have an image tagged as both "pokemon" and "pokemon_bw", you might get "crossover" when using `%copyright%`, or "pokemon pokemon_bw", which can become annoying for organizing.

In order to fix this, there are a few options.
To fix this, there are a few options.

### The "use shortest if possible" setting
This setting is specific for copyright tags, and can be found in the option window, in the "Save > Tags > Copyright" category, as a checkbox at the bottom of the window.
This setting is specific for copyright tags and can be found in the options window, in the "Save > Tags > Copyright" category, as a checkbox at the bottom of the window.

This feature takes all tags marked as "copyright", and remove all those which are another copyright with a suffix appended. So in our example, "pokemon pokemon_bw" would be simplified as "pokemon", since "pokemon_bw" is "pokemon" + "\_bw"..
This feature takes all tags marked as "copyright", and removes all those which are another copyright with a suffix appended. So in our example, "pokemon pokemon_bw" would be simplified as "pokemon", since "pokemon_bw" is "pokemon" + "\_bw"..

### Ignored tags
You can "ignore" tags by right-clicking on them then choosing "ignore". This causes the tag to not be treated as having any particular type, and therefore not appearing, in our example, in `%copyright%`. It will however still be in `%all%`.
You can "ignore" tags by right-clicking on them then choosing "ignore". This causes the tag to not be treated as having any particular type, and therefore not appear, in our example, in `%copyright%`. It will however still be in `%all%`.
18 changes: 9 additions & 9 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ There are four fields to fill:
* Language: the interface language
* Source: the source you want to try first, you can change it later, and even select more than one at a time
* Folder: where you want to store your images
* Filename: the biggest strentgh of Grabber is its filename formatting! See the [Filename](filename.md) documentation page for more details. The default value of `%md5%.%ext%` should be good at first.
* Filename: the biggest strength of Grabber is its filename formatting! See the [Filename](filename.md) documentation page for more details. The default value of `%md5%.%ext%` should be good at first.

Once finished, you can press the "Ok" button.
Once finished, you can press the "OK" button.

!!! note

Expand All @@ -42,7 +42,7 @@ You should now be seeing something like this:
The upper part of the window is "divided" into two sections:

* The search form: to make searches using tags. To insert a date, or access advanced features, you can click the "Plus" button. You can also browse other pages by changing the page value on the right.
* Hidden form: you can show it by clicking the "+" button. Here, you have some fields to quickly change the settings (images per page and columns), the sources and "Post-filtering". Post-filtering allows you, for example, to bypass the two tags limitation of Danbooru by adding additional tags or metas (source, id, height, etc.) in this field. Note that none of these fields will be saved at exit, so if you want to definitely change the number of images per page or columns for example, you have should change them directly in the options.
* Hidden form: you can show it by clicking the "+" button. Here, you have some fields to quickly change the settings (images per page and columns), the sources, and "Post-filtering". Post-filtering allows you, for example, to bypass the two-tags limitation of Danbooru by adding additional tags or meta (source, id, height, etc.) in this field. Note that none of these fields will be saved upon exiting. So if you want Grabber to remember your changes to the number of images per page or columns for example, you should change them directly in the options.
cvyl marked this conversation as resolved.
Show resolved Hide resolved

After searching for something, you should see something as:

Expand All @@ -52,7 +52,7 @@ After searching for something, you should see something as:

#### Batch downloads

To download a lot of pictures at the same time, first search for the tag you want to download (or no tag if that's what you want). You should arrive on the search page. From here, just click "Get this page" to download all the images on the page you are currently seeing (usually around 20 images), or "Get all" to download all the results of your search, including further pages (can go from 1 images to thousands).
To download a lot of pictures at the same time, first search for the tag you want to download (or no tag if that's what you want). You should arrive on the search page. From here, just click "Get this page" to download all the images on the page you are currently seeing (usually around 20 images), or "Get all" to download all the results of your search, including further pages (can go from 1 image to thousands).

Then, go to the "Downloads" tab to see a summary of what will be downloaded:

Expand All @@ -62,7 +62,7 @@ Once you are satisfied with your download list, click the "Download" button to s

![batch download window](img/batchdownload.png)

It lists all the images that will be or have already been downloaded. Now, you just have to wait. When all images are downloaded, the program wil show you a summary:
It lists all the images that will be or have already been downloaded. Now, you just have to wait. When all images are downloaded, the program will show you a summary:

![download finished window](img/downloadfinished.png)

Expand All @@ -74,7 +74,7 @@ To download single images, you have to "Ctrl + click" the images you want to dow

![single image selection](img/getselected.png)

One you have selected all the images you want to download, click the "Get selected" button. It will mark these images to be downloaded in the "Downloads" tab:
Once you have selected all the images you want to download, click the "Get selected" button. It will mark these images to be downloaded in the "Downloads" tab:

![single image downloads tab](img/downloadselected.png)

Expand All @@ -88,17 +88,17 @@ If you want to change the source of the pictures, just click the "Sources button

![sources window](img/sources.png)

Here, you just have to check the sources you want and then click "Ok".
Here, you just have to check the sources you want and then click "OK".

#### Multiple sources

If you select multiple sources, they will be put in one column by default. You can change this behavior by editing the "Columns" settings in the options.

Note that you can also merge all results to remove duplicates checking the "Merge results" option at the bottom of the window. It is useful if you browse from sites than mirror each others, while still having their own uploaders.
Note that you can also merge all results to remove duplicates by checking the "Merge results" option at the bottom of the window. It is useful if you browse from sites that mirror each other, while still having their uploaders.

#### Logging in

Some sources (for example Danbooru or Gelbooru) require to login to enable full API access. Even though it is usually not mandatory thanks to the regex fallback, it is usually strongly advised to do so.
Some sources (for example Danbooru or Gelbooru) require login to enable full API access. Even though it is usually not mandatory thanks to the regex fallback, it is usually strongly advised to do so.

To log into a source using an account, just enter your credentials in the "Credentials" tab of the Source Settings window:

Expand Down
Loading