From 3d3bcda6dbd103b4bc703f82ce2b67b496255069 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 2 Aug 2020 12:14:30 +0100 Subject: [PATCH] Remove formatting from youtube replacement domain --- daemon.py | 11 +++++++---- epicyon.py | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/daemon.py b/daemon.py index 47426a90..5d57c95a 100644 --- a/daemon.py +++ b/daemon.py @@ -6311,11 +6311,14 @@ class PubServer(BaseHTTPRequestHandler): if fields.get('ytdomain'): currYTDomain = self.server.YTReplacementDomain if fields['ytdomain'] != currYTDomain: + newYTDomain = fields['ytdomain'] + if '://' in newYTDomain: + newYTDomain = newYTDomain.split('://')[1] + if '/' in newYTDomain: + newYTDomain = newYTDomain.split('/')[0] setConfigParam(self.server.baseDir, - 'youtubedomain', - fields['ytdomain']) - self.server.YTReplacementDomain = \ - fields['ytdomain'] + 'youtubedomain', newYTDomain) + self.server.YTReplacementDomain = newYTDomain currInstanceDescriptionShort = \ getConfigParam(self.server.baseDir, diff --git a/epicyon.py b/epicyon.py index dfe0135d..bd5ecf52 100644 --- a/epicyon.py +++ b/epicyon.py @@ -1796,6 +1796,10 @@ if not registration: YTDomain = getConfigParam(baseDir, 'youtubedomain') if YTDomain: + if '://' in YTDomain: + YTDomain = YTDomain.split('://')[1] + if '/' in YTDomain: + YTDomain = YTDomain.split('/')[0] args.YTReplacementDomain = YTDomain if setTheme(baseDir, themeName):