Closed FuwaWata closed 2 months ago
There's now a post_date
metadata field, which is the "directory" / post datetime. Its value is the same for all files in a post. (https://github.com/mikf/gallery-dl/commit/a3642638109b22332072701fb157dcd6a4ef3a54)
Thank you for the update.
I can now use post_date
when downloading instagram posts. However, a key error occurred when I'm downloading story.
It's indicating an error on line 216:
data["date"] = data["post_date"]
It seems that post_date
is only added in the regular image/video post code block but not the story or highlight block under the def _parse_post_rest(self, post)
function.
I added "post_date": text.parse_timestamp(post.get("taken_at")),
in the story code block and I can download successfully again. But I'm not sure if post.get("taken_at")
is a valid key for instagram story.
A similar issue was mentioned here: #4600 There's a difference of one or two seconds between the filename datetime gallery-dl outputted and the real datetime from the post. Based on what I observed, this only happens for SOME posts with more than one photo.
For posts with only one photo or one video: Example: https://www.instagram.com/p/C-xuZTmtNQR/ Using flag -K, gallery-dl outputted the following dates for directory and filenames.
The dates for both directory and filenames are the same in this case.
However, for some posts with more than one photo, the dates are different: Example: https://www.instagram.com/p/C-BJm6VScvU/?img_index=1
There's a one second difference in this case. Checking the source code for the post date, it shows the same datetime as the directory date gallery-dl outputted.
Another example with two seconds difference: https://www.instagram.com/p/C9koxyoqgQX/?img_index=1
But there are also cases when gallery-dl outputted same datetimes for posts with more than one photo: Example: https://www.instagram.com/p/C-nUW1STK1c/?img_index=1
And so when I use
--filename "{date:%Y-%m-%d %H.%M.%S}.{extension}"
, sometimes gallery-dl output the wrong datetime. Is there any way I can output the directory date instead of the filename date?