Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect modified time for artstation images #3152

Open
sbstratos79 opened this issue Nov 3, 2022 · 3 comments
Open

Incorrect modified time for artstation images #3152

sbstratos79 opened this issue Nov 3, 2022 · 3 comments

Comments

@sbstratos79
Copy link

sbstratos79 commented Nov 3, 2022

Originally opened this issue in hydownloader repo.

Moving the issue here since it seems to be a problem with gallery-dl.

The modified time associated with most artstation images is the download time instead of the published date. The reason I said "most" is because some artstation images do in fact display the correct modified time. A lot of these correctly tagged files are gif but some are jpg as well. So I can't figure out the pattern. Booru images display the correct modified time however.

@AlttiRi
Copy link

AlttiRi commented Nov 3, 2022

For example: https://www.artstation.com/artwork/B121mD

It seems that /large/ still has the correct (?) last-modified header (Sun, 19 Sep 2021 21:39:04 GMT), but /4k/ does not (it has the current time value).

It's not a temporal server issue, for example, files are downloaded in May also have such mtimes.
I assume it's since #1422.

I think it makes sense to use the time from API response by default.
However, there are 3 different times:

  "created_at":   "2020-10-27T09:00:23.886-05:00",
  "updated_at":   "2022-11-02T04:51:18.469-05:00",
  "published_at": "2020-10-27T09:00:29.408-05:00",

Possibly, created_at is the more appropriate time.
Usually last-modified is the time of an upload of a file to a server.

date key already uses "created_at"'s value.

@AlttiRi
Copy link

AlttiRi commented Nov 3, 2022

The manual fix is just to add a mtime postprocessor in the config file:

        "artstation": {
            "directory": ["[gallery-dl]", "[{category}] {user[username]}—{user_id}—{userinfo[full_name]}"],
            "filename": "[{category}] {user[username]}—{date:%Y.%m.%d}—{hash_id}—{id}—{asset[id]}—{filename}—{title}.{extension}",
            "fallback": false,
            "postprocessors": [{
                "name": "mtime"
            }]
        },

@sbstratos79
Copy link
Author

Adding mtime postprocessor did the trick. Thanks! I will keep this issue open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants