Created
February 20, 2024 17:56
-
-
Save jlxip/40d8ceff6e29f051ef566531d20ed3ea to your computer and use it in GitHub Desktop.
Fix dates on photos from exported Telegram chats
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -eu | |
find . -type f | gawk '/_thumb.*\.jpg/ {print}' | tr '\n' '\0' | xargs -0 rm | |
find . -type f -name '*.jpg' | \ | |
gawk '{ | |
match($0, /@([0-9]+)-([0-9]+)-([0-9]+)_([0-9]+)-([0-9]+)-([0-9]+)\.jpg/, arr) | |
print "touch -d", arr[3] "-" arr[2] "-" arr[1] "T" arr[4] ":" arr[5] ":" arr[6], $0 | |
}' | bash - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment