diff --git a/core/network/interface.py b/core/network/interface.py new file mode 100644 index 0000000..bd63e27 --- /dev/null +++ b/core/network/interface.py @@ -0,0 +1,10 @@ +from core.utils.general.logs import consoleLog +import psutil + + + +def get_net_interfaces(): + addrs = psutil.net_if_addrs() + for interface in addrs.keys(): + consoleLog(f"Found Interface: {interface}") + return addrs.keys() \ No newline at end of file diff --git a/core/network/libtorrent_wrapper.py b/core/network/libtorrent_wrapper.py index 237a808..f383cb9 100644 --- a/core/network/libtorrent_wrapper.py +++ b/core/network/libtorrent_wrapper.py @@ -6,7 +6,4 @@ def add_magnet(uri): add_download(uri) consoleLog("Magnet URI added to LibTorrent") else: - consoleLog(f"Invalid Magnet Link: {uri}") - - - + consoleLog(f"Invalid Magnet Link: {uri}") \ No newline at end of file diff --git a/main.py b/main.py index b8bb61f..3d5ed9e 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,7 @@ from core.utils.general.logs import get_download_logs from core.utils.general.shutdown import closehelper, shutdown_event from core.utils.general.wrappers import run_thread from core.utils.general.loghandler import split_data, check_completed +from core.network.interface import get_net_interfaces from core.utils.config.config import read_config from PySide6 import QtWidgets from PySide6.QtCore import Qt @@ -51,6 +52,8 @@ if __name__ == "__main__": consoleLog("Started update_log thread") run_thread(threading.Thread(target=check_completed, args=(downloads, state.autoresume))) consoleLog("Started check_completed thread") + consoleLog("Fetching Network Interfaces...") + get_net_interfaces() consoleLog("Launching GUI") run_gui() diff --git a/test.py b/test.py new file mode 100644 index 0000000..ead049e --- /dev/null +++ b/test.py @@ -0,0 +1,11 @@ +import psutil + +addrs = psutil.net_if_addrs() +stats = psutil.net_if_stats() + +for interface in addrs.keys(): + print(interface) + +print(addrs) +print() +print(stats) \ No newline at end of file