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)
This commit is contained in:
Tyler Flowers 2026-03-22 15:34:35 -04:00 committed by GitHub
parent 79387f5f65
commit bc90e1830d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 6 deletions

View File

@ -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,