1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-23 11:12:40 +01:00
Commit Graph

125 Commits

Author SHA1 Message Date
Mike Fährmann
46d811bac0
add loaded config files to debug output 2022-11-18 17:15:32 +01:00
Mike Fährmann
597b63d922
move git head functionality to function in util.py 2022-11-04 19:49:39 +01:00
Mike Fährmann
b337e51e91
run flake8 on all .py files 2022-10-28 22:22:49 +02:00
Mike Fährmann
e140b85342
reword error text for unsupported URLs 2022-10-28 11:49:20 +02:00
Mike Fährmann
a6e2d96dde
fix bug when processing input file comments (#2808)
and move 'parse_inputfile()' to util.py
2022-10-08 15:41:39 +02:00
Mike Fährmann
bdad9c40dd
remove whitespace before comments in input file URLs (#2808) 2022-09-09 18:09:21 +02:00
Mike Fährmann
764906e1af
allow tabstops as whitespace before input file comments (#2808) 2022-08-11 12:39:19 +02:00
Mike Fährmann
d0adc13e23
allow comments after input file URLs (#2808)
everything after the first " #" (space + hash) gets ignored
2022-08-09 23:26:02 +02:00
Mike Fährmann
74865adae5
implement 'format-separator' option (#2737)
a global option, that servers as a workaround for shortcomings due to
lack of a proper format string parser
2022-07-10 13:31:43 +02:00
Mike Fährmann
603af48265
implement 'output.ansi' option (#2628) 2022-05-29 19:15:25 +02:00
Mike Fährmann
688d6553b4
replace calls to print() with stdout_write() (#2529) 2022-05-19 17:09:24 +02:00
Mike Fährmann
6742f3bc1e
implement --cookies-from-browser (#1606)
most of the code is adapted from yt-dlp's implementation
and *should* work the same.
2022-05-07 23:06:37 +02:00
Mike Fährmann
9e6c981388
replace '\f' in --filename arguments with form feed character
to make it easier to use special type format strings on command-line

(#2396)
2022-04-28 21:54:05 +02:00
Mike Fährmann
f5b2a9fcc6
add 'signals-ignore' option (#2296) 2022-02-13 23:00:50 +01:00
Mike Fährmann
4edf43891c
add -d/--directory and -f/--filename command-line arguments 2021-12-27 23:31:54 +01:00
Mike Fährmann
45ca1693d8
add indicator to debug output when using a standalone executable 2021-12-10 03:18:02 +01:00
Mike Fährmann
4048eabeab
allow 'extractor.modules' to be a string
with comma-separated module names
2021-07-18 00:34:04 +02:00
Mike Fährmann
e9993451c3
remove Python version checks 2021-06-12 00:20:59 +02:00
Mike Fährmann
dfe1e09df0
add '-T/--terminate' command-line option (#1399) 2021-06-05 14:14:48 +02:00
Mike Fährmann
c693db5b1a
add '"skip": "terminate"' option
Stops not only the current extractor/job,
but all parent extractors/jobs as well.
2021-05-12 02:22:28 +02:00
Mike Fährmann
755164b36a
improve --clear-cache (#1230)
Allow for an optional argument to only delete cached entries from
a specific module.

delete all cache entries
$ gallery-dl --clear-cache
or
$ gallery-dl --clear-cache all

only delete entries for instagram
$ gallery-dl --clear-cache instagram
2021-05-04 19:27:17 +02:00
Mike Fährmann
a86ffb04bb
add 'output.fallback' option
to enable/disable fallback URLs for -g/--get-urls
2021-04-12 02:00:41 +02:00
Ailothaen
2e8061091a
Adding handling of several input files (#1353)
* Adding handling of several input files

* Fixed flake8 error due to bad indenting
2021-03-04 21:37:26 +01:00
Mike Fährmann
5bcf28de93
add a 'extractor.modules' option 2020-10-25 03:05:10 +01:00
Mike Fährmann
6ecb0a19cf
handle sys.stdin being None when using '-' as input file (#653) 2020-03-25 22:33:39 +01:00
Mike Fährmann
4bc161ca0f
prevent crash when sys.stdout and co. are None (#653) 2020-03-23 23:38:55 +01:00
Mike Fährmann
383795b550
prevent superfluous calls to Logger.makeRecord()
… by setting an appropriate minimal logging level for the root Logger.
2020-01-30 15:19:06 +01:00
Mike Fährmann
f5604492c3
update interface of config functions 2019-11-24 00:42:28 +01:00
Mike Fährmann
5af291ba5c
include failed downloads and child extractors in exit status 2019-10-29 15:56:54 +01:00
Mike Fährmann
03e0cec715
return with non-zero exit status on error 2019-10-27 23:54:18 +01:00
Mike Fährmann
5ac9732adc
call 'sys.exit()' on Ctrl+c 2019-09-10 16:53:21 +02:00
Mike Fährmann
6393b47db2
add '-A/--abort'; deprecate '--abort-on-skip' 2019-06-30 14:28:28 +02:00
Mike Fährmann
bd9cb3d191
improve job class selection code
+ consistent argument order for add_argument() calls
2019-05-10 22:05:57 +02:00
Mike Fährmann
e64773ffdd
allow multiple post-processor command-line options (#253)
... without overwriting any previous ones
2019-05-10 15:32:23 +02:00
Mike Fährmann
bc26fc2439
implement '--clear-cache'
Effectively clears all cached values from the cache database by
executing "DELETE FROM data" without any further user input.
2019-04-25 21:31:01 +02:00
Mike Fährmann
176b7253a1
update function signature for config.load() 2019-03-01 14:13:34 +01:00
Mike Fährmann
ae353ed3b0
provide "extractor" and "job" keys for logging output
This allows for stuff like "{extractor.url}" and "{extractor.category}"
in logging format strings.
Accessing 'extractor' and 'job' in any way will return "None" if those
fields aren't defined, i.e. in general logging messages.
2019-02-14 11:09:58 +01:00
Mike Fährmann
bc0951d974
allow for simplified test data structures
Instead of a strict list of (URL, RESULTS)-tuples, extractor result
tests can now be a single (URL, RESULTS)-tuple, if it's just one test,
and "only matching" tests can now be a simple string.
2019-02-06 17:24:44 +01:00
Mike Fährmann
344bbaa71a
remove useless line
A remnant from when `filter` and `range` were global and only
available as command line options.
2019-01-11 12:25:49 +01:00
Mike Fährmann
e26ba682a2
enforce utf-8 encoding for input files (#120) 2018-11-10 18:27:01 +01:00
Mike Fährmann
a36259d8f1
update setup.py
- add Python version check
- add classifiers
- simplify sys.exit() usage
2018-10-24 14:43:37 +02:00
Mike Fährmann
0514d6a0ae
make --filter and --range config-file options
The functionality of --(chapter-)filter and --(chapter-)range are now
also exposed as the following config-file options:

- extractor.*.image-filter
- extractor.*.image-range
- extractor.*.chapter-filter
- extractor.*.chapter-range

TODO: update configuration.rst
2018-10-07 21:39:56 +02:00
Mike Fährmann
39f609b4c6
include current Git HEAD in debug output 2018-07-17 22:44:32 +02:00
Mike Fährmann
e8311eb1ed
drop Python 3.3 support 2018-07-17 21:21:27 +02:00
Mike Fährmann
12797e3b1f
update configuration.rst
... again

- some more 'Path' references
- fixed some inconsistencies and errors
- added note about logging config for files
2018-05-28 22:14:38 +02:00
Mike Fährmann
b08d95ebe4
add an 'encoding' option for logging files (default 'utf-8') 2018-05-25 16:29:45 +02:00
Mike Fährmann
2df1a15fb8
add '-s/--simulate' to run data extraction without download
Useful for quick testing (even though -g and -j kind of do the same)
and to fill a download archive without actually downloading the files.

-s does the same as the default behaviour, except downloading stuff.
Maybe it should get a more fitting name, as it does actually write to
disk (cache, archive)?
2018-05-25 16:07:18 +02:00
Mike Fährmann
8bf3cdd82b
implement logging options
Standard logging to stderr, logfiles, and unsupported URL files (which
are now handled through the logging module) can now be configured by
setting their respective option keys (log, logfile, unsupportedfile)
to a dict and specifying the following options;

- format:
    format string for logging messages
    available keys: see [1]
    default: "[{name}][{levelname}] {message}"
- format-date:
    format string for {asctime} fields in logging messages
    available keys: see [2]
    default: "%Y-%m-%d %H:%M:%S"
- level:
    the lowercase levelname until which the logger should activate;
    available levels are debug, info, warning, error, exception
    default: "info"
- path:
    path of the file to be written to
- mode:
    'mode' argument when opening the specified file
    can be either "w" to truncate the file or "a" to append to it (see [3])

If 'output.log', '.logfile', or '.unsupportedfile' is a string, it will
be interpreted, as it has been, as the filepath
(or as format string for .log)

[1] https://docs.python.org/3/library/logging.html#logrecord-attributes
[2] https://docs.python.org/3/library/time.html#time.strftime
[3] https://docs.python.org/3/library/functions.html#open
2018-05-01 17:54:52 +02:00
Mike Fährmann
0381ae5318
replace error handlers for stdout and co.
Python3.5 and lower throw an UnicodeEncodeError when trying to print
not-encodable characters when not using 'utf-8' as encoding.
Setting their error handlers to 'replace' should help.
2018-04-04 17:30:42 +02:00
Mike Fährmann
b50bdbf3d7
change config specifiers in input file format
Instead of a dictionary/object, input file options are now specified
by a 'key=value' pair starting with '-' for options only applying to
the next URL or '-G' for Global options applying to all following URLs.

See the docstring of parse_inputfile() for details.

Example option specifiers:

- filename = "{id}.{extension}"
- extractor.pixiv.user.directory = ["Pixiv Users", "{user[id]}"]
-spaces="are_optional"
-G keywords = {"global": "option"}
2018-02-16 03:10:41 +01:00