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

Possibility of saving {md5} hash into archive.db to avoid downloading duplicate files? #6843

Open
guzmelek opened this issue Jan 17, 2025 · 1 comment

Comments

@guzmelek
Copy link

guzmelek commented Jan 17, 2025

Hello everyone!

It seem like I stuck and cannot make gallery-dl to calculate hashes for the downlaoded files. My current config is below. Unfortunately, I am still getting None instead of hash

  "extractor": {
    "reddit": {
      "directory": ["downloads", "{extractor}"],
      "filename": "{id}_{md5}.{extension}",
      "archive": "/tmp/gallery-dl/gallery-dl-archive.db",
      "archive-format": "{md5}",
      "hash": {
        "event": "file",
        "filename": true,
        "hashes": "md5"
      }
    }
  },
  "path-restrict": {
    "?": "_",
    ":": "_",
    "/": "_",
    "\\": "_",
    "<": "_",
    ">": "_",
    "|": "_",
    "*": "_",
    "\"": "_"
  },
  "archive": "/tmp/gallery-dl/gallery-dl-archive.db"
}

./gallery-dl/downloads/None/u0vzud_None.jpg
./gallery-dl/downloads/None/u0px0y_None.jpg
./gallery-dl/downloads/None/u0pprb_None.jpg

$ sqlite3 /tmp/gallery-dl/gallery-dl-archive.db "SELECT * FROM archive;"
redditNone                                                                                                                                                                                                                                      
@mikf
Copy link
Owner

mikf commented Jan 17, 2025

      "hash": {
        "event": "file",
        "filename": true,
        "hashes": "md5"
      }

This should be

"postprocessors": {
    "name": "hash",
    "event": "file",
    "filename": true,
    "hashes": "md5"
}

but it would still not work with an archive. The archive check happens before a file download, but the MD5 hash can only be computed after a file was downloaded.

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