Created
April 8, 2020 14:52
-
-
Save ScDor/47f187239cd1b55cfb4011aa2d5055bc to your computer and use it in GitHub Desktop.
whatsapp group picture extractor
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
import sqlite3 | |
DB_FILE = r"PATH\TO\DB\FILE" | |
GROUP_ID = GROUP_ID \\ see messages.key_remote_jid, appears after the "@" sign | |
con = sqlite3.connect(DB_FILE) | |
with con: | |
cur = con.cursor() | |
image_paths = cur.execute(f"select file_path from message_media where " | |
f"message_media.file_hash in (SELECT media_hash from messages " | |
f"WHERE key_remote_jid LIKE '%{GROUP_ID}%' " | |
f"and media_hash is not null)").fetchall() | |
print(image_paths) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment