import subprocess, sys, os, logging, time, re from pathlib import Path from IPython import get_ipython src = Path('/kaggle/working/scripts') if not src.exists(): src.mkdir(parents=True, exist_ok=True) def from_cupang(): scriptz = [ f'curl -sLo {src}/cupang.py https://github.com/gutris1/segsmaker/raw/main/script/cupang.py', 'curl -sLo /usr/bin/cl https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64', 'chmod +x /usr/bin/cl' ] for url in scriptz: get_ipython().system(url) sys.path.append(str(src)) time.sleep(2) from cupang import Tunnel as Alice_Zuberg log_file = Path('segsmaker.log') log_file.write_text('A1111/Forge\n') logging.basicConfig( filename=log_file, level=logging.INFO, format="{message}", style="{" ) port = 7860 Alice_Synthesis_Thirty = Alice_Zuberg(port) Alice_Synthesis_Thirty.logger.setLevel(logging.DEBUG) Alice_Synthesis_Thirty.add_tunnel(command=f"cl tunnel --url localhost:{port}", name="Cloudflared", pattern=r"[\w-]+\.trycloudflare\.com") Alice_Synthesis_Thirty.check_local_port=False with Alice_Synthesis_Thirty: get_ipython().system(f'/kaggle/venv/bin/python3 cloudflared.py ' + ' '.join(sys.argv[1:])) if __name__ == '__main__': from_cupang()