13 Commits

Author SHA1 Message Date
Mike Fährmann
291fb78995 [pp:mtime] fix '_mtime_meta' for invalid values (#8918)
fixes regression introduced in d57dc48dcd
also prevents previous _mtime_meta entries from affecting new files
2026-01-24 18:58:24 +01:00
Mike Fährmann
0eb3c8a994 [dt] replace 'util' datetime functions 2025-10-15 21:30:38 +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
9e56d81292 fix Last-Modified mtime overwriting post processor mtime (#7529)
https://github.com/mikf/gallery-dl/issues/7529#issuecomment-2989955455

- split '_mtime' into '_mtime_http' and '_mtime_meta'
- add PathFormat.set_mtime() method
2025-06-20 16:19:37 +02:00
Mike Fährmann
0e730ba980 [pp:mtime] do not overwrite '_mtime' for None values (#5439) 2024-04-07 02:33:19 +02:00
bradenhilton
117eeefda0 [postprocessor:mtime] add 'value' option (#2739) 2022-07-08 20:56:01 +02:00
Mike Fährmann
e7b30866d0 [postprocessor:mtime] fix timestamps from datetime objects (#2307)
'datetime.timestamp()', which got used to convert datetime objects to
POSIX timestamps, assumes naive datetimes represent LOCAL time, while
datetimes in 'date' metadata fields represent UTC time.

Ref: https://docs.python.org/3/library/datetime.html#datetime.datetime.timestamp
> Naive datetime instances are assumed to represent local time
> you can obtain the POSIX timestamp by … calculating the timestamp directly
2022-03-23 23:05:14 +01:00
Mike Fährmann
59749555b1 [postprocessor:mtime] add 'event' option (#2307) 2022-02-22 23:27:40 +01:00
Mike Fährmann
3cbbefd4ed support 'filter' option for post processors (#1460) 2021-06-04 18:23:32 +02:00
Mike Fährmann
9fffa9c343 rework post processor callbacks 2020-11-19 02:29:06 +01:00
Mike Fährmann
ece73b5b2a make 'path' and 'keywords' available in logging messages
Wrap all loggers used by job, extractor, downloader, and postprocessor
objects into a (custom) LoggerAdapter that provides access to the
underlying job, extractor, pathfmt, and kwdict objects and their
properties.

__init__() signatures for all downloader and postprocessor classes have
been changed to take the current Job object as their first argument,
instead of the current extractor or pathfmt.

(#574, #575)
2020-05-18 19:04:51 +02:00
Mike Fährmann
0bb873757a update PathFormat class
- change 'has_extension' from a simple flag/bool to a field that
  contains the original filename extension
- rename 'keywords' to 'kwdict' and some other stuff as well
- inline 'adjust_path()'
- put enumeration index before filename extension (#306)
2019-08-12 21:40:37 +02:00
Mike Fährmann
16c582aaf9 implement 'mtime' post-processor (#332)
This can set a file's modification time according to a UNIX timestamp
or a datetime object from its metadata.
2019-07-14 22:39:17 +02:00