File size: 1,494 Bytes
076bd51 | 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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | import json
import os
from utils.enums import Info
def banner() -> None:
"""
Prints a banner with the name of the tool and its version number.
"""
print(Info.BANNER, flush=True)
def read_cookies():
"""
Loads the config file and returns it.
"""
script_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(script_dir, "..", "cookies.json")
with open(config_path, "r") as f:
return json.load(f)
def read_telegram_config():
"""
Loads the telegram config file and returns it.
"""
script_dir = os.path.dirname(os.path.abspath(__file__))
config_path = os.path.join(script_dir, "..", "telegram.json")
with open(config_path, "r") as f:
return json.load(f)
def is_termux() -> bool:
"""
Checks if the script is running in Termux.
Returns:
bool: True if running in Termux, False otherwise.
"""
import distro
import platform
return platform.system().lower() == "linux" and distro.like() == ""
def is_windows() -> bool:
"""
Checks if the script is running on Windows.
Returns:
bool: True if running on Windows, False otherwise.
"""
import platform
return platform.system().lower() == "windows"
def is_linux() -> bool:
"""
Checks if the script is running on Linux.
Returns:
bool: True if running on Linux, False otherwise.
"""
import platform
return platform.system().lower() == "linux"
|