Spiltte main.py
This commit is contained in:
24
utils.py
Normal file
24
utils.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env -S uv run --script
|
||||
"""
|
||||
Utility-Funktionen für den Video Download Helper
|
||||
"""
|
||||
import re
|
||||
import os
|
||||
from PyQt5.QtGui import QIcon
|
||||
from config import get_base_path
|
||||
|
||||
def mask_sensitive_data(command_string):
|
||||
"""Maskiert sensible Daten wie Benutzernamen und Passwörter in der Befehlszeile."""
|
||||
# Benutzername maskieren (-u "username" oder --username "username")
|
||||
command_string = re.sub(r'(-u|--username)\s+("[^"]+"|\'[^\']+\'|\S+)', r'\1 "******"', command_string)
|
||||
|
||||
# Passwort maskieren (-p "password" oder --password "password")
|
||||
command_string = re.sub(r'(-p|--password)\s+("[^"]+"|\'[^\']+\'|\S+)', r'\1 "******"', command_string)
|
||||
|
||||
return command_string
|
||||
|
||||
def set_window_icon(window):
|
||||
"""Setzt das Icon für ein Fenster falls verfügbar."""
|
||||
icon_path = os.path.join(get_base_path(), "icon.ico")
|
||||
if os.path.exists(icon_path):
|
||||
window.setWindowIcon(QIcon(icon_path))
|
Reference in New Issue
Block a user