diff --git a/README.md b/README.md index a4e4f5e..7281db3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # yt-dlp-FixupMtime -A [yt-dlp](https://github.com/yt-dlp/yt-dlp) postprocessor [plugin](https://github.com/yt-dlp/yt-dlp#plugins) which sets the mtime of all files to a given datetime value by key. +A [yt-dlp](https://github.com/yt-dlp/yt-dlp) postprocessor [plugin](https://github.com/yt-dlp/yt-dlp#plugins) that sets the mtime of all files to a given datetime value by key. -This postprocessor does not support all possible files output by yt-dlp, namely `*.dump` files. +Some file types (namely `*.dump` files) that can be optionally output by yt-dlp when downloading are not supported. -NOTE: This postprocessor should not be run before files are downloaded. +NOTE: This postprocessor should not be run before files are downloaded. The default `when` value of `post_process` is recommended. ## Installation @@ -21,14 +21,16 @@ See [installing yt-dlp plugins](https://github.com/yt-dlp/yt-dlp#installing-plug ## Usage ```text ---use-postprocessor FixupMtime[:;[mtime_key=][mtime_format=]] +--use-postprocessor FixupMtime[:[mtime_key=];[mtime_format=]] ``` -Where `` is the key of your desired datetime within the infojson dictionary and `` is the format of the datetime. +Where `` is the key of your desired datetime within the infojson dictionary and `` is the [format](https://docs.python.org/3.7/library/datetime.html#strftime-and-strptime-behavior) of the datetime. -The default value for `mtime_key` is `mtime`, which will set the mtime of all files (thumbnails, subtitles etc.) to the existing mtime of the video. If `mtime_key` is `mtime` and `--mtime` was passed to yt-dlp at the time of download, the value will be the datetime of the last-modified header. +The default value for the `mtime_key` parameter is `mtime`, which will set the mtime of all files (thumbnails, subtitles etc.) to the existing mtime of the video. If `mtime_key`'s value is `mtime` and the `--mtime` option was passed to yt-dlp at the time of download, the value will be the datetime of the last-modified header. -The default value for `mtime_format` is `%Y%m%d`. The postprocessor will also attempt to guess the format with yt-dlp's internal list of formats. +The default value for the `mtime_format` parameter is `%Y%m%d`. The postprocessor will also attempt to guess the format with yt-dlp's internal list of formats. + +Both parameters are optional and can be specified in any order. ## Examples @@ -49,3 +51,12 @@ Set the mtime of all files using a custom datetime and format: ```text --use-postprocessor FixupMtime:mtime_key=meta_date;mtime_format=%Y-%m-%dT%H.%M.%S ``` + +You can combine multiple invocations, ordered from least to most preferred: + +```text +--use-postprocessor FixupMtime:mtime_key=upload_date +--use-postprocessor FixupMtime:mtime_key=release_date +--use-postprocessor FixupMtime:mtime_key=timestamp +--use-postprocessor FixupMtime:mtime_key=release_timestamp +```