Last active
May 25, 2026 17:23
-
-
Save xqm32/ad67014474bc4543f7cea0e694af2c23 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env -S uv run --script | |
| # /// script | |
| # requires-python = ">=3.14" | |
| # dependencies = [ | |
| # "msgpack>=1.1.2", | |
| # "pendulum>=3.2.0", | |
| # ] | |
| # /// | |
| from base64 import b64decode | |
| from json import dumps | |
| from zlib import decompress | |
| from msgpack import unpackb | |
| from pendulum import from_timestamp | |
| def main() -> None: | |
| s = input() | |
| if len(s) % 4: | |
| n = 4 - len(s) % 4 | |
| s = f"{s}{'=' * n}" | |
| m = unpackb(decompress(b64decode(s))) | |
| if "latest_update" in m: | |
| t = int.from_bytes(m["latest_update"]) / 1000 | |
| m["latest_update"] = from_timestamp(t).diff_for_humans() | |
| print(dumps(m)) | |
| if __name__ == "__main__": | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment