mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.86k stars 975 forks source link

Did Instagram change something in the date it serves posts? #4600

Open Fukitsu opened 1 year ago

Fukitsu commented 1 year ago

I was updating several Instagram profiles when I noticed gallery-dl started re-downloading many of the pictures I already had but with a different filename, it being one second different. The filename settings I have in my config file are ` `` "filename": {

                "tagged_users and count > 1 and extension in ('mp4')": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode}_{num}.{extension}",
                "tagged_users and count > 1": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode}_{num} - {width}x{height}.{extension}",

                "tagged_users and extension in ('mp4')": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode}.{extension}",
                "tagged_users": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode} - {width}x{height}.{extension}",

                "count > 1 and extension in ('mp4')": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode}_{num}.{extension}",
                "count > 1": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode}_{num} - {width}x{height}.{extension}",

                "extension in ('mp4')": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode}.{extension}",
                "": "{date:%Y-%m-%d - %H_%M_%S} {post_shortcode} - {width}x{height}.{extension}"
            }

` For example this post: https://www.instagram.com/p/CxmcEtmMrTR/ I already had it downloaded with as2023-09-25 - 04_00_13 CxmcEtmMrTR_1 - 1440x1440.jpgand it redownloaded it as2023-09-25 - 04_00_14 CxmcEtmMrTR_1 - 1440x1440.jpg. The hash is the same. gallery-dl showed in the console the same filename:.\2023-09-25 - 04_00_13 CxmcEtmMrTR_1 - 1440x1440.jpg`

My gallery-dl version is: [gallery-dl][debug] Version 1.25.8 - Executable [gallery-dl][debug] Python 3.8.10 - Windows-10-10.0.19044 [gallery-dl][debug] requests 2.31.0 - urllib3 1.26.16 [gallery-dl][debug] Configuration Files ['%USERPROFILE%\\gallery-dl.conf'] usage: gallery-dl.exe [OPTION]... URL... gallery-dl.exe: error: The following arguments are required: URL Use 'gallery-dl --help' to get a list of all options.

TucocoTucoco commented 1 year ago

I have that same problem, one second difference. Hope there is a way to fix that because it will bloat folders.

Fixer221b commented 1 year ago

Same issue here.. that one second time difference made a mess for half of my gallery.. i dont know what changed that added one second to the time.. hoping for a fix soon.

mikf commented 1 year ago

Is this +1 second offset present for all posts or only some? If it's for all, I could add an option to apply an offset to all IG timetamps or you could use a post processor (*) to adjust them, but I don't think there's much that can be done when only some posts are affected.

A --download-archive would have helped, since that doesn't record dates in its keys.

(*)

    "postprocessors": [
        {
            "name": "metadata",
            "mode": "modify",
            "event": "prepare",
            "fields": {"date": "\fE date - timedelta(0, 1)"}
        }
    ]

I personally still get 04:00:13 as time for https://www.instagram.com/p/CxmcEtmMrTR/, by the way.

TucocoTucoco commented 1 year ago

Not all are affected, videos didnt seem to be affected when i tried, but most images were.