0x0.py 689 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env python
  2. import os
  3. import subprocess
  4. import sys
  5. import platform
  6. red = "\033[41m"
  7. norm = "\033[00m"
  8. instance = "http://0x0.st"
  9. fuzzy_picker = "fzf"
  10. platform = platform.system()
  11. if platform == "Windows":
  12. home = "C:\\"
  13. file = home + subprocess.getoutput(f"cd {home} && {fuzzy_picker}")
  14. git_bash_shell = "%LocalAppData%\\Programs\\Git\\bin\\sh.exe"
  15. windows_command = f"{git_bash_shell} -c \"curl -F'file=@{file}' {instance}\""
  16. os.system(windows_command)
  17. else:
  18. home = "~"
  19. file = subprocess.getoutput(f"cd {home} && {fuzzy_picker}")
  20. print(f"Uploading.... {file}")
  21. linux_command = f"curl -F'file=@{file}' {instance}"
  22. os.system(linux_command)