We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用 https://sleazyfork.org/zh-CN/scripts/374903-comicread 这个插件访问 本地服务 失败了。 不过我找到了解决办法 就是搞一个证书 openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
main.py 文件这样改一下。
# main.py if __name__ == '__main__': import uvicorn from args import parse_arguments args = parse_arguments() args.start_instance = True proc = prepare(args) print("Nonce: "+nonce) try: uvicorn.run(app, host=args.host, port=args.port, ssl_keyfile="key.pem", ssl_certfile="cert.pem") except Exception: if proc: proc.terminate()
貌似 instance.py 这里也要改一下,不然局域网请求也会出错。
# instance.py import socket def get_local_ip(): try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(("8.8.8.8", 80)) ip = s.getsockname()[0] s.close() return ip except Exception as e: print(f"Error getting local IP: {e}") return None class ExecutorInstance(BaseModel): ip: str port: int busy: bool = False def free_executor(self): self.busy = False async def sent(self, image: Image, config: Config): self.ip = get_local_ip() print(f"self.ip={self.ip}") return await fetch_data("http://"+self.ip+":"+str(self.port)+"/simple_execute/translate", image, config) async def sent_stream(self, image: Image, config: Config, sender: NotifyType): self.ip = get_local_ip() print(f"self.ip={self.ip}") await fetch_data_stream("http://"+self.ip+":"+str(self.port)+"/execute/translate", image, config, sender)
run.bat 里面用 python -m manga_translator %* 貌似会失败
python -m manga_translator %*
# run.bat python main.py --verbose --use-gpu --host 0.0.0.0 --port 5003
The text was updated successfully, but these errors were encountered:
可以发个pr
Sorry, something went wrong.
No branches or pull requests
Issue
使用 https://sleazyfork.org/zh-CN/scripts/374903-comicread 这个插件访问 本地服务 失败了。
不过我找到了解决办法
就是搞一个证书
openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
main.py 文件这样改一下。
貌似 instance.py 这里也要改一下,不然局域网请求也会出错。
run.bat 里面用
python -m manga_translator %*
貌似会失败Command Line Arguments
Console logs
The text was updated successfully, but these errors were encountered: