Skip to content

Commit 7db9a96

Browse files
committed
feat: add custom Chrome binary path input for Linux and update token retrieval to support it (resolves #96)
1 parent 5d96d2a commit 7db9a96

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

StreamLabsTikTokStreamKeyGenerator.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,20 @@ def init_ui(self):
100100

101101
token_layout.addLayout(load_buttons_row)
102102

103+
# Binary Location Input Row
104+
if platform.system() == "Linux":
105+
binary_row = QHBoxLayout()
106+
binary_row.setSpacing(5)
107+
108+
self.binary_location_entry = QLineEdit()
109+
self.binary_location_entry.setPlaceholderText("Custom Chrome binary path (optional)")
110+
self.binary_location_entry.setFixedHeight(28)
111+
self.binary_location_entry.setToolTip("Leave empty to auto-detect Chrome path on Linux")
112+
binary_row.addWidget(self.binary_location_entry)
113+
114+
token_layout.addLayout(binary_row)
115+
116+
103117
# Account Info Section
104118
account_info_label = QLabel("Account Information")
105119
account_info_label.setStyleSheet("font-weight: bold; margin-top: 8px;")
@@ -390,8 +404,11 @@ def load_local_token(self):
390404

391405
def fetch_online_token(self):
392406
retriever = TokenRetriever()
407+
binary_path = None
408+
if hasattr(self, "binary_location_entry"):
409+
binary_path = self.binary_location_entry.text().strip() or None
393410
try:
394-
token = retriever.retrieve_token()
411+
token = retriever.retrieve_token(binary_path)
395412
except Exception as e:
396413
if "Chrome not found" in str(e):
397414
QMessageBox.critical(self, "Error", "Google Chrome not found. Please install it to use this feature.")

TokenRetriever.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def load_cookies(self, driver):
3939
for cookie in cookies:
4040
driver.add_cookie(cookie)
4141

42-
def retrieve_token(self):
43-
with SB(uc=True, headless=False) as sb:
42+
def retrieve_token(self, binary_location=None):
43+
with SB(uc=True, headless=False, binary_location=binary_location) as sb:
4444
sb.open("https://www.tiktok.com/transparency")
4545
self.load_cookies(sb)
4646

0 commit comments

Comments
 (0)