2021-12-01 18:31:19 +00:00
|
|
|
#!/usr/bin/env python3
|
2019-10-01 17:52:13 +00:00
|
|
|
#encoding=utf-8
|
|
|
|
try:
|
|
|
|
# for Python2
|
|
|
|
import tkMessageBox as messagebox
|
2023-09-21 01:47:41 +00:00
|
|
|
import ttk
|
|
|
|
from Tkinter import *
|
2019-10-01 17:52:13 +00:00
|
|
|
except ImportError:
|
|
|
|
# for Python3
|
2024-03-15 08:05:56 +00:00
|
|
|
try:
|
|
|
|
import tkinter.font as tkfont
|
2024-03-17 07:02:25 +00:00
|
|
|
from tkinter import *
|
|
|
|
from tkinter import messagebox, ttk
|
2024-03-15 08:05:56 +00:00
|
|
|
from tkinter.filedialog import asksaveasfilename
|
|
|
|
except Exception as e:
|
|
|
|
pass
|
2024-03-07 03:20:57 +00:00
|
|
|
'''
|
|
|
|
try:
|
|
|
|
import customtkinter
|
|
|
|
customtkinter.set_appearance_mode("dark") # Modes: system (default), light, dark
|
|
|
|
customtkinter.set_default_color_theme("dark-blue") # Themes: blue (default), dark-blue, green
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
|
|
|
'''
|
2023-09-21 01:47:41 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
import asyncio
|
2023-02-11 05:36:27 +00:00
|
|
|
import base64
|
2023-05-31 00:52:03 +00:00
|
|
|
import json
|
2023-09-21 01:47:41 +00:00
|
|
|
import os
|
|
|
|
import platform
|
2023-07-17 08:57:25 +00:00
|
|
|
import socket
|
2024-01-11 09:28:47 +00:00
|
|
|
import ssl
|
2023-09-21 01:47:41 +00:00
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
import threading
|
|
|
|
import time
|
|
|
|
import warnings
|
|
|
|
import webbrowser
|
2024-01-21 11:41:11 +00:00
|
|
|
from datetime import datetime
|
|
|
|
from typing import Optional
|
2023-07-17 08:57:25 +00:00
|
|
|
|
2023-09-21 01:47:41 +00:00
|
|
|
import pyperclip
|
2023-06-15 09:58:35 +00:00
|
|
|
import requests
|
2024-01-11 09:28:47 +00:00
|
|
|
import tornado
|
|
|
|
from tornado.web import Application
|
2023-06-15 09:58:35 +00:00
|
|
|
from urllib3.exceptions import InsecureRequestWarning
|
2023-09-21 01:47:41 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
try:
|
|
|
|
import ddddocr
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2024-03-29 09:29:39 +00:00
|
|
|
CONST_APP_VERSION = "MaxBot (2024.03.13)"
|
2023-02-26 08:39:37 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
CONST_MAXBOT_ANSWER_ONLINE_FILE = "MAXBOT_ONLINE_ANSWER.txt"
|
2023-03-12 16:34:59 +00:00
|
|
|
CONST_MAXBOT_CONFIG_FILE = "settings.json"
|
2024-01-11 09:28:47 +00:00
|
|
|
CONST_MAXBOT_EXTENSION_NAME = "Maxbotplus_1.0.0"
|
|
|
|
CONST_MAXBOT_EXTENSION_STATUS_JSON = "status.json"
|
2023-03-12 16:34:59 +00:00
|
|
|
CONST_MAXBOT_INT28_FILE = "MAXBOT_INT28_IDLE.txt"
|
2024-01-11 09:28:47 +00:00
|
|
|
CONST_MAXBOT_LAST_URL_FILE = "MAXBOT_LAST_URL.txt"
|
2023-06-16 04:04:04 +00:00
|
|
|
CONST_MAXBOT_QUESTION_FILE = "MAXBOT_QUESTION.txt"
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
CONST_SERVER_PORT = 16888
|
2023-06-19 12:55:33 +00:00
|
|
|
|
2023-11-07 06:45:01 +00:00
|
|
|
CONST_FROM_TOP_TO_BOTTOM = "from top to bottom"
|
|
|
|
CONST_FROM_BOTTOM_TO_TOP = "from bottom to top"
|
|
|
|
CONST_CENTER = "center"
|
|
|
|
CONST_RANDOM = "random"
|
2023-11-28 04:54:55 +00:00
|
|
|
CONST_SELECT_ORDER_DEFAULT = CONST_RANDOM
|
2023-11-07 06:45:01 +00:00
|
|
|
CONST_SELECT_OPTIONS_DEFAULT = (CONST_FROM_TOP_TO_BOTTOM, CONST_FROM_BOTTOM_TO_TOP, CONST_CENTER, CONST_RANDOM)
|
2023-11-10 01:23:27 +00:00
|
|
|
CONST_EXCLUDE_DEFAULT = "\"輪椅\",\"身障\",\"身心 障礙\",\"Restricted View\",\"燈柱遮蔽\",\"視線不完整\""
|
2022-11-21 19:01:04 +00:00
|
|
|
CONST_CAPTCHA_SOUND_FILENAME_DEFAULT = "ding-dong.wav"
|
|
|
|
CONST_HOMEPAGE_DEFAULT = "https://tixcraft.com"
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-02-12 03:02:16 +00:00
|
|
|
CONST_OCR_CAPTCH_IMAGE_SOURCE_NON_BROWSER = "NonBrowser"
|
|
|
|
CONST_OCR_CAPTCH_IMAGE_SOURCE_CANVAS = "canvas"
|
|
|
|
|
|
|
|
CONST_WEBDRIVER_TYPE_SELENIUM = "selenium"
|
|
|
|
CONST_WEBDRIVER_TYPE_UC = "undetected_chromedriver"
|
2023-11-09 04:25:33 +00:00
|
|
|
CONST_WEBDRIVER_TYPE_DP = "DrissionPage"
|
2023-02-12 03:02:16 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
CONST_SUPPORTED_SITES = ["https://kktix.com"
|
|
|
|
,"https://tixcraft.com (拓元)"
|
|
|
|
,"https://ticketmaster.sg"
|
2024-01-21 11:41:11 +00:00
|
|
|
#,"https://ticketmaster.com"
|
2023-05-24 07:17:11 +00:00
|
|
|
,"https://teamear.tixcraft.com/ (添翼)"
|
|
|
|
,"https://www.indievox.com/ (獨立音樂)"
|
|
|
|
,"https://www.famiticket.com.tw (全網)"
|
|
|
|
,"https://ticket.ibon.com.tw/"
|
|
|
|
,"https://kham.com.tw/ (寬宏)"
|
|
|
|
,"https://ticket.com.tw/ (年代)"
|
2023-11-24 08:31:38 +00:00
|
|
|
,"https://tickets.udnfunlife.com/ (udn售票網)"
|
2023-05-24 07:17:11 +00:00
|
|
|
,"https://ticketplus.com.tw/ (遠大)"
|
2023-06-30 01:23:34 +00:00
|
|
|
,"===[香港或南半球的系統]==="
|
2023-05-24 07:17:11 +00:00
|
|
|
,"http://www.urbtix.hk/ (城市)"
|
|
|
|
,"https://www.cityline.com/ (買飛)"
|
2023-06-21 08:30:06 +00:00
|
|
|
,"https://hotshow.hkticketing.com/ (快達票)"
|
2023-05-24 07:17:11 +00:00
|
|
|
,"https://ticketing.galaxymacau.com/ (澳門銀河)"
|
2023-06-30 02:54:00 +00:00
|
|
|
,"http://premier.ticketek.com.au"
|
2023-05-24 07:17:11 +00:00
|
|
|
]
|
2024-01-11 09:28:47 +00:00
|
|
|
|
|
|
|
warnings.simplefilter('ignore',InsecureRequestWarning)
|
|
|
|
ssl._create_default_https_context = ssl._create_unverified_context
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
translate={}
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
URL_DONATE = 'https://max-everyday.com/about/#donate'
|
|
|
|
URL_HELP = 'https://max-everyday.com/2018/03/tixcraft-bot/'
|
|
|
|
URL_RELEASE = 'https://github.com/max32002/tixcraft_bot/releases'
|
2022-11-16 15:43:53 +00:00
|
|
|
URL_FB = 'https://www.facebook.com/maxbot.ticket'
|
2023-02-07 16:42:04 +00:00
|
|
|
URL_CHROME_DRIVER = 'https://chromedriver.chromium.org/'
|
|
|
|
URL_FIREFOX_DRIVER = 'https://github.com/mozilla/geckodriver/releases'
|
|
|
|
URL_EDGE_DRIVER = 'https://developer.microsoft.com/zh-tw/microsoft-edge/tools/webdriver/'
|
2022-11-13 18:34:22 +00:00
|
|
|
|
2024-01-16 09:21:20 +00:00
|
|
|
GLOBAL_SERVER_SHUTDOWN = False
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
def load_translate():
|
2022-11-13 18:34:22 +00:00
|
|
|
translate = {}
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us={}
|
|
|
|
en_us["homepage"] = 'Homepage'
|
|
|
|
en_us["browser"] = 'Browser'
|
|
|
|
en_us["language"] = 'Language'
|
|
|
|
en_us["ticket_number"] = 'Ticker Number'
|
2022-12-15 11:26:51 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us["enable"] = 'Enable'
|
2023-12-11 01:56:13 +00:00
|
|
|
en_us["recommand_enable"] = "Recommended to enable"
|
2023-01-12 08:51:05 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us["auto_press_next_step_button"] = 'Auto Press Next Step Button'
|
|
|
|
en_us["auto_fill_ticket_number"] = 'Auto Fill Ticket Number'
|
2022-11-13 18:34:22 +00:00
|
|
|
en_us["and"] = 'And with'
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
en_us["local_dictionary"] = 'Local Dictionary'
|
2024-01-11 09:28:47 +00:00
|
|
|
en_us["remote_url"] = 'Remote URL'
|
|
|
|
en_us["server_url"] = 'Server URL'
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us["auto_guess_options"] = 'Guess Options in Question'
|
2023-06-15 09:58:35 +00:00
|
|
|
en_us["user_guess_string"] = 'Fill Answers in Question'
|
2023-06-19 09:31:57 +00:00
|
|
|
en_us["preview"] = 'Preview'
|
2024-01-11 09:28:47 +00:00
|
|
|
en_us["question"] = 'Question'
|
|
|
|
en_us["answer"] = 'Answer'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
en_us["date_auto_select"] = 'Date Auto Select'
|
|
|
|
en_us["date_select_order"] = 'Date select order'
|
|
|
|
en_us["date_keyword"] = 'Date Keyword'
|
2023-01-12 08:51:05 +00:00
|
|
|
en_us["pass_date_is_sold_out"] = 'Pass date is sold out'
|
|
|
|
en_us["auto_reload_coming_soon_page"] = 'Reload coming soon page'
|
2024-01-09 08:30:49 +00:00
|
|
|
en_us["auto_reload_page_interval"] = 'Reload page interval(sec.)'
|
2024-01-18 03:48:17 +00:00
|
|
|
en_us["reset_browser_interval"] = 'Reset browser interval(sec.)'
|
2023-10-25 03:02:08 +00:00
|
|
|
en_us["proxy_server_port"] = 'Proxy IP:PORT'
|
2024-03-25 04:26:45 +00:00
|
|
|
en_us["window_size"] = 'Window size'
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
en_us["area_select_order"] = 'Area select order'
|
|
|
|
en_us["area_keyword"] = 'Area Keyword'
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us["area_auto_select"] = 'Area Auto Select'
|
2023-08-05 03:41:06 +00:00
|
|
|
en_us["keyword_exclude"] = 'Keyword Exclude'
|
|
|
|
en_us["keyword_usage"] = 'Each keyword need double quotes, separated by comma,\nUse space in keyword as AND logic.\nAppend ,\"\" to match all.'
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2023-01-12 08:51:05 +00:00
|
|
|
en_us["ocr_captcha"] = 'OCR captcha'
|
2023-06-28 08:08:59 +00:00
|
|
|
en_us["ocr_captcha_ddddocr_beta"] = 'ddddocr beta'
|
2023-01-13 00:43:16 +00:00
|
|
|
en_us["ocr_captcha_force_submit"] = 'Away from keyboard'
|
2023-01-13 19:01:47 +00:00
|
|
|
en_us["ocr_captcha_image_source"] = 'OCR image source'
|
2023-08-18 20:12:46 +00:00
|
|
|
en_us["ocr_captcha_not_support_arm"] = 'ddddocr only supports Intel CPU'
|
2023-02-12 03:02:16 +00:00
|
|
|
en_us["webdriver_type"] = 'WebDriver type'
|
2023-11-25 01:11:43 +00:00
|
|
|
en_us["headless"] = 'Headless mode'
|
2023-03-07 14:30:30 +00:00
|
|
|
# Make the operation more talkative
|
|
|
|
en_us["verbose"] = 'Verbose mode'
|
2023-03-12 16:34:59 +00:00
|
|
|
en_us["running_status"] = 'Running Status'
|
|
|
|
en_us["running_url"] = 'Running URL'
|
2024-01-21 11:41:11 +00:00
|
|
|
en_us["system_clock"] = 'System Clock'
|
|
|
|
en_us["idle_keyword"] = 'Idle Keyword'
|
|
|
|
en_us["resume_keyword"] = 'Resume Keyword'
|
|
|
|
en_us["idle_keyword_second"] = 'Idle Keyword (second)'
|
|
|
|
en_us["resume_keyword_second"] = 'Resume Keyword (second)'
|
|
|
|
|
2023-03-12 16:34:59 +00:00
|
|
|
en_us["status_idle"] = 'Idle'
|
|
|
|
en_us["status_paused"] = 'Paused'
|
|
|
|
en_us["status_enabled"] = 'Enabled'
|
|
|
|
en_us["status_running"] = 'Running'
|
|
|
|
|
|
|
|
en_us["idle"] = 'Idle'
|
|
|
|
en_us["resume"] = 'Resume'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
en_us["preference"] = 'Preference'
|
|
|
|
en_us["advanced"] = 'Advanced'
|
2024-01-21 11:41:11 +00:00
|
|
|
en_us["verification_word"] = "Verification"
|
2024-01-11 09:28:47 +00:00
|
|
|
en_us["maxbot_server"] = 'Server'
|
2023-02-11 05:36:27 +00:00
|
|
|
en_us["autofill"] = 'Autofill'
|
2023-03-12 16:34:59 +00:00
|
|
|
en_us["runtime"] = 'Runtime'
|
2022-11-16 15:43:53 +00:00
|
|
|
en_us["about"] = 'About'
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us["run"] = 'Run'
|
|
|
|
en_us["save"] = 'Save'
|
2022-11-16 15:43:53 +00:00
|
|
|
en_us["exit"] = 'Close'
|
2022-11-17 18:17:19 +00:00
|
|
|
en_us["copy"] = 'Copy'
|
2022-12-27 15:38:13 +00:00
|
|
|
en_us["restore_defaults"] = 'Restore Defaults'
|
2023-02-26 08:39:37 +00:00
|
|
|
en_us["config_launcher"] = 'Launcher'
|
2022-12-27 15:38:13 +00:00
|
|
|
en_us["done"] = 'Done'
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
en_us["tixcraft_sid"] = 'Tixcraft family cookie SID'
|
2023-02-26 08:39:37 +00:00
|
|
|
en_us["ibon_ibonqware"] = 'ibon cookie ibonqware'
|
2022-11-17 18:17:19 +00:00
|
|
|
en_us["facebook_account"] = 'Facebook account'
|
2022-12-27 15:38:13 +00:00
|
|
|
en_us["kktix_account"] = 'KKTIX account'
|
2023-11-01 10:35:28 +00:00
|
|
|
en_us["fami_account"] = 'FamiTicket account'
|
2023-08-19 12:49:51 +00:00
|
|
|
en_us["cityline_account"] = 'cityline account'
|
2023-01-18 08:40:41 +00:00
|
|
|
en_us["urbtix_account"] = 'URBTIX account'
|
2023-02-12 09:49:55 +00:00
|
|
|
en_us["hkticketing_account"] = 'HKTICKETING account'
|
2023-02-11 05:36:27 +00:00
|
|
|
en_us["kham_account"] = 'KHAM account'
|
2023-10-06 06:43:53 +00:00
|
|
|
en_us["ticket_account"] = 'TICKET account'
|
2023-11-24 08:31:38 +00:00
|
|
|
en_us["udn_account"] = 'UDN account'
|
2023-06-29 03:45:07 +00:00
|
|
|
en_us["ticketplus_account"] = 'TicketPlus account'
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-10-07 05:31:33 +00:00
|
|
|
en_us["password"] = 'Password'
|
2023-02-11 05:36:27 +00:00
|
|
|
en_us["facebook_password"] = 'Facebook password'
|
|
|
|
en_us["kktix_password"] = 'KKTIX password'
|
2023-11-01 10:35:28 +00:00
|
|
|
en_us["fami_password"] = 'FamiTicket password'
|
2023-08-19 12:49:51 +00:00
|
|
|
en_us["cityline_password"] = 'cityline password'
|
2023-02-11 05:36:27 +00:00
|
|
|
en_us["urbtix_password"] = 'URBTIX password'
|
2023-02-12 09:49:55 +00:00
|
|
|
en_us["hkticketing_password"] = 'HKTICKETING password'
|
2023-02-11 05:36:27 +00:00
|
|
|
en_us["kham_password"] = 'KHAM password'
|
2023-10-06 06:43:53 +00:00
|
|
|
en_us["ticket_password"] = 'TICKET password'
|
2023-11-24 08:31:38 +00:00
|
|
|
en_us["udn_password"] = 'UDN password'
|
2023-06-29 03:45:07 +00:00
|
|
|
en_us["ticketplus_password"] = 'TicketPlus password'
|
2023-02-11 05:36:27 +00:00
|
|
|
en_us["save_password_alert"] = 'Saving passwords to config file may expose your passwords.'
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
en_us["play_ticket_sound"] = 'Play sound when ticketing'
|
|
|
|
en_us["play_order_sound"] = 'Play sound when ordering'
|
|
|
|
en_us["play_sound_filename"] = 'sound filename'
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
en_us["chrome_extension"] = "Chrome Browser Extension"
|
2023-05-17 00:06:08 +00:00
|
|
|
en_us["disable_adjacent_seat"] = "Disable Adjacent Seat"
|
2023-11-08 07:31:18 +00:00
|
|
|
en_us["hide_some_image"] = "Hide Some Images"
|
2023-11-09 04:25:33 +00:00
|
|
|
en_us["block_facebook_network"] = "Block Facebook Network"
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
en_us["maxbot_slogan"] = 'MaxBot is a FREE and open source bot program. Wish you good luck.'
|
2022-11-11 16:46:36 +00:00
|
|
|
en_us["donate"] = 'Donate'
|
2022-11-13 18:34:22 +00:00
|
|
|
en_us["help"] = 'Help'
|
|
|
|
en_us["release"] = 'Release'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
zh_tw={}
|
|
|
|
zh_tw["homepage"] = '售票網站'
|
|
|
|
zh_tw["browser"] = '瀏覽器'
|
|
|
|
zh_tw["language"] = '語言'
|
|
|
|
zh_tw["ticket_number"] = '門票張數'
|
2022-12-15 11:26:51 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_tw["enable"] = '啟用'
|
2023-12-11 01:56:13 +00:00
|
|
|
zh_tw["recommand_enable"] = "建議啟用"
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_tw["auto_press_next_step_button"] = '自動點選下一步按鈕'
|
|
|
|
zh_tw["auto_fill_ticket_number"] = '自動輸入張數'
|
2022-11-13 18:34:22 +00:00
|
|
|
zh_tw["and"] = '而且(同列)'
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
zh_tw["local_dictionary"] = '使用者自定字典'
|
2024-01-11 09:28:47 +00:00
|
|
|
zh_tw["remote_url"] = '遠端網址'
|
|
|
|
zh_tw["server_url"] = '伺服器網址'
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_tw["auto_guess_options"] = '自動猜測驗證問題'
|
2023-06-15 09:58:35 +00:00
|
|
|
zh_tw["user_guess_string"] = '驗證問題中的答案清單'
|
2023-06-19 09:31:57 +00:00
|
|
|
zh_tw["preview"] = '預覽'
|
2024-01-11 09:28:47 +00:00
|
|
|
zh_tw["question"] = '驗證問題'
|
|
|
|
zh_tw["answer"] = '答案'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
zh_tw["date_auto_select"] = '日期自動點選'
|
|
|
|
zh_tw["date_select_order"] = '日期排序方式'
|
|
|
|
zh_tw["date_keyword"] = '日期關鍵字'
|
2023-01-12 08:51:05 +00:00
|
|
|
zh_tw["pass_date_is_sold_out"] = '避開「搶購一空」的日期'
|
|
|
|
zh_tw["auto_reload_coming_soon_page"] = '自動刷新倒數中的日期頁面'
|
2024-01-09 08:30:49 +00:00
|
|
|
zh_tw["auto_reload_page_interval"] = '自動刷新頁面間隔(秒)'
|
2024-01-18 03:48:17 +00:00
|
|
|
zh_tw["reset_browser_interval"] = '重新啟動瀏覽器間隔(秒)'
|
2023-10-25 03:02:08 +00:00
|
|
|
zh_tw["proxy_server_port"] = 'Proxy IP:PORT'
|
2024-03-25 04:26:45 +00:00
|
|
|
zh_tw["window_size"] = '瀏覽器視窗大小'
|
2023-01-12 08:51:05 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
zh_tw["area_select_order"] = '區域排序方式'
|
|
|
|
zh_tw["area_keyword"] = '區域關鍵字'
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_tw["area_auto_select"] = '區域自動點選'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_tw["keyword_exclude"] = '排除關鍵字'
|
|
|
|
zh_tw["keyword_usage"] = '每組關鍵字需要雙引號, 用逗號分隔, \n在關鍵字中使用空格作為 AND 邏輯。\n加入 ,\"\" 代表符合所有關鍵字'
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2023-01-12 08:51:05 +00:00
|
|
|
zh_tw["ocr_captcha"] = '猜測驗證碼'
|
2023-06-28 08:08:59 +00:00
|
|
|
zh_tw["ocr_captcha_ddddocr_beta"] = 'ddddocr beta'
|
2023-01-13 00:43:16 +00:00
|
|
|
zh_tw["ocr_captcha_force_submit"] = '掛機模式'
|
2023-01-13 19:01:47 +00:00
|
|
|
zh_tw["ocr_captcha_image_source"] = 'OCR圖片取得方式'
|
2023-08-18 20:12:46 +00:00
|
|
|
zh_tw["ocr_captcha_not_support_arm"] = 'ocr 只支援 Intel CPU'
|
2023-02-12 03:02:16 +00:00
|
|
|
zh_tw["webdriver_type"] = 'WebDriver類別'
|
2023-11-25 01:11:43 +00:00
|
|
|
zh_tw["headless"] = '無圖形界面模式'
|
2023-03-07 14:30:30 +00:00
|
|
|
zh_tw["verbose"] = '輸出詳細除錯訊息'
|
2023-03-12 16:34:59 +00:00
|
|
|
zh_tw["running_status"] = '執行狀態'
|
|
|
|
zh_tw["running_url"] = '執行網址'
|
2024-01-21 11:41:11 +00:00
|
|
|
zh_tw["system_clock"] = '系統時鐘'
|
|
|
|
zh_tw["idle_keyword"] = '暫停關鍵字'
|
|
|
|
zh_tw["resume_keyword"] = '接續關鍵字'
|
|
|
|
zh_tw["idle_keyword_second"] = '暫停關鍵字(秒)'
|
|
|
|
zh_tw["resume_keyword_second"] = '接續關鍵字(秒)'
|
|
|
|
|
2023-03-12 16:34:59 +00:00
|
|
|
zh_tw["status_idle"] = '閒置中'
|
|
|
|
zh_tw["status_paused"] = '已暫停'
|
|
|
|
zh_tw["status_enabled"] = '已啟用'
|
|
|
|
zh_tw["status_running"] = '執行中'
|
|
|
|
|
|
|
|
zh_tw["idle"] = '暫停搶票'
|
|
|
|
zh_tw["resume"] = '接續搶票'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
zh_tw["preference"] = '偏好設定'
|
|
|
|
zh_tw["advanced"] = '進階設定'
|
2023-06-19 09:31:57 +00:00
|
|
|
zh_tw["verification_word"] = "驗證問題"
|
2024-01-11 09:28:47 +00:00
|
|
|
zh_tw["maxbot_server"] = '伺服器'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_tw["autofill"] = '自動填表單'
|
2023-03-12 16:34:59 +00:00
|
|
|
zh_tw["runtime"] = '執行階段'
|
2022-11-16 15:43:53 +00:00
|
|
|
zh_tw["about"] = '關於'
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_tw["run"] = '搶票'
|
|
|
|
zh_tw["save"] = '存檔'
|
|
|
|
zh_tw["exit"] = '關閉'
|
2022-11-17 18:17:19 +00:00
|
|
|
zh_tw["copy"] = '複製'
|
2022-12-27 15:38:13 +00:00
|
|
|
zh_tw["restore_defaults"] = '恢復預設值'
|
2023-02-26 08:39:37 +00:00
|
|
|
zh_tw["config_launcher"] = '設定檔管理'
|
2022-12-27 15:38:13 +00:00
|
|
|
zh_tw["done"] = '完成'
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
zh_tw["tixcraft_sid"] = '拓元家族 cookie SID'
|
2023-02-26 08:39:37 +00:00
|
|
|
zh_tw["ibon_ibonqware"] = 'ibon cookie ibonqware'
|
2022-11-17 18:17:19 +00:00
|
|
|
zh_tw["facebook_account"] = 'Facebook 帳號'
|
2022-12-27 15:38:13 +00:00
|
|
|
zh_tw["kktix_account"] = 'KKTIX 帳號'
|
2023-11-01 10:35:28 +00:00
|
|
|
zh_tw["fami_account"] = 'FamiTicket 帳號'
|
2023-08-19 12:49:51 +00:00
|
|
|
zh_tw["cityline_account"] = 'cityline 帳號'
|
2023-01-18 08:40:41 +00:00
|
|
|
zh_tw["urbtix_account"] = 'URBTIX 帳號'
|
2023-02-12 09:49:55 +00:00
|
|
|
zh_tw["hkticketing_account"] = 'HKTICKETING 帳號'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_tw["kham_account"] = '寬宏 帳號'
|
2023-10-06 06:43:53 +00:00
|
|
|
zh_tw["ticket_account"] = '年代 帳號'
|
2023-11-24 08:31:38 +00:00
|
|
|
zh_tw["udn_account"] = 'UDN 帳號'
|
2023-06-29 03:45:07 +00:00
|
|
|
zh_tw["ticketplus_account"] = '遠大 帳號'
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-10-07 05:31:33 +00:00
|
|
|
zh_tw["password"] = '密碼'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_tw["facebook_password"] = 'Facebook 密碼'
|
|
|
|
zh_tw["kktix_password"] = 'KKTIX 密碼'
|
2023-11-01 10:35:28 +00:00
|
|
|
zh_tw["fami_password"] = 'FamiTicket 密碼'
|
2023-08-19 12:49:51 +00:00
|
|
|
zh_tw["cityline_password"] = 'cityline 密碼'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_tw["urbtix_password"] = 'URBTIX 密碼'
|
2023-02-12 09:49:55 +00:00
|
|
|
zh_tw["hkticketing_password"] = 'HKTICKETING 密碼'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_tw["kham_password"] = '寬宏 密碼'
|
2023-10-06 06:43:53 +00:00
|
|
|
zh_tw["ticket_password"] = '年代 密碼'
|
2023-11-24 08:31:38 +00:00
|
|
|
zh_tw["udn_password"] = 'UDN 密碼'
|
2023-06-29 03:45:07 +00:00
|
|
|
zh_tw["ticketplus_password"] = '遠大 密碼'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_tw["save_password_alert"] = '將密碼保存到設定檔中可能會讓您的密碼被盜。'
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
zh_tw["play_ticket_sound"] = '有票時播放音效'
|
|
|
|
zh_tw["play_order_sound"] = '訂購時播放音效'
|
|
|
|
zh_tw["play_sound_filename"] = '音效檔'
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
zh_tw["chrome_extension"] = "Chrome 瀏覽器擴充功能"
|
2023-05-17 00:06:08 +00:00
|
|
|
zh_tw["disable_adjacent_seat"] = "允許不連續座位"
|
2023-11-08 07:31:18 +00:00
|
|
|
zh_tw["hide_some_image"] = "隱藏部份圖片"
|
2023-11-09 04:25:33 +00:00
|
|
|
zh_tw["block_facebook_network"] = "擋掉 Facebook 連線"
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
zh_tw["maxbot_slogan"] = 'MaxBot是一個免費、開放原始碼的搶票機器人。\n祝您搶票成功。'
|
2022-11-16 15:43:53 +00:00
|
|
|
zh_tw["donate"] = '打賞'
|
|
|
|
zh_tw["release"] = '所有可用版本'
|
|
|
|
zh_tw["help"] = '使用教學'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
zh_cn={}
|
|
|
|
zh_cn["homepage"] = '售票网站'
|
|
|
|
zh_cn["browser"] = '浏览器'
|
|
|
|
zh_cn["language"] = '语言'
|
|
|
|
zh_cn["ticket_number"] = '门票张数'
|
2022-12-15 11:26:51 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_cn["enable"] = '启用'
|
2023-12-11 01:56:13 +00:00
|
|
|
zh_cn["recommand_enable"] = "建议启用"
|
2023-01-12 08:51:05 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_cn["auto_press_next_step_button"] = '自动点选下一步按钮'
|
|
|
|
zh_cn["auto_fill_ticket_number"] = '自动输入张数'
|
2022-11-13 18:34:22 +00:00
|
|
|
zh_cn["and"] = '而且(同列)'
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
zh_cn["local_dictionary"] = '本地字典'
|
2024-01-11 09:28:47 +00:00
|
|
|
zh_cn["remote_url"] = '远端网址'
|
|
|
|
zh_cn["server_url"] = '服务器地址'
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_cn["auto_guess_options"] = '自动猜测验证问题'
|
2023-06-15 09:58:35 +00:00
|
|
|
zh_cn["user_guess_string"] = '验证问题的答案列表'
|
2023-06-19 09:31:57 +00:00
|
|
|
zh_cn["preview"] = '预览'
|
2024-01-11 09:28:47 +00:00
|
|
|
zh_cn["question"] = '验证问题'
|
|
|
|
zh_cn["answer"] = '答案'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
zh_cn["date_auto_select"] = '日期自动点选'
|
|
|
|
zh_cn["date_select_order"] = '日期排序方式'
|
|
|
|
zh_cn["date_keyword"] = '日期关键字'
|
2023-01-12 08:51:05 +00:00
|
|
|
zh_cn["pass_date_is_sold_out"] = '避开“抢购一空”的日期'
|
|
|
|
zh_cn["auto_reload_coming_soon_page"] = '自动刷新倒数中的日期页面'
|
2024-01-09 08:30:49 +00:00
|
|
|
zh_cn["auto_reload_page_interval"] = '重新加载间隔(秒)'
|
2024-01-18 03:48:17 +00:00
|
|
|
zh_cn["reset_browser_interval"] = '重新启动浏览器间隔(秒)'
|
2023-10-25 03:02:08 +00:00
|
|
|
zh_cn["proxy_server_port"] = 'Proxy IP:PORT'
|
2024-03-25 04:26:45 +00:00
|
|
|
zh_cn["window_size"] = '浏览器窗口大小'
|
2023-01-12 08:51:05 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
zh_cn["area_select_order"] = '区域排序方式'
|
|
|
|
zh_cn["area_keyword"] = '区域关键字'
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_cn["area_auto_select"] = '区域自动点选'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["keyword_exclude"] = '排除关键字'
|
|
|
|
zh_cn["keyword_usage"] = '每组关键字需要双引号, 用逗号分隔, \n在关键字中使用空格作为 AND 逻辑。\n附加 ,\"\" 以匹配所有结果。'
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2023-01-12 08:51:05 +00:00
|
|
|
zh_cn["ocr_captcha"] = '猜测验证码'
|
2023-06-28 08:08:59 +00:00
|
|
|
zh_cn["ocr_captcha_ddddocr_beta"] = 'ddddocr beta'
|
2023-01-13 00:43:16 +00:00
|
|
|
zh_cn["ocr_captcha_force_submit"] = '挂机模式'
|
2023-01-13 19:01:47 +00:00
|
|
|
zh_cn["ocr_captcha_image_source"] = 'OCR图像源'
|
2023-08-18 20:12:46 +00:00
|
|
|
zh_cn["ocr_captcha_not_support_arm"] = 'ddddocr 仅支持 Intel CPU'
|
2023-02-12 03:02:16 +00:00
|
|
|
zh_cn["webdriver_type"] = 'WebDriver类别'
|
2023-11-25 01:11:43 +00:00
|
|
|
zh_cn["headless"] = '无图形界面模式'
|
2023-03-07 14:30:30 +00:00
|
|
|
zh_cn["verbose"] = '输出详细除错讯息'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["running_status"] = '执行状态'
|
|
|
|
zh_cn["running_url"] = '执行网址'
|
2024-01-21 11:41:11 +00:00
|
|
|
zh_cn["system_clock"] = '系统时钟'
|
|
|
|
zh_cn["idle_keyword"] = '暂停关键字'
|
|
|
|
zh_cn["resume_keyword"] = '接续关键字'
|
|
|
|
zh_cn["idle_keyword_second"] = '暂停关键字(秒)'
|
|
|
|
zh_cn["resume_keyword_second"] = '接续关键字(秒)'
|
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["status_idle"] = '闲置中'
|
|
|
|
zh_cn["status_paused"] = '已暂停'
|
2023-03-12 16:34:59 +00:00
|
|
|
zh_cn["status_enabled"] = '已启用'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["status_running"] = '执行中'
|
2023-03-12 16:34:59 +00:00
|
|
|
|
|
|
|
zh_cn["idle"] = '暂停抢票'
|
|
|
|
zh_cn["resume"] = '接续抢票'
|
2022-11-16 15:43:53 +00:00
|
|
|
|
|
|
|
zh_cn["preference"] = '偏好设定'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["advanced"] = '进阶设定'
|
2023-06-19 09:31:57 +00:00
|
|
|
zh_cn["verification_word"] = "验证字"
|
2024-01-11 09:28:47 +00:00
|
|
|
zh_cn["maxbot_server"] = '伺服器'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_cn["autofill"] = '自动填表单'
|
2023-03-12 16:34:59 +00:00
|
|
|
zh_cn["runtime"] = '运行'
|
2022-11-16 15:43:53 +00:00
|
|
|
zh_cn["about"] = '关于'
|
2022-11-17 18:17:19 +00:00
|
|
|
zh_cn["copy"] = '复制'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
zh_cn["run"] = '抢票'
|
|
|
|
zh_cn["save"] = '存档'
|
2022-11-16 15:43:53 +00:00
|
|
|
zh_cn["exit"] = '关闭'
|
2022-12-27 15:38:13 +00:00
|
|
|
zh_cn["copy"] = '复制'
|
|
|
|
zh_cn["restore_defaults"] = '恢复默认值'
|
2023-02-26 08:39:37 +00:00
|
|
|
zh_cn["config_launcher"] = '设定档管理'
|
2022-12-27 15:38:13 +00:00
|
|
|
zh_cn["done"] = '完成'
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
zh_cn["tixcraft_sid"] = '拓元家族 cookie SID'
|
2023-02-26 08:39:37 +00:00
|
|
|
zh_cn["ibon_ibonqware"] = 'ibon cookie ibonqware'
|
2022-11-17 18:17:19 +00:00
|
|
|
zh_cn["facebook_account"] = 'Facebook 帐号'
|
2022-12-27 15:38:13 +00:00
|
|
|
zh_cn["kktix_account"] = 'KKTIX 帐号'
|
2023-11-01 10:35:28 +00:00
|
|
|
zh_cn["fami_account"] = 'FamiTicket 帐号'
|
2023-08-19 12:49:51 +00:00
|
|
|
zh_cn["cityline_account"] = 'cityline 帐号'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_cn["urbtix_account"] = 'URBTIX 帐号'
|
2023-02-12 09:49:55 +00:00
|
|
|
zh_cn["hkticketing_account"] = 'HKTICKETING 帐号'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_cn["kham_account"] = '宽宏 帐号'
|
2023-10-06 06:43:53 +00:00
|
|
|
zh_cn["ticket_account"] = '年代 帐号'
|
2023-11-24 08:31:38 +00:00
|
|
|
zh_cn["udn_account"] = 'UDN 帐号'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["ticketplus_account"] = '远大 帐号'
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-10-07 05:31:33 +00:00
|
|
|
zh_cn["password"] = '密码'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_cn["facebook_password"] = 'Facebook 密码'
|
|
|
|
zh_cn["kktix_password"] = 'KKTIX 密码'
|
2023-11-01 10:35:28 +00:00
|
|
|
zh_cn["fami_password"] = 'FamiTicket 密码'
|
2023-08-19 12:49:51 +00:00
|
|
|
zh_cn["cityline_password"] = 'cityline 密码'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_cn["urbtix_password"] = 'URBTIX 密码'
|
2023-02-12 09:49:55 +00:00
|
|
|
zh_cn["hkticketing_password"] = 'HKTICKETING 密码'
|
2023-02-11 05:36:27 +00:00
|
|
|
zh_cn["kham_password"] = '宽宏 密码'
|
2023-10-06 06:43:53 +00:00
|
|
|
zh_cn["ticket_password"] = '年代 密码'
|
2023-11-24 08:31:38 +00:00
|
|
|
zh_cn["udn_password"] = 'UDN 密码'
|
2023-08-05 03:41:06 +00:00
|
|
|
zh_cn["ticketplus_password"] = '远大 密码'
|
|
|
|
zh_cn["save_password_alert"] = '将密码保存到文件中可能会暴露您的密码。'
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
zh_cn["play_ticket_sound"] = '有票时播放音效'
|
|
|
|
zh_cn["play_order_sound"] = '订购时播放音效'
|
|
|
|
zh_cn["play_sound_filename"] = '音效档'
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
zh_cn["chrome_extension"] = "Chrome 浏览器扩展程序"
|
2023-05-17 00:06:08 +00:00
|
|
|
zh_cn["disable_adjacent_seat"] = "允许不连续座位"
|
2023-11-08 07:31:18 +00:00
|
|
|
zh_cn["hide_some_image"] = "隐藏一些图像"
|
2023-11-09 04:25:33 +00:00
|
|
|
zh_cn["block_facebook_network"] = "擋掉 Facebook 連線"
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
zh_cn["maxbot_slogan"] = 'MaxBot 是一个免费的开源机器人程序。\n祝您抢票成功。'
|
2022-11-11 16:46:36 +00:00
|
|
|
zh_cn["donate"] = '打赏'
|
2022-11-13 18:34:22 +00:00
|
|
|
zh_cn["help"] = '使用教学'
|
|
|
|
zh_cn["release"] = '所有可用版本'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
ja_jp={}
|
|
|
|
ja_jp["homepage"] = 'ホームページ'
|
|
|
|
ja_jp["browser"] = 'ブラウザ'
|
|
|
|
ja_jp["language"] = '言語'
|
|
|
|
ja_jp["ticket_number"] = '枚数'
|
2022-12-15 11:26:51 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
ja_jp["enable"] = '有効'
|
2023-12-11 01:56:13 +00:00
|
|
|
ja_jp["recommand_enable"] = "有効化を推奨"
|
2023-01-12 08:51:05 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
ja_jp["auto_press_next_step_button"] = '次を自動で押す'
|
|
|
|
ja_jp["auto_fill_ticket_number"] = '枚数自動入力'
|
2022-11-13 18:34:22 +00:00
|
|
|
ja_jp["and"] = 'そして(同列)'
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
ja_jp["local_dictionary"] = 'ローカル辞書'
|
2024-01-11 09:28:47 +00:00
|
|
|
ja_jp["remote_url"] = 'リモートURL'
|
|
|
|
ja_jp["server_url"] = 'サーバーURL'
|
2022-11-11 16:46:36 +00:00
|
|
|
ja_jp["auto_guess_options"] = '自動推測検証問題'
|
2023-06-15 09:58:35 +00:00
|
|
|
ja_jp["user_guess_string"] = '検証用の質問の回答リスト'
|
2023-06-19 09:31:57 +00:00
|
|
|
ja_jp["preview"] = 'プレビュー'
|
2024-01-11 09:28:47 +00:00
|
|
|
ja_jp["question"] = '質問'
|
|
|
|
ja_jp["answer"] = '答え'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
ja_jp["date_auto_select"] = '日付自動選択'
|
|
|
|
ja_jp["date_select_order"] = '日付のソート方法'
|
|
|
|
ja_jp["date_keyword"] = '日付キーワード'
|
2023-01-12 08:51:05 +00:00
|
|
|
ja_jp["pass_date_is_sold_out"] = '「売り切れ」公演を避ける'
|
|
|
|
ja_jp["auto_reload_coming_soon_page"] = '公開予定のページをリロード'
|
2024-01-09 08:30:49 +00:00
|
|
|
ja_jp["auto_reload_page_interval"] = 'リロード間隔(秒)'
|
2024-01-18 03:48:17 +00:00
|
|
|
ja_jp["reset_browser_interval"] = 'ブラウザの再起動間隔(秒)'
|
2023-10-25 03:02:08 +00:00
|
|
|
ja_jp["proxy_server_port"] = 'Proxy IP:PORT'
|
2024-03-25 04:26:45 +00:00
|
|
|
ja_jp["window_size"] = 'ウィンドウサイズ'
|
2023-01-12 08:51:05 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
ja_jp["area_select_order"] = 'エリアソート方法'
|
|
|
|
ja_jp["area_keyword"] = 'エリアキーワード'
|
2022-11-11 16:46:36 +00:00
|
|
|
ja_jp["area_auto_select"] = 'エリア自動選択'
|
2023-08-05 03:41:06 +00:00
|
|
|
ja_jp["keyword_exclude"] = '除外キーワード'
|
|
|
|
ja_jp["keyword_usage"] = '各キーワードはカンマで区切られた二重引用符が必要です。\nキーワード内のスペースを AND ロジックとして使用します。\nすべてに一致するように ,\"\" を追加します。'
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2023-01-12 08:51:05 +00:00
|
|
|
ja_jp["ocr_captcha"] = 'キャプチャを推測する'
|
2023-06-28 08:08:59 +00:00
|
|
|
ja_jp["ocr_captcha_ddddocr_beta"] = 'ddddocr beta'
|
2023-01-13 19:01:47 +00:00
|
|
|
ja_jp["ocr_captcha_force_submit"] = 'キーボードから離れて'
|
|
|
|
ja_jp["ocr_captcha_image_source"] = 'OCR 画像ソース'
|
2023-08-18 20:12:46 +00:00
|
|
|
ja_jp["ocr_captcha_not_support_arm"] = 'Intel CPU のみをサポートします'
|
2023-02-12 03:02:16 +00:00
|
|
|
ja_jp["webdriver_type"] = 'WebDriverタイプ'
|
2023-11-25 01:11:43 +00:00
|
|
|
ja_jp["headless"] = 'ヘッドレスモード'
|
2023-03-07 14:30:30 +00:00
|
|
|
ja_jp["verbose"] = '詳細モード'
|
2023-03-12 16:34:59 +00:00
|
|
|
ja_jp["running_status"] = 'スターテス'
|
|
|
|
ja_jp["running_url"] = '現在の URL'
|
2024-01-21 11:41:11 +00:00
|
|
|
ja_jp["system_clock"] = 'システムクロック'
|
|
|
|
ja_jp["idle_keyword"] = 'アイドルキーワード'
|
|
|
|
ja_jp["resume_keyword"] = '再起動キーワード'
|
|
|
|
ja_jp["idle_keyword_second"] = 'アイドルキーワード(秒)'
|
|
|
|
ja_jp["resume_keyword_second"] = '再起動キーワード(秒)'
|
|
|
|
|
|
|
|
ja_jp["status_idle"] = 'アイドル状態'
|
2023-03-12 16:34:59 +00:00
|
|
|
ja_jp["status_paused"] = '一時停止'
|
|
|
|
ja_jp["status_enabled"] = '有効'
|
|
|
|
ja_jp["status_running"] = 'ランニング'
|
|
|
|
|
|
|
|
ja_jp["idle"] = 'アイドル'
|
2024-01-21 11:41:11 +00:00
|
|
|
ja_jp["resume"] = '再起動'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
ja_jp["preference"] = '設定'
|
|
|
|
ja_jp["advanced"] = '高度な設定'
|
2023-06-19 09:31:57 +00:00
|
|
|
ja_jp["verification_word"] = "確認の言葉"
|
2024-01-11 09:28:47 +00:00
|
|
|
ja_jp["maxbot_server"] = 'サーバ'
|
2023-02-11 05:36:27 +00:00
|
|
|
ja_jp["autofill"] = 'オートフィル'
|
2023-03-12 16:34:59 +00:00
|
|
|
ja_jp["runtime"] = 'ランタイム'
|
2022-11-16 15:43:53 +00:00
|
|
|
ja_jp["about"] = '情報'
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
ja_jp["run"] = 'チケットを取る'
|
|
|
|
ja_jp["save"] = '保存'
|
2022-11-16 15:43:53 +00:00
|
|
|
ja_jp["exit"] = '閉じる'
|
2022-11-17 18:17:19 +00:00
|
|
|
ja_jp["copy"] = 'コピー'
|
2022-12-27 15:38:13 +00:00
|
|
|
ja_jp["restore_defaults"] = 'デフォルトに戻す'
|
2023-02-26 08:39:37 +00:00
|
|
|
ja_jp["config_launcher"] = 'ランチャー'
|
2022-12-27 15:38:13 +00:00
|
|
|
ja_jp["done"] = '終わり'
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
ja_jp["tixcraft_sid"] = '拓元家 cookie SID'
|
2023-02-26 08:39:37 +00:00
|
|
|
ja_jp["ibon_ibonqware"] = 'ibon cookie ibonqware'
|
2022-11-17 18:17:19 +00:00
|
|
|
ja_jp["facebook_account"] = 'Facebookのアカウント'
|
2022-12-27 15:38:13 +00:00
|
|
|
ja_jp["kktix_account"] = 'KKTIXのアカウント'
|
2023-11-01 10:35:28 +00:00
|
|
|
ja_jp["fami_account"] = 'FamiTicketのアカウント'
|
2023-08-19 12:49:51 +00:00
|
|
|
ja_jp["cityline_account"] = 'citylineのアカウント'
|
2023-01-18 08:40:41 +00:00
|
|
|
ja_jp["urbtix_account"] = 'URBTIXのアカウント'
|
2023-02-12 09:49:55 +00:00
|
|
|
ja_jp["hkticketing_account"] = 'HKTICKETINGのアカウント'
|
2023-02-11 05:36:27 +00:00
|
|
|
ja_jp["kham_account"] = 'KHAMのアカウント'
|
2023-10-06 06:43:53 +00:00
|
|
|
ja_jp["ticket_account"] = 'TICKETのアカウント'
|
2023-11-24 08:31:38 +00:00
|
|
|
ja_jp["udn_account"] = 'UDNのアカウント'
|
2023-06-29 03:45:07 +00:00
|
|
|
ja_jp["ticketplus_account"] = '遠大のアカウント'
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-10-07 05:31:33 +00:00
|
|
|
ja_jp["password"] = 'パスワード'
|
2023-02-11 05:36:27 +00:00
|
|
|
ja_jp["facebook_password"] = 'Facebookのパスワード'
|
|
|
|
ja_jp["kktix_password"] = 'KKTIXのパスワード'
|
2023-11-01 10:35:28 +00:00
|
|
|
ja_jp["fami_password"] = 'FamiTicketのパスワード'
|
2023-08-19 12:49:51 +00:00
|
|
|
ja_jp["cityline_password"] = 'citylineのパスワード'
|
2023-02-11 05:36:27 +00:00
|
|
|
ja_jp["urbtix_password"] = 'URBTIXのパスワード'
|
2023-02-12 09:49:55 +00:00
|
|
|
ja_jp["hkticketing_password"] = 'HKTICKETINGのパスワード'
|
2023-02-11 05:36:27 +00:00
|
|
|
ja_jp["kham_password"] = 'KHAMのパスワード'
|
2023-10-06 06:43:53 +00:00
|
|
|
ja_jp["ticket_password"] = 'TICKETのパスワード'
|
2023-11-24 08:31:38 +00:00
|
|
|
ja_jp["udn_password"] = 'UDNのパスワード'
|
2023-06-29 03:45:07 +00:00
|
|
|
ja_jp["ticketplus_password"] = '遠大のパスワード'
|
2023-02-11 05:36:27 +00:00
|
|
|
ja_jp["save_password_alert"] = 'パスワードをファイルに保存すると、パスワードが公開される可能性があります。'
|
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
ja_jp["play_ticket_sound"] = '有票時に音を鳴らす'
|
|
|
|
ja_jp["play_order_sound"] = '注文時に音を鳴らす'
|
|
|
|
ja_jp["play_sound_filename"] = 'サウンドファイル'
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
ja_jp["chrome_extension"] = "Chrome ブラウザ拡張機能"
|
2023-05-17 00:06:08 +00:00
|
|
|
ja_jp["disable_adjacent_seat"] = "連続しない座席も可"
|
2023-11-08 07:31:18 +00:00
|
|
|
ja_jp["hide_some_image"] = "一部の画像を非表示にする"
|
2023-11-09 04:25:33 +00:00
|
|
|
ja_jp["block_facebook_network"] = "Facebookをブロックする"
|
2023-02-09 17:50:34 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
ja_jp["maxbot_slogan"] = 'MaxBot は無料のオープン ソース ボット プログラムです。チケットの成功をお祈りします。'
|
2022-11-11 16:46:36 +00:00
|
|
|
ja_jp["donate"] = '寄付'
|
2022-11-13 18:34:22 +00:00
|
|
|
ja_jp["help"] = '利用方法'
|
|
|
|
ja_jp["release"] = 'リリース'
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
translate['en_us']=en_us
|
|
|
|
translate['zh_tw']=zh_tw
|
|
|
|
translate['zh_cn']=zh_cn
|
|
|
|
translate['ja_jp']=ja_jp
|
2022-11-13 18:34:22 +00:00
|
|
|
return translate
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2023-06-19 12:55:33 +00:00
|
|
|
def get_ip_address():
|
2023-07-12 08:26:11 +00:00
|
|
|
default_ip = "127.0.0.1"
|
|
|
|
ip = default_ip
|
|
|
|
try:
|
|
|
|
ip = [l for l in ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2]
|
|
|
|
if not ip.startswith("127.")][:1], [[(s.connect(('8.8.8.8', 53)),
|
|
|
|
s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET,
|
|
|
|
socket.SOCK_DGRAM)]][0][1]]) if l][0][0]
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
try:
|
|
|
|
ip = socket.gethostname()
|
|
|
|
except Exception as exc2:
|
|
|
|
print(exc2)
|
|
|
|
ip = default_ip
|
2023-06-19 12:55:33 +00:00
|
|
|
return ip
|
|
|
|
|
2023-06-15 16:31:46 +00:00
|
|
|
def format_config_keyword_for_json(user_input):
|
|
|
|
if len(user_input) > 0:
|
|
|
|
if not ('\"' in user_input):
|
|
|
|
user_input = '"' + user_input + '"'
|
2023-06-16 16:04:55 +00:00
|
|
|
|
2023-06-15 16:38:34 +00:00
|
|
|
if user_input[:1]=="{" and user_input[-1:]=="}":
|
2023-06-16 16:04:55 +00:00
|
|
|
tmp_json = {}
|
|
|
|
try:
|
|
|
|
tmp_json = json.loads(user_input)
|
|
|
|
key=list(tmp_json.keys())[0]
|
|
|
|
first_item=tmp_json[key]
|
|
|
|
user_input=json.dumps(first_item)
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
|
|
|
|
2023-06-15 16:38:34 +00:00
|
|
|
if user_input[:1]=="[" and user_input[-1:]=="]":
|
2023-06-15 16:31:46 +00:00
|
|
|
user_input=user_input[1:]
|
2023-06-15 16:38:34 +00:00
|
|
|
user_input=user_input[:-1]
|
2023-06-15 16:31:46 +00:00
|
|
|
return user_input
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
def sx(s1):
|
|
|
|
key=18
|
|
|
|
return ''.join(chr(ord(a) ^ key) for a in s1)
|
|
|
|
|
|
|
|
def decryptMe(b):
|
|
|
|
s=""
|
|
|
|
if(len(b)>0):
|
|
|
|
s=sx(base64.b64decode(b).decode("UTF-8"))
|
|
|
|
return s
|
|
|
|
|
|
|
|
def encryptMe(s):
|
|
|
|
data=""
|
|
|
|
if(len(s)>0):
|
|
|
|
data=base64.b64encode(sx(s).encode('UTF-8')).decode("UTF-8")
|
|
|
|
return data
|
|
|
|
|
2023-06-03 04:23:53 +00:00
|
|
|
def is_arm():
|
|
|
|
ret = False
|
|
|
|
if "-arm" in platform.platform():
|
|
|
|
ret = True
|
|
|
|
return ret
|
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
def get_app_root():
|
2024-03-29 09:29:39 +00:00
|
|
|
app_root = ""
|
2019-10-01 17:52:13 +00:00
|
|
|
if hasattr(sys, 'frozen'):
|
|
|
|
basis = sys.executable
|
2024-03-29 09:29:39 +00:00
|
|
|
app_root = os.path.dirname(basis)
|
2019-10-01 17:52:13 +00:00
|
|
|
else:
|
2024-03-29 09:29:39 +00:00
|
|
|
app_root = os.getcwd()
|
2022-11-16 15:43:53 +00:00
|
|
|
return app_root
|
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
def get_default_config():
|
|
|
|
config_dict={}
|
|
|
|
|
|
|
|
config_dict["homepage"] = CONST_HOMEPAGE_DEFAULT
|
|
|
|
config_dict["browser"] = "chrome"
|
|
|
|
config_dict["language"] = "English"
|
|
|
|
config_dict["ticket_number"] = 2
|
2023-01-12 11:41:49 +00:00
|
|
|
config_dict["ocr_captcha"] = {}
|
|
|
|
config_dict["ocr_captcha"]["enable"] = True
|
2023-06-28 08:08:59 +00:00
|
|
|
config_dict["ocr_captcha"]["beta"] = True
|
2023-05-20 14:57:24 +00:00
|
|
|
config_dict["ocr_captcha"]["force_submit"] = True
|
2023-02-12 03:02:16 +00:00
|
|
|
config_dict["ocr_captcha"]["image_source"] = CONST_OCR_CAPTCH_IMAGE_SOURCE_CANVAS
|
|
|
|
config_dict["webdriver_type"] = CONST_WEBDRIVER_TYPE_UC
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2023-06-03 04:23:53 +00:00
|
|
|
if is_arm():
|
|
|
|
config_dict["ocr_captcha"]["enable"] = False
|
|
|
|
config_dict["ocr_captcha"]["force_submit"] = False
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2024-01-08 02:32:17 +00:00
|
|
|
config_dict["date_auto_select"] = {}
|
|
|
|
config_dict["date_auto_select"]["enable"] = True
|
|
|
|
config_dict["date_auto_select"]["date_keyword"] = ""
|
|
|
|
config_dict["date_auto_select"]["mode"] = CONST_SELECT_ORDER_DEFAULT
|
2023-05-24 07:17:11 +00:00
|
|
|
|
|
|
|
config_dict["area_auto_select"] = {}
|
|
|
|
config_dict["area_auto_select"]["enable"] = True
|
|
|
|
config_dict["area_auto_select"]["mode"] = CONST_SELECT_ORDER_DEFAULT
|
|
|
|
config_dict["area_auto_select"]["area_keyword"] = ""
|
2023-11-10 01:23:27 +00:00
|
|
|
config_dict["keyword_exclude"] = CONST_EXCLUDE_DEFAULT
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2024-01-08 02:32:17 +00:00
|
|
|
config_dict['kktix']={}
|
|
|
|
config_dict["kktix"]["auto_press_next_step_button"] = True
|
|
|
|
config_dict["kktix"]["auto_fill_ticket_number"] = True
|
|
|
|
|
|
|
|
config_dict['tixcraft']={}
|
2023-01-12 08:51:05 +00:00
|
|
|
config_dict["tixcraft"]["pass_date_is_sold_out"] = True
|
2022-11-21 19:01:04 +00:00
|
|
|
config_dict["tixcraft"]["auto_reload_coming_soon_page"] = True
|
|
|
|
|
|
|
|
config_dict['advanced']={}
|
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
config_dict['advanced']['play_sound']={}
|
|
|
|
config_dict["advanced"]["play_sound"]["ticket"] = True
|
|
|
|
config_dict["advanced"]["play_sound"]["order"] = True
|
|
|
|
config_dict["advanced"]["play_sound"]["filename"] = CONST_CAPTCHA_SOUND_FILENAME_DEFAULT
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2023-02-22 16:05:44 +00:00
|
|
|
config_dict["advanced"]["tixcraft_sid"] = ""
|
2023-02-26 08:39:37 +00:00
|
|
|
config_dict["advanced"]["ibonqware"] = ""
|
2022-11-21 19:01:04 +00:00
|
|
|
config_dict["advanced"]["facebook_account"] = ""
|
2022-12-27 15:38:13 +00:00
|
|
|
config_dict["advanced"]["kktix_account"] = ""
|
2023-11-01 10:35:28 +00:00
|
|
|
config_dict["advanced"]["fami_account"] = ""
|
2023-08-19 12:49:51 +00:00
|
|
|
config_dict["advanced"]["cityline_account"] = ""
|
2023-01-18 08:40:41 +00:00
|
|
|
config_dict["advanced"]["urbtix_account"] = ""
|
2023-02-12 09:49:55 +00:00
|
|
|
config_dict["advanced"]["hkticketing_account"] = ""
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["kham_account"] = ""
|
2023-10-06 06:43:53 +00:00
|
|
|
config_dict["advanced"]["ticket_account"] = ""
|
2023-11-24 08:31:38 +00:00
|
|
|
config_dict["advanced"]["udn_account"] = ""
|
2023-06-29 03:45:07 +00:00
|
|
|
config_dict["advanced"]["ticketplus_account"] = ""
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
config_dict["advanced"]["facebook_password"] = ""
|
|
|
|
config_dict["advanced"]["kktix_password"] = ""
|
2023-11-01 10:35:28 +00:00
|
|
|
config_dict["advanced"]["fami_password"] = ""
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["urbtix_password"] = ""
|
2023-08-19 12:49:51 +00:00
|
|
|
config_dict["advanced"]["cityline_password"] = ""
|
2023-02-12 09:49:55 +00:00
|
|
|
config_dict["advanced"]["hkticketing_password"] = ""
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["kham_password"] = ""
|
2023-10-06 06:43:53 +00:00
|
|
|
config_dict["advanced"]["ticket_password"] = ""
|
2023-11-24 08:31:38 +00:00
|
|
|
config_dict["advanced"]["udn_password"] = ""
|
2023-06-29 03:45:07 +00:00
|
|
|
config_dict["advanced"]["ticketplus_password"] = ""
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2024-03-08 01:11:16 +00:00
|
|
|
config_dict["advanced"]["facebook_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["kktix_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["fami_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["urbtix_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["cityline_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["hkticketing_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["kham_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["ticket_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["udn_password_plaintext"] = ""
|
|
|
|
config_dict["advanced"]["ticketplus_password_plaintext"] = ""
|
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
config_dict["advanced"]["chrome_extension"] = True
|
2023-05-17 00:06:08 +00:00
|
|
|
config_dict["advanced"]["disable_adjacent_seat"] = False
|
2023-12-11 01:56:13 +00:00
|
|
|
config_dict["advanced"]["hide_some_image"] = False
|
|
|
|
config_dict["advanced"]["block_facebook_network"] = False
|
2023-11-16 05:58:19 +00:00
|
|
|
|
2023-11-25 01:11:43 +00:00
|
|
|
config_dict["advanced"]["headless"] = False
|
2023-03-07 14:30:30 +00:00
|
|
|
config_dict["advanced"]["verbose"] = False
|
2023-06-18 16:19:49 +00:00
|
|
|
config_dict["advanced"]["auto_guess_options"] = True
|
2023-06-15 09:58:35 +00:00
|
|
|
config_dict["advanced"]["user_guess_string"] = ""
|
2024-01-11 09:28:47 +00:00
|
|
|
config_dict["advanced"]["remote_url"] = "http://127.0.0.1:%d/" % (CONST_SERVER_PORT)
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2024-01-09 08:30:49 +00:00
|
|
|
config_dict["advanced"]["auto_reload_page_interval"] = 0.1
|
2024-01-18 03:48:17 +00:00
|
|
|
config_dict["advanced"]["reset_browser_interval"] = 0
|
2023-10-25 03:02:08 +00:00
|
|
|
config_dict["advanced"]["proxy_server_port"] = ""
|
2024-03-27 07:38:54 +00:00
|
|
|
config_dict["advanced"]["window_size"] = "512,1024"
|
2023-05-26 04:43:18 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
config_dict["advanced"]["idle_keyword"] = ""
|
|
|
|
config_dict["advanced"]["resume_keyword"] = ""
|
|
|
|
config_dict["advanced"]["idle_keyword_second"] = ""
|
|
|
|
config_dict["advanced"]["resume_keyword_second"] = ""
|
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
return config_dict
|
|
|
|
|
2023-03-12 16:34:59 +00:00
|
|
|
def read_last_url_from_file():
|
|
|
|
ret = ""
|
2023-06-16 04:04:04 +00:00
|
|
|
if os.path.exists(CONST_MAXBOT_LAST_URL_FILE):
|
|
|
|
with open(CONST_MAXBOT_LAST_URL_FILE, "r") as text_file:
|
|
|
|
ret = text_file.readline()
|
2023-03-12 16:34:59 +00:00
|
|
|
return ret
|
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
def load_json():
|
|
|
|
app_root = get_app_root()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
# overwrite config path.
|
2023-03-12 16:34:59 +00:00
|
|
|
config_filepath = os.path.join(app_root, CONST_MAXBOT_CONFIG_FILE)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
config_dict = None
|
|
|
|
if os.path.isfile(config_filepath):
|
|
|
|
with open(config_filepath) as json_data:
|
|
|
|
config_dict = json.load(json_data)
|
2022-11-21 19:01:04 +00:00
|
|
|
else:
|
|
|
|
config_dict = get_default_config()
|
2022-11-13 18:34:22 +00:00
|
|
|
return config_filepath, config_dict
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
def btn_restore_defaults_clicked(language_code):
|
|
|
|
app_root = get_app_root()
|
2023-03-12 16:34:59 +00:00
|
|
|
config_filepath = os.path.join(app_root, CONST_MAXBOT_CONFIG_FILE)
|
2024-03-15 04:06:18 +00:00
|
|
|
if os.path.exists(str(config_filepath)):
|
|
|
|
try:
|
|
|
|
os.unlink(str(config_filepath))
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
pass
|
2022-12-27 15:38:13 +00:00
|
|
|
|
|
|
|
config_dict = get_default_config()
|
|
|
|
messagebox.showinfo(translate[language_code]["restore_defaults"], translate[language_code]["done"])
|
|
|
|
|
|
|
|
global root
|
|
|
|
load_GUI(root, config_dict)
|
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
def do_maxbot_idle():
|
2023-03-12 16:34:59 +00:00
|
|
|
app_root = get_app_root()
|
|
|
|
idle_filepath = os.path.join(app_root, CONST_MAXBOT_INT28_FILE)
|
|
|
|
with open(CONST_MAXBOT_INT28_FILE, "w") as text_file:
|
|
|
|
text_file.write("")
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
def btn_idle_clicked(language_code):
|
|
|
|
do_maxbot_idle()
|
2023-03-12 17:08:23 +00:00
|
|
|
update_maxbot_runtime_status()
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
def do_maxbot_resume():
|
2023-03-12 16:34:59 +00:00
|
|
|
app_root = get_app_root()
|
|
|
|
idle_filepath = os.path.join(app_root, CONST_MAXBOT_INT28_FILE)
|
2024-01-21 11:41:11 +00:00
|
|
|
for i in range(3):
|
2023-06-16 04:04:04 +00:00
|
|
|
force_remove_file(idle_filepath)
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
def btn_resume_clicked(language_code):
|
|
|
|
do_maxbot_resume()
|
2023-03-12 17:08:23 +00:00
|
|
|
update_maxbot_runtime_status()
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2023-02-26 08:39:37 +00:00
|
|
|
def btn_launcher_clicked(language_code):
|
|
|
|
Root_Dir = ""
|
2024-03-15 04:06:18 +00:00
|
|
|
save_ret = btn_save_act(slience_mode=True)
|
2023-02-26 08:39:37 +00:00
|
|
|
if save_ret:
|
2023-06-15 15:45:50 +00:00
|
|
|
run_python_script("config_launcher")
|
|
|
|
|
2024-03-15 04:06:18 +00:00
|
|
|
def btn_save_clicked():
|
|
|
|
btn_save_act()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-03-15 04:06:18 +00:00
|
|
|
def btn_save_act(slience_mode=False):
|
2022-11-21 19:01:04 +00:00
|
|
|
app_root = get_app_root()
|
2023-03-12 16:34:59 +00:00
|
|
|
config_filepath = os.path.join(app_root, CONST_MAXBOT_CONFIG_FILE)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
config_dict = get_default_config()
|
2024-03-15 04:06:18 +00:00
|
|
|
language_code = get_language_code_by_name(config_dict["language"])
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
# read user input
|
|
|
|
global combo_homepage
|
|
|
|
global combo_browser
|
|
|
|
global combo_language
|
|
|
|
global combo_ticket_number
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
global chk_state_auto_press_next_step_button
|
|
|
|
global chk_state_auto_fill_ticket_number
|
2023-06-15 09:58:35 +00:00
|
|
|
global txt_user_guess_string
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
global chk_state_date_auto_select
|
|
|
|
global txt_date_keyword
|
|
|
|
global chk_state_area_auto_select
|
2023-05-24 07:17:11 +00:00
|
|
|
global txt_area_keyword
|
2023-08-05 03:41:06 +00:00
|
|
|
global txt_keyword_exclude
|
2024-01-11 09:28:47 +00:00
|
|
|
global txt_remote_url
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
global combo_date_auto_select_mode
|
|
|
|
global combo_area_auto_select_mode
|
|
|
|
|
|
|
|
global chk_state_pass_date_is_sold_out
|
|
|
|
global chk_state_auto_reload_coming_soon_page
|
2023-05-26 05:13:06 +00:00
|
|
|
global txt_auto_reload_page_interval
|
2024-01-18 03:48:17 +00:00
|
|
|
global txt_reset_browser_intervalv
|
2023-10-25 03:02:08 +00:00
|
|
|
global txt_proxy_server_port
|
2024-03-25 04:26:45 +00:00
|
|
|
global txt_window_size
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-02-22 16:05:44 +00:00
|
|
|
global txt_tixcraft_sid
|
2023-02-26 08:39:37 +00:00
|
|
|
global txt_ibon_ibonqware
|
2022-11-21 19:01:04 +00:00
|
|
|
global txt_facebook_account
|
2022-12-27 15:38:13 +00:00
|
|
|
global txt_kktix_account
|
2023-11-01 10:35:28 +00:00
|
|
|
global txt_fami_account
|
2023-08-19 12:49:51 +00:00
|
|
|
global txt_cityline_account
|
2023-01-18 08:40:41 +00:00
|
|
|
global txt_urbtix_account
|
2023-02-12 09:49:55 +00:00
|
|
|
global txt_hkticketing_account
|
2023-02-11 05:36:27 +00:00
|
|
|
global txt_kham_account
|
2023-10-06 06:43:53 +00:00
|
|
|
global txt_ticket_account
|
2023-11-24 08:31:38 +00:00
|
|
|
global txt_udn_account
|
2023-06-29 03:45:07 +00:00
|
|
|
global txt_ticketplus_account
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
global txt_facebook_password
|
|
|
|
global txt_kktix_password
|
2023-11-01 10:35:28 +00:00
|
|
|
global txt_fami_password
|
2023-08-19 12:49:51 +00:00
|
|
|
global txt_cityline_password
|
2023-02-11 05:36:27 +00:00
|
|
|
global txt_urbtix_password
|
2023-02-12 09:49:55 +00:00
|
|
|
global txt_hkticketing_password
|
2023-02-11 05:36:27 +00:00
|
|
|
global txt_kham_password
|
2023-10-06 06:43:53 +00:00
|
|
|
global txt_ticket_password
|
2023-11-24 08:31:38 +00:00
|
|
|
global txt_udn_password
|
2023-06-29 03:45:07 +00:00
|
|
|
global txt_ticketplus_password
|
2023-01-18 08:40:41 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global chk_state_play_ticket_sound
|
|
|
|
global chk_state_play_order_sound
|
|
|
|
global txt_play_sound_filename
|
2023-01-12 08:51:05 +00:00
|
|
|
global chk_state_ocr_captcha
|
2023-06-28 08:08:59 +00:00
|
|
|
global chk_state_ocr_captcha_ddddocr_beta
|
2023-01-12 22:29:58 +00:00
|
|
|
global chk_state_ocr_captcha_force_submit
|
2024-01-21 11:41:11 +00:00
|
|
|
global chk_state_chrome_extension
|
2023-05-17 00:06:08 +00:00
|
|
|
global chk_state_adjacent_seat
|
2023-11-08 07:31:18 +00:00
|
|
|
global chk_state_hide_some_image
|
2023-11-09 04:25:33 +00:00
|
|
|
global chk_state_block_facebook_network
|
2023-11-16 05:58:19 +00:00
|
|
|
|
2023-11-25 01:11:43 +00:00
|
|
|
global chk_state_headless
|
2023-03-07 14:30:30 +00:00
|
|
|
global chk_state_verbose
|
2023-04-28 04:04:21 +00:00
|
|
|
global chk_state_auto_guess_options
|
2023-01-13 19:01:47 +00:00
|
|
|
global combo_ocr_captcha_image_source
|
2023-02-12 03:02:16 +00:00
|
|
|
global combo_webdriver_type
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
global txt_idle_keyword
|
|
|
|
global txt_resume_keyword
|
|
|
|
global txt_idle_keyword_second
|
|
|
|
global txt_resume_keyword_second
|
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
is_all_data_correct = True
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
if is_all_data_correct:
|
|
|
|
if combo_homepage.get().strip()=="":
|
|
|
|
is_all_data_correct = False
|
|
|
|
messagebox.showerror("Error", "Please enter homepage")
|
|
|
|
else:
|
2023-01-23 13:32:47 +00:00
|
|
|
homepage_domain = combo_homepage.get().strip()
|
|
|
|
if ' (' in homepage_domain:
|
|
|
|
homepage_domain = homepage_domain.split(' (')[0]
|
|
|
|
config_dict["homepage"] = homepage_domain
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
if is_all_data_correct:
|
|
|
|
if combo_browser.get().strip()=="":
|
|
|
|
is_all_data_correct = False
|
|
|
|
messagebox.showerror("Error", "Please select a browser: chrome or firefox")
|
|
|
|
else:
|
|
|
|
config_dict["browser"] = combo_browser.get().strip()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
if is_all_data_correct:
|
|
|
|
if combo_language.get().strip()=="":
|
|
|
|
is_all_data_correct = False
|
|
|
|
messagebox.showerror("Error", "Please select a language")
|
|
|
|
else:
|
|
|
|
config_dict["language"] = combo_language.get().strip()
|
2022-12-27 15:38:13 +00:00
|
|
|
# display as new language.
|
|
|
|
language_code = get_language_code_by_name(config_dict["language"])
|
2022-11-21 19:01:04 +00:00
|
|
|
|
|
|
|
if is_all_data_correct:
|
|
|
|
if combo_ticket_number.get().strip()=="":
|
|
|
|
is_all_data_correct = False
|
|
|
|
messagebox.showerror("Error", "Please select a value")
|
|
|
|
else:
|
|
|
|
config_dict["ticket_number"] = int(combo_ticket_number.get().strip())
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
|
|
|
config_dict["kktix"]["auto_press_next_step_button"] = bool(chk_state_auto_press_next_step_button.get())
|
|
|
|
config_dict["kktix"]["auto_fill_ticket_number"] = bool(chk_state_auto_fill_ticket_number.get())
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-01-08 02:32:17 +00:00
|
|
|
config_dict["date_auto_select"]["enable"] = bool(chk_state_date_auto_select.get())
|
|
|
|
config_dict["date_auto_select"]["mode"] = combo_date_auto_select_mode.get().strip()
|
2024-01-11 09:28:47 +00:00
|
|
|
|
2023-07-17 10:16:58 +00:00
|
|
|
date_keyword = txt_date_keyword.get("1.0",END).strip()
|
|
|
|
date_keyword = format_config_keyword_for_json(date_keyword)
|
2024-01-08 02:32:17 +00:00
|
|
|
config_dict["date_auto_select"]["date_keyword"] = date_keyword
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
config_dict["tixcraft"]["pass_date_is_sold_out"] = bool(chk_state_pass_date_is_sold_out.get())
|
|
|
|
config_dict["tixcraft"]["auto_reload_coming_soon_page"] = bool(chk_state_auto_reload_coming_soon_page.get())
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-05-26 05:13:06 +00:00
|
|
|
area_keyword = txt_area_keyword.get("1.0",END).strip()
|
2023-06-15 16:31:46 +00:00
|
|
|
area_keyword = format_config_keyword_for_json(area_keyword)
|
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
keyword_exclude = txt_keyword_exclude.get("1.0",END).strip()
|
|
|
|
keyword_exclude = format_config_keyword_for_json(keyword_exclude)
|
2023-06-15 16:31:46 +00:00
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
user_guess_string = txt_user_guess_string.get("1.0",END).strip()
|
2023-06-15 16:31:46 +00:00
|
|
|
user_guess_string = format_config_keyword_for_json(user_guess_string)
|
2023-05-26 05:13:06 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
remote_url = txt_remote_url.get("1.0",END).strip()
|
|
|
|
remote_url = format_config_keyword_for_json(remote_url)
|
2023-06-16 04:04:04 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
idle_keyword = txt_idle_keyword.get("1.0",END).strip()
|
|
|
|
idle_keyword = format_config_keyword_for_json(idle_keyword)
|
|
|
|
|
|
|
|
resume_keyword = txt_resume_keyword.get("1.0",END).strip()
|
|
|
|
resume_keyword = format_config_keyword_for_json(resume_keyword)
|
|
|
|
|
|
|
|
idle_keyword_second = txt_idle_keyword_second.get("1.0",END).strip()
|
|
|
|
idle_keyword_second = format_config_keyword_for_json(idle_keyword_second)
|
|
|
|
|
|
|
|
resume_keyword_second = txt_resume_keyword_second.get("1.0",END).strip()
|
|
|
|
resume_keyword_second = format_config_keyword_for_json(resume_keyword_second)
|
|
|
|
|
2023-06-16 04:04:04 +00:00
|
|
|
# test keyword format.
|
|
|
|
if is_all_data_correct:
|
|
|
|
if len(area_keyword) > 0:
|
|
|
|
try:
|
|
|
|
test_array = json.loads("["+ area_keyword +"]")
|
|
|
|
except Exception as exc:
|
2023-08-05 03:41:06 +00:00
|
|
|
print(exc)
|
2023-06-16 04:04:04 +00:00
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["area_keyword"])
|
|
|
|
is_all_data_correct = False
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
2023-08-05 03:41:06 +00:00
|
|
|
if len(keyword_exclude) > 0:
|
2023-06-16 04:04:04 +00:00
|
|
|
try:
|
2023-08-05 03:41:06 +00:00
|
|
|
test_array = json.loads("["+ keyword_exclude +"]")
|
2023-06-16 04:04:04 +00:00
|
|
|
except Exception as exc:
|
2023-08-05 03:41:06 +00:00
|
|
|
print(exc)
|
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["keyword_exclude"])
|
2023-06-16 04:04:04 +00:00
|
|
|
is_all_data_correct = False
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
|
|
|
if len(user_guess_string) > 0:
|
|
|
|
try:
|
|
|
|
test_array = json.loads("["+ user_guess_string +"]")
|
|
|
|
except Exception as exc:
|
2023-08-05 03:41:06 +00:00
|
|
|
print(exc)
|
2023-06-16 04:04:04 +00:00
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["user_guess_string"])
|
|
|
|
is_all_data_correct = False
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
2024-01-11 09:28:47 +00:00
|
|
|
if len(remote_url) > 0:
|
2023-06-16 04:04:04 +00:00
|
|
|
try:
|
2024-01-11 09:28:47 +00:00
|
|
|
test_array = json.loads("["+ remote_url +"]")
|
2023-06-16 04:04:04 +00:00
|
|
|
except Exception as exc:
|
2023-08-05 03:41:06 +00:00
|
|
|
print(exc)
|
2024-01-11 09:28:47 +00:00
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["remote_url"])
|
2023-06-16 04:04:04 +00:00
|
|
|
is_all_data_correct = False
|
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
if is_all_data_correct:
|
|
|
|
if len(idle_keyword) > 0:
|
|
|
|
try:
|
|
|
|
test_array = json.loads("["+ idle_keyword +"]")
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["idle_keyword"])
|
|
|
|
is_all_data_correct = False
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
|
|
|
if len(resume_keyword) > 0:
|
|
|
|
try:
|
|
|
|
test_array = json.loads("["+ resume_keyword +"]")
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["resume_keyword"])
|
|
|
|
is_all_data_correct = False
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
|
|
|
if len(idle_keyword_second) > 0:
|
|
|
|
try:
|
|
|
|
test_array = json.loads("["+ idle_keyword_second +"]")
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["idle_keyword_second"])
|
|
|
|
is_all_data_correct = False
|
|
|
|
|
|
|
|
if is_all_data_correct:
|
|
|
|
if len(resume_keyword_second) > 0:
|
|
|
|
try:
|
|
|
|
test_array = json.loads("["+ resume_keyword_second +"]")
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
messagebox.showinfo(translate[language_code]["save"], "Error:" + translate[language_code]["resume_keyword_second"])
|
|
|
|
is_all_data_correct = False
|
|
|
|
|
2023-06-16 04:04:04 +00:00
|
|
|
if is_all_data_correct:
|
|
|
|
config_dict["area_auto_select"]["area_keyword"] = area_keyword
|
2023-08-05 03:41:06 +00:00
|
|
|
config_dict["keyword_exclude"] = keyword_exclude
|
2023-06-16 04:04:04 +00:00
|
|
|
config_dict["advanced"]["user_guess_string"] = user_guess_string
|
2024-01-11 09:28:47 +00:00
|
|
|
config_dict["advanced"]["remote_url"] = remote_url
|
2024-03-07 03:20:57 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
config_dict["advanced"]["idle_keyword"] = idle_keyword
|
|
|
|
config_dict["advanced"]["resume_keyword"] = resume_keyword
|
|
|
|
config_dict["advanced"]["idle_keyword_second"] = idle_keyword_second
|
|
|
|
config_dict["advanced"]["resume_keyword_second"] = resume_keyword_second
|
2023-06-16 04:04:04 +00:00
|
|
|
|
2024-03-07 03:20:57 +00:00
|
|
|
txt_idle_keyword.delete(1.0, "end")
|
|
|
|
txt_resume_keyword.delete(1.0, "end")
|
|
|
|
txt_idle_keyword_second.delete(1.0, "end")
|
|
|
|
txt_resume_keyword_second.delete(1.0, "end")
|
|
|
|
|
|
|
|
txt_idle_keyword.insert("1.0", config_dict["advanced"]["idle_keyword"].strip())
|
|
|
|
txt_resume_keyword.insert("1.0", config_dict["advanced"]["resume_keyword"].strip())
|
|
|
|
txt_idle_keyword_second.insert("1.0", config_dict["advanced"]["idle_keyword_second"].strip())
|
|
|
|
txt_resume_keyword_second.insert("1.0", config_dict["advanced"]["resume_keyword_second"].strip())
|
|
|
|
|
2023-06-16 04:04:04 +00:00
|
|
|
if is_all_data_correct:
|
2023-05-24 07:17:11 +00:00
|
|
|
config_dict["area_auto_select"]["enable"] = bool(chk_state_area_auto_select.get())
|
|
|
|
config_dict["area_auto_select"]["mode"] = combo_area_auto_select_mode.get().strip()
|
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
config_dict["advanced"]["play_sound"]["ticket"] = bool(chk_state_play_ticket_sound.get())
|
|
|
|
config_dict["advanced"]["play_sound"]["order"] = bool(chk_state_play_order_sound.get())
|
|
|
|
config_dict["advanced"]["play_sound"]["filename"] = txt_play_sound_filename.get().strip()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-02-22 16:05:44 +00:00
|
|
|
config_dict["advanced"]["tixcraft_sid"] = txt_tixcraft_sid.get().strip()
|
2023-02-26 08:39:37 +00:00
|
|
|
config_dict["advanced"]["ibonqware"] = txt_ibon_ibonqware.get().strip()
|
2024-03-08 01:11:16 +00:00
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
config_dict["advanced"]["facebook_account"] = txt_facebook_account.get().strip()
|
2022-12-27 15:38:13 +00:00
|
|
|
config_dict["advanced"]["kktix_account"] = txt_kktix_account.get().strip()
|
2023-11-01 10:35:28 +00:00
|
|
|
config_dict["advanced"]["fami_account"] = txt_fami_account.get().strip()
|
2023-08-19 12:49:51 +00:00
|
|
|
config_dict["advanced"]["cityline_account"] = txt_cityline_account.get().strip()
|
2023-01-18 08:40:41 +00:00
|
|
|
config_dict["advanced"]["urbtix_account"] = txt_urbtix_account.get().strip()
|
2023-02-12 09:49:55 +00:00
|
|
|
config_dict["advanced"]["hkticketing_account"] = txt_hkticketing_account.get().strip()
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["kham_account"] = txt_kham_account.get().strip()
|
2023-10-06 06:43:53 +00:00
|
|
|
config_dict["advanced"]["ticket_account"] = txt_ticket_account.get().strip()
|
2023-11-24 08:31:38 +00:00
|
|
|
config_dict["advanced"]["udn_account"] = txt_udn_account.get().strip()
|
2023-06-29 03:45:07 +00:00
|
|
|
config_dict["advanced"]["ticketplus_account"] = txt_ticketplus_account.get().strip()
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
config_dict["advanced"]["facebook_password"] = txt_facebook_password.get().strip()
|
|
|
|
config_dict["advanced"]["kktix_password"] = txt_kktix_password.get().strip()
|
2023-11-01 10:35:28 +00:00
|
|
|
config_dict["advanced"]["fami_password"] = txt_fami_password.get().strip()
|
2023-08-19 12:49:51 +00:00
|
|
|
config_dict["advanced"]["cityline_password"] = txt_cityline_password.get().strip()
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["urbtix_password"] = txt_urbtix_password.get().strip()
|
2023-02-12 09:49:55 +00:00
|
|
|
config_dict["advanced"]["hkticketing_password"] = txt_hkticketing_password.get().strip()
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["kham_password"] = txt_kham_password.get().strip()
|
2023-10-06 06:43:53 +00:00
|
|
|
config_dict["advanced"]["ticket_password"] = txt_ticket_password.get().strip()
|
2023-11-24 08:31:38 +00:00
|
|
|
config_dict["advanced"]["udn_password"] = txt_udn_password.get().strip()
|
2023-06-29 03:45:07 +00:00
|
|
|
config_dict["advanced"]["ticketplus_password"] = txt_ticketplus_password.get().strip()
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2024-03-08 01:11:16 +00:00
|
|
|
config_dict["advanced"]["tixcraft_sid"] = config_dict["advanced"]["tixcraft_sid"]
|
|
|
|
config_dict["advanced"]["ibonqware"] = config_dict["advanced"]["ibonqware"]
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["facebook_password"] = encryptMe(config_dict["advanced"]["facebook_password"])
|
|
|
|
config_dict["advanced"]["kktix_password"] = encryptMe(config_dict["advanced"]["kktix_password"])
|
2023-11-01 10:35:28 +00:00
|
|
|
config_dict["advanced"]["fami_password"] = encryptMe(config_dict["advanced"]["fami_password"])
|
2023-08-19 12:49:51 +00:00
|
|
|
config_dict["advanced"]["cityline_password"] = encryptMe(config_dict["advanced"]["cityline_password"])
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["urbtix_password"] = encryptMe(config_dict["advanced"]["urbtix_password"])
|
2023-02-12 09:49:55 +00:00
|
|
|
config_dict["advanced"]["hkticketing_password"] = encryptMe(config_dict["advanced"]["hkticketing_password"])
|
2023-02-11 05:36:27 +00:00
|
|
|
config_dict["advanced"]["kham_password"] = encryptMe(config_dict["advanced"]["kham_password"])
|
2023-10-06 06:43:53 +00:00
|
|
|
config_dict["advanced"]["ticket_password"] = encryptMe(config_dict["advanced"]["ticket_password"])
|
2023-11-24 08:31:38 +00:00
|
|
|
config_dict["advanced"]["udn_password"] = encryptMe(config_dict["advanced"]["udn_password"])
|
2023-06-29 03:45:07 +00:00
|
|
|
config_dict["advanced"]["ticketplus_password"] = encryptMe(config_dict["advanced"]["ticketplus_password"])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
config_dict["advanced"]["chrome_extension"] = bool(chk_state_chrome_extension.get())
|
2023-05-17 00:06:08 +00:00
|
|
|
config_dict["advanced"]["disable_adjacent_seat"] = bool(chk_state_adjacent_seat.get())
|
2023-11-08 07:31:18 +00:00
|
|
|
config_dict["advanced"]["hide_some_image"] = bool(chk_state_hide_some_image.get())
|
2023-11-09 04:25:33 +00:00
|
|
|
config_dict["advanced"]["block_facebook_network"] = bool(chk_state_block_facebook_network.get())
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2023-01-12 11:41:49 +00:00
|
|
|
config_dict["ocr_captcha"] = {}
|
|
|
|
config_dict["ocr_captcha"]["enable"] = bool(chk_state_ocr_captcha.get())
|
2023-06-28 08:08:59 +00:00
|
|
|
config_dict["ocr_captcha"]["beta"] = bool(chk_state_ocr_captcha_ddddocr_beta.get())
|
2023-01-12 22:29:58 +00:00
|
|
|
config_dict["ocr_captcha"]["force_submit"] = bool(chk_state_ocr_captcha_force_submit.get())
|
2023-01-13 19:01:47 +00:00
|
|
|
config_dict["ocr_captcha"]["image_source"] = combo_ocr_captcha_image_source.get().strip()
|
2023-06-03 04:23:53 +00:00
|
|
|
|
|
|
|
if is_arm():
|
|
|
|
config_dict["ocr_captcha"]["enable"] = False
|
|
|
|
config_dict["ocr_captcha"]["force_submit"] = False
|
|
|
|
|
2023-02-12 03:02:16 +00:00
|
|
|
config_dict["webdriver_type"] = combo_webdriver_type.get().strip()
|
2023-11-25 01:11:43 +00:00
|
|
|
config_dict["advanced"]["headless"] = bool(chk_state_headless.get())
|
2023-03-07 14:30:30 +00:00
|
|
|
config_dict["advanced"]["verbose"] = bool(chk_state_verbose.get())
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-04-28 04:04:21 +00:00
|
|
|
config_dict["advanced"]["auto_guess_options"] = bool(chk_state_auto_guess_options.get())
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2023-05-31 00:52:03 +00:00
|
|
|
config_dict["advanced"]["auto_reload_page_interval"] = float(txt_auto_reload_page_interval.get().strip())
|
2024-01-18 03:48:17 +00:00
|
|
|
config_dict["advanced"]["reset_browser_interval"] = float(txt_reset_browser_interval.get().strip())
|
2023-10-25 03:02:08 +00:00
|
|
|
config_dict["advanced"]["proxy_server_port"] = txt_proxy_server_port.get().strip()
|
2024-03-25 04:26:45 +00:00
|
|
|
config_dict["advanced"]["window_size"] = txt_window_size.get().strip()
|
2023-05-26 05:13:06 +00:00
|
|
|
|
2024-01-18 03:48:17 +00:00
|
|
|
if config_dict["advanced"]["reset_browser_interval"] > 0:
|
|
|
|
if config_dict["advanced"]["reset_browser_interval"] < 20:
|
|
|
|
# min value is 20 seconds.
|
|
|
|
config_dict["advanced"]["reset_browser_interval"] = 20
|
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-05-31 00:52:03 +00:00
|
|
|
# save config.
|
|
|
|
if is_all_data_correct:
|
2022-12-27 15:38:13 +00:00
|
|
|
if not slience_mode:
|
2023-03-05 08:04:15 +00:00
|
|
|
#messagebox.showinfo(translate[language_code]["save"], translate[language_code]["done"])
|
2023-03-30 15:07:55 +00:00
|
|
|
file_to_save = asksaveasfilename(initialdir=app_root , initialfile=CONST_MAXBOT_CONFIG_FILE, defaultextension=".json", filetypes=[("json Documents","*.json"),("All Files","*.*")])
|
2023-03-05 08:04:15 +00:00
|
|
|
if not file_to_save is None:
|
2023-03-30 15:07:55 +00:00
|
|
|
if len(file_to_save) > 0:
|
|
|
|
print("save as to:", file_to_save)
|
2024-01-16 06:24:21 +00:00
|
|
|
save_json(config_dict, file_to_save)
|
2023-03-05 08:04:15 +00:00
|
|
|
else:
|
|
|
|
# slience
|
2024-01-16 06:24:21 +00:00
|
|
|
save_json(config_dict, config_filepath)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
return is_all_data_correct
|
|
|
|
|
2024-01-16 06:24:21 +00:00
|
|
|
def save_json(config_dict, target_path):
|
|
|
|
json_str = json.dumps(config_dict, indent=4)
|
|
|
|
with open(target_path, 'w') as outfile:
|
|
|
|
outfile.write(json_str)
|
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
def btn_run_clicked(language_code):
|
2022-09-13 10:48:21 +00:00
|
|
|
print('run button pressed.')
|
2021-12-01 18:31:19 +00:00
|
|
|
Root_Dir = ""
|
2024-03-15 04:06:18 +00:00
|
|
|
save_ret = btn_save_act(slience_mode=True)
|
2022-09-13 10:48:21 +00:00
|
|
|
print("save config result:", save_ret)
|
|
|
|
if save_ret:
|
2023-03-14 00:28:24 +00:00
|
|
|
threading.Thread(target=launch_maxbot).start()
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2023-03-14 00:28:24 +00:00
|
|
|
def launch_maxbot():
|
2023-06-15 15:45:50 +00:00
|
|
|
run_python_script("chrome_tixcraft")
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
def show_preview_text():
|
2023-06-16 04:04:04 +00:00
|
|
|
if os.path.exists(CONST_MAXBOT_ANSWER_ONLINE_FILE):
|
|
|
|
answer_text = ""
|
|
|
|
with open(CONST_MAXBOT_ANSWER_ONLINE_FILE, "r") as text_file:
|
|
|
|
answer_text = text_file.readline()
|
2023-06-16 16:04:55 +00:00
|
|
|
|
|
|
|
answer_text = format_config_keyword_for_json(answer_text)
|
|
|
|
|
|
|
|
date_array = []
|
|
|
|
try:
|
|
|
|
date_array = json.loads("["+ answer_text +"]")
|
|
|
|
except Exception as exc:
|
|
|
|
date_array = []
|
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
global lbl_online_dictionary_preview_data
|
2024-03-17 07:02:25 +00:00
|
|
|
if 'lbl_online_dictionary_preview_data' in globals():
|
|
|
|
try:
|
|
|
|
lbl_online_dictionary_preview_data.config(text=','.join(date_array))
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-11-27 06:38:46 +00:00
|
|
|
def write_string_to_file(filename, data):
|
|
|
|
outfile = None
|
|
|
|
if platform.system() == 'Windows':
|
|
|
|
outfile = open(filename, 'w', encoding='UTF-8')
|
|
|
|
else:
|
|
|
|
outfile = open(filename, 'w')
|
|
|
|
|
|
|
|
if not outfile is None:
|
|
|
|
outfile.write("%s" % data)
|
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
def save_url_to_file(new_remote_url, force_write = False):
|
2023-06-16 04:04:04 +00:00
|
|
|
html_text = ""
|
2024-01-11 09:28:47 +00:00
|
|
|
if len(new_remote_url) > 0:
|
2023-06-15 09:58:35 +00:00
|
|
|
html_result = None
|
|
|
|
try:
|
2024-01-11 09:28:47 +00:00
|
|
|
html_result = requests.get(new_remote_url , timeout=0.5, allow_redirects=False)
|
2023-06-15 09:58:35 +00:00
|
|
|
except Exception as exc:
|
|
|
|
html_result = None
|
2023-06-15 15:45:50 +00:00
|
|
|
#print(exc)
|
2023-06-15 09:58:35 +00:00
|
|
|
if not html_result is None:
|
|
|
|
status_code = html_result.status_code
|
2023-06-15 15:45:50 +00:00
|
|
|
#print("status_code:", status_code)
|
2023-06-15 09:58:35 +00:00
|
|
|
if status_code == 200:
|
|
|
|
html_text = html_result.text
|
2023-06-16 16:04:55 +00:00
|
|
|
#print("html_text:", html_text)
|
2023-06-16 04:04:04 +00:00
|
|
|
|
|
|
|
is_write_to_file = False
|
|
|
|
if force_write:
|
|
|
|
is_write_to_file = True
|
|
|
|
if len(html_text) > 0:
|
|
|
|
is_write_to_file = True
|
|
|
|
|
|
|
|
if is_write_to_file:
|
2023-06-16 16:04:55 +00:00
|
|
|
html_text = format_config_keyword_for_json(html_text)
|
2023-12-04 03:15:00 +00:00
|
|
|
working_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
target_path = os.path.join(working_dir, CONST_MAXBOT_ANSWER_ONLINE_FILE)
|
|
|
|
write_string_to_file(target_path, html_text)
|
2023-06-16 04:04:04 +00:00
|
|
|
return is_write_to_file
|
2023-06-15 09:58:35 +00:00
|
|
|
|
|
|
|
def btn_preview_text_clicked():
|
2024-01-11 09:28:47 +00:00
|
|
|
global txt_remote_url
|
|
|
|
remote_url = ""
|
2024-03-17 07:02:25 +00:00
|
|
|
if 'txt_remote_url' in globals():
|
|
|
|
try:
|
|
|
|
remote_url = txt_remote_url.get("1.0",END).strip()
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
2024-01-11 09:28:47 +00:00
|
|
|
remote_url = format_config_keyword_for_json(remote_url)
|
2024-03-17 07:02:25 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
if len(remote_url) > 0:
|
2023-06-16 04:04:04 +00:00
|
|
|
url_array = []
|
|
|
|
try:
|
2024-01-11 09:28:47 +00:00
|
|
|
url_array = json.loads("["+ remote_url +"]")
|
2023-06-16 04:04:04 +00:00
|
|
|
except Exception as exc:
|
|
|
|
url_array = []
|
|
|
|
|
|
|
|
force_write = False
|
|
|
|
if len(url_array)==1:
|
|
|
|
force_write = True
|
|
|
|
for each_url in url_array:
|
2024-01-11 09:28:47 +00:00
|
|
|
#print("new_remote_url:", new_remote_url)
|
2023-06-16 04:04:04 +00:00
|
|
|
is_write_to_file = save_url_to_file(each_url, force_write=force_write)
|
|
|
|
if is_write_to_file:
|
|
|
|
break
|
2023-06-15 09:58:35 +00:00
|
|
|
show_preview_text()
|
|
|
|
|
2023-06-15 15:45:50 +00:00
|
|
|
def run_python_script(script_name):
|
|
|
|
working_dir = os.path.dirname(os.path.realpath(__file__))
|
2024-03-29 09:29:39 +00:00
|
|
|
cmd_argument = ""
|
2023-06-15 15:45:50 +00:00
|
|
|
if hasattr(sys, 'frozen'):
|
|
|
|
print("execute in frozen mode")
|
|
|
|
|
2024-03-29 09:29:39 +00:00
|
|
|
cmd = './' + script_name + cmd_argument
|
2023-06-15 15:45:50 +00:00
|
|
|
# check platform here.
|
|
|
|
if platform.system() == 'Darwin':
|
|
|
|
print("execute MacOS python script")
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
print("execute linux binary")
|
|
|
|
if platform.system() == 'Windows':
|
|
|
|
print("execute .exe binary.")
|
2024-03-29 09:29:39 +00:00
|
|
|
cmd = script_name + ".exe" + cmd_argument
|
|
|
|
subprocess.Popen(cmd, shell=True, cwd=working_dir)
|
2023-06-15 15:45:50 +00:00
|
|
|
else:
|
|
|
|
interpreter_binary = 'python'
|
|
|
|
interpreter_binary_alt = 'python3'
|
2024-03-29 09:29:39 +00:00
|
|
|
if platform.system() != 'Windows':
|
2023-06-15 15:45:50 +00:00
|
|
|
interpreter_binary = 'python3'
|
|
|
|
interpreter_binary_alt = 'python'
|
|
|
|
print("execute in shell mode.")
|
2024-03-29 09:29:39 +00:00
|
|
|
|
|
|
|
cmd = script_name + '.py'
|
2023-06-15 15:45:50 +00:00
|
|
|
try:
|
|
|
|
print('try', interpreter_binary)
|
2024-03-29 09:29:39 +00:00
|
|
|
s=subprocess.Popen([interpreter_binary, cmd], cwd=working_dir)
|
2023-06-15 15:45:50 +00:00
|
|
|
except Exception as exc:
|
|
|
|
print('try', interpreter_binary_alt)
|
|
|
|
try:
|
2024-03-29 09:29:39 +00:00
|
|
|
s=subprocess.Popen([interpreter_binary_alt, cmd], cwd=working_dir)
|
2023-06-15 15:45:50 +00:00
|
|
|
except Exception as exc:
|
|
|
|
msg=str(exc)
|
|
|
|
print("exeption:", msg)
|
|
|
|
pass
|
|
|
|
|
|
|
|
def btn_open_text_server_clicked():
|
2024-01-11 09:28:47 +00:00
|
|
|
global tab4
|
|
|
|
global tabControl
|
|
|
|
tabControl.select(tab4)
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
def btn_preview_sound_clicked():
|
2024-03-12 10:24:11 +00:00
|
|
|
global txt_play_sound_filename
|
|
|
|
new_sound_filename = txt_play_sound_filename.get().strip()
|
2022-11-16 15:43:53 +00:00
|
|
|
#print("new_sound_filename:", new_sound_filename)
|
|
|
|
app_root = get_app_root()
|
|
|
|
new_sound_filename = os.path.join(app_root, new_sound_filename)
|
2022-11-17 18:17:19 +00:00
|
|
|
play_mp3_async(new_sound_filename)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-17 18:17:19 +00:00
|
|
|
def play_mp3_async(sound_filename):
|
2023-04-05 12:47:44 +00:00
|
|
|
threading.Thread(target=play_mp3, args=(sound_filename,)).start()
|
2022-11-17 18:17:19 +00:00
|
|
|
|
|
|
|
def play_mp3(sound_filename):
|
2022-11-16 15:43:53 +00:00
|
|
|
from playsound import playsound
|
|
|
|
try:
|
2022-11-17 18:17:19 +00:00
|
|
|
playsound(sound_filename)
|
2022-11-16 15:43:53 +00:00
|
|
|
except Exception as exc:
|
|
|
|
msg=str(exc)
|
2024-03-25 16:10:00 +00:00
|
|
|
#print("play sound exeption:", msg)
|
2022-11-17 18:17:19 +00:00
|
|
|
if platform.system() == 'Windows':
|
|
|
|
import winsound
|
|
|
|
try:
|
|
|
|
winsound.PlaySound(sound_filename, winsound.SND_FILENAME)
|
|
|
|
except Exception as exc2:
|
|
|
|
pass
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
def open_url(url):
|
|
|
|
webbrowser.open_new(url)
|
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
def btn_exit_clicked():
|
|
|
|
root.destroy()
|
|
|
|
|
2022-11-10 14:02:26 +00:00
|
|
|
def btn_donate_clicked():
|
2023-06-19 09:31:57 +00:00
|
|
|
webbrowser.open(URL_DONATE)
|
2022-11-10 14:02:26 +00:00
|
|
|
|
|
|
|
def btn_help_clicked():
|
2023-06-19 09:31:57 +00:00
|
|
|
webbrowser.open(URL_HELP)
|
2022-11-10 14:02:26 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
def callbackLanguageOnChange(event):
|
|
|
|
applyNewLanguage()
|
|
|
|
|
|
|
|
def get_language_code_by_name(new_language):
|
|
|
|
language_code = "en_us"
|
2022-11-13 18:34:22 +00:00
|
|
|
if u'繁體中文' in new_language:
|
2022-11-11 16:46:36 +00:00
|
|
|
language_code = 'zh_tw'
|
2022-11-13 18:34:22 +00:00
|
|
|
if u'簡体中文' in new_language:
|
2022-11-11 16:46:36 +00:00
|
|
|
language_code = 'zh_cn'
|
2022-11-13 18:34:22 +00:00
|
|
|
if u'日本語' in new_language:
|
2022-11-11 16:46:36 +00:00
|
|
|
language_code = 'ja_jp'
|
|
|
|
#print("new language code:", language_code)
|
|
|
|
|
|
|
|
return language_code
|
|
|
|
|
|
|
|
def applyNewLanguage():
|
|
|
|
global combo_language
|
|
|
|
new_language = combo_language.get().strip()
|
|
|
|
#print("new language value:", new_language)
|
|
|
|
|
|
|
|
language_code=get_language_code_by_name(new_language)
|
|
|
|
|
|
|
|
global lbl_homepage
|
|
|
|
global lbl_browser
|
|
|
|
global lbl_language
|
|
|
|
global lbl_ticket_number
|
|
|
|
|
|
|
|
# for kktix
|
|
|
|
global lbl_auto_press_next_step_button
|
|
|
|
global lbl_auto_fill_ticket_number
|
2023-06-19 09:31:57 +00:00
|
|
|
global lbl_user_guess_string_description
|
2022-12-27 15:38:13 +00:00
|
|
|
global lbl_user_guess_string
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
# for tixcraft
|
|
|
|
global lbl_date_auto_select
|
|
|
|
global lbl_date_auto_select_mode
|
|
|
|
global lbl_date_keyword
|
|
|
|
global lbl_area_auto_select
|
|
|
|
global lbl_area_auto_select_mode
|
2023-05-24 07:17:11 +00:00
|
|
|
global lbl_area_keyword
|
2023-08-05 03:41:06 +00:00
|
|
|
global lbl_keyword_exclude
|
|
|
|
global lbl_keyword_usage
|
2023-05-24 07:17:11 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global lbl_pass_date_is_sold_out
|
|
|
|
global lbl_auto_reload_coming_soon_page
|
2023-01-12 08:51:05 +00:00
|
|
|
global lbl_ocr_captcha
|
2023-06-28 08:08:59 +00:00
|
|
|
global lbl_ocr_captcha_ddddocr_beta
|
2023-01-12 22:29:58 +00:00
|
|
|
global lbl_ocr_captcha_force_submit
|
2023-01-13 19:01:47 +00:00
|
|
|
global lbl_ocr_captcha_image_source
|
2023-08-18 20:12:46 +00:00
|
|
|
global lbl_ocr_captcha_not_support_arm
|
2023-02-12 03:02:16 +00:00
|
|
|
global lbl_webdriver_type
|
2023-11-25 01:11:43 +00:00
|
|
|
global lbl_headless
|
2023-03-07 14:30:30 +00:00
|
|
|
global lbl_verbose
|
2023-04-28 04:04:21 +00:00
|
|
|
global lbl_auto_guess_options
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2023-03-12 17:08:23 +00:00
|
|
|
global lbl_maxbot_status
|
|
|
|
global lbl_maxbot_last_url
|
2024-01-21 11:41:11 +00:00
|
|
|
global lbl_system_clock
|
|
|
|
global lbl_idle_keyword
|
|
|
|
global lbl_resume_keyword
|
|
|
|
global lbl_idle_keyword_second
|
|
|
|
global lbl_resume_keyword_second
|
2023-03-12 17:08:23 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
# for checkbox
|
|
|
|
global chk_auto_press_next_step_button
|
|
|
|
global chk_auto_fill_ticket_number
|
|
|
|
global chk_date_auto_select
|
|
|
|
global chk_area_auto_select
|
|
|
|
global chk_pass_date_is_sold_out
|
|
|
|
global chk_auto_reload_coming_soon_page
|
2024-03-12 10:24:11 +00:00
|
|
|
global chk_play_ticket_sound
|
|
|
|
global chk_play_order_sound
|
2023-01-12 08:51:05 +00:00
|
|
|
global chk_ocr_captcha
|
2023-06-28 08:08:59 +00:00
|
|
|
global chk_ocr_captcha_ddddocr_beta
|
2023-01-13 09:27:08 +00:00
|
|
|
global chk_ocr_captcha_force_submit
|
2024-01-21 11:41:11 +00:00
|
|
|
global chk_chrome_extension
|
2023-05-17 00:06:08 +00:00
|
|
|
global chk_adjacent_seat
|
2023-11-08 07:31:18 +00:00
|
|
|
global chk_hide_some_image
|
2023-11-09 04:25:33 +00:00
|
|
|
global chk_block_facebook_network
|
2023-11-16 05:58:19 +00:00
|
|
|
|
2023-11-25 01:11:43 +00:00
|
|
|
global chk_headless
|
2023-03-07 14:30:30 +00:00
|
|
|
global chk_verbose
|
2024-01-11 09:28:47 +00:00
|
|
|
global lbl_remote_url
|
|
|
|
global lbl_server_url
|
2023-06-19 09:31:57 +00:00
|
|
|
global lbl_online_dictionary_preview
|
2024-01-11 09:28:47 +00:00
|
|
|
global lbl_question
|
|
|
|
global lbl_answer
|
2023-04-28 04:04:21 +00:00
|
|
|
global chk_auto_guess_options
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
global tabControl
|
|
|
|
|
|
|
|
global lbl_slogan
|
|
|
|
global lbl_help
|
|
|
|
global lbl_donate
|
|
|
|
global lbl_release
|
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
global lbl_chrome_extension
|
2023-05-17 00:06:08 +00:00
|
|
|
global lbl_adjacent_seat
|
2023-11-08 07:31:18 +00:00
|
|
|
global lbl_hide_some_image
|
2023-11-09 04:25:33 +00:00
|
|
|
global lbl_block_facebook_network
|
2023-11-16 05:58:19 +00:00
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
global lbl_hide_some_image_recommand
|
|
|
|
global lbl_block_facebook_network_recommand
|
|
|
|
|
2023-05-26 04:43:18 +00:00
|
|
|
global lbl_auto_reload_page_interval
|
2024-01-18 03:48:17 +00:00
|
|
|
global lbl_reset_browser_interval
|
2023-10-25 03:02:08 +00:00
|
|
|
global lbl_proxy_server_port
|
2024-03-25 04:26:45 +00:00
|
|
|
global lbl_window_size
|
2022-11-17 18:17:19 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
lbl_homepage.config(text=translate[language_code]["homepage"])
|
|
|
|
lbl_browser.config(text=translate[language_code]["browser"])
|
|
|
|
lbl_language.config(text=translate[language_code]["language"])
|
|
|
|
lbl_ticket_number.config(text=translate[language_code]["ticket_number"])
|
|
|
|
|
|
|
|
lbl_auto_press_next_step_button.config(text=translate[language_code]["auto_press_next_step_button"])
|
|
|
|
lbl_auto_fill_ticket_number.config(text=translate[language_code]["auto_fill_ticket_number"])
|
2023-06-19 09:31:57 +00:00
|
|
|
lbl_user_guess_string_description.config(text=translate[language_code]["user_guess_string"])
|
|
|
|
lbl_user_guess_string.config(text=translate[language_code]["local_dictionary"])
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
lbl_date_auto_select.config(text=translate[language_code]["date_auto_select"])
|
|
|
|
lbl_date_auto_select_mode.config(text=translate[language_code]["date_select_order"])
|
|
|
|
lbl_date_keyword.config(text=translate[language_code]["date_keyword"])
|
|
|
|
lbl_area_auto_select.config(text=translate[language_code]["area_auto_select"])
|
|
|
|
lbl_area_auto_select_mode.config(text=translate[language_code]["area_select_order"])
|
2023-05-24 07:17:11 +00:00
|
|
|
lbl_area_keyword.config(text=translate[language_code]["area_keyword"])
|
2023-08-05 03:41:06 +00:00
|
|
|
lbl_keyword_exclude.config(text=translate[language_code]["keyword_exclude"])
|
|
|
|
lbl_keyword_usage.config(text=translate[language_code]["keyword_usage"])
|
2022-11-11 16:46:36 +00:00
|
|
|
lbl_pass_date_is_sold_out.config(text=translate[language_code]["pass_date_is_sold_out"])
|
|
|
|
lbl_auto_reload_coming_soon_page.config(text=translate[language_code]["auto_reload_coming_soon_page"])
|
2023-01-12 08:51:05 +00:00
|
|
|
lbl_ocr_captcha.config(text=translate[language_code]["ocr_captcha"])
|
2023-06-28 08:08:59 +00:00
|
|
|
lbl_ocr_captcha_ddddocr_beta.config(text=translate[language_code]["ocr_captcha_ddddocr_beta"])
|
2023-01-12 22:29:58 +00:00
|
|
|
lbl_ocr_captcha_force_submit.config(text=translate[language_code]["ocr_captcha_force_submit"])
|
2023-01-13 19:01:47 +00:00
|
|
|
lbl_ocr_captcha_image_source.config(text=translate[language_code]["ocr_captcha_image_source"])
|
2023-08-18 20:12:46 +00:00
|
|
|
lbl_ocr_captcha_not_support_arm.config(text=translate[language_code]["ocr_captcha_not_support_arm"])
|
2023-02-12 03:02:16 +00:00
|
|
|
lbl_webdriver_type.config(text=translate[language_code]["webdriver_type"])
|
2024-01-21 11:41:11 +00:00
|
|
|
lbl_chrome_extension.config(text=translate[language_code]["chrome_extension"])
|
2023-05-17 00:06:08 +00:00
|
|
|
lbl_adjacent_seat.config(text=translate[language_code]["disable_adjacent_seat"])
|
2023-11-08 07:31:18 +00:00
|
|
|
lbl_hide_some_image.config(text=translate[language_code]["hide_some_image"])
|
2023-11-09 04:25:33 +00:00
|
|
|
lbl_block_facebook_network.config(text=translate[language_code]["block_facebook_network"])
|
2023-11-16 05:58:19 +00:00
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
lbl_hide_some_image_recommand.config(text=translate[language_code]["recommand_enable"])
|
2023-12-11 08:57:22 +00:00
|
|
|
lbl_block_facebook_network_recommand.config(text=translate[language_code]["recommand_enable"])
|
2023-12-11 01:56:13 +00:00
|
|
|
|
2023-05-26 04:43:18 +00:00
|
|
|
lbl_auto_reload_page_interval.config(text=translate[language_code]["auto_reload_page_interval"])
|
2024-01-18 03:48:17 +00:00
|
|
|
lbl_reset_browser_interval.config(text=translate[language_code]["reset_browser_interval"])
|
2023-10-25 03:02:08 +00:00
|
|
|
lbl_proxy_server_port.config(text=translate[language_code]["proxy_server_port"])
|
2024-03-25 04:26:45 +00:00
|
|
|
lbl_window_size.config(text=translate[language_code]["window_size"])
|
2023-05-26 04:43:18 +00:00
|
|
|
|
2023-11-25 01:11:43 +00:00
|
|
|
lbl_headless.config(text=translate[language_code]["headless"])
|
2023-03-07 14:30:30 +00:00
|
|
|
lbl_verbose.config(text=translate[language_code]["verbose"])
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
lbl_remote_url.config(text=translate[language_code]["remote_url"])
|
|
|
|
lbl_server_url.config(text=translate[language_code]["server_url"])
|
2023-06-19 09:31:57 +00:00
|
|
|
lbl_online_dictionary_preview.config(text=translate[language_code]["preview"])
|
2023-04-28 04:04:21 +00:00
|
|
|
lbl_auto_guess_options.config(text=translate[language_code]["auto_guess_options"])
|
2024-01-11 09:28:47 +00:00
|
|
|
lbl_question.config(text=translate[language_code]["question"])
|
|
|
|
lbl_answer.config(text=translate[language_code]["answer"])
|
2023-04-28 04:04:21 +00:00
|
|
|
|
2023-03-12 17:08:23 +00:00
|
|
|
lbl_maxbot_status.config(text=translate[language_code]["running_status"])
|
|
|
|
lbl_maxbot_last_url.config(text=translate[language_code]["running_url"])
|
2024-01-21 11:41:11 +00:00
|
|
|
lbl_system_clock.config(text=translate[language_code]["system_clock"])
|
|
|
|
lbl_idle_keyword.config(text=translate[language_code]["idle_keyword"])
|
|
|
|
lbl_resume_keyword.config(text=translate[language_code]["resume_keyword"])
|
|
|
|
lbl_idle_keyword_second.config(text=translate[language_code]["idle_keyword_second"])
|
|
|
|
lbl_resume_keyword_second.config(text=translate[language_code]["resume_keyword_second"])
|
2022-11-11 16:46:36 +00:00
|
|
|
|
|
|
|
chk_auto_press_next_step_button.config(text=translate[language_code]["enable"])
|
|
|
|
chk_auto_fill_ticket_number.config(text=translate[language_code]["enable"])
|
|
|
|
chk_date_auto_select.config(text=translate[language_code]["enable"])
|
|
|
|
chk_area_auto_select.config(text=translate[language_code]["enable"])
|
|
|
|
chk_pass_date_is_sold_out.config(text=translate[language_code]["enable"])
|
|
|
|
chk_auto_reload_coming_soon_page.config(text=translate[language_code]["enable"])
|
2024-03-12 10:24:11 +00:00
|
|
|
chk_play_ticket_sound.config(text=translate[language_code]["enable"])
|
|
|
|
chk_play_order_sound.config(text=translate[language_code]["enable"])
|
2023-01-12 08:51:05 +00:00
|
|
|
chk_ocr_captcha.config(text=translate[language_code]["enable"])
|
2023-06-28 08:08:59 +00:00
|
|
|
chk_ocr_captcha_ddddocr_beta.config(text=translate[language_code]["enable"])
|
2023-01-13 09:27:08 +00:00
|
|
|
chk_ocr_captcha_force_submit.config(text=translate[language_code]["enable"])
|
2024-01-21 11:41:11 +00:00
|
|
|
chk_chrome_extension.config(text=translate[language_code]["enable"])
|
2023-05-17 00:06:08 +00:00
|
|
|
chk_adjacent_seat.config(text=translate[language_code]["enable"])
|
2023-11-08 07:31:18 +00:00
|
|
|
chk_hide_some_image.config(text=translate[language_code]["enable"])
|
2023-11-09 04:25:33 +00:00
|
|
|
chk_block_facebook_network.config(text=translate[language_code]["enable"])
|
2023-11-16 05:58:19 +00:00
|
|
|
|
2023-11-25 01:11:43 +00:00
|
|
|
chk_headless.config(text=translate[language_code]["enable"])
|
2023-03-07 14:30:30 +00:00
|
|
|
chk_verbose.config(text=translate[language_code]["enable"])
|
2023-04-28 04:04:21 +00:00
|
|
|
chk_auto_guess_options.config(text=translate[language_code]["enable"])
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
tabControl.tab(0, text=translate[language_code]["preference"])
|
2022-11-16 15:43:53 +00:00
|
|
|
tabControl.tab(1, text=translate[language_code]["advanced"])
|
2023-06-19 09:31:57 +00:00
|
|
|
tabControl.tab(2, text=translate[language_code]["verification_word"])
|
2024-01-11 09:28:47 +00:00
|
|
|
tabControl.tab(3, text=translate[language_code]["maxbot_server"])
|
|
|
|
tabControl.tab(4, text=translate[language_code]["autofill"])
|
|
|
|
tabControl.tab(5, text=translate[language_code]["runtime"])
|
|
|
|
tabControl.tab(6, text=translate[language_code]["about"])
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-02-22 16:05:44 +00:00
|
|
|
global lbl_tixcraft_sid
|
2023-02-26 08:39:37 +00:00
|
|
|
global lbl_ibon_ibonqware
|
2022-11-16 15:43:53 +00:00
|
|
|
global lbl_facebook_account
|
2022-12-27 15:38:13 +00:00
|
|
|
global lbl_kktix_account
|
2023-11-01 10:35:28 +00:00
|
|
|
global lbl_fami_account
|
2023-08-19 12:49:51 +00:00
|
|
|
global lbl_cityline_account
|
2023-01-18 08:40:41 +00:00
|
|
|
global lbl_urbtix_account
|
2023-02-12 09:49:55 +00:00
|
|
|
global lbl_hkticketing_account
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_kham_account
|
2023-10-06 06:43:53 +00:00
|
|
|
global lbl_ticket_account
|
2023-11-24 08:31:38 +00:00
|
|
|
global lbl_udn_account
|
2023-06-29 03:45:07 +00:00
|
|
|
global lbl_ticketplus_account
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-10-07 05:31:33 +00:00
|
|
|
global lbl_password
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_facebook_password
|
|
|
|
global lbl_kktix_password
|
2023-11-01 10:35:28 +00:00
|
|
|
global lbl_fami_password
|
2023-08-19 12:49:51 +00:00
|
|
|
global lbl_cityline_password
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_urbtix_password
|
2023-02-12 09:49:55 +00:00
|
|
|
global lbl_hkticketing_password
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_kham_password
|
2023-10-06 06:43:53 +00:00
|
|
|
global lbl_ticket_password
|
2023-11-24 08:31:38 +00:00
|
|
|
global lbl_udn_password
|
2023-06-29 03:45:07 +00:00
|
|
|
global lbl_ticketplus_password
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
global lbl_save_password_alert
|
2023-01-18 08:40:41 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global lbl_play_ticket_sound
|
|
|
|
global lbl_play_order_sound
|
|
|
|
global lbl_play_sound_filename
|
2023-02-22 16:05:44 +00:00
|
|
|
|
|
|
|
lbl_tixcraft_sid.config(text=translate[language_code]["tixcraft_sid"])
|
2023-02-26 08:39:37 +00:00
|
|
|
lbl_ibon_ibonqware.config(text=translate[language_code]["ibon_ibonqware"])
|
2022-11-16 15:43:53 +00:00
|
|
|
lbl_facebook_account.config(text=translate[language_code]["facebook_account"])
|
2022-12-27 15:38:13 +00:00
|
|
|
lbl_kktix_account.config(text=translate[language_code]["kktix_account"])
|
2023-11-01 10:35:28 +00:00
|
|
|
lbl_fami_account.config(text=translate[language_code]["fami_account"])
|
2023-08-19 12:49:51 +00:00
|
|
|
lbl_cityline_account.config(text=translate[language_code]["cityline_account"])
|
2023-01-18 08:40:41 +00:00
|
|
|
lbl_urbtix_account.config(text=translate[language_code]["urbtix_account"])
|
2023-02-12 09:49:55 +00:00
|
|
|
lbl_hkticketing_account.config(text=translate[language_code]["hkticketing_account"])
|
2023-02-11 05:36:27 +00:00
|
|
|
lbl_kham_account.config(text=translate[language_code]["kham_account"])
|
2023-10-06 06:43:53 +00:00
|
|
|
lbl_ticket_account.config(text=translate[language_code]["ticket_account"])
|
2023-11-24 08:31:38 +00:00
|
|
|
lbl_udn_account.config(text=translate[language_code]["udn_account"])
|
2023-06-29 03:45:07 +00:00
|
|
|
lbl_ticketplus_account.config(text=translate[language_code]["ticketplus_account"])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-10-07 05:31:33 +00:00
|
|
|
lbl_password.config(text=translate[language_code]["password"])
|
|
|
|
#lbl_facebook_password.config(text=translate[language_code]["facebook_password"])
|
|
|
|
#lbl_kktix_password.config(text=translate[language_code]["kktix_password"])
|
|
|
|
#lbl_cityline_password.config(text=translate[language_code]["cityline_password"])
|
|
|
|
#lbl_urbtix_password.config(text=translate[language_code]["urbtix_password"])
|
|
|
|
#lbl_hkticketing_password.config(text=translate[language_code]["hkticketing_password"])
|
|
|
|
#lbl_kham_password.config(text=translate[language_code]["kham_password"])
|
|
|
|
#lbl_ticket_password.config(text=translate[language_code]["ticket_password"])
|
|
|
|
#lbl_ticketplus_password.config(text=translate[language_code]["ticketplus_password"])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
lbl_save_password_alert.config(text=translate[language_code]["save_password_alert"])
|
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
lbl_play_ticket_sound.config(text=translate[language_code]["play_ticket_sound"])
|
|
|
|
lbl_play_order_sound.config(text=translate[language_code]["play_order_sound"])
|
|
|
|
lbl_play_sound_filename.config(text=translate[language_code]["play_sound_filename"])
|
2022-11-14 09:26:52 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_slogan.config(text=translate[language_code]["maxbot_slogan"])
|
|
|
|
lbl_help.config(text=translate[language_code]["help"])
|
|
|
|
lbl_donate.config(text=translate[language_code]["donate"])
|
|
|
|
lbl_release.config(text=translate[language_code]["release"])
|
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
global btn_run
|
|
|
|
global btn_save
|
|
|
|
global btn_exit
|
2022-12-27 15:38:13 +00:00
|
|
|
global btn_restore_defaults
|
2023-02-26 08:39:37 +00:00
|
|
|
global btn_launcher
|
2022-12-27 15:38:13 +00:00
|
|
|
|
2023-03-12 17:08:23 +00:00
|
|
|
global btn_idle
|
|
|
|
global btn_resume
|
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
btn_run.config(text=translate[language_code]["run"])
|
|
|
|
btn_save.config(text=translate[language_code]["save"])
|
2022-12-27 15:38:13 +00:00
|
|
|
if btn_exit:
|
|
|
|
btn_exit.config(text=translate[language_code]["exit"])
|
|
|
|
btn_restore_defaults.config(text=translate[language_code]["restore_defaults"])
|
2023-02-26 08:39:37 +00:00
|
|
|
btn_launcher.config(text=translate[language_code]["config_launcher"])
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2023-03-12 17:08:23 +00:00
|
|
|
btn_idle.config(text=translate[language_code]["idle"])
|
|
|
|
btn_resume.config(text=translate[language_code]["resume"])
|
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
def callbackHomepageOnChange(event):
|
|
|
|
showHideBlocks()
|
|
|
|
|
|
|
|
def callbackDateAutoOnChange():
|
|
|
|
showHideTixcraftBlocks()
|
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
def callbackAreaAutoOnChange():
|
|
|
|
showHideAreaBlocks()
|
|
|
|
|
2023-01-02 06:53:28 +00:00
|
|
|
def showHideBlocks():
|
2019-10-01 17:52:13 +00:00
|
|
|
global UI_PADDING_X
|
|
|
|
|
|
|
|
global frame_group_kktix
|
|
|
|
global frame_group_kktix_index
|
|
|
|
global frame_group_tixcraft
|
|
|
|
global frame_group_tixcraft_index
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global combo_homepage
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-03-25 08:16:35 +00:00
|
|
|
new_homepage = ""
|
|
|
|
if 'combo_homepage' in globals():
|
|
|
|
new_homepage = combo_homepage.get().strip()
|
|
|
|
#print("new homepage value:", new_homepage)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-01-02 06:53:28 +00:00
|
|
|
BLOCK_STYLE_TIXCRAFT = 0
|
|
|
|
BLOCK_STYLE_KKTIX = 1
|
|
|
|
STYLE_KKTIX_DOMAIN_LIST = ['kktix']
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-01-02 06:53:28 +00:00
|
|
|
show_block_index = BLOCK_STYLE_TIXCRAFT
|
|
|
|
for domain_name in STYLE_KKTIX_DOMAIN_LIST:
|
|
|
|
if domain_name in new_homepage:
|
|
|
|
show_block_index = BLOCK_STYLE_KKTIX
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-03-25 08:16:35 +00:00
|
|
|
if 'frame_group_kktix' in globals():
|
|
|
|
if show_block_index == BLOCK_STYLE_KKTIX:
|
|
|
|
frame_group_kktix.grid(column=0, row=frame_group_kktix_index, padx=UI_PADDING_X)
|
|
|
|
frame_group_tixcraft.grid_forget()
|
|
|
|
else:
|
|
|
|
frame_group_tixcraft.grid(column=0, row=frame_group_tixcraft_index, padx=UI_PADDING_X)
|
|
|
|
frame_group_kktix.grid_forget()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2024-03-25 08:16:35 +00:00
|
|
|
showHideTixcraftBlocks()
|
2023-01-12 11:41:49 +00:00
|
|
|
|
|
|
|
def showHideOcrCaptchaWithSubmit():
|
|
|
|
global chk_state_ocr_captcha
|
|
|
|
is_ocr_captcha_enable = bool(chk_state_ocr_captcha.get())
|
|
|
|
|
2023-01-12 22:29:58 +00:00
|
|
|
global ocr_captcha_force_submit_index
|
|
|
|
global lbl_ocr_captcha_force_submit
|
2023-01-13 09:27:08 +00:00
|
|
|
global chk_ocr_captcha_force_submit
|
2023-01-12 22:29:58 +00:00
|
|
|
|
2023-06-28 08:08:59 +00:00
|
|
|
global lbl_ocr_captcha_ddddocr_beta
|
|
|
|
global chk_ocr_captcha_ddddocr_beta
|
|
|
|
|
2023-01-13 09:27:08 +00:00
|
|
|
if is_ocr_captcha_enable:
|
2023-01-12 22:29:58 +00:00
|
|
|
# show.
|
|
|
|
lbl_ocr_captcha_force_submit.grid(column=0, row=ocr_captcha_force_submit_index, sticky = E)
|
2023-01-13 09:27:08 +00:00
|
|
|
chk_ocr_captcha_force_submit.grid(column=1, row=ocr_captcha_force_submit_index, sticky = W)
|
2023-06-28 08:08:59 +00:00
|
|
|
|
|
|
|
lbl_ocr_captcha_ddddocr_beta.grid(column=0, row=ocr_captcha_force_submit_index-1, sticky = E)
|
|
|
|
chk_ocr_captcha_ddddocr_beta.grid(column=1, row=ocr_captcha_force_submit_index-1, sticky = W)
|
2023-01-12 22:29:58 +00:00
|
|
|
else:
|
|
|
|
# hide
|
|
|
|
lbl_ocr_captcha_force_submit.grid_forget()
|
2023-01-13 09:27:08 +00:00
|
|
|
chk_ocr_captcha_force_submit.grid_forget()
|
2023-01-12 22:29:58 +00:00
|
|
|
|
2023-06-28 08:08:59 +00:00
|
|
|
lbl_ocr_captcha_ddddocr_beta.grid_forget()
|
|
|
|
chk_ocr_captcha_ddddocr_beta.grid_forget()
|
|
|
|
|
2021-03-21 06:14:20 +00:00
|
|
|
# purpose: show detail blocks if master field is enable.
|
2019-10-01 17:52:13 +00:00
|
|
|
def showHideTixcraftBlocks():
|
|
|
|
# for tixcraft show/hide enable.
|
|
|
|
global chk_state_date_auto_select
|
|
|
|
|
|
|
|
global date_auto_select_mode_index
|
|
|
|
global lbl_date_auto_select_mode
|
|
|
|
global combo_date_auto_select_mode
|
|
|
|
|
|
|
|
global date_keyword_index
|
|
|
|
global lbl_date_keyword
|
|
|
|
global txt_date_keyword
|
|
|
|
|
2019-10-27 01:31:22 +00:00
|
|
|
is_date_set_to_enable = bool(chk_state_date_auto_select.get())
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2019-10-27 01:31:22 +00:00
|
|
|
if is_date_set_to_enable:
|
2019-10-01 17:52:13 +00:00
|
|
|
# show
|
|
|
|
lbl_date_auto_select_mode.grid(column=0, row=date_auto_select_mode_index, sticky = E)
|
|
|
|
combo_date_auto_select_mode.grid(column=1, row=date_auto_select_mode_index, sticky = W)
|
|
|
|
|
2023-07-17 10:16:58 +00:00
|
|
|
lbl_date_keyword.grid(column=0, row=date_keyword_index, sticky = E+N)
|
2019-10-01 17:52:13 +00:00
|
|
|
txt_date_keyword.grid(column=1, row=date_keyword_index, sticky = W)
|
|
|
|
else:
|
|
|
|
# hide
|
|
|
|
lbl_date_auto_select_mode.grid_forget()
|
|
|
|
combo_date_auto_select_mode.grid_forget()
|
|
|
|
|
|
|
|
lbl_date_keyword.grid_forget()
|
|
|
|
txt_date_keyword.grid_forget()
|
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
|
|
|
|
# purpose: show detail of area block.
|
|
|
|
def showHideAreaBlocks():
|
|
|
|
# for tixcraft show/hide enable.
|
|
|
|
global chk_state_area_auto_select
|
|
|
|
|
|
|
|
global area_auto_select_mode_index
|
|
|
|
global lbl_area_auto_select_mode
|
|
|
|
global combo_area_auto_select_mode
|
|
|
|
|
|
|
|
area_keyword_index = area_auto_select_mode_index + 1
|
2023-08-05 03:41:06 +00:00
|
|
|
keyword_exclude_index = area_auto_select_mode_index + 2
|
2023-05-24 07:17:11 +00:00
|
|
|
|
|
|
|
global lbl_area_keyword
|
|
|
|
global txt_area_keyword
|
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
global lbl_keyword_exclude
|
|
|
|
global txt_keyword_exclude
|
2023-05-24 07:17:11 +00:00
|
|
|
|
|
|
|
is_area_set_to_enable = bool(chk_state_area_auto_select.get())
|
|
|
|
|
2019-10-27 01:31:22 +00:00
|
|
|
if is_area_set_to_enable:
|
2019-10-01 17:52:13 +00:00
|
|
|
# show
|
2023-05-24 07:17:11 +00:00
|
|
|
lbl_area_auto_select_mode.grid(column=0, row=area_auto_select_mode_index, sticky = E)
|
|
|
|
combo_area_auto_select_mode.grid(column=1, row=area_auto_select_mode_index, sticky = W)
|
2019-10-27 01:31:22 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
lbl_area_keyword.grid(column=0, row=area_keyword_index, sticky = E+N)
|
|
|
|
txt_area_keyword.grid(column=1, row=area_keyword_index, sticky = W)
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
lbl_keyword_exclude.grid(column=0, row=keyword_exclude_index, sticky = E+N)
|
|
|
|
txt_keyword_exclude.grid(column=1, row=keyword_exclude_index, sticky = W)
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
else:
|
|
|
|
# hide
|
|
|
|
lbl_area_auto_select_mode.grid_forget()
|
|
|
|
combo_area_auto_select_mode.grid_forget()
|
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
lbl_area_keyword.grid_forget()
|
|
|
|
txt_area_keyword.grid_forget()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
lbl_keyword_exclude.grid_forget()
|
|
|
|
txt_keyword_exclude.grid_forget()
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-05-25 02:42:32 +00:00
|
|
|
def on_homepage_configure(event):
|
|
|
|
font = tkfont.nametofont(str(event.widget.cget('font')))
|
|
|
|
width = font.measure(CONST_SUPPORTED_SITES[len(CONST_SUPPORTED_SITES)-1] + "0") - event.width
|
|
|
|
style = ttk.Style()
|
|
|
|
style.configure('TCombobox', postoffset=(0,0,width,0))
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
def PreferenctTab(root, config_dict, language_code, UI_PADDING_X):
|
2022-11-21 19:01:04 +00:00
|
|
|
# output config:
|
2023-07-28 08:39:54 +00:00
|
|
|
print("setting app version:", CONST_APP_VERSION)
|
|
|
|
print("python version:", platform.python_version())
|
|
|
|
print("platform:", platform.platform())
|
2021-11-21 09:33:49 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
global lbl_homepage
|
|
|
|
global lbl_ticket_number
|
|
|
|
|
|
|
|
global lbl_kktix
|
|
|
|
global lbl_tixcraft
|
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
|
|
|
# first row need padding Y
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_homepage = Label(frame_group_header, text=translate[language_code]['homepage'])
|
2019-10-01 17:52:13 +00:00
|
|
|
lbl_homepage.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global combo_homepage
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_homepage = ttk.Combobox(frame_group_header, width=30)
|
2023-05-24 07:17:11 +00:00
|
|
|
combo_homepage['values'] = CONST_SUPPORTED_SITES
|
|
|
|
combo_homepage.set(config_dict["homepage"])
|
2019-10-01 17:52:13 +00:00
|
|
|
combo_homepage.bind("<<ComboboxSelected>>", callbackHomepageOnChange)
|
2023-05-25 02:42:32 +00:00
|
|
|
#combo_homepage.bind('<Configure>', on_homepage_configure)
|
2019-10-01 17:52:13 +00:00
|
|
|
combo_homepage.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
lbl_ticket_number = Label(frame_group_header, text=translate[language_code]['ticket_number'])
|
2019-10-01 17:52:13 +00:00
|
|
|
lbl_ticket_number.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2022-01-13 09:49:26 +00:00
|
|
|
global combo_ticket_number
|
|
|
|
# for text format.
|
2022-11-16 15:43:53 +00:00
|
|
|
# PS: some user keyin wrong type. @_@;
|
2022-01-13 09:49:26 +00:00
|
|
|
'''
|
|
|
|
global combo_ticket_number_value
|
|
|
|
combo_ticket_number_value = StringVar(frame_group_header, value=ticket_number)
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_ticket_number = Entry(frame_group_header, width=30, textvariable = combo_ticket_number_value)
|
2022-01-13 09:49:26 +00:00
|
|
|
combo_ticket_number.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
'''
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_ticket_number = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
2022-11-16 15:43:53 +00:00
|
|
|
combo_ticket_number['values']= ("1","2","3","4","5","6","7","8","9","10","11","12")
|
2022-01-13 09:49:26 +00:00
|
|
|
#combo_ticket_number.current(0)
|
2023-05-24 07:17:11 +00:00
|
|
|
combo_ticket_number.set(str(config_dict["ticket_number"]))
|
2022-01-13 09:49:26 +00:00
|
|
|
combo_ticket_number.grid(column=1, row=group_row_count, sticky = W)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
frame_group_header.grid(column=0, row=row_count, sticky = W, padx=UI_PADDING_X)
|
|
|
|
|
|
|
|
row_count+=1
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
# for sub group KKTix.
|
2019-10-01 17:52:13 +00:00
|
|
|
global frame_group_kktix
|
|
|
|
frame_group_kktix = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
# start sub group...
|
2019-10-01 17:52:13 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global lbl_auto_press_next_step_button
|
|
|
|
lbl_auto_press_next_step_button = Label(frame_group_kktix, text=translate[language_code]['auto_press_next_step_button'])
|
2019-10-01 17:52:13 +00:00
|
|
|
lbl_auto_press_next_step_button.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_auto_press_next_step_button
|
|
|
|
chk_state_auto_press_next_step_button = BooleanVar()
|
2023-05-24 07:17:11 +00:00
|
|
|
chk_state_auto_press_next_step_button.set(config_dict["kktix"]["auto_press_next_step_button"])
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global chk_auto_press_next_step_button
|
|
|
|
chk_auto_press_next_step_button = Checkbutton(frame_group_kktix, text=translate[language_code]['enable'], variable=chk_state_auto_press_next_step_button)
|
2019-10-01 17:52:13 +00:00
|
|
|
chk_auto_press_next_step_button.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global lbl_auto_fill_ticket_number
|
|
|
|
lbl_auto_fill_ticket_number = Label(frame_group_kktix, text=translate[language_code]['auto_fill_ticket_number'])
|
2019-10-01 17:52:13 +00:00
|
|
|
lbl_auto_fill_ticket_number.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_auto_fill_ticket_number
|
|
|
|
chk_state_auto_fill_ticket_number = BooleanVar()
|
2023-05-24 07:17:11 +00:00
|
|
|
chk_state_auto_fill_ticket_number.set(config_dict["kktix"]["auto_fill_ticket_number"])
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global chk_auto_fill_ticket_number
|
|
|
|
chk_auto_fill_ticket_number = Checkbutton(frame_group_kktix, text=translate[language_code]['enable'], variable=chk_state_auto_fill_ticket_number)
|
2021-03-21 06:14:20 +00:00
|
|
|
chk_auto_fill_ticket_number.grid(column=1, row=group_row_count, sticky = W)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
global frame_group_kktix_index
|
|
|
|
frame_group_kktix_index = row_count
|
2023-01-02 06:53:28 +00:00
|
|
|
#PS: don't need show when onload(), because show/hide block will load again.
|
|
|
|
#frame_group_kktix.grid(column=0, row=row_count, sticky = W, padx=UI_PADDING_X)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
row_count+=1
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
# for sub group tixcraft.
|
2019-10-01 17:52:13 +00:00
|
|
|
global frame_group_tixcraft
|
|
|
|
frame_group_tixcraft = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
# start sub group.
|
2019-10-01 17:52:13 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global lbl_date_auto_select
|
|
|
|
lbl_date_auto_select = Label(frame_group_tixcraft, text=translate[language_code]['date_auto_select'])
|
2019-10-01 17:52:13 +00:00
|
|
|
lbl_date_auto_select.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_date_auto_select
|
|
|
|
chk_state_date_auto_select = BooleanVar()
|
2024-01-08 02:32:17 +00:00
|
|
|
chk_state_date_auto_select.set(config_dict["date_auto_select"]["enable"])
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-11 16:46:36 +00:00
|
|
|
global chk_date_auto_select
|
|
|
|
chk_date_auto_select = Checkbutton(frame_group_tixcraft, text=translate[language_code]['enable'], variable=chk_state_date_auto_select, command=callbackDateAutoOnChange)
|
2019-10-01 17:52:13 +00:00
|
|
|
chk_date_auto_select.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global date_auto_select_mode_index
|
|
|
|
date_auto_select_mode_index = group_row_count
|
|
|
|
|
|
|
|
global lbl_date_auto_select_mode
|
2022-11-11 16:46:36 +00:00
|
|
|
lbl_date_auto_select_mode = Label(frame_group_tixcraft, text=translate[language_code]['date_select_order'])
|
2019-10-01 17:52:13 +00:00
|
|
|
lbl_date_auto_select_mode.grid(column=0, row=date_auto_select_mode_index, sticky = E)
|
|
|
|
|
|
|
|
global combo_date_auto_select_mode
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_date_auto_select_mode = ttk.Combobox(frame_group_tixcraft, state="readonly", width=30)
|
2023-07-19 02:13:07 +00:00
|
|
|
combo_date_auto_select_mode['values']= CONST_SELECT_OPTIONS_DEFAULT
|
2024-01-08 02:32:17 +00:00
|
|
|
combo_date_auto_select_mode.set(config_dict["date_auto_select"]["mode"])
|
2019-10-01 17:52:13 +00:00
|
|
|
combo_date_auto_select_mode.grid(column=1, row=date_auto_select_mode_index, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global date_keyword_index
|
|
|
|
date_keyword_index = group_row_count
|
|
|
|
|
|
|
|
global lbl_date_keyword
|
2022-11-11 16:46:36 +00:00
|
|
|
lbl_date_keyword = Label(frame_group_tixcraft, text=translate[language_code]['date_keyword'])
|
2023-07-17 10:16:58 +00:00
|
|
|
lbl_date_keyword.grid(column=0, row=date_keyword_index, sticky = E+N)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
global txt_date_keyword
|
2023-07-17 10:16:58 +00:00
|
|
|
txt_date_keyword = Text(frame_group_tixcraft, width=30, height=4)
|
|
|
|
txt_date_keyword.grid(column=1, row=group_row_count, sticky = W)
|
2024-01-08 02:32:17 +00:00
|
|
|
txt_date_keyword.insert("1.0", config_dict["date_auto_select"]["date_keyword"].strip())
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
2023-01-12 08:51:05 +00:00
|
|
|
global lbl_pass_date_is_sold_out
|
|
|
|
lbl_pass_date_is_sold_out = Label(frame_group_tixcraft, text=translate[language_code]['pass_date_is_sold_out'])
|
|
|
|
lbl_pass_date_is_sold_out.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_pass_date_is_sold_out
|
|
|
|
chk_state_pass_date_is_sold_out = BooleanVar()
|
2023-05-24 07:17:11 +00:00
|
|
|
chk_state_pass_date_is_sold_out.set(config_dict["tixcraft"]["pass_date_is_sold_out"])
|
2023-01-12 08:51:05 +00:00
|
|
|
|
|
|
|
global chk_pass_date_is_sold_out
|
|
|
|
chk_pass_date_is_sold_out = Checkbutton(frame_group_tixcraft, text=translate[language_code]['enable'], variable=chk_state_pass_date_is_sold_out)
|
|
|
|
chk_pass_date_is_sold_out.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_auto_reload_coming_soon_page
|
|
|
|
lbl_auto_reload_coming_soon_page = Label(frame_group_tixcraft, text=translate[language_code]['auto_reload_coming_soon_page'])
|
|
|
|
lbl_auto_reload_coming_soon_page.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_auto_reload_coming_soon_page
|
|
|
|
chk_state_auto_reload_coming_soon_page = BooleanVar()
|
2023-05-24 07:17:11 +00:00
|
|
|
chk_state_auto_reload_coming_soon_page.set(config_dict["tixcraft"]["auto_reload_coming_soon_page"])
|
2023-01-12 08:51:05 +00:00
|
|
|
|
|
|
|
global chk_auto_reload_coming_soon_page
|
|
|
|
chk_auto_reload_coming_soon_page = Checkbutton(frame_group_tixcraft, text=translate[language_code]['enable'], variable=chk_state_auto_reload_coming_soon_page)
|
|
|
|
chk_auto_reload_coming_soon_page.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
# final flush.
|
|
|
|
global frame_group_tixcraft_index
|
|
|
|
frame_group_tixcraft_index = row_count
|
|
|
|
#PS: don't need show when onload(), because show/hide block will load again.
|
|
|
|
#frame_group_tixcraft.grid(column=0, row=row_count, sticky = W, padx=UI_PADDING_X)
|
2019-10-27 01:31:22 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
row_count += 1
|
2019-10-27 01:31:22 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
showHideBlocks()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
# for area block.
|
|
|
|
global frame_group_area
|
|
|
|
frame_group_area = Frame(root)
|
|
|
|
group_row_count = 0
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global lbl_area_auto_select
|
|
|
|
lbl_area_auto_select = Label(frame_group_area, text=translate[language_code]['area_auto_select'])
|
|
|
|
lbl_area_auto_select.grid(column=0, row=group_row_count, sticky = E)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global chk_state_area_auto_select
|
|
|
|
chk_state_area_auto_select = BooleanVar()
|
|
|
|
chk_state_area_auto_select.set(config_dict["area_auto_select"]["enable"])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global chk_area_auto_select
|
|
|
|
chk_area_auto_select = Checkbutton(frame_group_area, text=translate[language_code]['enable'], variable=chk_state_area_auto_select, command=callbackAreaAutoOnChange)
|
|
|
|
chk_area_auto_select.grid(column=1, row=group_row_count, sticky = W)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2021-03-21 06:14:20 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global area_auto_select_mode_index
|
|
|
|
area_auto_select_mode_index = group_row_count
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global lbl_area_auto_select_mode
|
|
|
|
lbl_area_auto_select_mode = Label(frame_group_area, text=translate[language_code]['area_auto_select'])
|
|
|
|
lbl_area_auto_select_mode.grid(column=0, row=area_auto_select_mode_index, sticky = E)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global combo_area_auto_select_mode
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_area_auto_select_mode = ttk.Combobox(frame_group_area, state="readonly", width=30)
|
2023-05-24 07:17:11 +00:00
|
|
|
combo_area_auto_select_mode['values']= CONST_SELECT_OPTIONS_DEFAULT
|
|
|
|
combo_area_auto_select_mode.set(config_dict["area_auto_select"]["mode"])
|
|
|
|
combo_area_auto_select_mode.grid(column=1, row=area_auto_select_mode_index, sticky = W)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2022-11-09 17:56:12 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global lbl_area_keyword
|
|
|
|
lbl_area_keyword = Label(frame_group_area, text=translate[language_code]['area_keyword'])
|
|
|
|
lbl_area_keyword.grid(column=0, row=group_row_count, sticky = E+N)
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
global txt_area_keyword
|
|
|
|
txt_area_keyword = Text(frame_group_area, width=30, height=4)
|
|
|
|
txt_area_keyword.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_area_keyword.insert("1.0", config_dict["area_auto_select"]["area_keyword"].strip())
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
group_row_count+=1
|
2022-11-09 17:56:12 +00:00
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
global lbl_keyword_exclude
|
|
|
|
lbl_keyword_exclude = Label(frame_group_area, text=translate[language_code]['keyword_exclude'])
|
|
|
|
lbl_keyword_exclude.grid(column=0, row=group_row_count, sticky = E+N)
|
2023-03-21 17:33:12 +00:00
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
global txt_keyword_exclude
|
|
|
|
txt_keyword_exclude = Text(frame_group_area, width=30, height=4)
|
|
|
|
txt_keyword_exclude.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_keyword_exclude.insert("1.0", config_dict["keyword_exclude"].strip())
|
2022-12-27 15:38:13 +00:00
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
2023-08-05 03:41:06 +00:00
|
|
|
global lbl_keyword_usage
|
|
|
|
lbl_keyword_usage = Label(frame_group_area, text=translate[language_code]['keyword_usage'])
|
|
|
|
lbl_keyword_usage.grid(column=1, row=group_row_count, sticky = W)
|
2023-02-17 16:54:16 +00:00
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
# flush
|
2023-05-24 07:17:11 +00:00
|
|
|
frame_group_area.grid(column=0, row=row_count, sticky = W, padx=UI_PADDING_X)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-05-24 07:17:11 +00:00
|
|
|
showHideAreaBlocks()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
def AdvancedTab(root, config_dict, language_code, UI_PADDING_X):
|
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
|
|
|
# assign default value.
|
2024-03-12 10:24:11 +00:00
|
|
|
play_sound_filename = config_dict["advanced"]["play_sound"]["filename"].strip()
|
|
|
|
if play_sound_filename is None:
|
|
|
|
play_sound_filename = ""
|
|
|
|
if len(play_sound_filename)==0:
|
|
|
|
play_sound_filename = play_sound_filename_default
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-01-12 08:51:05 +00:00
|
|
|
global lbl_browser
|
|
|
|
lbl_browser = Label(frame_group_header, text=translate[language_code]['browser'])
|
|
|
|
lbl_browser.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global combo_browser
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_browser = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
2023-06-13 05:35:53 +00:00
|
|
|
combo_browser['values']= ("chrome","firefox","edge","safari","brave")
|
2023-01-12 08:51:05 +00:00
|
|
|
combo_browser.set(config_dict['browser'])
|
|
|
|
combo_browser.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_language
|
|
|
|
lbl_language = Label(frame_group_header, text=translate[language_code]['language'])
|
|
|
|
lbl_language.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global combo_language
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_language = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
2023-01-12 08:51:05 +00:00
|
|
|
combo_language['values']= ("English","繁體中文","簡体中文","日本語")
|
|
|
|
combo_language.set(config_dict['language'])
|
|
|
|
combo_language.bind("<<ComboboxSelected>>", callbackLanguageOnChange)
|
|
|
|
combo_language.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-01-13 19:01:47 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_ocr_captcha_image_source
|
|
|
|
lbl_ocr_captcha_image_source = Label(frame_group_header, text=translate[language_code]['ocr_captcha_image_source'])
|
|
|
|
lbl_ocr_captcha_image_source.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global combo_ocr_captcha_image_source
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_ocr_captcha_image_source = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
2023-02-12 03:02:16 +00:00
|
|
|
combo_ocr_captcha_image_source['values']= (CONST_OCR_CAPTCH_IMAGE_SOURCE_NON_BROWSER, CONST_OCR_CAPTCH_IMAGE_SOURCE_CANVAS)
|
2023-01-13 19:01:47 +00:00
|
|
|
combo_ocr_captcha_image_source.set(config_dict["ocr_captcha"]["image_source"])
|
|
|
|
combo_ocr_captcha_image_source.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-02-12 03:02:16 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_webdriver_type
|
|
|
|
lbl_webdriver_type = Label(frame_group_header, text=translate[language_code]['webdriver_type'])
|
|
|
|
lbl_webdriver_type.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global combo_webdriver_type
|
2023-05-25 02:42:32 +00:00
|
|
|
combo_webdriver_type = ttk.Combobox(frame_group_header, state="readonly", width=30)
|
2023-02-12 03:02:16 +00:00
|
|
|
combo_webdriver_type['values']= (CONST_WEBDRIVER_TYPE_SELENIUM, CONST_WEBDRIVER_TYPE_UC)
|
|
|
|
combo_webdriver_type.set(config_dict["webdriver_type"])
|
|
|
|
combo_webdriver_type.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global lbl_play_ticket_sound
|
|
|
|
lbl_play_ticket_sound = Label(frame_group_header, text=translate[language_code]['play_ticket_sound'])
|
|
|
|
lbl_play_ticket_sound.grid(column=0, row=group_row_count, sticky = E)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global chk_state_play_ticket_sound
|
|
|
|
chk_state_play_ticket_sound = BooleanVar()
|
|
|
|
chk_state_play_ticket_sound.set(config_dict["advanced"]["play_sound"]["ticket"])
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global chk_play_ticket_sound
|
|
|
|
chk_play_ticket_sound = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_play_ticket_sound)
|
|
|
|
chk_play_ticket_sound.grid(column=1, row=group_row_count, sticky = W)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global lbl_play_order_sound
|
|
|
|
lbl_play_order_sound = Label(frame_group_header, text=translate[language_code]['play_order_sound'])
|
|
|
|
lbl_play_order_sound.grid(column=0, row=group_row_count, sticky = E)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2024-03-12 10:24:11 +00:00
|
|
|
global chk_state_play_order_sound
|
|
|
|
chk_state_play_order_sound = BooleanVar()
|
|
|
|
chk_state_play_order_sound.set(config_dict["advanced"]["play_sound"]["order"])
|
|
|
|
|
|
|
|
global chk_play_order_sound
|
|
|
|
chk_play_order_sound = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_play_order_sound)
|
|
|
|
chk_play_order_sound.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_play_sound_filename
|
|
|
|
lbl_play_sound_filename = Label(frame_group_header, text=translate[language_code]['play_sound_filename'])
|
|
|
|
lbl_play_sound_filename.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_play_sound_filename
|
|
|
|
txt_play_sound_filename_value = StringVar(frame_group_header, value=play_sound_filename)
|
|
|
|
txt_play_sound_filename = Entry(frame_group_header, width=30, textvariable = txt_play_sound_filename_value)
|
|
|
|
txt_play_sound_filename.grid(column=1, row=group_row_count, sticky = W)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2022-11-17 18:17:19 +00:00
|
|
|
icon_play_filename = "icon_play_1.gif"
|
2022-11-16 15:43:53 +00:00
|
|
|
icon_play_img = PhotoImage(file=icon_play_filename)
|
|
|
|
|
|
|
|
lbl_icon_play = Label(frame_group_header, image=icon_play_img, cursor="hand2")
|
|
|
|
lbl_icon_play.image = icon_play_img
|
2023-12-11 01:56:13 +00:00
|
|
|
lbl_icon_play.grid(column=2, row=group_row_count, sticky = W)
|
2022-11-16 15:43:53 +00:00
|
|
|
lbl_icon_play.bind("<Button-1>", lambda e: btn_preview_sound_clicked())
|
|
|
|
|
2022-11-17 18:17:19 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
2023-05-26 04:43:18 +00:00
|
|
|
global lbl_auto_reload_page_interval
|
|
|
|
lbl_auto_reload_page_interval = Label(frame_group_header, text=translate[language_code]['auto_reload_page_interval'])
|
|
|
|
lbl_auto_reload_page_interval.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_auto_reload_page_interval
|
|
|
|
txt_auto_reload_page_interval_value = StringVar(frame_group_header, value=config_dict["advanced"]["auto_reload_page_interval"])
|
|
|
|
txt_auto_reload_page_interval = Entry(frame_group_header, width=30, textvariable = txt_auto_reload_page_interval_value)
|
|
|
|
txt_auto_reload_page_interval.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2024-01-18 03:48:17 +00:00
|
|
|
global lbl_reset_browser_interval
|
|
|
|
lbl_reset_browser_interval = Label(frame_group_header, text=translate[language_code]['reset_browser_interval'])
|
|
|
|
lbl_reset_browser_interval.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_reset_browser_interval
|
|
|
|
txt_reset_browser_interval_value = StringVar(frame_group_header, value=config_dict["advanced"]["reset_browser_interval"])
|
|
|
|
txt_reset_browser_interval = Entry(frame_group_header, width=30, textvariable = txt_reset_browser_interval_value)
|
|
|
|
txt_reset_browser_interval.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-10-25 03:02:08 +00:00
|
|
|
global lbl_proxy_server_port
|
|
|
|
lbl_proxy_server_port = Label(frame_group_header, text=translate[language_code]['proxy_server_port'])
|
|
|
|
lbl_proxy_server_port.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_proxy_server_port
|
|
|
|
txt_proxy_server_port_value = StringVar(frame_group_header, value=config_dict["advanced"]["proxy_server_port"])
|
|
|
|
txt_proxy_server_port = Entry(frame_group_header, width=30, textvariable = txt_proxy_server_port_value)
|
|
|
|
txt_proxy_server_port.grid(column=1, row=group_row_count, sticky = W)
|
2023-06-13 10:16:28 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2024-03-25 04:26:45 +00:00
|
|
|
global lbl_window_size
|
|
|
|
lbl_window_size = Label(frame_group_header, text=translate[language_code]['window_size'])
|
|
|
|
lbl_window_size.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_window_size
|
|
|
|
txt_window_size_value = StringVar(frame_group_header, value=config_dict["advanced"]["window_size"])
|
|
|
|
txt_window_size = Entry(frame_group_header, width=30, textvariable = txt_window_size_value)
|
|
|
|
txt_window_size.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
global lbl_chrome_extension
|
|
|
|
lbl_chrome_extension = Label(frame_group_header, text=translate[language_code]['chrome_extension'])
|
|
|
|
lbl_chrome_extension.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_chrome_extension
|
|
|
|
chk_state_chrome_extension = BooleanVar()
|
|
|
|
chk_state_chrome_extension.set(config_dict["advanced"]["chrome_extension"])
|
|
|
|
|
|
|
|
global chk_chrome_extension
|
|
|
|
chk_chrome_extension = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_chrome_extension)
|
|
|
|
chk_chrome_extension.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-05-17 00:06:08 +00:00
|
|
|
global lbl_adjacent_seat
|
|
|
|
lbl_adjacent_seat = Label(frame_group_header, text=translate[language_code]['disable_adjacent_seat'])
|
|
|
|
lbl_adjacent_seat.grid(column=0, row=group_row_count, sticky = E)
|
2023-02-09 17:23:46 +00:00
|
|
|
|
2023-05-17 00:06:08 +00:00
|
|
|
global chk_state_adjacent_seat
|
|
|
|
chk_state_adjacent_seat = BooleanVar()
|
|
|
|
chk_state_adjacent_seat.set(config_dict["advanced"]["disable_adjacent_seat"])
|
2023-02-09 17:50:34 +00:00
|
|
|
|
2023-05-17 00:06:08 +00:00
|
|
|
global chk_adjacent_seat
|
|
|
|
chk_adjacent_seat = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_adjacent_seat)
|
|
|
|
chk_adjacent_seat.grid(column=1, row=group_row_count, sticky = W)
|
2023-02-09 17:23:46 +00:00
|
|
|
|
2023-11-08 07:31:18 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_hide_some_image
|
|
|
|
lbl_hide_some_image = Label(frame_group_header, text=translate[language_code]['hide_some_image'])
|
|
|
|
lbl_hide_some_image.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_hide_some_image
|
|
|
|
chk_state_hide_some_image = BooleanVar()
|
|
|
|
chk_state_hide_some_image.set(config_dict["advanced"]["hide_some_image"])
|
|
|
|
|
|
|
|
global chk_hide_some_image
|
|
|
|
chk_hide_some_image = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_hide_some_image)
|
|
|
|
chk_hide_some_image.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
global lbl_hide_some_image_recommand
|
|
|
|
lbl_hide_some_image_recommand = Label(frame_group_header, text=translate[language_code]['recommand_enable'])
|
|
|
|
lbl_hide_some_image_recommand.grid(column=2, row=group_row_count, sticky = W)
|
|
|
|
|
2023-11-09 04:25:33 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_block_facebook_network
|
|
|
|
lbl_block_facebook_network = Label(frame_group_header, text=translate[language_code]['block_facebook_network'])
|
|
|
|
lbl_block_facebook_network.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_block_facebook_network
|
|
|
|
chk_state_block_facebook_network = BooleanVar()
|
|
|
|
chk_state_block_facebook_network.set(config_dict["advanced"]["block_facebook_network"])
|
|
|
|
|
|
|
|
global chk_block_facebook_network
|
|
|
|
chk_block_facebook_network = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_block_facebook_network)
|
|
|
|
chk_block_facebook_network.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-12-11 01:56:13 +00:00
|
|
|
global lbl_block_facebook_network_recommand
|
|
|
|
lbl_block_facebook_network_recommand = Label(frame_group_header, text=translate[language_code]['recommand_enable'])
|
|
|
|
lbl_block_facebook_network_recommand.grid(column=2, row=group_row_count, sticky = W)
|
|
|
|
|
2023-02-22 16:05:44 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
2023-11-25 01:11:43 +00:00
|
|
|
global lbl_headless
|
|
|
|
lbl_headless = Label(frame_group_header, text=translate[language_code]['headless'])
|
|
|
|
lbl_headless.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_headless
|
|
|
|
chk_state_headless = BooleanVar()
|
|
|
|
chk_state_headless.set(config_dict['advanced']["headless"])
|
|
|
|
|
|
|
|
global chk_headless
|
|
|
|
chk_headless = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_headless)
|
|
|
|
chk_headless.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
2023-03-07 14:30:30 +00:00
|
|
|
global lbl_verbose
|
|
|
|
lbl_verbose = Label(frame_group_header, text=translate[language_code]['verbose'])
|
|
|
|
lbl_verbose.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_verbose
|
|
|
|
chk_state_verbose = BooleanVar()
|
|
|
|
chk_state_verbose.set(config_dict['advanced']["verbose"])
|
|
|
|
|
|
|
|
global chk_verbose
|
|
|
|
chk_verbose = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_verbose)
|
|
|
|
chk_verbose.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
global lbl_ocr_captcha
|
|
|
|
lbl_ocr_captcha = Label(frame_group_header, text=translate[language_code]['ocr_captcha'])
|
|
|
|
lbl_ocr_captcha.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-18 20:12:46 +00:00
|
|
|
frame_group_ddddocr_enable = Frame(frame_group_header)
|
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
global chk_state_ocr_captcha
|
|
|
|
chk_state_ocr_captcha = BooleanVar()
|
|
|
|
chk_state_ocr_captcha.set(config_dict['ocr_captcha']["enable"])
|
|
|
|
|
|
|
|
global chk_ocr_captcha
|
2023-08-18 20:12:46 +00:00
|
|
|
chk_ocr_captcha = Checkbutton(frame_group_ddddocr_enable, text=translate[language_code]['enable'], variable=chk_state_ocr_captcha, command=showHideOcrCaptchaWithSubmit)
|
|
|
|
chk_ocr_captcha.grid(column=0, row=0, sticky = W)
|
|
|
|
|
|
|
|
global lbl_ocr_captcha_not_support_arm
|
|
|
|
lbl_ocr_captcha_not_support_arm = Label(frame_group_ddddocr_enable, fg="red", text=translate[language_code]['ocr_captcha_not_support_arm'])
|
|
|
|
if is_arm():
|
|
|
|
lbl_ocr_captcha_not_support_arm.grid(column=1, row=0, sticky = E)
|
|
|
|
|
|
|
|
frame_group_ddddocr_enable.grid(column=1, row=group_row_count, sticky = W)
|
2023-06-19 09:31:57 +00:00
|
|
|
|
2023-06-28 08:08:59 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_ocr_captcha_ddddocr_beta
|
|
|
|
lbl_ocr_captcha_ddddocr_beta = Label(frame_group_header, text=translate[language_code]['ocr_captcha_ddddocr_beta'])
|
|
|
|
lbl_ocr_captcha_ddddocr_beta.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_ocr_captcha_ddddocr_beta
|
|
|
|
chk_state_ocr_captcha_ddddocr_beta = BooleanVar()
|
|
|
|
chk_state_ocr_captcha_ddddocr_beta.set(config_dict['ocr_captcha']["beta"])
|
|
|
|
|
|
|
|
global chk_ocr_captcha_ddddocr_beta
|
|
|
|
chk_ocr_captcha_ddddocr_beta = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_ocr_captcha_ddddocr_beta)
|
|
|
|
chk_ocr_captcha_ddddocr_beta.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2023-06-19 09:31:57 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global ocr_captcha_force_submit_index
|
|
|
|
ocr_captcha_force_submit_index = group_row_count
|
|
|
|
|
|
|
|
global lbl_ocr_captcha_force_submit
|
|
|
|
lbl_ocr_captcha_force_submit = Label(frame_group_header, text=translate[language_code]['ocr_captcha_force_submit'])
|
|
|
|
lbl_ocr_captcha_force_submit.grid(column=0, row=ocr_captcha_force_submit_index, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_ocr_captcha_force_submit
|
|
|
|
chk_state_ocr_captcha_force_submit = BooleanVar()
|
|
|
|
chk_state_ocr_captcha_force_submit.set(config_dict['ocr_captcha']["force_submit"])
|
|
|
|
|
|
|
|
global chk_ocr_captcha_force_submit
|
|
|
|
chk_ocr_captcha_force_submit = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_ocr_captcha_force_submit)
|
|
|
|
chk_ocr_captcha_force_submit.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X)
|
|
|
|
|
|
|
|
showHideOcrCaptchaWithSubmit()
|
|
|
|
|
|
|
|
def VerificationTab(root, config_dict, language_code, UI_PADDING_X):
|
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
|
|
|
global lbl_user_guess_string_description
|
|
|
|
lbl_user_guess_string_description = Label(frame_group_header, text=translate[language_code]['user_guess_string'])
|
|
|
|
lbl_user_guess_string_description.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_user_guess_string
|
|
|
|
lbl_user_guess_string = Label(frame_group_header, text=translate[language_code]['local_dictionary'])
|
|
|
|
lbl_user_guess_string.grid(column=0, row=group_row_count, sticky = E+N)
|
|
|
|
|
|
|
|
global txt_user_guess_string
|
|
|
|
txt_user_guess_string = Text(frame_group_header, width=30, height=4)
|
|
|
|
txt_user_guess_string.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_user_guess_string.insert("1.0", config_dict["advanced"]["user_guess_string"].strip())
|
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
global lbl_remote_url
|
|
|
|
lbl_remote_url = Label(frame_group_header, text=translate[language_code]['remote_url'])
|
|
|
|
lbl_remote_url.grid(column=0, row=group_row_count, sticky = E+N)
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
global txt_remote_url
|
|
|
|
txt_remote_url = Text(frame_group_header, width=30, height=4)
|
|
|
|
txt_remote_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_remote_url.insert("1.0", config_dict['advanced']["remote_url"].strip())
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-06-15 15:45:50 +00:00
|
|
|
icon_preview_text_filename = "icon_chrome_4.gif"
|
|
|
|
icon_preview_text_img = PhotoImage(file=icon_preview_text_filename)
|
|
|
|
|
|
|
|
lbl_icon_preview_text = Label(frame_group_header, image=icon_preview_text_img, cursor="hand2")
|
|
|
|
lbl_icon_preview_text.image = icon_preview_text_img
|
2023-06-16 04:04:04 +00:00
|
|
|
lbl_icon_preview_text.grid(column=2, row=group_row_count, sticky = W+N)
|
2023-06-15 15:45:50 +00:00
|
|
|
lbl_icon_preview_text.bind("<Button-1>", lambda e: btn_open_text_server_clicked())
|
|
|
|
|
2023-06-15 09:58:35 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_online_dictionary_preview
|
2023-06-19 09:31:57 +00:00
|
|
|
lbl_online_dictionary_preview = Label(frame_group_header, text=translate[language_code]['preview'])
|
|
|
|
lbl_online_dictionary_preview.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global lbl_online_dictionary_preview_data
|
|
|
|
lbl_online_dictionary_preview_data = Label(frame_group_header, text="")
|
|
|
|
lbl_online_dictionary_preview_data.grid(column=1, row=group_row_count, sticky = W)
|
2023-06-15 09:58:35 +00:00
|
|
|
|
2023-04-28 04:04:21 +00:00
|
|
|
group_row_count+=1
|
|
|
|
|
|
|
|
global lbl_auto_guess_options
|
|
|
|
lbl_auto_guess_options = Label(frame_group_header, text=translate[language_code]['auto_guess_options'])
|
|
|
|
lbl_auto_guess_options.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global chk_state_auto_guess_options
|
|
|
|
chk_state_auto_guess_options = BooleanVar()
|
|
|
|
chk_state_auto_guess_options.set(config_dict["advanced"]["auto_guess_options"])
|
|
|
|
|
|
|
|
global chk_auto_guess_options
|
|
|
|
chk_auto_guess_options = Checkbutton(frame_group_header, text=translate[language_code]['enable'], variable=chk_state_auto_guess_options)
|
|
|
|
chk_auto_guess_options.grid(column=1, row=group_row_count, sticky = W)
|
2023-03-21 17:33:12 +00:00
|
|
|
|
|
|
|
group_row_count+=1
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X)
|
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
def ServerTab(root, config_dict, language_code, UI_PADDING_X):
|
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
|
|
|
global lbl_server_url
|
|
|
|
lbl_server_url = Label(frame_group_header, text=translate[language_code]['server_url'])
|
|
|
|
lbl_server_url.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
local_ip = get_ip_address()
|
|
|
|
ip_address = "http://%s:%d/" % (local_ip, CONST_SERVER_PORT)
|
|
|
|
global lbl_ip_address
|
|
|
|
lbl_ip_address = Label(frame_group_header, text=ip_address)
|
|
|
|
lbl_ip_address.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
icon_copy_filename = "icon_copy_2.gif"
|
|
|
|
icon_copy_img = PhotoImage(file=icon_copy_filename)
|
|
|
|
|
|
|
|
lbl_icon_copy_ip = Label(frame_group_header, image=icon_copy_img, cursor="hand2")
|
|
|
|
lbl_icon_copy_ip.image = icon_copy_img
|
|
|
|
lbl_icon_copy_ip.grid(column=2, row=group_row_count, sticky = W+N)
|
|
|
|
lbl_icon_copy_ip.bind("<Button-1>", lambda e: btn_copy_ip_clicked())
|
|
|
|
|
|
|
|
group_row_count += 1
|
|
|
|
|
|
|
|
global lbl_question
|
|
|
|
lbl_question = Label(frame_group_header, text=translate[language_code]['question'])
|
|
|
|
lbl_question.grid(column=0, row=group_row_count, sticky = E+N)
|
|
|
|
|
|
|
|
global txt_question
|
|
|
|
txt_question = Text(frame_group_header, width=50, height=22)
|
|
|
|
txt_question.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_question.insert("1.0", "")
|
|
|
|
|
|
|
|
lbl_icon_copy_question = Label(frame_group_header, image=icon_copy_img, cursor="hand2")
|
|
|
|
lbl_icon_copy_question.image = icon_copy_img
|
|
|
|
#lbl_icon_copy_question.grid(column=2, row=group_row_count, sticky = W+N)
|
|
|
|
lbl_icon_copy_question.bind("<Button-1>", lambda e: btn_copy_question_clicked())
|
|
|
|
|
|
|
|
icon_query_filename = "icon_query_5.gif"
|
|
|
|
icon_query_img = PhotoImage(file=icon_query_filename)
|
|
|
|
|
|
|
|
lbl_icon_query_question = Label(frame_group_header, image=icon_query_img, cursor="hand2")
|
|
|
|
lbl_icon_query_question.image = icon_query_img
|
|
|
|
lbl_icon_query_question.grid(column=2, row=group_row_count, sticky = W+N)
|
|
|
|
lbl_icon_query_question.bind("<Button-1>", lambda e: btn_query_question_clicked())
|
|
|
|
|
|
|
|
group_row_count += 1
|
|
|
|
|
|
|
|
global lbl_answer
|
|
|
|
lbl_answer = Label(frame_group_header, text=translate[language_code]['answer'])
|
|
|
|
lbl_answer.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_answer
|
|
|
|
global txt_answer_value
|
|
|
|
txt_answer_value = StringVar(frame_group_header, value="")
|
|
|
|
txt_answer = Entry(frame_group_header, width=30, textvariable = txt_answer_value)
|
|
|
|
txt_answer.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_answer.bind('<Control-v>', lambda e: btn_paste_answer_by_user())
|
|
|
|
|
|
|
|
frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X, pady=15)
|
|
|
|
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
def AutofillTab(root, config_dict, language_code, UI_PADDING_X):
|
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
2023-02-22 16:05:44 +00:00
|
|
|
global lbl_tixcraft_sid
|
|
|
|
lbl_tixcraft_sid = Label(frame_group_header, text=translate[language_code]['tixcraft_sid'])
|
|
|
|
lbl_tixcraft_sid.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_tixcraft_sid
|
2024-03-08 01:11:16 +00:00
|
|
|
txt_tixcraft_sid_value = StringVar(frame_group_header, value=config_dict["advanced"]["tixcraft_sid"].strip())
|
2023-05-25 02:42:32 +00:00
|
|
|
txt_tixcraft_sid = Entry(frame_group_header, width=30, textvariable = txt_tixcraft_sid_value, show="*")
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_tixcraft_sid.grid(column=1, row=group_row_count, columnspan=2, sticky = W)
|
2023-02-22 16:05:44 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-02-26 08:39:37 +00:00
|
|
|
global lbl_ibon_ibonqware
|
|
|
|
lbl_ibon_ibonqware = Label(frame_group_header, text=translate[language_code]['ibon_ibonqware'])
|
|
|
|
lbl_ibon_ibonqware.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_ibon_ibonqware
|
2024-03-08 01:11:16 +00:00
|
|
|
txt_ibon_ibonqware_value = StringVar(frame_group_header, value=config_dict["advanced"]["ibonqware"].strip())
|
2023-05-25 02:42:32 +00:00
|
|
|
txt_ibon_ibonqware = Entry(frame_group_header, width=30, textvariable = txt_ibon_ibonqware_value, show="*")
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_ibon_ibonqware.grid(column=1, row=group_row_count, columnspan=2, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_password
|
|
|
|
lbl_password = Label(frame_group_header, text=translate[language_code]['password'])
|
|
|
|
lbl_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-02-26 08:39:37 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_facebook_account
|
|
|
|
lbl_facebook_account = Label(frame_group_header, text=translate[language_code]['facebook_account'])
|
|
|
|
lbl_facebook_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_facebook_account
|
|
|
|
txt_facebook_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["facebook_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_facebook_account = Entry(frame_group_header, width=15, textvariable = txt_facebook_account_value)
|
2023-02-11 05:36:27 +00:00
|
|
|
txt_facebook_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_facebook_password
|
|
|
|
txt_facebook_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["facebook_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_facebook_password = Entry(frame_group_header, width=15, textvariable = txt_facebook_password_value, show="*")
|
|
|
|
txt_facebook_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_kktix_account
|
|
|
|
lbl_kktix_account = Label(frame_group_header, text=translate[language_code]['kktix_account'])
|
|
|
|
lbl_kktix_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_kktix_account
|
|
|
|
txt_kktix_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["kktix_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_kktix_account = Entry(frame_group_header, width=15, textvariable = txt_kktix_account_value)
|
2023-02-11 05:36:27 +00:00
|
|
|
txt_kktix_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_kktix_password
|
|
|
|
txt_kktix_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["kktix_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_kktix_password = Entry(frame_group_header, width=15, textvariable = txt_kktix_password_value, show="*")
|
|
|
|
txt_kktix_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-11-01 10:35:28 +00:00
|
|
|
global lbl_fami_account
|
|
|
|
lbl_fami_account = Label(frame_group_header, text=translate[language_code]['fami_account'])
|
|
|
|
lbl_fami_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_fami_account
|
|
|
|
txt_fami_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["fami_account"].strip())
|
|
|
|
txt_fami_account = Entry(frame_group_header, width=15, textvariable = txt_fami_account_value)
|
|
|
|
txt_fami_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_fami_password
|
|
|
|
txt_fami_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["fami_password"].strip()))
|
|
|
|
txt_fami_password = Entry(frame_group_header, width=15, textvariable = txt_fami_password_value, show="*")
|
|
|
|
txt_fami_password.grid(column=2, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-08-19 12:49:51 +00:00
|
|
|
global lbl_cityline_account
|
|
|
|
lbl_cityline_account = Label(frame_group_header, text=translate[language_code]['cityline_account'])
|
|
|
|
lbl_cityline_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_cityline_account
|
|
|
|
txt_cityline_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["cityline_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_cityline_account = Entry(frame_group_header, width=15, textvariable = txt_cityline_account_value)
|
2023-08-19 12:49:51 +00:00
|
|
|
txt_cityline_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_cityline_password
|
|
|
|
txt_cityline_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["cityline_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_cityline_password = Entry(frame_group_header, width=15, textvariable = txt_cityline_password_value, show="*")
|
|
|
|
txt_cityline_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-08-19 12:49:51 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
2024-01-11 09:28:47 +00:00
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_urbtix_account
|
|
|
|
lbl_urbtix_account = Label(frame_group_header, text=translate[language_code]['urbtix_account'])
|
|
|
|
lbl_urbtix_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_urbtix_account
|
|
|
|
txt_urbtix_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["urbtix_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_urbtix_account = Entry(frame_group_header, width=15, textvariable = txt_urbtix_account_value)
|
2023-02-11 05:36:27 +00:00
|
|
|
txt_urbtix_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_urbtix_password
|
|
|
|
txt_urbtix_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["urbtix_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_urbtix_password = Entry(frame_group_header, width=15, textvariable = txt_urbtix_password_value, show="*")
|
|
|
|
txt_urbtix_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-02-12 09:49:55 +00:00
|
|
|
global lbl_hkticketing_account
|
|
|
|
lbl_hkticketing_account = Label(frame_group_header, text=translate[language_code]['hkticketing_account'])
|
|
|
|
lbl_hkticketing_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_hkticketing_account
|
|
|
|
txt_hkticketing_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["hkticketing_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_hkticketing_account = Entry(frame_group_header, width=15, textvariable = txt_hkticketing_account_value)
|
2023-02-12 09:49:55 +00:00
|
|
|
txt_hkticketing_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_hkticketing_password
|
|
|
|
txt_hkticketing_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["hkticketing_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_hkticketing_password = Entry(frame_group_header, width=15, textvariable = txt_hkticketing_password_value, show="*")
|
|
|
|
txt_hkticketing_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-02-12 09:49:55 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_kham_account
|
|
|
|
lbl_kham_account = Label(frame_group_header, text=translate[language_code]['kham_account'])
|
|
|
|
lbl_kham_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_kham_account
|
|
|
|
txt_kham_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["kham_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_kham_account = Entry(frame_group_header, width=15, textvariable = txt_kham_account_value)
|
2023-02-11 05:36:27 +00:00
|
|
|
txt_kham_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_kham_password
|
|
|
|
txt_kham_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["kham_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_kham_password = Entry(frame_group_header, width=15, textvariable = txt_kham_password_value, show="*")
|
|
|
|
txt_kham_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-02-11 05:36:27 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-10-06 06:43:53 +00:00
|
|
|
global lbl_ticket_account
|
|
|
|
lbl_ticket_account = Label(frame_group_header, text=translate[language_code]['ticket_account'])
|
|
|
|
lbl_ticket_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_ticket_account
|
|
|
|
txt_ticket_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["ticket_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_ticket_account = Entry(frame_group_header, width=15, textvariable = txt_ticket_account_value)
|
2023-10-06 06:43:53 +00:00
|
|
|
txt_ticket_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_ticket_password
|
|
|
|
txt_ticket_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["ticket_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_ticket_password = Entry(frame_group_header, width=15, textvariable = txt_ticket_password_value, show="*")
|
|
|
|
txt_ticket_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-10-06 06:43:53 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-11-24 08:31:38 +00:00
|
|
|
global lbl_udn_account
|
|
|
|
lbl_udn_account = Label(frame_group_header, text=translate[language_code]['udn_account'])
|
|
|
|
lbl_udn_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_udn_account
|
|
|
|
txt_udn_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["udn_account"].strip())
|
|
|
|
txt_udn_account = Entry(frame_group_header, width=15, textvariable = txt_udn_account_value)
|
|
|
|
txt_udn_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_udn_password
|
|
|
|
txt_udn_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["udn_password"].strip()))
|
|
|
|
txt_udn_password = Entry(frame_group_header, width=15, textvariable = txt_udn_password_value, show="*")
|
|
|
|
txt_udn_password.grid(column=2, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-06-29 03:45:07 +00:00
|
|
|
global lbl_ticketplus_account
|
|
|
|
lbl_ticketplus_account = Label(frame_group_header, text=translate[language_code]['ticketplus_account'])
|
|
|
|
lbl_ticketplus_account.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
global txt_ticketplus_account
|
|
|
|
txt_ticketplus_account_value = StringVar(frame_group_header, value=config_dict["advanced"]["ticketplus_account"].strip())
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_ticketplus_account = Entry(frame_group_header, width=15, textvariable = txt_ticketplus_account_value)
|
2023-06-29 03:45:07 +00:00
|
|
|
txt_ticketplus_account.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global txt_ticketplus_password
|
|
|
|
txt_ticketplus_password_value = StringVar(frame_group_header, value=decryptMe(config_dict["advanced"]["ticketplus_password"].strip()))
|
2023-10-07 05:31:33 +00:00
|
|
|
txt_ticketplus_password = Entry(frame_group_header, width=15, textvariable = txt_ticketplus_password_value, show="*")
|
|
|
|
txt_ticketplus_password.grid(column=2, row=group_row_count, sticky = W)
|
2023-06-29 03:45:07 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
2023-02-11 05:36:27 +00:00
|
|
|
global lbl_save_password_alert
|
|
|
|
lbl_save_password_alert = Label(frame_group_header, fg="red", text=translate[language_code]['save_password_alert'])
|
|
|
|
lbl_save_password_alert.grid(column=0, row=group_row_count, columnspan=2, sticky = E)
|
2023-02-09 17:23:46 +00:00
|
|
|
|
2022-11-16 17:52:38 +00:00
|
|
|
frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
def is_text_match_keyword(keyword_string, text):
|
|
|
|
is_match_keyword = True
|
|
|
|
if len(keyword_string) > 0 and len(text) > 0:
|
|
|
|
is_match_keyword = False
|
|
|
|
keyword_array = []
|
|
|
|
try:
|
|
|
|
keyword_array = json.loads("["+ keyword_string +"]")
|
|
|
|
except Exception as exc:
|
|
|
|
keyword_array = []
|
|
|
|
for item_list in keyword_array:
|
|
|
|
if len(item_list) > 0:
|
|
|
|
if ' ' in item_list:
|
|
|
|
keyword_item_array = item_list.split(' ')
|
|
|
|
is_match_all = True
|
|
|
|
for each_item in keyword_item_array:
|
|
|
|
if not each_item in text:
|
|
|
|
is_match_all = False
|
|
|
|
if is_match_all:
|
|
|
|
is_match_keyword = True
|
|
|
|
else:
|
|
|
|
if item_list in text:
|
|
|
|
is_match_keyword = True
|
|
|
|
else:
|
|
|
|
is_match_keyword = True
|
|
|
|
if is_match_keyword:
|
|
|
|
break
|
|
|
|
return is_match_keyword
|
|
|
|
|
|
|
|
def change_maxbot_status_by_keyword():
|
|
|
|
config_filepath, config_dict = load_json()
|
|
|
|
|
|
|
|
system_clock_data = datetime.now()
|
|
|
|
current_time = system_clock_data.strftime('%H:%M:%S')
|
|
|
|
#print('Current Time is:', current_time)
|
|
|
|
if len(config_dict["advanced"]["idle_keyword"]) > 0:
|
|
|
|
is_matched = is_text_match_keyword(config_dict["advanced"]["idle_keyword"], current_time)
|
|
|
|
if is_matched:
|
|
|
|
#print("match to idle:", current_time)
|
|
|
|
do_maxbot_idle()
|
|
|
|
if len(config_dict["advanced"]["resume_keyword"]) > 0:
|
|
|
|
is_matched = is_text_match_keyword(config_dict["advanced"]["resume_keyword"], current_time)
|
|
|
|
if is_matched:
|
|
|
|
#print("match to resume:", current_time)
|
|
|
|
do_maxbot_resume()
|
|
|
|
|
|
|
|
current_time = system_clock_data.strftime('%S')
|
|
|
|
if len(config_dict["advanced"]["idle_keyword_second"]) > 0:
|
|
|
|
is_matched = is_text_match_keyword(config_dict["advanced"]["idle_keyword_second"], current_time)
|
|
|
|
if is_matched:
|
|
|
|
#print("match to idle:", current_time)
|
|
|
|
do_maxbot_idle()
|
|
|
|
if len(config_dict["advanced"]["resume_keyword_second"]) > 0:
|
|
|
|
is_matched = is_text_match_keyword(config_dict["advanced"]["resume_keyword_second"], current_time)
|
|
|
|
if is_matched:
|
|
|
|
#print("match to resume:", current_time)
|
|
|
|
do_maxbot_resume()
|
|
|
|
|
2024-03-07 03:20:57 +00:00
|
|
|
check_maxbot_config_unsaved(config_dict)
|
|
|
|
|
|
|
|
def check_maxbot_config_unsaved(config_dict):
|
|
|
|
# alert not saved config.
|
2024-03-25 08:16:35 +00:00
|
|
|
global combo_homepage
|
2024-03-08 01:11:16 +00:00
|
|
|
global combo_ticket_number
|
2024-03-25 08:16:35 +00:00
|
|
|
|
2024-03-08 01:11:16 +00:00
|
|
|
global txt_date_keyword
|
|
|
|
global txt_area_keyword
|
|
|
|
global txt_keyword_exclude
|
|
|
|
|
2024-03-07 03:20:57 +00:00
|
|
|
global txt_idle_keyword
|
|
|
|
global txt_resume_keyword
|
|
|
|
global txt_idle_keyword_second
|
|
|
|
global txt_resume_keyword_second
|
|
|
|
|
|
|
|
try:
|
2024-03-17 07:02:25 +00:00
|
|
|
date_keyword = ""
|
|
|
|
if 'txt_date_keyword' in globals():
|
|
|
|
date_keyword = txt_date_keyword.get("1.0",END).strip()
|
|
|
|
date_keyword = format_config_keyword_for_json(date_keyword)
|
|
|
|
|
|
|
|
area_keyword = ""
|
|
|
|
if 'txt_area_keyword' in globals():
|
|
|
|
area_keyword = txt_area_keyword.get("1.0",END).strip()
|
|
|
|
area_keyword = format_config_keyword_for_json(area_keyword)
|
|
|
|
|
|
|
|
keyword_exclude = ""
|
|
|
|
if 'txt_keyword_exclude' in globals():
|
|
|
|
keyword_exclude = txt_keyword_exclude.get("1.0",END).strip()
|
|
|
|
keyword_exclude = format_config_keyword_for_json(keyword_exclude)
|
|
|
|
|
|
|
|
idle_keyword = ""
|
|
|
|
if 'txt_idle_keyword' in globals():
|
|
|
|
idle_keyword = txt_idle_keyword.get("1.0",END).strip()
|
|
|
|
idle_keyword = format_config_keyword_for_json(idle_keyword)
|
|
|
|
|
|
|
|
resume_keyword = ""
|
|
|
|
if 'txt_resume_keyword' in globals():
|
|
|
|
resume_keyword = txt_resume_keyword.get("1.0",END).strip()
|
|
|
|
resume_keyword = format_config_keyword_for_json(resume_keyword)
|
|
|
|
|
|
|
|
idle_keyword_second = ""
|
|
|
|
if 'txt_idle_keyword_second' in globals():
|
|
|
|
idle_keyword_second = txt_idle_keyword_second.get("1.0",END).strip()
|
|
|
|
idle_keyword_second = format_config_keyword_for_json(idle_keyword_second)
|
|
|
|
|
|
|
|
resume_keyword_second = ""
|
|
|
|
if 'txt_resume_keyword_second' in globals():
|
|
|
|
resume_keyword_second = txt_resume_keyword_second.get("1.0",END).strip()
|
|
|
|
resume_keyword_second = format_config_keyword_for_json(resume_keyword_second)
|
2024-03-07 03:20:57 +00:00
|
|
|
|
2024-03-25 08:16:35 +00:00
|
|
|
highlightthickness = 0
|
|
|
|
if 'combo_homepage' in globals():
|
|
|
|
if len(combo_homepage.get().strip())>0:
|
|
|
|
if config_dict["homepage"] != combo_homepage.get().strip():
|
|
|
|
highlightthickness = 2
|
|
|
|
|
|
|
|
if highlightthickness > 0:
|
|
|
|
showHideBlocks()
|
|
|
|
|
2024-03-08 01:11:16 +00:00
|
|
|
highlightthickness = 0
|
2024-03-17 07:02:25 +00:00
|
|
|
if 'combo_ticket_number' in globals():
|
|
|
|
if len(combo_ticket_number.get().strip())>0:
|
|
|
|
if config_dict["ticket_number"] != int(combo_ticket_number.get().strip()):
|
|
|
|
highlightthickness = 2
|
2024-03-25 08:16:35 +00:00
|
|
|
# fail, tkinter combobox border style is not working anymore
|
2024-03-08 01:11:16 +00:00
|
|
|
#combo_ticket_number.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["date_auto_select"]["date_keyword"] != date_keyword:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_date_keyword.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["area_auto_select"]["area_keyword"] != area_keyword:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_area_keyword.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["keyword_exclude"] != keyword_exclude:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_keyword_exclude.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
2024-03-07 03:20:57 +00:00
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["advanced"]["idle_keyword"] != idle_keyword:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_idle_keyword.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["advanced"]["resume_keyword"] != resume_keyword:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_resume_keyword.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["advanced"]["idle_keyword_second"] != idle_keyword_second:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_idle_keyword_second.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
|
|
|
|
highlightthickness = 0
|
|
|
|
if config_dict["advanced"]["resume_keyword_second"] != resume_keyword_second:
|
|
|
|
highlightthickness = 2
|
|
|
|
txt_resume_keyword_second.config(highlightthickness=highlightthickness, highlightbackground="red")
|
|
|
|
except Exception as exc:
|
2024-03-17 07:02:25 +00:00
|
|
|
#print(exc)
|
2024-03-07 03:20:57 +00:00
|
|
|
pass
|
|
|
|
|
2024-03-17 07:02:25 +00:00
|
|
|
def settgins_gui_timer():
|
2023-03-12 16:34:59 +00:00
|
|
|
while True:
|
2023-06-15 09:58:35 +00:00
|
|
|
btn_preview_text_clicked()
|
2024-01-11 09:28:47 +00:00
|
|
|
preview_question_text_file()
|
2023-06-16 16:04:55 +00:00
|
|
|
update_maxbot_runtime_status()
|
2024-01-21 11:41:11 +00:00
|
|
|
change_maxbot_status_by_keyword()
|
2024-01-16 09:21:20 +00:00
|
|
|
time.sleep(0.3)
|
|
|
|
if GLOBAL_SERVER_SHUTDOWN:
|
|
|
|
break
|
2023-06-16 16:04:55 +00:00
|
|
|
|
2024-01-06 17:44:06 +00:00
|
|
|
def clean_extension_status():
|
|
|
|
Root_Dir = get_app_root()
|
|
|
|
webdriver_path = os.path.join(Root_Dir, "webdriver")
|
2024-01-11 09:28:47 +00:00
|
|
|
target_path = os.path.join(webdriver_path, CONST_MAXBOT_EXTENSION_NAME)
|
2024-01-06 17:44:06 +00:00
|
|
|
target_path = os.path.join(target_path, "data")
|
2024-01-11 09:28:47 +00:00
|
|
|
target_path = os.path.join(target_path, CONST_MAXBOT_EXTENSION_STATUS_JSON)
|
2024-01-06 17:44:06 +00:00
|
|
|
if os.path.exists(target_path):
|
|
|
|
try:
|
|
|
|
os.unlink(target_path)
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
pass
|
|
|
|
|
|
|
|
def sync_status_to_extension(status):
|
|
|
|
Root_Dir = get_app_root()
|
|
|
|
webdriver_path = os.path.join(Root_Dir, "webdriver")
|
2024-01-11 09:28:47 +00:00
|
|
|
target_path = os.path.join(webdriver_path, CONST_MAXBOT_EXTENSION_NAME)
|
2024-01-06 17:44:06 +00:00
|
|
|
target_path = os.path.join(target_path, "data")
|
2024-01-11 09:28:47 +00:00
|
|
|
target_path = os.path.join(target_path, CONST_MAXBOT_EXTENSION_STATUS_JSON)
|
2024-01-06 17:44:06 +00:00
|
|
|
#print("save as to:", target_path)
|
|
|
|
status_json={}
|
|
|
|
status_json["status"]=status
|
|
|
|
#print("dump json to path:", target_path)
|
|
|
|
with open(target_path, 'w') as outfile:
|
|
|
|
json.dump(status_json, outfile)
|
|
|
|
|
2023-03-12 17:08:23 +00:00
|
|
|
def update_maxbot_runtime_status():
|
2023-03-12 16:34:59 +00:00
|
|
|
is_paused = False
|
|
|
|
if os.path.exists(CONST_MAXBOT_INT28_FILE):
|
|
|
|
is_paused = True
|
|
|
|
|
2024-01-06 17:44:06 +00:00
|
|
|
sync_status_to_extension(not is_paused)
|
|
|
|
|
2024-03-17 07:02:25 +00:00
|
|
|
global combo_language
|
|
|
|
global lbl_maxbot_status_data
|
2023-03-12 16:34:59 +00:00
|
|
|
try:
|
2024-03-25 08:16:35 +00:00
|
|
|
language_code = ""
|
2024-03-17 07:02:25 +00:00
|
|
|
if 'combo_language' in globals():
|
|
|
|
new_language = combo_language.get().strip()
|
|
|
|
language_code=get_language_code_by_name(new_language)
|
2023-03-12 17:08:23 +00:00
|
|
|
|
2024-03-25 08:16:35 +00:00
|
|
|
if len(language_code) > 0:
|
|
|
|
maxbot_status = translate[language_code]['status_enabled']
|
|
|
|
if is_paused:
|
|
|
|
maxbot_status = translate[language_code]['status_paused']
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2024-03-25 08:16:35 +00:00
|
|
|
if 'lbl_maxbot_status_data' in globals():
|
|
|
|
lbl_maxbot_status_data.config(text=maxbot_status)
|
2023-03-12 16:34:59 +00:00
|
|
|
|
|
|
|
global btn_idle
|
|
|
|
global btn_resume
|
|
|
|
|
|
|
|
if not is_paused:
|
|
|
|
btn_idle.grid(column=1, row=0)
|
|
|
|
btn_resume.grid_forget()
|
|
|
|
else:
|
|
|
|
btn_resume.grid(column=2, row=0)
|
|
|
|
btn_idle.grid_forget()
|
|
|
|
|
|
|
|
global lbl_maxbot_last_url_data
|
|
|
|
last_url = read_last_url_from_file()
|
2023-03-15 15:40:05 +00:00
|
|
|
if len(last_url) > 60:
|
|
|
|
last_url=last_url[:60]+"..."
|
2024-03-17 07:02:25 +00:00
|
|
|
if 'lbl_maxbot_last_url_data' in globals():
|
|
|
|
lbl_maxbot_last_url_data.config(text=last_url)
|
2024-01-21 11:41:11 +00:00
|
|
|
|
|
|
|
system_clock_data = datetime.now()
|
|
|
|
current_time = system_clock_data.strftime('%H:%M:%S')
|
|
|
|
#print('Current Time is:', current_time)
|
2024-03-17 07:02:25 +00:00
|
|
|
|
|
|
|
global lbl_system_clock_data
|
|
|
|
if 'lbl_system_clock_data' in globals():
|
|
|
|
lbl_system_clock_data.config(text=current_time)
|
2024-03-07 03:20:57 +00:00
|
|
|
|
2023-03-12 16:34:59 +00:00
|
|
|
except Exception as exc:
|
2024-01-21 11:41:11 +00:00
|
|
|
#print(exc)
|
2023-03-12 16:34:59 +00:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def RuntimeTab(root, config_dict, language_code, UI_PADDING_X):
|
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
|
|
|
|
|
|
|
maxbot_status = ""
|
|
|
|
global lbl_maxbot_status
|
|
|
|
lbl_maxbot_status = Label(frame_group_header, text=translate[language_code]['running_status'])
|
|
|
|
lbl_maxbot_status.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
frame_maxbot_interrupt = Frame(frame_group_header)
|
|
|
|
|
|
|
|
global lbl_maxbot_status_data
|
|
|
|
lbl_maxbot_status_data = Label(frame_maxbot_interrupt, text=maxbot_status)
|
|
|
|
lbl_maxbot_status_data.grid(column=0, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
global btn_idle
|
|
|
|
global btn_resume
|
|
|
|
|
|
|
|
btn_idle = ttk.Button(frame_maxbot_interrupt, text=translate[language_code]['idle'], command= lambda: btn_idle_clicked(language_code) )
|
|
|
|
btn_idle.grid(column=1, row=0)
|
|
|
|
|
|
|
|
btn_resume = ttk.Button(frame_maxbot_interrupt, text=translate[language_code]['resume'], command= lambda: btn_resume_clicked(language_code))
|
|
|
|
btn_resume.grid(column=2, row=0)
|
|
|
|
|
|
|
|
frame_maxbot_interrupt.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_maxbot_last_url
|
|
|
|
lbl_maxbot_last_url = Label(frame_group_header, text=translate[language_code]['running_url'])
|
|
|
|
lbl_maxbot_last_url.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
last_url = ""
|
|
|
|
global lbl_maxbot_last_url_data
|
|
|
|
lbl_maxbot_last_url_data = Label(frame_group_header, text=last_url)
|
|
|
|
lbl_maxbot_last_url_data.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
2024-01-21 11:41:11 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_system_clock
|
|
|
|
lbl_system_clock = Label(frame_group_header, text=translate[language_code]['system_clock'])
|
|
|
|
lbl_system_clock.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
|
|
|
system_clock = ""
|
|
|
|
global lbl_system_clock_data
|
|
|
|
lbl_system_clock_data = Label(frame_group_header, text=system_clock)
|
|
|
|
lbl_system_clock_data.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_idle_keyword
|
|
|
|
lbl_idle_keyword = Label(frame_group_header, text=translate[language_code]['idle_keyword'])
|
|
|
|
lbl_idle_keyword.grid(column=0, row=group_row_count, sticky = E+N)
|
|
|
|
|
|
|
|
global txt_idle_keyword
|
|
|
|
txt_idle_keyword = Text(frame_group_header, width=30, height=4)
|
|
|
|
txt_idle_keyword.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_idle_keyword.insert("1.0", config_dict["advanced"]["idle_keyword"].strip())
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_resume_keyword
|
|
|
|
lbl_resume_keyword = Label(frame_group_header, text=translate[language_code]['resume_keyword'])
|
|
|
|
lbl_resume_keyword.grid(column=0, row=group_row_count, sticky = E+N)
|
|
|
|
|
|
|
|
global txt_resume_keyword
|
|
|
|
txt_resume_keyword = Text(frame_group_header, width=30, height=4)
|
|
|
|
txt_resume_keyword.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_resume_keyword.insert("1.0", config_dict["advanced"]["resume_keyword"].strip())
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_idle_keyword_second
|
|
|
|
lbl_idle_keyword_second = Label(frame_group_header, text=translate[language_code]['idle_keyword_second'])
|
|
|
|
lbl_idle_keyword_second.grid(column=0, row=group_row_count, sticky = E+N)
|
|
|
|
|
|
|
|
global txt_idle_keyword_second
|
|
|
|
txt_idle_keyword_second = Text(frame_group_header, width=30, height=4)
|
|
|
|
txt_idle_keyword_second.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_idle_keyword_second.insert("1.0", config_dict["advanced"]["idle_keyword_second"].strip())
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
global lbl_resume_keyword_second
|
|
|
|
lbl_resume_keyword_second = Label(frame_group_header, text=translate[language_code]['resume_keyword_second'])
|
|
|
|
lbl_resume_keyword_second.grid(column=0, row=group_row_count, sticky = E+N)
|
|
|
|
|
|
|
|
global txt_resume_keyword_second
|
|
|
|
txt_resume_keyword_second = Text(frame_group_header, width=30, height=4)
|
|
|
|
txt_resume_keyword_second.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
txt_resume_keyword_second.insert("1.0", config_dict["advanced"]["resume_keyword_second"].strip())
|
|
|
|
|
2023-03-12 16:34:59 +00:00
|
|
|
frame_group_header.grid(column=0, row=row_count, padx=UI_PADDING_X)
|
2023-03-12 17:08:23 +00:00
|
|
|
update_maxbot_runtime_status()
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
def AboutTab(root, language_code):
|
|
|
|
row_count = 0
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
frame_group_header = Frame(root)
|
|
|
|
group_row_count = 0
|
2022-11-10 14:02:26 +00:00
|
|
|
|
2022-11-14 09:26:52 +00:00
|
|
|
logo_filename = "maxbot_logo2_single.ppm"
|
|
|
|
logo_img = PhotoImage(file=logo_filename)
|
|
|
|
|
|
|
|
lbl_logo = Label(frame_group_header, image=logo_img)
|
|
|
|
lbl_logo.image = logo_img
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_logo.grid(column=0, row=group_row_count, columnspan=2)
|
2022-11-10 17:19:03 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
group_row_count +=1
|
2022-11-10 14:02:26 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
global lbl_slogan
|
|
|
|
global lbl_help
|
|
|
|
global lbl_donate
|
|
|
|
global lbl_release
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_slogan = Label(frame_group_header, text=translate[language_code]['maxbot_slogan'], wraplength=400, justify="center")
|
|
|
|
lbl_slogan.grid(column=0, row=group_row_count, columnspan=2)
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_help = Label(frame_group_header, text=translate[language_code]['help'])
|
|
|
|
lbl_help.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_help_url = Label(frame_group_header, text=URL_HELP, fg="blue", bg="gray", cursor="hand2")
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_help_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_help_url.bind("<Button-1>", lambda e: open_url(URL_HELP))
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_donate = Label(frame_group_header, text=translate[language_code]['donate'])
|
|
|
|
lbl_donate.grid(column=0, row=group_row_count, sticky = E)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_donate_url = Label(frame_group_header, text=URL_DONATE, fg="blue", bg="gray", cursor="hand2")
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_donate_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_donate_url.bind("<Button-1>", lambda e: open_url(URL_DONATE))
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_release = Label(frame_group_header, text=translate[language_code]['release'])
|
|
|
|
lbl_release.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_release_url = Label(frame_group_header, text=URL_RELEASE, fg="blue", bg="gray", cursor="hand2")
|
2022-11-13 18:34:22 +00:00
|
|
|
lbl_release_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_release_url.bind("<Button-1>", lambda e: open_url(URL_RELEASE))
|
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_fb_fans = Label(frame_group_header, text=u'Facebook')
|
|
|
|
lbl_fb_fans.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_fb_fans_url = Label(frame_group_header, text=URL_FB, fg="blue", bg="gray", cursor="hand2")
|
2022-11-16 15:43:53 +00:00
|
|
|
lbl_fb_fans_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_fb_fans_url.bind("<Button-1>", lambda e: open_url(URL_FB))
|
|
|
|
|
2023-02-07 16:42:04 +00:00
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_chrome_driver = Label(frame_group_header, text=u'Chrome Driver')
|
|
|
|
lbl_chrome_driver.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_chrome_driver_url = Label(frame_group_header, text=URL_CHROME_DRIVER, fg="blue", bg="gray", cursor="hand2")
|
2023-02-07 16:42:04 +00:00
|
|
|
lbl_chrome_driver_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_chrome_driver_url.bind("<Button-1>", lambda e: open_url(URL_CHROME_DRIVER))
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_firefox_driver = Label(frame_group_header, text=u'Firefox Driver')
|
|
|
|
lbl_firefox_driver.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_firefox_driver_url = Label(frame_group_header, text=URL_FIREFOX_DRIVER, fg="blue", bg="gray", cursor="hand2")
|
2023-02-07 16:42:04 +00:00
|
|
|
lbl_firefox_driver_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_firefox_driver_url.bind("<Button-1>", lambda e: open_url(URL_FIREFOX_DRIVER))
|
|
|
|
|
|
|
|
group_row_count +=1
|
|
|
|
|
|
|
|
lbl_edge_driver = Label(frame_group_header, text=u'Edge Driver')
|
|
|
|
lbl_edge_driver.grid(column=0, row=group_row_count, sticky = E)
|
|
|
|
|
2023-08-20 05:28:58 +00:00
|
|
|
lbl_edge_driver_url = Label(frame_group_header, text=URL_EDGE_DRIVER, fg="blue", bg="gray", cursor="hand2")
|
2023-02-07 16:42:04 +00:00
|
|
|
lbl_edge_driver_url.grid(column=1, row=group_row_count, sticky = W)
|
|
|
|
lbl_edge_driver_url.bind("<Button-1>", lambda e: open_url(URL_EDGE_DRIVER))
|
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
frame_group_header.grid(column=0, row=row_count)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
def get_action_bar(root, language_code):
|
2022-11-16 15:43:53 +00:00
|
|
|
frame_action = Frame(root)
|
|
|
|
|
2022-11-21 19:01:04 +00:00
|
|
|
global btn_run
|
|
|
|
global btn_save
|
|
|
|
global btn_exit
|
2022-12-27 15:38:13 +00:00
|
|
|
global btn_restore_defaults
|
2023-02-26 08:39:37 +00:00
|
|
|
global btn_launcher
|
2022-11-21 19:01:04 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
btn_run = ttk.Button(frame_action, text=translate[language_code]['run'], command= lambda: btn_run_clicked(language_code))
|
2022-11-16 15:43:53 +00:00
|
|
|
btn_run.grid(column=0, row=0)
|
|
|
|
|
2024-03-15 04:06:18 +00:00
|
|
|
btn_save = ttk.Button(frame_action, text=translate[language_code]['save'], command= lambda: btn_save_clicked() )
|
2022-11-16 15:43:53 +00:00
|
|
|
btn_save.grid(column=1, row=0)
|
|
|
|
|
|
|
|
btn_exit = ttk.Button(frame_action, text=translate[language_code]['exit'], command=btn_exit_clicked)
|
2022-12-27 15:38:13 +00:00
|
|
|
#btn_exit.grid(column=2, row=0)
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2023-03-03 14:05:20 +00:00
|
|
|
btn_launcher = ttk.Button(frame_action, text=translate[language_code]['config_launcher'], command= lambda: btn_launcher_clicked(language_code))
|
|
|
|
btn_launcher.grid(column=2, row=0)
|
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
btn_restore_defaults = ttk.Button(frame_action, text=translate[language_code]['restore_defaults'], command= lambda: btn_restore_defaults_clicked(language_code))
|
2023-03-03 14:05:20 +00:00
|
|
|
btn_restore_defaults.grid(column=3, row=0)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
return frame_action
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
def clearFrame(frame):
|
|
|
|
# destroy all widgets from frame
|
|
|
|
for widget in frame.winfo_children():
|
|
|
|
widget.destroy()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
def load_GUI(root, config_dict):
|
|
|
|
clearFrame(root)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
language_code="en_us"
|
|
|
|
if not config_dict is None:
|
|
|
|
if u'language' in config_dict:
|
|
|
|
language_code = get_language_code_by_name(config_dict["language"])
|
|
|
|
|
|
|
|
row_count = 0
|
|
|
|
|
|
|
|
global tabControl
|
|
|
|
tabControl = ttk.Notebook(root)
|
|
|
|
tab1 = Frame(tabControl)
|
|
|
|
tabControl.add(tab1, text=translate[language_code]['preference'])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
tab2 = Frame(tabControl)
|
2022-11-16 15:43:53 +00:00
|
|
|
tabControl.add(tab2, text=translate[language_code]['advanced'])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2022-11-16 15:43:53 +00:00
|
|
|
tab3 = Frame(tabControl)
|
2023-06-19 09:31:57 +00:00
|
|
|
tabControl.add(tab3, text=translate[language_code]['verification_word'])
|
2023-02-11 05:36:27 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
global tab4
|
2023-02-11 05:36:27 +00:00
|
|
|
tab4 = Frame(tabControl)
|
2024-01-11 09:28:47 +00:00
|
|
|
tabControl.add(tab4, text=translate[language_code]['maxbot_server'])
|
2023-03-12 16:34:59 +00:00
|
|
|
|
|
|
|
tab5 = Frame(tabControl)
|
2024-01-11 09:28:47 +00:00
|
|
|
tabControl.add(tab5, text=translate[language_code]['autofill'])
|
2023-06-19 09:31:57 +00:00
|
|
|
|
|
|
|
tab6 = Frame(tabControl)
|
2024-01-11 09:28:47 +00:00
|
|
|
tabControl.add(tab6, text=translate[language_code]['runtime'])
|
|
|
|
|
|
|
|
tab7 = Frame(tabControl)
|
|
|
|
tabControl.add(tab7, text=translate[language_code]['about'])
|
2023-03-12 16:34:59 +00:00
|
|
|
|
2022-11-13 18:34:22 +00:00
|
|
|
tabControl.grid(column=0, row=row_count)
|
|
|
|
tabControl.select(tab1)
|
|
|
|
|
|
|
|
row_count+=1
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
frame_action = get_action_bar(root, language_code)
|
2022-11-13 18:34:22 +00:00
|
|
|
frame_action.grid(column=0, row=row_count)
|
|
|
|
|
|
|
|
global UI_PADDING_X
|
|
|
|
PreferenctTab(tab1, config_dict, language_code, UI_PADDING_X)
|
2022-11-16 15:43:53 +00:00
|
|
|
AdvancedTab(tab2, config_dict, language_code, UI_PADDING_X)
|
2023-06-19 09:31:57 +00:00
|
|
|
VerificationTab(tab3, config_dict, language_code, UI_PADDING_X)
|
2024-01-11 09:28:47 +00:00
|
|
|
ServerTab(tab4, config_dict, language_code, UI_PADDING_X)
|
|
|
|
AutofillTab(tab5, config_dict, language_code, UI_PADDING_X)
|
|
|
|
RuntimeTab(tab6, config_dict, language_code, UI_PADDING_X)
|
|
|
|
AboutTab(tab7, language_code)
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2022-12-27 15:38:13 +00:00
|
|
|
|
2024-03-15 07:55:38 +00:00
|
|
|
def main_gui():
|
2022-12-27 15:38:13 +00:00
|
|
|
global translate
|
|
|
|
# only need to load translate once.
|
|
|
|
translate = load_translate()
|
|
|
|
|
|
|
|
global config_filepath
|
|
|
|
global config_dict
|
|
|
|
# only need to load json file once.
|
|
|
|
config_filepath, config_dict = load_json()
|
|
|
|
|
|
|
|
global root
|
|
|
|
root = Tk()
|
2024-03-07 03:20:57 +00:00
|
|
|
#root = customtkinter.CTk()
|
2022-12-27 15:38:13 +00:00
|
|
|
root.title(CONST_APP_VERSION)
|
|
|
|
|
|
|
|
global UI_PADDING_X
|
|
|
|
UI_PADDING_X = 15
|
|
|
|
|
|
|
|
load_GUI(root, config_dict)
|
|
|
|
|
2023-12-13 16:32:10 +00:00
|
|
|
GUI_SIZE_WIDTH = 580
|
2024-03-25 04:26:45 +00:00
|
|
|
GUI_SIZE_HEIGHT = 610
|
2022-12-27 15:38:13 +00:00
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
GUI_SIZE_MACOS = str(GUI_SIZE_WIDTH) + 'x' + str(GUI_SIZE_HEIGHT)
|
2023-06-19 12:55:33 +00:00
|
|
|
GUI_SIZE_WINDOWS=str(GUI_SIZE_WIDTH-60) + 'x' + str(GUI_SIZE_HEIGHT-70)
|
2019-10-01 17:52:13 +00:00
|
|
|
|
|
|
|
GUI_SIZE =GUI_SIZE_MACOS
|
2022-11-16 15:43:53 +00:00
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
if platform.system() == 'Windows':
|
2022-11-10 14:02:26 +00:00
|
|
|
GUI_SIZE = GUI_SIZE_WINDOWS
|
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
root.geometry(GUI_SIZE)
|
2022-11-11 16:46:36 +00:00
|
|
|
|
2020-12-01 18:28:56 +00:00
|
|
|
# for icon.
|
|
|
|
icon_filepath = 'tmp.ico'
|
|
|
|
|
|
|
|
# icon format.
|
|
|
|
iconImg = 'AAABAAEAAAAAAAEAIAD4MgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAEAAAABAAgGAAAAXHKoZgAAAAFzUkdCAK7OHOkAAABQZVhJZk1NACoAAAAIAAIBEgADAAAAAQABAACHaQAEAAAAAQAAACYAAAAAAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAQCgAwAEAAAAAQAAAQAAAAAAdTc0VwAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAMPFJREFUeAHtndmTJNd13rP36e7pWXt6OFiHGAxACssApChTskRZom1J3ETS9ov/AIclO/Tm8JMj/OxQBMNhO0IRdvjNtB0SSYirTFEiJZoSTBAidoAAZjCYAYazb73M9O7vdzKzOqu6qmvLyr5VeW5MT3VXVea997s3v3vOueecO/SlmYnNyIsj4AiUEoHhUvbaO+0IOAKGgBOATwRHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECDgBlHjwveuOgBOAzwFHoMQIOAGUePC9646AE4DPAUegxAg4AZR48L3rjoATgM8BR6DECIzuWt83N3et6oGpeGioflf6FFtmhPWoUb/q9zafd4VZpf587ljIXSpt7hCz4glADR0ZH49GJiai4dHRaGh4JErbbvOW/2wweAVD+68QMPupks2NzWhlfj7a3FivavbQ8HA0PjMjXPtRuBuK1u7eidbu3KnqUxF/jAmzkbFxVdVv820o2lhbjVYWFuy5aRer4glALYQAJg/PRlNzc9H00Q/o9aj9znt7Dh6MJvbtj8amp6ORPXs0KGPR0MiIloYhWx02Y5aAI+IO2y/tdru/v8/DffPM6eh7f/D70Z1r1wRNLAlsbmxEhz704eiTX/pP0fi+fR1NiN1EhnF+/X99OfrJl/6wMAJjPk3NHok++R//c3TgoRMi1I3dhKDtusHswt/+KPrBv/030cbqStvXF08AAnzl9u1oWT9MYiYvnRgeHYtG90zYgz8+s09EcCianD0cTR2Zi6ZEEtMpSRw5Ek3qs4n9B6KxvXuj0clJkyTa7nmfXzD/3nvRqlg/ffjpDpN37tRT0T2//CuFPUB5w3jw5MlC2765vh7d92ufiD7425+yhSnv/hRxv6uvvhJtSgropBRPALQyWc3TBjMI6/xI/Lt784Zmsj4RUcSrPd/XP6kKqAwj4yKJqSkTcycOHIgmDx2OJkUK00clRSREwd+8z+eQydjUpF1nkkRaaZ+/XnnpBROVs33i96NPfaTQByhvGMen91r7i1qJmUuPfPGf9u3DD/4LF96PNvT8dKL27Q4BNJo1Rgw87fEXkpfKtyGKtaXFaFU/S1cuV5OEvgUAw0gTUjGQDMYlIUzsOxDtOSRpQqRgKsecpAmRxaQki8nZROUQSYxK5RjFLiGVI/SysbYWXX7pRSPICkYizHH14ciTp0Jv/o7tG4MANIZFEADzafaxx6P7fvUTO7Yp9A8Xf37B8Op/AmgF6VR60Cul8gAk1yI1rC8vS5q4G929fl0k8e6WJMH3uR6S0IM+KhsDtgb05T0HUDkSuwTqhtkmpH5IP4RAzC6ByqFrIJis6J1UXdgL/brx5s+q2kC/p4/dEx04caKwdvSiIlZkJL2NFemzyRj3oh67pxaME5/9XRv3ntXR4xtDYgsXL3ZcS1gSQMfdqHMhD3oDkuDbG6uynGqSLd+6FUUXxKB6gPRffCOuRZrQREQqGDWVA5KQNHE4sUuIJEztgCwkXeyRysHnWOBHJ6dsl6MTRq7Tk21v3X73bDQvsS97f1bMQ49+yNqy7YI+egOsi5DCwGvvPfdGJz71mT5CZ3tT15bvRkuXLm1fCbd/te47g0sAdbtb82YTkoBdVxcXoxX9LF1uoHKIJIa1fTQmlQOjZGyXQJpA5ciQhHY80l0Os0tMQxKSJnR9u+Xqa6+aITW7QkJ2GABpSz8XCICdH6i4VrrLs18QwAO/8ZvRwUcezfO2hd9rdWFRO0FXK4tduw1of/a1W0O/fx+SoA96tRf7f+s/JtK6WBgD5p3r16JIq3PFeKmvVascIgmpHBP7k12OZCvUjJcYMc0ukVU5ZJfYIwMmdomkfmrGAIgdIEse2Dzmnnp6q2F9+hsqFoZek8Yyfc61O5L0sA898oV/UoVhrnUUdDMk2OVbN1VbZ3TpBJDXQEEUDUiCKrZUjpuy2r4XaxuJymEkYSrHmHwf0l2OfbE0AUlgwBRB4DOx58DB6MKzz1bq4t6QEEbOQ498iD/7uqBygUEvC3hBlvd8/Fd6WU0h976rRQcnoHTutVupE0C7iHXz/WYksb4WbSzEXl2L6HUiiCppItnlMPFYhsy0bG5uRAdPPCwj4LH0rb59xUN0VKpRzJC96QZG4Id/9wtGsL2pobi7Ll6+ZAbvrITYTu1OAO2gVcR3IQnqaSBNZAmh0hwxAtt/WND7vWDDwIjaq8Lqv//B49EHf+t3elVFofdd1A7AugzanUoA/egwXijA/VAZrtVzcgAahGLbsyKyODQn/x5BoA/+o39sbr/53734O8Y+ANXxIO20wgmgHbQC/C4TGrfp2V94LMDWtd8kDJsmySQ7su3fYYcrhBX+HCc//8WqLdQdrgj+o4Wf/1zqUufNdALoHLswrpRIu+/48Wjm/vvDaE+XrcCTk52SXpQNYfWBX/yYfn6pF7cv/J7rK8vyAejcCYgGOwEUPmz5VogEcOSxJ7S1uD/fG+/S3TDQ4U/RizIi6YLVny3AQShrS0tyib/Ssf4PBk4AfT4TEJnnnmb/v7N94BC7T0BQ3sWMfw+diI5L/x+Usqx8EHdvyN09MRh30i8ngE5QC+Uarf64Hh954slQWpRLO0wCyJvPhBWW/30PPJhLG0O4yfKNG0oKc7srCaCYbUAYSgNAsW0sfk//jt+1//2/xggMDQ1vM1yxqs3ce1+0//gHG1/Yh59YRqM8JRrNNQK6Tmrvf5AK4v+q1IBuJICeEwDbOkTUEYpLIA2ebHGMfhwww+cE
|
|
|
|
if platform.system() == 'Linux':
|
|
|
|
# PNG format.
|
|
|
|
iconImg = 'iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAABcWlDQ1BpY2MAACiRdZE9S8NQFIbfttaKVjroIOKQoUqHFoqCOGoduhQptYJVl+Q2aYUkDTcpUlwFF4eCg+ji1+A/0FVwVRAERRBx8Bf4tUiJ5zaFFmlPuDkP7z3v4d5zAX9GZ4bdlwQM0+G5dEpaLaxJoXeE4UMQMfTLzLYWstkMesbPI9VSPCREr951XWOoqNoM8A0QzzKLO8TzxJktxxK8RzzKynKR+IQ4zumAxLdCVzx+E1zy+Eswz+cWAb/oKZU6WOlgVuYGcYw4auhV1jqPuElYNVeWKY/TmoCNHNJIQYKCKjahw0GCskkz6+5LNn1LqJCH0d9CDZwcJZTJGye1Sl1VyhrpKn06amLu/+dpazPTXvdwCgi+uu7nJBDaBxp11/09dd3GGRB4Aa7Ntr9Cc5r7Jr3e1qLHQGQHuLxpa8oBcLULjD1bMpebUoCWX9OAjwtguACM3AOD696sWvs4fwLy2/REd8DhETBF9ZGNP5NzZ9j92udAAAAACXBIWXMAAAsSAAALEgHS3X78AAAgAElEQVR4Xu1d+ZMdV3W+s2s0GmkkzYwsa7EsWbLBi7wAAcIScBbCYjBJfskfkAokxW+p/JSq/JyiypVKUkVVUvktJCmwMYsxYTUQg4MxWJIl29qsxZIlzYyW2ffJ953ufuq3Tfd7vbz7+p6bUmys9/r1/e7tr88595zvdDw12LdmdCgCioCTCHQ6OWudtCKgCAgCSgC6ERQBhxFQAnB48XXqioASgO4BRcBhBJQAHF58nboioASge0ARcBgBJQCHF1+nrggoAegeUAQcRkAJwOHF16krAkoAugcUAYcRUAJwePF16oqAEoDuAUXAYQSUABxefJ26IqAEoHtAEXAYASUAhxdfp64IKAHoHlAEHEZACcDhxdepKwJKALoHFAGHEVACcHjxdeqKgBKA7gFFwGEElAAcXnyduiKgBKB7QBFwGAElAIcXX6euCCgB6B5QBBxGQAnA4cXXqSsCSgC6BxQBhxFQAnB48XXqioASgO4BRcBhBJQAHF58nboioASge0ARcBgBJQCHF1+nrggoAegeUAQcRkAJwOHF16krAkoAugcUAYcRUAJwePF16oqAEoDuAUXAYQSUABxefJ26IqAEoHtAEXAYASUAhxdfp64IKAHoHlAEHEZACcDhxdepKwJKALoHFAGHEVACcHjxdeqKgBKA7gFFwGEElAAcXnyduiKgBKB7QBFwGAElAIcXX6euCCgB6B5QBBxGQAnA4cXXqSsCSgC6BxQBhxFQAnB48XXqioASgO4BRcBhBJQAHF58nboioASge0ARcBgBJQCHF1+nrggoAegeUAQcRkAJwOHF16krAkoAugcUAYcRUAJwePF16oqAEoDuAUXAYQSUABxefJ26IqAEoHtAEXAYASUAhxdfp64IKAHoHlAEHEZACcDhxdepKwJKALoHFAGHEehu2dzX1lr204X54Y6O2lNpU2y5I2RG9eaV5cIBs9LvZ/k7KV87KWb5EwAWt6u313T19ZnO7m7T0dlVWm/Zt/x/shj8J9FSoqi1Z9ZW18zi1JRZW10p++uOzk7TOzgIXNvRuOswy/NzZnluLuXHJPpyPcCsq6e3Dfdbh1ldXjKL09Pes9PgyJ8AcIMkgP7tw2bj6KgZ2HEH/rlD/p3/bcPWraZv8xbTMzBgujZswKL0mI6uLnkr8O2w5rGEN1efLBqcc9t/nA/3zbNnzA+/9EUzNzEBaDxLYG111Wy7713m8af+yfRu3tzUhmglOFzn1//rq+bXT305NwLjfto4PGIe/8d/NkP7DwiG7TSI2eVfvmhe+Nu/MatLiw3fev4EAMAXJyfNAv5wE3PzchKd3T2me0OfPPi9g5tBBNtM//B2s3Fk1GwESQwEJDEyYvrxd31bhkzPpk2mu79fLAnXxtTbb5slsH7w8AcEMHr4YXPnBz6Y2wOUNu5bDx7M9d7XVlbM7g9/xNz9iU/Ki6kdx/jx18warIBmRmueHP9tHtwwF2GFf2D+zd+84Vn9dAMCkwYvOLoKfNC7ekESGzeKmds3NGT6t203/SCFgR2wInyi4P/mf+ffk0x6NvbL98SSKMgYO/qqmMrhOfHfdzz8aK4PUNpw9g5skvvP603MvXTo83/atg8/8Z++fMms4vlpxu1rDQHU2zVCDHzavQ9UhrhIFMuzM2YJf2bHrpWTBD+PjdNJawJMTsugFxZC3+Yhs2EbrAmQgrgco7AmQBb9sCz6h32XAyTRDcujm3EJuBy2j9XlZXPt6BEhyBJG+PdezGHkocO23/6699dDAsAa5kEA3E/D9z9gdn/oI22N2cw7lwWv9ieAOMsQWA++31tFEngQVhYWYE3Mm/nr10ES529bEiSJwOXAg96NGIO4HPCXNwzR5fDjEnQ3JDYB9wP+IQlE4hJ0OfAdEkzY9I5z22l+hvO6cfLNcvMf8x7YeacZOnAgzZ/K/Vp8I9PSW12EP5v1aQBeGAc+81lZ93YdJLHpK1eavn27LICmp1Hji3zQ65AEP726hMgpNtnCrVvGXAaDhgOK/C6tCWxEWgXd4nKQJGBNbPfjEiAJcTtIFrAuNsDl4N/TNenu3yinHM0wchwIJs+fM1Mw+8LXlwDgvffJvbTzINZ5WGHEa9Odu8yBT366neEyywvzZvbq1WpzOeasiksAcQCIIAmy69LMjFnEn9lrdVwOkEQnjo964HLQQvDiErQm6HKESCJ0yiFxiQGSBKyJJgKY4yeOSyA1/IYk2TEAyHtp50EC4MlP1mfyJIC9H/u42Xro3naGC4HgGZwEjTdtkbpNAHGWPsrlwEZaAQszgDl3fcIYvJ1LwcsqlwMkAZejb4t/yuEfhUrwktaExCXCLgfiEhsQwGRcImQOMwDIOECYPBjzGH34kTgzsvozdLEYsJUj3qxcAMZLQNaHnvyTpgjYJgBpwS7cusmd1tRtKQE0BVsSl+MmorZv385jCEhCXI4e5D4EpxybPWuCJMEAJgiCORMbhraayy+9VHX8xyDntkP3pTWbll2HLhcxyHLw7U+yvPP9H8zyZ3K59jxeOkwCajYmpQSQyzL5PxIVl1hZNqvTXlbXDP268FEoicI/5RDzOHSkuba2arYeuAdBwJ15ziaT32LspBuuUTNZbXFviNjd89knhWDbfcxcuyoB72atJSUA23ZAlMtRK90TjMDjP0bQ230whsEgalaDb/8td+0zd//RH2f1E7ledwYnACsIaDdrAbRjwniuALfDjzGDbRQJQEUYPAFgINArzUl/MD5z1x/8oaT9FmF4OQDl9SCNzEsJoBG0LPwsNzTTpofffb+Fd9f4LTGwKZZMFs8/sGI+x8HPfT6zI9rGZ5zsG9PvvJMIKyWAZPi3/tswaTfv22cG9+xp/b2kcAfM5ORJSRZjFVjd8Z734s/7srh87tdcWVxADkDzSUC8YSWA3Jct3R+kBTBy/4M4WtyS7oVbdDUG6JhPkcXognXBtz+PAIswlmdnkRI/1rT/rwRQgF1Ak3n0EZ7/N3cObCMELAhKe0jwD37/Pvj/RRkL0IOYv4F09wT5EmoBtPNuYEILUo9HHnyonWdRde9iAaTNZ8CKkf/Ne+8qDFYLN25AFGYykQWQzzEgGco/virl3Af/W5Yji4hPYdZZJtLR0VkVuOJbbXDXbrNl392FmqwoGqXJAAyUIj37IM7+izRo/i/BDUhiAWROADzWYUUdK+tYSMNMNq9G3yuY4d8zwaWkaqOKP1V7lPjcOHPanHr2GcP6hGCQTLe/693AtX2r2Wo9kOKjpyhpxlp5Zv0VIVU6jNcMAoArrJpMMDInAFbdzSJbiUIfXvktCmYQsPIUf2rIgjEXPiQLxu8UScij2bU68q9fMSef/lrZ10kM3NSMnBdpiCYACaAJjbtaOPBFcxB5/6yXKNKYwRHgGmpCkjwfmRMAAScDr0K9hlFLath5op+0/D3TX2r0meYKa4AVcqyU82TBtoZy4f2CGVTYsWCGFXdhWTAmw2RVftvqTUNT/8rLvyov
|
|
|
|
|
|
|
|
tmpIcon = open(icon_filepath, 'wb+')
|
|
|
|
tmpIcon.write(base64.b64decode(iconImg))
|
|
|
|
tmpIcon.close()
|
|
|
|
if platform.system() == 'Windows':
|
|
|
|
root.iconbitmap(icon_filepath)
|
|
|
|
if platform.system() == 'Darwin':
|
|
|
|
#from PIL import Image, ImageTk
|
|
|
|
#logo = ImageTk.PhotoImage(Image.open(icon_filepath).convert('RGB'))
|
|
|
|
#root.call('wm', 'iconphoto', root._w, logo)
|
|
|
|
pass
|
|
|
|
if platform.system() == 'Linux':
|
2020-12-08 15:24:17 +00:00
|
|
|
logo = PhotoImage(file=icon_filepath)
|
2020-12-01 18:28:56 +00:00
|
|
|
root.call('wm', 'iconphoto', root._w, logo)
|
|
|
|
os.remove(icon_filepath)
|
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
root.mainloop()
|
2024-01-06 17:44:06 +00:00
|
|
|
print("exit settings")
|
2024-01-16 09:21:20 +00:00
|
|
|
GLOBAL_SERVER_SHUTDOWN=True
|
2024-01-06 17:44:06 +00:00
|
|
|
clean_extension_status()
|
2019-10-01 17:52:13 +00:00
|
|
|
|
2023-06-16 04:04:04 +00:00
|
|
|
def force_remove_file(filepath):
|
|
|
|
if os.path.exists(filepath):
|
|
|
|
try:
|
|
|
|
os.remove(filepath)
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
|
|
|
|
|
|
|
def clean_tmp_file():
|
|
|
|
remove_file_list = [CONST_MAXBOT_LAST_URL_FILE
|
|
|
|
,CONST_MAXBOT_INT28_FILE
|
|
|
|
,CONST_MAXBOT_ANSWER_ONLINE_FILE
|
|
|
|
,CONST_MAXBOT_QUESTION_FILE
|
|
|
|
]
|
|
|
|
for filepath in remove_file_list:
|
|
|
|
force_remove_file(filepath)
|
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
def get_ip_address():
|
|
|
|
default_ip = "127.0.0.1"
|
|
|
|
ip = default_ip
|
|
|
|
try:
|
|
|
|
ip = [l for l in ([ip for ip in socket.gethostbyname_ex(socket.gethostname())[2]
|
|
|
|
if not ip.startswith("127.")][:1], [[(s.connect(('8.8.8.8', 53)),
|
|
|
|
s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET,
|
|
|
|
socket.SOCK_DGRAM)]][0][1]]) if l][0][0]
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
try:
|
|
|
|
ip = socket.gethostname()
|
|
|
|
except Exception as exc2:
|
|
|
|
print(exc2)
|
|
|
|
ip = default_ip
|
|
|
|
return ip
|
|
|
|
|
|
|
|
def btn_copy_ip_clicked():
|
|
|
|
local_ip = get_ip_address()
|
|
|
|
ip_address = "http://%s:%d/" % (local_ip,CONST_SERVER_PORT)
|
|
|
|
pyperclip.copy(ip_address)
|
|
|
|
|
|
|
|
def btn_copy_question_clicked():
|
|
|
|
global txt_question
|
|
|
|
question_text = txt_question.get("1.0",END).strip()
|
|
|
|
if len(question_text) > 0:
|
|
|
|
pyperclip.copy(question_text)
|
|
|
|
|
|
|
|
def btn_query_question_clicked():
|
|
|
|
global txt_question
|
|
|
|
question_text = txt_question.get("1.0",END).strip()
|
|
|
|
if len(question_text) > 0:
|
|
|
|
webbrowser.open("https://www.google.com/search?q="+question_text)
|
|
|
|
|
|
|
|
class MainHandler(tornado.web.RequestHandler):
|
|
|
|
def format_config_keyword_for_json(self, user_input):
|
|
|
|
if len(user_input) > 0:
|
|
|
|
if not ('\"' in user_input):
|
|
|
|
user_input = '"' + user_input + '"'
|
|
|
|
return user_input
|
|
|
|
|
|
|
|
def compose_as_json(self, user_input):
|
|
|
|
user_input = self.format_config_keyword_for_json(user_input)
|
|
|
|
return "{\"data\":[%s]}" % user_input
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
global txt_answer_value
|
|
|
|
answer_text = ""
|
|
|
|
try:
|
|
|
|
answer_text = txt_answer_value.get().strip()
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
|
|
|
answer_text_output = self.compose_as_json(answer_text)
|
|
|
|
#print("answer_text_output:", answer_text_output)
|
|
|
|
self.write(answer_text_output)
|
|
|
|
|
|
|
|
class QuestionHandler(tornado.web.RequestHandler):
|
|
|
|
def get(self):
|
|
|
|
global txt_question
|
|
|
|
txt_question.insert("1.0", "")
|
|
|
|
|
|
|
|
class VersionHandler(tornado.web.RequestHandler):
|
|
|
|
def get(self):
|
|
|
|
self.write({"version":self.application.version})
|
|
|
|
|
|
|
|
class OcrHandler(tornado.web.RequestHandler):
|
|
|
|
def get(self):
|
|
|
|
self.write({"answer": "1234"})
|
2024-01-16 09:21:20 +00:00
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
def post(self):
|
|
|
|
self.set_header("Access-Control-Allow-Origin", "*")
|
|
|
|
self.set_header("Access-Control-Allow-Headers", "x-requested-with")
|
2024-01-16 09:21:20 +00:00
|
|
|
self.set_header('Access-Control-Allow-Methods', 'POST, GET, OPTIONS')
|
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
_body = None
|
|
|
|
is_pass_check = True
|
|
|
|
errorMessage = ""
|
|
|
|
errorCode = 0
|
|
|
|
|
|
|
|
if is_pass_check:
|
|
|
|
is_pass_check = False
|
|
|
|
try :
|
|
|
|
_body = json.loads(self.request.body)
|
|
|
|
is_pass_check = True
|
|
|
|
except Exception:
|
|
|
|
errorMessage = "wrong json format"
|
|
|
|
errorCode = 1001
|
|
|
|
pass
|
|
|
|
|
|
|
|
img_base64 = None
|
|
|
|
image_data = ""
|
|
|
|
if is_pass_check:
|
|
|
|
if 'image_data' in _body:
|
|
|
|
image_data = _body['image_data']
|
|
|
|
if len(image_data) > 0:
|
|
|
|
img_base64 = base64.b64decode(image_data)
|
|
|
|
else:
|
|
|
|
errorMessage = "image_data not exist"
|
|
|
|
errorCode = 1002
|
|
|
|
|
|
|
|
#print("is_pass_check:", is_pass_check)
|
|
|
|
#print("errorMessage:", errorMessage)
|
|
|
|
#print("errorCode:", errorCode)
|
|
|
|
ocr_answer = ""
|
|
|
|
if not img_base64 is None:
|
|
|
|
try:
|
|
|
|
ocr_answer = self.application.ocr.classification(img_base64)
|
|
|
|
print("ocr_answer:", ocr_answer)
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
|
|
|
|
|
|
|
self.write({"answer": ocr_answer})
|
|
|
|
|
|
|
|
async def main_server():
|
|
|
|
ocr = None
|
|
|
|
try:
|
|
|
|
ocr = ddddocr.DdddOcr(show_ad=False, beta=True)
|
|
|
|
except Exception as exc:
|
|
|
|
print(exc)
|
|
|
|
pass
|
|
|
|
|
|
|
|
app = Application([
|
|
|
|
(r"/", MainHandler),
|
|
|
|
(r"/version", VersionHandler),
|
|
|
|
(r"/ocr", OcrHandler),
|
|
|
|
(r"/query", MainHandler),
|
|
|
|
(r"/question", QuestionHandler),
|
|
|
|
])
|
|
|
|
app.ocr = ocr;
|
|
|
|
app.version = CONST_APP_VERSION;
|
|
|
|
|
|
|
|
app.listen(CONST_SERVER_PORT)
|
2024-01-16 09:21:20 +00:00
|
|
|
print("server running on port:", CONST_SERVER_PORT)
|
2024-01-11 09:28:47 +00:00
|
|
|
await asyncio.Event().wait()
|
|
|
|
|
2024-01-17 01:44:38 +00:00
|
|
|
def is_connectable(port: int, host: Optional[str] = "localhost") -> bool:
|
|
|
|
"""Tries to connect to the server at port to see if it is running.
|
|
|
|
|
|
|
|
:Args:
|
|
|
|
- port - The port to connect.
|
|
|
|
"""
|
|
|
|
socket_ = None
|
|
|
|
_is_connectable_exceptions = (socket.error, ConnectionResetError)
|
|
|
|
try:
|
|
|
|
socket_ = socket.create_connection((host, port), 1)
|
|
|
|
result = True
|
|
|
|
except _is_connectable_exceptions:
|
|
|
|
result = False
|
|
|
|
finally:
|
|
|
|
if socket_:
|
|
|
|
socket_.close()
|
|
|
|
return result
|
|
|
|
|
2024-01-11 09:28:47 +00:00
|
|
|
def web_server():
|
2024-01-17 01:44:38 +00:00
|
|
|
is_port_binded = is_connectable(CONST_SERVER_PORT)
|
|
|
|
#print("is_port_binded:", is_port_binded)
|
|
|
|
if not is_port_binded:
|
|
|
|
asyncio.run(main_server())
|
|
|
|
else:
|
|
|
|
print("port:", CONST_SERVER_PORT, " is in used.")
|
2024-01-11 09:28:47 +00:00
|
|
|
|
|
|
|
def preview_question_text_file():
|
|
|
|
if os.path.exists(CONST_MAXBOT_QUESTION_FILE):
|
|
|
|
infile = None
|
|
|
|
if platform.system() == 'Windows':
|
|
|
|
infile = open(CONST_MAXBOT_QUESTION_FILE, 'r', encoding='UTF-8')
|
|
|
|
else:
|
|
|
|
infile = open(CONST_MAXBOT_QUESTION_FILE, 'r')
|
|
|
|
|
|
|
|
if not infile is None:
|
|
|
|
question_text = infile.readline()
|
|
|
|
|
|
|
|
global txt_question
|
2024-03-17 07:02:25 +00:00
|
|
|
if 'txt_question' in globals():
|
|
|
|
try:
|
|
|
|
displayed_question_text = txt_question.get("1.0",END).strip()
|
|
|
|
if displayed_question_text != question_text:
|
|
|
|
# start to refresh
|
|
|
|
txt_question.delete("1.0","end")
|
|
|
|
if len(question_text) > 0:
|
|
|
|
txt_question.insert("1.0", question_text)
|
|
|
|
except Exception as exc:
|
|
|
|
pass
|
2024-01-11 09:28:47 +00:00
|
|
|
|
2019-10-01 17:52:13 +00:00
|
|
|
if __name__ == "__main__":
|
2024-03-17 07:02:25 +00:00
|
|
|
threading.Thread(target=settgins_gui_timer, daemon=True).start()
|
2024-01-11 09:28:47 +00:00
|
|
|
threading.Thread(target=web_server, daemon=True).start()
|
2023-06-16 04:04:04 +00:00
|
|
|
clean_tmp_file()
|
2024-03-15 07:55:38 +00:00
|
|
|
main_gui()
|