From bc90e1830df7e8a505d3756bbf1f276b5f783a35 Mon Sep 17 00:00:00 2001 From: Tyler Flowers Date: Sun, 22 Mar 2026 15:34:35 -0400 Subject: [PATCH] Refactor URL config methods Merge `_add_potoken_url()` and `_add_gluetun_url()` since they're functionally doing the same thing, cleans up a bit of code. (Also I forgot to call `_add_gluetun_url()`, whoops) --- backend/download/src/yt_dlp_base.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/download/src/yt_dlp_base.py b/backend/download/src/yt_dlp_base.py index d668251e..2ffe4550 100644 --- a/backend/download/src/yt_dlp_base.py +++ b/backend/download/src/yt_dlp_base.py @@ -49,7 +49,7 @@ class YtWrap: deep_merge(self.obs, self.obs_request) if self.config: self._add_cookie() - self._add_potoken_url() + self._add_urls() if getattr(settings, "DEBUG", False): del self.obs["quiet"] @@ -64,8 +64,8 @@ class YtWrap: self.obs["cookiefile"] = cookie_io - def _add_potoken_url(self): - """add bgutils token url""" + def _add_urls(self): + """add bgutils token and proxy url""" if pot_provider_url := self.config["downloads"].get( "pot_provider_url" ): @@ -82,9 +82,6 @@ class YtWrap: if EnvironmentSettings.APP_DIR == "/app": # container internal only self.obs["plugin_dirs"].append("/opt/yt_plugins/bgutil") - - def _add_gluetun_url(self): - """add gluetun proxy url""" if gluetun_url := self.config["downloads"].get("gluetun_url"): deep_merge( self.obs,