266 Commits

Author SHA1 Message Date
Mike Fährmann
eb4e44401b [util] implement 'build_duration_func_ex()' 2026-02-12 17:28:46 +01:00
Mike Fährmann
71680feab9 [actions] implement 'flag … = skip' (#8960) 2026-02-06 10:10:38 +01:00
Mike Fährmann
0c04090ff4 [util] set flags in range predicates
use flags to stop extractors immediately when hitting the upper range
limit instead of raising an exception one predicate check later
2026-02-02 21:48:45 +01:00
Mike Fährmann
8a84714372 [util] use function for HTTPBasicAuth
more lightweight and faster than a class
2026-01-18 21:13:42 +01:00
Mike Fährmann
c23beee57c [util] use functions for predicates
more lightweight and faster than classes
2026-01-18 20:32:36 +01:00
Mike Fährmann
90cd23e279 [util] use function for custom Popen
instead of an entire class with inheritance
2026-01-17 20:44:07 +01:00
Mike Fährmann
a28fbbc3c6 [util] rename 'USERAGENT' to 'USERAGENT_GALLERYDL' 2026-01-03 10:31:48 +01:00
Mike Fährmann
e33a63231f [util] adjust Firefox/Chrome UA versions
modify 'ordinal' offsets to get the correct version numbers
2026-01-03 10:31:32 +01:00
Mike Fährmann
826b557f6d [util] support integer values for '…-range' options (#8604) 2025-12-08 10:32:46 +01:00
Mike Fährmann
0eb3c8a994 [dt] replace 'util' datetime functions 2025-10-15 21:30:38 +02:00
Mike Fährmann
a16238edda [util] add __enter__ & __exit__ methods to NullResponse (#8227) 2025-09-17 09:09:08 +02:00
Mike Fährmann
a3b1100600 [util] extend list of ISO 639 language codes 2025-09-14 22:44:28 +02:00
Mike Fährmann
fea747768f [util] emit debug 'Proxy Map' logging message (#8195)
in 'build_proxy_map()'
2025-09-10 17:55:05 +02:00
Mike Fährmann
55977e2be3 more f-string usage (#7671) 2025-08-03 11:36:28 +02:00
Mike Fährmann
a097a373a9 simplify if statements by using walrus operators (#7671) 2025-07-22 20:57:54 +02:00
Mike Fährmann
50cec2fb0c [util] add 'error()' function to global scope (#7814) 2025-07-14 20:05:20 +02:00
Mike Fährmann
d8a370da0b [signals] update FLAGS handling 2025-07-11 22:28:26 +02:00
Mike Fährmann
0210ffcdd8 initial 'signals-actions' implementation (#6582)
https://github.com/mikf/gallery-dl/issues/6582#issuecomment-2973285775

To stop gracefully after the current file finishes processing when
Ctrl+C was pressed, or after the current post finishes processing when
SIGUSR1 was received:

{
    "signals-actions": {
        "SIGINT" : "file",
        "SIGUSR1": "post"
    }
}
2025-07-09 23:02:23 +02:00
Mike Fährmann
0dfe7e25a5 [util] slightly improve 'filter' performance 2025-07-06 19:46:34 +02:00
Mike Fährmann
c08833aed9 [util] move 're' functions to text.py 2025-06-23 20:05:20 +02:00
Mike Fährmann
ce4d78e8e3 [util] make NONE compare equal to the native None 2025-06-22 19:50:21 +02:00
Mike Fährmann
475506cc39 [util] more micro optimizations 2025-06-18 12:27:18 +02:00
Mike Fährmann
c88d69376f [util] update code to 3.8 2025-06-17 17:06:00 +02:00
Mike Fährmann
40dedd7ce0 [util] restore stdlib 're' module in filter expressions (#7665)
fixes regression introduced in 4fc719bb10
2025-06-13 20:52:33 +02:00
Mike Fährmann
e08ec7e083 update copyright notices 2025-06-13 00:03:41 +02:00
Mike Fährmann
811b665e33 remove @staticmethod decorators
There might have been a time when calling a static method was faster
than a regular method, but that is no longer the case. According to
micro-benchmarks, it is 70% slower in CPython 3.13 and it also makes
executing the code of a class definition slower.
2025-06-12 22:50:52 +02:00
Mike Fährmann
7a48b696a6 [dl] improve maximum 'rate' detection (#7638) 2025-06-09 12:15:39 +02:00
Mike Fährmann
e84df260c0 [util] generalize 'build_duration_func' 2025-06-08 20:01:16 +02:00
Mike Fährmann
e1f03a5a93 [util] allow 'noop()' to accept one optional argument
fixes 'NullResponse.close()'
2025-06-05 20:08:24 +02:00
Mike Fährmann
4fc719bb10 [util] add 're' helper 2025-06-04 07:56:43 +02:00
Mike Fährmann
002c25d417 [util] add 'NullResponse' class 2025-05-29 20:27:40 +02:00
Mike Fährmann
17b2910938 [util] implement 'to_datetime()' 2025-05-28 20:10:18 +02:00
Mike Fährmann
47af8459c2 [util] add collections of image/video/archive filename extensions 2025-05-26 23:08:27 +02:00
Mike Fährmann
48053cf3ec [util] update auto Chrome version 2025-04-15 22:47:33 +02:00
Mike Fährmann
4c8c98a14d use internal, non-caching version of re.compile for extractor patterns
speeds up total compile time of extractor patterns by ~10ms
2025-04-15 22:47:19 +02:00
Mike Fährmann
ee26f3ccd7 [instagram] use Chrome User-Agent by default (#6379) 2025-03-30 22:21:38 +02:00
Mike Fährmann
6b4cd1b4d4 [util] update auto Firefox version 2025-03-27 21:56:55 +01:00
Mike Fährmann
c9488cee30 [util] move Cloudflare/DDoS-Guard detection into 'detect_challenge()' 2025-03-06 14:21:35 +01:00
Mike Fährmann
5486a9c429 [util] implement 'decrypt_xor()' 2025-03-04 16:33:42 +01:00
Mike Fährmann
182b544217 [ytdl] support specifying filesystem paths as 'module' (#6991) 2025-02-14 19:58:25 +01:00
Mike Fährmann
770f41eb4a [util] support not splitting "contains" value (#6773)
by passing any "false" value as 'separator' argument except None
2025-01-06 13:47:32 +01:00
Mike Fährmann
041baf8441 [common] compute and use latest Firefox UA
instead of the latest ESR UA
2024-12-17 22:20:37 +01:00
Mike Fährmann
bced143750 [tests] add workaround for compile_expression_defaultdict in pypy3 2024-11-16 19:35:28 +01:00
Mike Fährmann
5bc3657c59 [util] implement 'compile_filter()' (#5262)
https://github.com/mikf/gallery-dl/issues/5262#issuecomment-2477029728

allow (theoretically*) all filter expression statements
to be a list of individual filters

(*) except for 'filename' and 'directory' conditionals,
as dict keys cannot be lists
2024-11-14 22:47:36 +01:00
Mike Fährmann
0b99d9e6b9 [util] add "defaultdict" filters-environment
allows accessing undefined values without raising an exception,
but preserves other errors like TypeError, AttributeError, etc
2024-11-14 22:47:25 +01:00
Mike Fährmann
4667833195 [util] add 'std' object to global eval namespace (#6330)
allows accessing standard library modules (and other external modules)
in a more straightforward manner than '__import__(...)'

* std.os.getcwd()
* std["os"].getcwd()
2024-10-17 21:08:07 +02:00
Mike Fährmann
36883e458e use 'v[0] == "c"' instead of 'v.startswith("c")' 2024-10-15 08:24:06 +02:00
Mike Fährmann
3946fe5ac4 [cookies] return loaded cookies as list
don't set_cookie() them immediately into a CookieJar
also, give some more consistent names to chrome/chromium functions
2024-10-14 14:24:27 +02:00
Mike Fährmann
a120295632 [util] use minimal separators for 'json_dumps()' 2024-10-01 17:03:13 +02:00
Mike Fährmann
2c7a0c3ca8 add alternatives for deprecated utc datetime functions 2024-09-19 20:47:05 +02:00