From 2bd67261d189f8462f38bdad19a846ab44d415ce Mon Sep 17 00:00:00 2001 From: jenz Date: Wed, 15 Oct 2025 01:26:10 +0200 Subject: [PATCH] removing cookie approach again for proxy --- torchlight_changes_unloze/config/yt-dlp/config | 1 + torchlight_changes_unloze/systemd/torchlight_restart.service | 2 ++ torchlight_changes_unloze/torchlight3/Torchlight/Commands.py | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 torchlight_changes_unloze/config/yt-dlp/config diff --git a/torchlight_changes_unloze/config/yt-dlp/config b/torchlight_changes_unloze/config/yt-dlp/config new file mode 100644 index 0000000..65c3506 --- /dev/null +++ b/torchlight_changes_unloze/config/yt-dlp/config @@ -0,0 +1 @@ +--proxy diff --git a/torchlight_changes_unloze/systemd/torchlight_restart.service b/torchlight_changes_unloze/systemd/torchlight_restart.service index fd4e7e7..2449258 100644 --- a/torchlight_changes_unloze/systemd/torchlight_restart.service +++ b/torchlight_changes_unloze/systemd/torchlight_restart.service @@ -5,6 +5,8 @@ Description=Restarting torch on ze every 30 minutes Type=simple User=gameservers WorkingDirectory=/home/gameservers/css_ze/torchlight3 +Environment="http_proxy=" +Environment="https_proxy=" ExecStart=/home/gameservers/css_ze/torchlight3/_start.sh Restart=always RuntimeMaxSec=1800 diff --git a/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py b/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py index c290da1..d47d14c 100755 --- a/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py +++ b/torchlight_changes_unloze/torchlight3/Torchlight/Commands.py @@ -114,7 +114,7 @@ class URLFilter(BaseCommand): if TimeStr: Time = Utils.ParseTime(TimeStr) - Proc = await asyncio.create_subprocess_exec("yt-dlp", "--cookies-from-browser", "chrome", "--dump-json", "-g", url, + Proc = await asyncio.create_subprocess_exec("yt-dlp", "--dump-json", "-g", url, stdout = asyncio.subprocess.PIPE) Out, _ = await Proc.communicate() @@ -704,7 +704,7 @@ class YouTubeSearch(BaseCommand): message[1] = message[1][:Temp.value] search_term = message[1].split("pitch=")[0].split("tempo=")[0].split('backward=')[0].split('backwards=')[0] - Proc = await asyncio.create_subprocess_exec("yt-dlp", "--dump-json", "--cookies-from-browser", "chrome", "-xg", "ytsearch:" + search_term, + Proc = await asyncio.create_subprocess_exec("yt-dlp", "--dump-json", "-xg", "ytsearch:" + search_term, stdout = asyncio.subprocess.PIPE) Out, _ = await Proc.communicate()