fix: change desktop pet port 51983->41983 (avoid Hyper-V reserved range) & update wechat group QR code
This commit is contained in:
@@ -3,7 +3,7 @@ import tkinter as tk, threading, random, os, sys
|
||||
from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
|
||||
PORT = 51983
|
||||
PORT = 41983
|
||||
GIF = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), 'pet.gif')
|
||||
|
||||
class Pet:
|
||||
|
||||
@@ -4,7 +4,7 @@ from http.server import HTTPServer, BaseHTTPRequestHandler
|
||||
from urllib.parse import urlparse, parse_qs
|
||||
from PIL import Image, ImageDraw, ImageFont, ImageOps
|
||||
|
||||
PORT = 51983
|
||||
PORT = 41983
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
PROJECT_DIR = os.path.dirname(SCRIPT_DIR)
|
||||
SKINS_DIR = os.path.join(SCRIPT_DIR, 'skins')
|
||||
|
||||
@@ -50,7 +50,7 @@ def render_sidebar():
|
||||
subprocess.Popen([sys.executable, pet_script], **kwargs)
|
||||
def _pet_req(q):
|
||||
def _do():
|
||||
try: urlopen(f'http://127.0.0.1:51983/?{q}', timeout=2)
|
||||
try: urlopen(f'http://127.0.0.1:41983/?{q}', timeout=2)
|
||||
except Exception: pass
|
||||
threading.Thread(target=_do, daemon=True).start()
|
||||
agent._pet_req = _pet_req
|
||||
|
||||
Reference in New Issue
Block a user