-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexiftool_installer.py
More file actions
35 lines (28 loc) · 1 KB
/
exiftool_installer.py
File metadata and controls
35 lines (28 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import subprocess
import shutil
import sys
import os
def is_exiftool_installed():
return shutil.which("exiftool") is not None
def install_exiftool():
try:
print("[+] Atualizando repositórios...")
subprocess.run(["apt-get", "update"], check=True)
print("[+] Instalando o ExifTool...")
subprocess.run(["apt-get", "install", "-y", "libimage-exiftool-perl"], check=True)
print("[✓] ExifTool instalado com sucesso.")
except subprocess.CalledProcessError as e:
print(f"[-] Erro ao tentar instalar o ExifTool: {e}")
sys.exit(1)
def main():
if is_exiftool_installed():
print("[✓] ExifTool já está instalado.")
else:
print("[!] ExifTool não encontrado. Instalando agora...")
install_exiftool()
if __name__ == "__main__":
if os.geteuid() != 0:
print("[-] Este script precisa ser executado como root.")
print("Use: sudo python3 nome_do_arquivo.py")
sys.exit(1)
main()