diff options
| author | 2022-08-29 02:17:16 -0400 | |
|---|---|---|
| committer | 2022-08-29 02:17:16 -0400 | |
| commit | a768930761f7f20587ae40a8cacca0e55c85290a (patch) | |
| tree | 5a4163db912b93fc45f717e5e43fd5be3e66f16c /gallery_dl/__init__.py | |
| parent | ae2a0f5622beaa6f402526f8a7b939419283a090 (diff) | |
New upstream version 1.23.0.upstream/1.23.0
Diffstat (limited to 'gallery_dl/__init__.py')
| -rw-r--r-- | gallery_dl/__init__.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gallery_dl/__init__.py b/gallery_dl/__init__.py index 04ea54c..329e7ab 100644 --- a/gallery_dl/__init__.py +++ b/gallery_dl/__init__.py @@ -38,11 +38,11 @@ def parse_inputfile(file, log): Lines starting with '#' and empty lines will be ignored. Lines starting with '-' will be interpreted as a key-value pair separated by an '='. where 'key' is a dot-separated option name and 'value' is a - JSON-parsable value for it. These config options will be applied while + JSON-parsable value. These configuration options will be applied while processing the next URL. Lines starting with '-G' are the same as above, except these options will - be valid for all following URLs, i.e. they are Global. - Everything else will be used as potential URL. + be applied for *all* following URLs, i.e. they are Global. + Everything else will be used as a potential URL. Example input file: @@ -57,7 +57,8 @@ def parse_inputfile(file, log): https://example.org/ # next URL uses default filename and 'skip' is false. - https://example.com/index.htm + https://example.com/index.htm # comment1 + https://example.com/404.htm # comment2 """ gconf = [] lconf = [] @@ -94,6 +95,10 @@ def parse_inputfile(file, log): else: # url + if " #" in line: + line = line.partition(" #")[0] + elif "\t#" in line: + line = line.partition("\t#")[0] if gconf or lconf: yield util.ExtendedUrl(line, gconf, lconf) gconf = [] |
